diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-09-01 05:24:51 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-09-03 05:08:53 -0400 |
commit | 4f2c7337af638bd73fd1f247f84a85521a34b74c (patch) | |
tree | 5f6f284b1b006f5100b2b6dd99cea3d7a1401b3d | |
parent | 48e905048f39ae97bd08dbbbc78a848d1d555d80 (diff) |
drm/i915: Determine uses-full-ppgtt from context for execbuf
Rather than inspect the global module parameter for whether full-ppgtt
maybe enabled, we can inspect the context directly as to whether it has
its own vm.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Bob Paauwe <bob.j.paauwe@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180901092451.7233-1-chris@chris-wilson.co.uk
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index a926d7d47183..020a2394fc85 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
@@ -735,7 +735,12 @@ static int eb_select_context(struct i915_execbuffer *eb) | |||
735 | return -ENOENT; | 735 | return -ENOENT; |
736 | 736 | ||
737 | eb->ctx = ctx; | 737 | eb->ctx = ctx; |
738 | eb->vm = ctx->ppgtt ? &ctx->ppgtt->vm : &eb->i915->ggtt.vm; | 738 | if (ctx->ppgtt) { |
739 | eb->vm = &ctx->ppgtt->vm; | ||
740 | eb->invalid_flags |= EXEC_OBJECT_NEEDS_GTT; | ||
741 | } else { | ||
742 | eb->vm = &eb->i915->ggtt.vm; | ||
743 | } | ||
739 | 744 | ||
740 | eb->context_flags = 0; | 745 | eb->context_flags = 0; |
741 | if (ctx->flags & CONTEXT_NO_ZEROMAP) | 746 | if (ctx->flags & CONTEXT_NO_ZEROMAP) |
@@ -2201,8 +2206,6 @@ i915_gem_do_execbuffer(struct drm_device *dev, | |||
2201 | eb.flags = (unsigned int *)(eb.vma + args->buffer_count + 1); | 2206 | eb.flags = (unsigned int *)(eb.vma + args->buffer_count + 1); |
2202 | 2207 | ||
2203 | eb.invalid_flags = __EXEC_OBJECT_UNKNOWN_FLAGS; | 2208 | eb.invalid_flags = __EXEC_OBJECT_UNKNOWN_FLAGS; |
2204 | if (USES_FULL_PPGTT(eb.i915)) | ||
2205 | eb.invalid_flags |= EXEC_OBJECT_NEEDS_GTT; | ||
2206 | reloc_cache_init(&eb.reloc_cache, eb.i915); | 2209 | reloc_cache_init(&eb.reloc_cache, eb.i915); |
2207 | 2210 | ||
2208 | eb.buffer_count = args->buffer_count; | 2211 | eb.buffer_count = args->buffer_count; |