From: Daniele Ceraolo Spurio <daniele.ceraolospu...@intel.com>

The context has to obey the same offset requirements as the ring,
so we can re-use the same bias value we computed for the ring instead of
unconditionally using GUC_WOPCM_TOP.

Suggested-by: Chris Wilson <ch...@chris-wilson.co.uk>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospu...@intel.com>
Cc: Chris Wilson <ch...@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_lrc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index cec9037..0a321d1 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -767,7 +767,7 @@ static int execlists_context_pin(struct intel_engine_cs 
*engine,
                                 struct i915_gem_context *ctx)
 {
        struct intel_context *ce = &ctx->engine[engine->id];
-       unsigned int flags;
+       unsigned int flags = PIN_GLOBAL;
        void *vaddr;
        int ret;
 
@@ -782,7 +782,9 @@ static int execlists_context_pin(struct intel_engine_cs 
*engine,
                        goto err;
        }
 
-       flags = PIN_OFFSET_BIAS | GUC_WOPCM_TOP | PIN_GLOBAL;
+       if (ctx->ggtt_offset_bias)
+               flags |= PIN_OFFSET_BIAS | ctx->ggtt_offset_bias;
+
        if (ctx == ctx->i915->kernel_context)
                flags |= PIN_HIGH;
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to