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
308#define I915_PARAM_RSVD_FOR_FUTURE_USE 22308#define I915_PARAM_RSVD_FOR_FUTURE_USE 22
309#define I915_PARAM_HAS_SECURE_BATCHES 23309#define I915_PARAM_HAS_SECURE_BATCHES 23
310#define I915_PARAM_HAS_PINNED_BATCHES 24310#define I915_PARAM_HAS_PINNED_BATCHES 24
311#define I915_PARAM_HAS_EXEC_NO_RELOC 25
311 312
312typedef struct drm_i915_getparam {313typedef struct drm_i915_getparam {
313 int param;314 int param;
@@ -628,7 +629,11 @@ struct drm_i915_gem_exec_object2 { · 314 unmodified lines
628 __u64 offset;629 __u64 offset;
629 630
630#define EXEC_OBJECT_NEEDS_FENCE (1<<0)631#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)
631 __u64 flags;635 __u64 flags;
636
632 __u64 rsvd1;637 __u64 rsvd1;
633 __u64 rsvd2;638 __u64 rsvd2;
634};639};
@@ -687,6 +692,15 @@ struct drm_i915_gem_execbuffer2 { · 52 unmodified lines
687 */692 */
688#define I915_EXEC_IS_PINNED (1<<10)693#define I915_EXEC_IS_PINNED (1<<10)
689 694
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
690#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)704#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
691#define i915_execbuffer2_set_context_id(eb2, context) \705#define i915_execbuffer2_set_context_id(eb2, context) \
692 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK706 (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