From: Greg Kroah-Hartman Date: Sun, 16 Oct 2022 16:29:21 +0000 (+0200) Subject: 6.0-stable patches X-Git-Tag: v5.4.219~76 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b636e47599f635efd078201e884944a689b7ed0f;p=thirdparty%2Fkernel%2Fstable-queue.git 6.0-stable patches added patches: drm-i915-fix-watermark-calculations-for-gen12-rc-ccs-modifier.patch drm-i915-guc-fix-revocation-of-non-persistent-contexts.patch --- diff --git a/queue-6.0/drm-i915-fix-watermark-calculations-for-gen12-rc-ccs-modifier.patch b/queue-6.0/drm-i915-fix-watermark-calculations-for-gen12-rc-ccs-modifier.patch new file mode 100644 index 00000000000..e96ccede522 --- /dev/null +++ b/queue-6.0/drm-i915-fix-watermark-calculations-for-gen12-rc-ccs-modifier.patch @@ -0,0 +1,50 @@ +From c56453a00f19ccddee302f5f9fe96b80e0b47fd3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +Date: Mon, 3 Oct 2022 14:15:39 +0300 +Subject: drm/i915: Fix watermark calculations for gen12+ RC CCS modifier +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ville Syrjälä + +commit c56453a00f19ccddee302f5f9fe96b80e0b47fd3 upstream. + +Take the gen12+ RC CCS modifier into account when calculating the +watermarks. Othwerwise we'll calculate the watermarks thinking this +Y-tiled modifier is linear. + +The rc_surface part is actually a nop since that is not used +for any glk+ platform. + +v2: Split RC CCS vs. MC CCS to separate patches + +Cc: stable@vger.kernel.org +Fixes: b3e57bccd68a ("drm/i915/tgl: Gen-12 render decompression") +Reviewed-by: Juha-Pekka Heikkila +Signed-off-by: Ville Syrjälä +Link: https://patchwork.freedesktop.org/patch/msgid/20221003111544.8007-2-ville.syrjala@linux.intel.com +(cherry picked from commit a89a96a586114f67598c6391c75678b4dba5c2da) +Signed-off-by: Tvrtko Ursulin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/i915/intel_pm.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/i915/intel_pm.c ++++ b/drivers/gpu/drm/i915/intel_pm.c +@@ -5308,10 +5308,12 @@ skl_compute_wm_params(const struct intel + modifier == I915_FORMAT_MOD_4_TILED || + modifier == I915_FORMAT_MOD_Yf_TILED || + modifier == I915_FORMAT_MOD_Y_TILED_CCS || +- modifier == I915_FORMAT_MOD_Yf_TILED_CCS; ++ modifier == I915_FORMAT_MOD_Yf_TILED_CCS || ++ modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS; + wp->x_tiled = modifier == I915_FORMAT_MOD_X_TILED; + wp->rc_surface = modifier == I915_FORMAT_MOD_Y_TILED_CCS || +- modifier == I915_FORMAT_MOD_Yf_TILED_CCS; ++ modifier == I915_FORMAT_MOD_Yf_TILED_CCS || ++ modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS; + wp->is_planar = intel_format_info_is_yuv_semiplanar(format, modifier); + + wp->width = width; diff --git a/queue-6.0/drm-i915-guc-fix-revocation-of-non-persistent-contexts.patch b/queue-6.0/drm-i915-guc-fix-revocation-of-non-persistent-contexts.patch new file mode 100644 index 00000000000..7dc0a13c318 --- /dev/null +++ b/queue-6.0/drm-i915-guc-fix-revocation-of-non-persistent-contexts.patch @@ -0,0 +1,169 @@ +From 7023472834a39341460dae5c9b506c76c5940cad Mon Sep 17 00:00:00 2001 +From: Tvrtko Ursulin +Date: Mon, 3 Oct 2022 13:16:30 +0100 +Subject: drm/i915/guc: Fix revocation of non-persistent contexts + +From: Tvrtko Ursulin + +commit 7023472834a39341460dae5c9b506c76c5940cad upstream. + +Patch which added graceful exit for non-persistent contexts missed the +fact it is not enough to set the exiting flag on a context and let the +backend handle it from there. + +GuC backend cannot handle it because it runs independently in the +firmware and driver might not see the requests ever again. Patch also +missed the fact some usages of intel_context_is_banned in the GuC backend +needed replacing with newly introduced intel_context_is_schedulable. + +Fix the first issue by calling into backend revoke when we know this is +the last chance to do it. Fix the second issue by replacing +intel_context_is_banned with intel_context_is_schedulable, which should +always be safe since latter is a superset of the former. + +v2: + * Just call ce->ops->revoke unconditionally. (Andrzej) + +Signed-off-by: Tvrtko Ursulin +Fixes: 45c64ecf97ee ("drm/i915: Improve user experience and driver robustness under SIGINT or similar") +Cc: Andrzej Hajda +Cc: John Harrison +Cc: Daniele Ceraolo Spurio +Cc: # v6.0+ +Reviewed-by: Andrzej Hajda +Acked-by: Daniele Ceraolo Spurio +Link: https://patchwork.freedesktop.org/patch/msgid/20221003121630.694249-1-tvrtko.ursulin@linux.intel.com +(cherry picked from commit 0add082cebac8555ee3972ba768ae5c01db7a498) +Signed-off-by: Tvrtko Ursulin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/i915/gem/i915_gem_context.c | 8 ------ + drivers/gpu/drm/i915/gt/intel_context.c | 5 +--- + drivers/gpu/drm/i915/gt/intel_context.h | 3 -- + drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 26 +++++++++++----------- + 4 files changed, 17 insertions(+), 25 deletions(-) + +--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c ++++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c +@@ -1387,14 +1387,8 @@ kill_engines(struct i915_gem_engines *en + */ + for_each_gem_engine(ce, engines, it) { + struct intel_engine_cs *engine; +- bool skip = false; + +- if (exit) +- skip = intel_context_set_exiting(ce); +- else if (!persistent) +- skip = intel_context_exit_nonpersistent(ce, NULL); +- +- if (skip) ++ if ((exit || !persistent) && intel_context_revoke(ce)) + continue; /* Already marked. */ + + /* +--- a/drivers/gpu/drm/i915/gt/intel_context.c ++++ b/drivers/gpu/drm/i915/gt/intel_context.c +@@ -614,13 +614,12 @@ bool intel_context_ban(struct intel_cont + return ret; + } + +-bool intel_context_exit_nonpersistent(struct intel_context *ce, +- struct i915_request *rq) ++bool intel_context_revoke(struct intel_context *ce) + { + bool ret = intel_context_set_exiting(ce); + + if (ce->ops->revoke) +- ce->ops->revoke(ce, rq, ce->engine->props.preempt_timeout_ms); ++ ce->ops->revoke(ce, NULL, ce->engine->props.preempt_timeout_ms); + + return ret; + } +--- a/drivers/gpu/drm/i915/gt/intel_context.h ++++ b/drivers/gpu/drm/i915/gt/intel_context.h +@@ -329,8 +329,7 @@ static inline bool intel_context_set_exi + return test_and_set_bit(CONTEXT_EXITING, &ce->flags); + } + +-bool intel_context_exit_nonpersistent(struct intel_context *ce, +- struct i915_request *rq); ++bool intel_context_revoke(struct intel_context *ce); + + static inline bool + intel_context_force_single_submission(const struct intel_context *ce) +--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c ++++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +@@ -684,7 +684,7 @@ static int __guc_add_request(struct inte + * Corner case where requests were sitting in the priority list or a + * request resubmitted after the context was banned. + */ +- if (unlikely(intel_context_is_banned(ce))) { ++ if (unlikely(!intel_context_is_schedulable(ce))) { + i915_request_put(i915_request_mark_eio(rq)); + intel_engine_signal_breadcrumbs(ce->engine); + return 0; +@@ -870,15 +870,15 @@ static int guc_wq_item_append(struct int + struct i915_request *rq) + { + struct intel_context *ce = request_to_scheduling_context(rq); +- int ret = 0; ++ int ret; + +- if (likely(!intel_context_is_banned(ce))) { +- ret = __guc_wq_item_append(rq); ++ if (unlikely(!intel_context_is_schedulable(ce))) ++ return 0; + +- if (unlikely(ret == -EBUSY)) { +- guc->stalled_request = rq; +- guc->submission_stall_reason = STALL_MOVE_LRC_TAIL; +- } ++ ret = __guc_wq_item_append(rq); ++ if (unlikely(ret == -EBUSY)) { ++ guc->stalled_request = rq; ++ guc->submission_stall_reason = STALL_MOVE_LRC_TAIL; + } + + return ret; +@@ -897,7 +897,7 @@ static bool multi_lrc_submit(struct i915 + * submitting all the requests generated in parallel. + */ + return test_bit(I915_FENCE_FLAG_SUBMIT_PARALLEL, &rq->fence.flags) || +- intel_context_is_banned(ce); ++ !intel_context_is_schedulable(ce); + } + + static int guc_dequeue_one_context(struct intel_guc *guc) +@@ -966,7 +966,7 @@ register_context: + struct intel_context *ce = request_to_scheduling_context(last); + + if (unlikely(!ctx_id_mapped(guc, ce->guc_id.id) && +- !intel_context_is_banned(ce))) { ++ intel_context_is_schedulable(ce))) { + ret = try_context_registration(ce, false); + if (unlikely(ret == -EPIPE)) { + goto deadlk; +@@ -1576,7 +1576,7 @@ static void guc_reset_state(struct intel + { + struct intel_engine_cs *engine = __context_to_physical_engine(ce); + +- if (intel_context_is_banned(ce)) ++ if (!intel_context_is_schedulable(ce)) + return; + + GEM_BUG_ON(!intel_context_is_pinned(ce)); +@@ -4434,12 +4434,12 @@ static void guc_handle_context_reset(str + { + trace_intel_context_reset(ce); + +- if (likely(!intel_context_is_banned(ce))) { ++ if (likely(intel_context_is_schedulable(ce))) { + capture_error_state(guc, ce); + guc_context_replay(ce); + } else { + drm_info(&guc_to_gt(guc)->i915->drm, +- "Ignoring context reset notification of banned context 0x%04X on %s", ++ "Ignoring context reset notification of exiting context 0x%04X on %s", + ce->guc_id.id, ce->engine->name); + } + } diff --git a/queue-6.0/series b/queue-6.0/series index 808c42bc2cd..eadcef169be 100644 --- a/queue-6.0/series +++ b/queue-6.0/series @@ -180,3 +180,5 @@ staging-greybus-audio_helper-remove-unused-and-wrong-debugfs-usage.patch drm-nouveau-kms-nv140-disable-interlacing.patch drm-nouveau-fix-a-use-after-free-in-nouveau_gem_prime_import_sg_table.patch drm-i915-gt-use-i915_vm_put-on-ppgtt_create-error-paths.patch +drm-i915-guc-fix-revocation-of-non-persistent-contexts.patch +drm-i915-fix-watermark-calculations-for-gen12-rc-ccs-modifier.patch