Instead use the pin() callback to detect dynamic DMA-buf handling. Since amdgpu is now migrated it doesn't make much sense to keep the extra flag.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -42,18 +42,6 @@ struct dma_buf_ops { · 41 unmodified lines | ||
| 42 | 42 | */ |
| 43 | 43 | bool cache_sgt_mapping; |
| 44 | 44 | |
| 45 | − /** | |
| 46 | − * @dynamic_mapping: | |
| 47 | − * | |
| 48 | − * If true the framework makes sure that the map/unmap_dma_buf | |
| 49 | − * callbacks are always called with the dma_resv object locked. | |
| 50 | − * | |
| 51 | − * If false the framework makes sure that the map/unmap_dma_buf | |
| 52 | − * callbacks are always called without the dma_resv object locked. | |
| 53 | − * Mutual exclusive with @cache_sgt_mapping. | |
| 54 | − */ | |
| 55 | − bool dynamic_mapping; | |
| 56 | − | |
| 57 | 45 | /** |
| 58 | 46 | * @attach: |
| 59 | 47 | * |
| @@ -99,7 +87,8 @@ struct dma_buf_ops { · 39 unmodified lines | ||
| 99 | 87 | * This is called by dma_buf_pin and lets the exporter know that the |
| 100 | 88 | * DMA-buf can't be moved any more. |
| 101 | 89 | * |
| 102 | − * This is called with the dmabuf->resv object locked. | |
| 90 | + * This is called with the dmabuf->resv object locked and is mutual | |
| 91 | + * exclusive with @cache_sgt_mapping. | |
| 103 | 92 | * |
| 104 | 93 | * This callback is optional and should only be used in limited use |
| 105 | 94 | * cases like scanout and not for temporary pin operations. |
| @@ -116,7 +105,8 @@ struct dma_buf_ops { · 10 unmodified lines | ||
| 116 | 105 | * This is called by dma_buf_unpin and lets the exporter know that the |
| 117 | 106 | * DMA-buf can be moved again. |
| 118 | 107 | * |
| 119 | − * This is called with the dmabuf->resv object locked. | |
| 108 | + * This is called with the dmabuf->resv object locked and is mutual | |
| 109 | + * exclusive with @cache_sgt_mapping. | |
| 120 | 110 | * |
| 121 | 111 | * This callback is optional. |
| 122 | 112 | */ |
| @@ -455,8 +445,7 @@ static inline void get_dma_buf(struct dma_buf *dmabuf) · 332 unmodified lines | ||
| 455 | 445 | */ |
| 456 | 446 | static inline bool dma_buf_is_dynamic(struct dma_buf *dmabuf) |
| 457 | 447 | { |
| 458 | − /* TODO: switch to using pin/unpin functions as indicator. */ | |
| 459 | − return dmabuf->ops->dynamic_mapping; | |
| 448 | + return !!dmabuf->ops->pin; | |
| 460 | 449 | } |
| 461 | 450 | |
| 462 | 451 | /** |