aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-01-17 16:23:36 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-01-17 16:23:36 -0500
commited5982e6ce5f106abcbf071f80730db344a6da42 (patch)
tree3669b5e3640209cdf6ebfb3200dfd4947777dff3 /include
parentbcffc3faa692d6b2ef734e4f0c8f097175284db6 (diff)
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). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Imre Deak <imre.deak@intel.com> [danvet: Fixup merge conflict in userspace header due to different baseline trees.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/drm/i915_drm.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index c4d2e9c74002..2430b6ad6a85 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -308,6 +308,7 @@ typedef struct drm_i915_irq_wait {
308#define I915_PARAM_RSVD_FOR_FUTURE_USE 22 308#define I915_PARAM_RSVD_FOR_FUTURE_USE 22
309#define I915_PARAM_HAS_SECURE_BATCHES 23 309#define I915_PARAM_HAS_SECURE_BATCHES 23
310#define I915_PARAM_HAS_PINNED_BATCHES 24 310#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 {
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 {
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_MASK 706 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK