History

drm/i915: Allow userspace to hint that the relocations were known

Userspace is able to hint to the kernel that its command stream and auxiliary state buffers already hold the correct presumed addresses and so the relocation process may be skipped if the kernel does not need to move any buffers in preparation for the execbuffer. Thus for the common case where the allotment of buffers is static between batches, we can avoid the overhead of individually checking the relocation entries. Note that this requires userspace to supply the domain tracking and requests for workarounds itself that would otherwise be computed based upon the relocation entries. Using copywinwin10 as an example that is dependent upon emitting a lot of relocations (2 per operation), we see improvements of: c2d/gm45: 618000.0/sec to 632000.0/sec. i3-330m: 748000.0/sec to 830000.0/sec. (measured relative to a baseline with neither optimisations applied).

Daniel Vetter committed 13 years ago

Commit ed5982e1 parent bcffc3f3 files · +62 −23Browse files

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

Unified · Split

include/uapi/drm/i915_drm.h+14−0
@@ -308,6 +308,7 @@ typedef struct drm_i915_irq_wait { · 307 unmodified lines
308308 #define I915_PARAM_RSVD_FOR_FUTURE_USE 22
309309 #define I915_PARAM_HAS_SECURE_BATCHES 23
310310 #define I915_PARAM_HAS_PINNED_BATCHES 24
311+#define I915_PARAM_HAS_EXEC_NO_RELOC 25
311312
312313 typedef struct drm_i915_getparam {
313314 int param;
@@ -628,7 +629,11 @@ struct drm_i915_gem_exec_object2 { · 314 unmodified lines
628629 __u64 offset;
629630
630631 #define EXEC_OBJECT_NEEDS_FENCE (1<<0)
632+#define EXEC_OBJECT_NEEDS_GTT (1<<1)
633+#define EXEC_OBJECT_WRITE (1<<2)
634+#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_WRITE<<1)
631635 __u64 flags;
636+
632637 __u64 rsvd1;
633638 __u64 rsvd2;
634639 };
@@ -687,6 +692,15 @@ struct drm_i915_gem_execbuffer2 { · 52 unmodified lines
687692 */
688693 #define I915_EXEC_IS_PINNED (1<<10)
689694
695+/** Provide a hint to the kernel that the command stream and auxilliary
696+ * state buffers already holds the correct presumed addresses and so the
697+ * relocation process may be skipped if no buffers need to be moved in
698+ * preparation for the execbuffer.
699+ */
700+#define I915_EXEC_NO_RELOC (1<<11)
701+
702+#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_NO_RELOC<<1)
703+
690704 #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
691705 #define i915_execbuffer2_set_context_id(eb2, context) \
692706 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK

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