Currently, NO_PREFETCH is passed implicitly through drm_nouveau_gem_pushbuf_push::length and drm_nouveau_exec_push::va_len. Since this is a direct representation of how the HW is programmed it isn't really future proof for a uAPI. Hence, fix this up for the new uAPI and split up the va_len field of struct drm_nouveau_exec_push, such that we keep 32bit for va_len and 32bit for flags. For drm_nouveau_gem_pushbuf_push::length at least provide NOUVEAU_GEM_PUSHBUF_NO_PREFETCH to indicate the bit shift. While at it, fix up nv50_dma_push() as well, such that the caller doesn't need to encode the NO_PREFETCH flag into the length parameter.
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -138,6 +138,7 @@ struct drm_nouveau_gem_pushbuf_push { · 137 unmodified lines | |||
| 138 | __u32 pad; | 138 | __u32 pad; |
| 139 | __u64 offset; | 139 | __u64 offset; |
| 140 | __u64 length; | 140 | __u64 length; |
| 141 | #define NOUVEAU_GEM_PUSHBUF_NO_PREFETCH (1 << 23) | ||
| 141 | }; | 142 | }; |
| 142 | 143 | ||
| 143 | struct drm_nouveau_gem_pushbuf { | 144 | struct drm_nouveau_gem_pushbuf { |
| @@ -338,7 +339,12 @@ struct drm_nouveau_exec_push { · 194 unmodified lines | |||
| 338 | /** | 339 | /** |
| 339 | * @va_len: the length of the push buffer mapping | 340 | * @va_len: the length of the push buffer mapping |
| 340 | */ | 341 | */ |
| 341 | __u64 va_len; | 342 | __u32 va_len; |
| 343 | /** | ||
| 344 | * @flags: the flags for this push buffer mapping | ||
| 345 | */ | ||
| 346 | __u32 flags; | ||
| 347 | #define DRM_NOUVEAU_EXEC_PUSH_NO_PREFETCH 0x1 | ||
| 342 | }; | 348 | }; |
| 343 | 349 | ||
| 344 | /** | 350 | /** |