diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 6 |
5 files changed, 11 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index cef08d0918d3..ff9afa726072 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -885,6 +885,8 @@ struct intel_context { struct i915_ctx_sched_info sched_info; struct i915_hw_ppgtt *ppgtt; + int relative_constants_mode; + /* Legacy ring buffer submission */ struct { struct drm_i915_gem_object *rcs_state; @@ -1768,8 +1770,6 @@ struct drm_i915_private { const struct intel_device_info info; - int relative_constants_mode; - void __iomem *regs; struct intel_uncore uncore; diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 9ae0114cfe70..2e5434d2bed8 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -5678,8 +5678,6 @@ i915_gem_load_init(struct drm_device *dev) i915_scheduler_work_handler); init_waitqueue_head(&dev_priv->gpu_error.reset_queue); - dev_priv->relative_constants_mode = I915_EXEC_CONSTANTS_REL_GENERAL; - /* * Set initial sequence number for requests. * Using this number allows the wraparound to happen early, diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 69f1bc39e78c..abf99e3978b8 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -251,6 +251,9 @@ __create_hw_context(struct drm_device *dev, * is no remap info, it will be a NOP. */ ctx->remap_slice = (1 << NUM_L3_SLICES(dev)) - 1; + /* First execbuffer will override this */ + ctx->relative_constants_mode = -1; + ctx->hang_stats.ban_period_seconds = DRM_I915_CTX_BAN_PERIOD; return ctx; diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 61b1a5f1e855..2113491b5251 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -1243,7 +1243,7 @@ i915_gem_ringbuffer_submission(struct i915_execbuffer_params *params, return -EINVAL; } - if (params->instp_mode != dev_priv->relative_constants_mode) { + if (params->instp_mode != params->ctx->relative_constants_mode) { if (INTEL_INFO(dev)->gen < 4) { DRM_DEBUG("no rel constants on pre-gen4\n"); return -EINVAL; @@ -1366,14 +1366,14 @@ int i915_gem_ringbuffer_submission_final(struct i915_execbuffer_params *params) "%s didn't clear reload\n", engine->name); if (engine == &dev_priv->engine[RCS] && - params->instp_mode != dev_priv->relative_constants_mode) { + params->instp_mode != params->ctx->relative_constants_mode) { intel_ring_emit(engine, MI_NOOP); intel_ring_emit(engine, MI_LOAD_REGISTER_IMM(1)); intel_ring_emit_reg(engine, INSTPM); intel_ring_emit(engine, params->instp_mask << 16 | params->instp_mode); intel_ring_advance(engine); - dev_priv->relative_constants_mode = params->instp_mode; + params->ctx->relative_constants_mode = params->instp_mode; } if (params->args_flags & I915_EXEC_GEN7_SOL_RESET) { diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 8c7bd66d6008..1cd34c9ee4b5 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -991,7 +991,7 @@ int intel_execlists_submission(struct i915_execbuffer_params *params, return -EINVAL; } - if (params->instp_mode != dev_priv->relative_constants_mode) { + if (params->instp_mode != params->ctx->relative_constants_mode) { if (params->instp_mode == I915_EXEC_CONSTANTS_REL_SURFACE) { DRM_DEBUG("rel surface constants mode invalid on gen5+\n"); return -EINVAL; @@ -1105,14 +1105,14 @@ int intel_execlists_submission_final(struct i915_execbuffer_params *params) goto err; if (engine == &dev_priv->engine[RCS] && - params->instp_mode != dev_priv->relative_constants_mode) { + params->instp_mode != params->ctx->relative_constants_mode) { intel_logical_ring_emit(ringbuf, MI_NOOP); intel_logical_ring_emit(ringbuf, MI_LOAD_REGISTER_IMM(1)); intel_logical_ring_emit_reg(ringbuf, INSTPM); intel_logical_ring_emit(ringbuf, params->instp_mask << 16 | params->instp_mode); intel_logical_ring_advance(ringbuf); - dev_priv->relative_constants_mode = params->instp_mode; + params->ctx->relative_constants_mode = params->instp_mode; } exec_start = params->batch_obj_vm_offset + |