History

drm/i915: Pad GTT views of exec objects up to user specified size

Our GPUs impose certain requirements upon buffers that depend upon how exactly they are used. Typically this is expressed as that they require a larger surface than would be naively computed by pitch * height. Normally such requirements are hidden away in the userspace driver, but when we accept pointers from strangers and later impose extra conditions on them, the original client allocator has no idea about the monstrosities in the GPU and we require the userspace driver to inform the kernel how many padding pages are required beyond the client allocation. v2: Long time, no see v3: Try an anonymous union for uapi struct compatibility

Chris Wilson committed 10 years ago

Commit 91b2db61 parent 2ffffd04 files · +64 −47Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/drm/i915_drm.h+6−2
@@ -727,11 +727,15 @@ struct drm_i915_gem_exec_object2 { · 726 unmodified lines
727727 #define EXEC_OBJECT_WRITE (1<<2)
728728 #define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3)
729729 #define EXEC_OBJECT_PINNED (1<<4)
730+#define EXEC_OBJECT_PAD_TO_SIZE (1<<5)
730731 /* All remaining bits are MBZ and RESERVED FOR FUTURE USE */
731−#define __EXEC_OBJECT_UNKNOWN_FLAGS (-(EXEC_OBJECT_PINNED<<1))
732+#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_PAD_TO_SIZE<<1)
732733 __u64 flags;
733734
734− __u64 rsvd1;
735+ union {
736+ __u64 rsvd1;
737+ __u64 pad_to_size;
738+ };
735739 __u64 rsvd2;
736740 };
737741

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t