summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_execbuffer.c
diff options
context:
space:
mode:
authorChris Wilson2017-06-16 16:05:23 +0200
committerChris Wilson2017-06-16 17:54:05 +0200
commit1a71cf2fa646799d4397a49b223549d8617fece0 (patch)
treebe457298385f3d0e077577a2836bcc35cae51c9f /drivers/gpu/drm/i915/i915_gem_execbuffer.c
parentdrm/i915: Wait upon userptr get-user-pages within execbuffer (diff)
downloadkernel-qcow2-linux-1a71cf2fa646799d4397a49b223549d8617fece0.tar.gz
kernel-qcow2-linux-1a71cf2fa646799d4397a49b223549d8617fece0.tar.xz
kernel-qcow2-linux-1a71cf2fa646799d4397a49b223549d8617fece0.zip
drm/i915: Allow execbuffer to use the first object as the batch
Currently, the last object in the execlist is the always the batch. However, when building the batch buffer we often know the batch object first and if we can use the first slot in the execlist we can emit relocation instructions relative to it immediately and avoid a separate pass to adjust the relocations to point to the last execlist slot. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_execbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_execbuffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index f4b02ef3987f..e262133a7cf5 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -645,7 +645,10 @@ ht_needs_resize(const struct i915_gem_context_vma_lut *lut)
static unsigned int eb_batch_index(const struct i915_execbuffer *eb)
{
- return eb->buffer_count - 1;
+ if (eb->args->flags & I915_EXEC_BATCH_FIRST)
+ return 0;
+ else
+ return eb->buffer_count - 1;
}
static int eb_select_context(struct i915_execbuffer *eb)