Commit 08e3e21a authored by Lucas De Marchi's avatar Lucas De Marchi Committed by Chris Wilson

drm/i915: kill resource streamer support

After disabling resource streamer on ICL (due to it actually not
existing there), I got feedback that there have been some experimental
patches for mesa to use RS years ago, but nothing ever landed or shipped
because there was no performance improvement.

This removes it from kernel keeping the uapi defines around for
compatibility.

v2: - re-add the inadvertent removal of CTX_CTRL_INHIBIT_SYN_CTX_SWITCH
    - don't bother trying to document removed params on uapi header:
      applications should know that from the query.
      (from Chris)

v3: - disable CTX_CTRL_RS_CTX_ENABLE istead of removing it
    - reword commit message after Daniele confirmed no performance
      regression on his machine
    - reword commit message to make clear RS is being removed due to
      never been used
v4: - move I915_EXEC_RESOURCE_STREAMER to __I915_EXEC_ILLEGAL_FLAGS so
      the check on ioctl() is made much earlier by
      i915_gem_check_execbuffer() (suggested by Tvrtko)
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Acked-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180803232443.17193-1-lucas.demarchi@intel.com
parent 48928d4b
...@@ -373,7 +373,7 @@ static int i915_getparam_ioctl(struct drm_device *dev, void *data, ...@@ -373,7 +373,7 @@ static int i915_getparam_ioctl(struct drm_device *dev, void *data,
value = 2; value = 2;
break; break;
case I915_PARAM_HAS_RESOURCE_STREAMER: case I915_PARAM_HAS_RESOURCE_STREAMER:
value = HAS_RESOURCE_STREAMER(dev_priv); value = 0;
break; break;
case I915_PARAM_HAS_POOLED_EU: case I915_PARAM_HAS_POOLED_EU:
value = HAS_POOLED_EU(dev_priv); value = HAS_POOLED_EU(dev_priv);
......
...@@ -2610,8 +2610,6 @@ intel_info(const struct drm_i915_private *dev_priv) ...@@ -2610,8 +2610,6 @@ intel_info(const struct drm_i915_private *dev_priv)
#define USES_GUC_SUBMISSION(dev_priv) intel_uc_is_using_guc_submission() #define USES_GUC_SUBMISSION(dev_priv) intel_uc_is_using_guc_submission()
#define USES_HUC(dev_priv) intel_uc_is_using_huc() #define USES_HUC(dev_priv) intel_uc_is_using_huc()
#define HAS_RESOURCE_STREAMER(dev_priv) ((dev_priv)->info.has_resource_streamer)
#define HAS_POOLED_EU(dev_priv) ((dev_priv)->info.has_pooled_eu) #define HAS_POOLED_EU(dev_priv) ((dev_priv)->info.has_pooled_eu)
#define INTEL_PCH_DEVICE_ID_MASK 0xff80 #define INTEL_PCH_DEVICE_ID_MASK 0xff80
......
...@@ -64,7 +64,9 @@ enum { ...@@ -64,7 +64,9 @@ enum {
#define BATCH_OFFSET_BIAS (256*1024) #define BATCH_OFFSET_BIAS (256*1024)
#define __I915_EXEC_ILLEGAL_FLAGS \ #define __I915_EXEC_ILLEGAL_FLAGS \
(__I915_EXEC_UNKNOWN_FLAGS | I915_EXEC_CONSTANTS_MASK) (__I915_EXEC_UNKNOWN_FLAGS | \
I915_EXEC_CONSTANTS_MASK | \
I915_EXEC_RESOURCE_STREAMER)
/* Catch emission of unexpected errors for CI! */ /* Catch emission of unexpected errors for CI! */
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM) #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)
...@@ -2221,20 +2223,6 @@ i915_gem_do_execbuffer(struct drm_device *dev, ...@@ -2221,20 +2223,6 @@ i915_gem_do_execbuffer(struct drm_device *dev,
if (!eb.engine) if (!eb.engine)
return -EINVAL; return -EINVAL;
if (args->flags & I915_EXEC_RESOURCE_STREAMER) {
if (!HAS_RESOURCE_STREAMER(eb.i915)) {
DRM_DEBUG("RS is only allowed for Haswell and Gen8 - Gen10\n");
return -EINVAL;
}
if (eb.engine->id != RCS) {
DRM_DEBUG("RS is not available on %s\n",
eb.engine->name);
return -EINVAL;
}
eb.batch_flags |= I915_DISPATCH_RS;
}
if (args->flags & I915_EXEC_FENCE_IN) { if (args->flags & I915_EXEC_FENCE_IN) {
in_fence = sync_file_get_fence(lower_32_bits(args->rsvd2)); in_fence = sync_file_get_fence(lower_32_bits(args->rsvd2));
if (!in_fence) if (!in_fence)
......
...@@ -368,7 +368,6 @@ static const struct intel_device_info intel_valleyview_info = { ...@@ -368,7 +368,6 @@ static const struct intel_device_info intel_valleyview_info = {
.has_ddi = 1, \ .has_ddi = 1, \
.has_fpga_dbg = 1, \ .has_fpga_dbg = 1, \
.has_psr = 1, \ .has_psr = 1, \
.has_resource_streamer = 1, \
.has_dp_mst = 1, \ .has_dp_mst = 1, \
.has_rc6p = 0 /* RC6p removed-by HSW */, \ .has_rc6p = 0 /* RC6p removed-by HSW */, \
.has_runtime_pm = 1 .has_runtime_pm = 1
...@@ -441,7 +440,6 @@ static const struct intel_device_info intel_cherryview_info = { ...@@ -441,7 +440,6 @@ static const struct intel_device_info intel_cherryview_info = {
.ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING,
.has_64bit_reloc = 1, .has_64bit_reloc = 1,
.has_runtime_pm = 1, .has_runtime_pm = 1,
.has_resource_streamer = 1,
.has_rc6 = 1, .has_rc6 = 1,
.has_logical_ring_contexts = 1, .has_logical_ring_contexts = 1,
.has_gmch_display = 1, .has_gmch_display = 1,
...@@ -515,7 +513,6 @@ static const struct intel_device_info intel_skylake_gt4_info = { ...@@ -515,7 +513,6 @@ static const struct intel_device_info intel_skylake_gt4_info = {
.has_runtime_pm = 1, \ .has_runtime_pm = 1, \
.has_pooled_eu = 0, \ .has_pooled_eu = 0, \
.has_csr = 1, \ .has_csr = 1, \
.has_resource_streamer = 1, \
.has_rc6 = 1, \ .has_rc6 = 1, \
.has_dp_mst = 1, \ .has_dp_mst = 1, \
.has_logical_ring_contexts = 1, \ .has_logical_ring_contexts = 1, \
...@@ -604,7 +601,6 @@ static const struct intel_device_info intel_cannonlake_info = { ...@@ -604,7 +601,6 @@ static const struct intel_device_info intel_cannonlake_info = {
GEN(11), \ GEN(11), \
.ddb_size = 2048, \ .ddb_size = 2048, \
.has_csr = 0, \ .has_csr = 0, \
.has_resource_streamer = 0, \
.has_logical_ring_elsq = 1 .has_logical_ring_elsq = 1
static const struct intel_device_info intel_icelake_11_info = { static const struct intel_device_info intel_icelake_11_info = {
......
...@@ -103,7 +103,6 @@ enum intel_platform { ...@@ -103,7 +103,6 @@ enum intel_platform {
func(has_psr); \ func(has_psr); \
func(has_rc6); \ func(has_rc6); \
func(has_rc6p); \ func(has_rc6p); \
func(has_resource_streamer); \
func(has_runtime_pm); \ func(has_runtime_pm); \
func(has_snoop); \ func(has_snoop); \
func(has_coherent_ggtt); \ func(has_coherent_ggtt); \
......
...@@ -2065,8 +2065,7 @@ static int gen8_emit_bb_start(struct i915_request *rq, ...@@ -2065,8 +2065,7 @@ static int gen8_emit_bb_start(struct i915_request *rq,
/* FIXME(BDW): Address space and security selectors. */ /* FIXME(BDW): Address space and security selectors. */
*cs++ = MI_BATCH_BUFFER_START_GEN8 | *cs++ = MI_BATCH_BUFFER_START_GEN8 |
(flags & I915_DISPATCH_SECURE ? 0 : BIT(8)) | (flags & I915_DISPATCH_SECURE ? 0 : BIT(8));
(flags & I915_DISPATCH_RS ? MI_BATCH_RESOURCE_STREAMER : 0);
*cs++ = lower_32_bits(offset); *cs++ = lower_32_bits(offset);
*cs++ = upper_32_bits(offset); *cs++ = upper_32_bits(offset);
...@@ -2584,10 +2583,9 @@ static void execlists_init_reg_state(u32 *regs, ...@@ -2584,10 +2583,9 @@ static void execlists_init_reg_state(u32 *regs,
CTX_REG(regs, CTX_CONTEXT_CONTROL, RING_CONTEXT_CONTROL(engine), CTX_REG(regs, CTX_CONTEXT_CONTROL, RING_CONTEXT_CONTROL(engine),
_MASKED_BIT_DISABLE(CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT | _MASKED_BIT_DISABLE(CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT |
CTX_CTRL_ENGINE_CTX_SAVE_INHIBIT) | CTX_CTRL_ENGINE_CTX_SAVE_INHIBIT |
_MASKED_BIT_ENABLE(CTX_CTRL_INHIBIT_SYN_CTX_SWITCH | CTX_CTRL_RS_CTX_ENABLE) |
(HAS_RESOURCE_STREAMER(dev_priv) ? _MASKED_BIT_ENABLE(CTX_CTRL_INHIBIT_SYN_CTX_SWITCH));
CTX_CTRL_RS_CTX_ENABLE : 0)));
CTX_REG(regs, CTX_RING_HEAD, RING_HEAD(base), 0); CTX_REG(regs, CTX_RING_HEAD, RING_HEAD(base), 0);
CTX_REG(regs, CTX_RING_TAIL, RING_TAIL(base), 0); CTX_REG(regs, CTX_RING_TAIL, RING_TAIL(base), 0);
CTX_REG(regs, CTX_RING_BUFFER_START, RING_START(base), 0); CTX_REG(regs, CTX_RING_BUFFER_START, RING_START(base), 0);
......
...@@ -1980,9 +1980,7 @@ hsw_emit_bb_start(struct i915_request *rq, ...@@ -1980,9 +1980,7 @@ hsw_emit_bb_start(struct i915_request *rq,
return PTR_ERR(cs); return PTR_ERR(cs);
*cs++ = MI_BATCH_BUFFER_START | (dispatch_flags & I915_DISPATCH_SECURE ? *cs++ = MI_BATCH_BUFFER_START | (dispatch_flags & I915_DISPATCH_SECURE ?
0 : MI_BATCH_PPGTT_HSW | MI_BATCH_NON_SECURE_HSW) | 0 : MI_BATCH_PPGTT_HSW | MI_BATCH_NON_SECURE_HSW);
(dispatch_flags & I915_DISPATCH_RS ?
MI_BATCH_RESOURCE_STREAMER : 0);
/* bit0-7 is the length on GEN6+ */ /* bit0-7 is the length on GEN6+ */
*cs++ = offset; *cs++ = offset;
intel_ring_advance(rq, cs); intel_ring_advance(rq, cs);
......
...@@ -474,7 +474,6 @@ struct intel_engine_cs { ...@@ -474,7 +474,6 @@ struct intel_engine_cs {
unsigned int dispatch_flags); unsigned int dispatch_flags);
#define I915_DISPATCH_SECURE BIT(0) #define I915_DISPATCH_SECURE BIT(0)
#define I915_DISPATCH_PINNED BIT(1) #define I915_DISPATCH_PINNED BIT(1)
#define I915_DISPATCH_RS BIT(2)
void (*emit_breadcrumb)(struct i915_request *rq, u32 *cs); void (*emit_breadcrumb)(struct i915_request *rq, u32 *cs);
int emit_breadcrumb_sz; int emit_breadcrumb_sz;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment