public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev,
	Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	Fudongwang <fudong.wang@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH 6.1 69/69] drm/amd/display: fix disable otg wa logic in DCN316
Date: Mon, 15 Apr 2024 16:21:40 +0200	[thread overview]
Message-ID: <20240415141948.248193251@linuxfoundation.org> (raw)
In-Reply-To: <20240415141946.165870434@linuxfoundation.org>

6.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Fudongwang <fudong.wang@amd.com>

commit cf79814cb0bf5749b9f0db53ca231aa540c02768 upstream.

[Why]
Wrong logic cause screen corruption.

[How]
Port logic from DCN35/314.

Cc: stable@vger.kernel.org
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Fudongwang <fudong.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c |   19 ++++++----
 1 file changed, 12 insertions(+), 7 deletions(-)

--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c
@@ -112,20 +112,25 @@ static int dcn316_get_active_display_cnt
 	return display_count;
 }
 
-static void dcn316_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state *context, bool disable)
+static void dcn316_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state *context,
+		bool safe_to_lower, bool disable)
 {
 	struct dc *dc = clk_mgr_base->ctx->dc;
 	int i;
 
 	for (i = 0; i < dc->res_pool->pipe_count; ++i) {
-		struct pipe_ctx *pipe = &dc->current_state->res_ctx.pipe_ctx[i];
+		struct pipe_ctx *pipe = safe_to_lower
+			? &context->res_ctx.pipe_ctx[i]
+			: &dc->current_state->res_ctx.pipe_ctx[i];
 
 		if (pipe->top_pipe || pipe->prev_odm_pipe)
 			continue;
-		if (pipe->stream && (pipe->stream->dpms_off || pipe->plane_state == NULL ||
-				     dc_is_virtual_signal(pipe->stream->signal))) {
+		if (pipe->stream && (pipe->stream->dpms_off || dc_is_virtual_signal(pipe->stream->signal) ||
+				     !pipe->stream->link_enc)) {
 			if (disable) {
-				pipe->stream_res.tg->funcs->immediate_disable_crtc(pipe->stream_res.tg);
+				if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->immediate_disable_crtc)
+					pipe->stream_res.tg->funcs->immediate_disable_crtc(pipe->stream_res.tg);
+
 				reset_sync_context_for_pipe(dc, context, i);
 			} else
 				pipe->stream_res.tg->funcs->enable_crtc(pipe->stream_res.tg);
@@ -222,11 +227,11 @@ static void dcn316_update_clocks(struct
 	}
 
 	if (should_set_clock(safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) {
-		dcn316_disable_otg_wa(clk_mgr_base, context, true);
+		dcn316_disable_otg_wa(clk_mgr_base, context, safe_to_lower, true);
 
 		clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;
 		dcn316_smu_set_dispclk(clk_mgr, clk_mgr_base->clks.dispclk_khz);
-		dcn316_disable_otg_wa(clk_mgr_base, context, false);
+		dcn316_disable_otg_wa(clk_mgr_base, context, safe_to_lower, false);
 
 		update_dispclk = true;
 	}



  parent reply	other threads:[~2024-04-15 14:41 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 14:20 [PATCH 6.1 00/69] 6.1.87-rc1 review Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 01/69] smb3: fix Open files on server counter going negative Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 02/69] ata: libata-scsi: Fix ata_scsi_dev_rescan() error path Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 03/69] batman-adv: Avoid infinite loop trying to resize local TT Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 04/69] ring-buffer: Only update pages_touched when a new page is touched Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 05/69] Bluetooth: Fix memory leak in hci_req_sync_complete() Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 06/69] drm/amd/pm: fixes a random hang in S4 for SMU v13.0.4/11 Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 07/69] PM: s2idle: Make sure CPUs will wakeup directly on resume Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 08/69] media: cec: core: remove length check of Timer Status Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 09/69] arm64: dts: imx8-ss-conn: fix usdhc wrong lpcg clock order Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 10/69] Revert "drm/qxl: simplify qxl_fence_wait" Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 11/69] nouveau: fix function cast warning Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 12/69] scsi: hisi_sas: Modify the deadline for ata_wait_after_reset() Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 13/69] scsi: qla2xxx: Fix off by one in qla_edif_app_getstats() Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 14/69] net: openvswitch: fix unwanted error log on timeout policy probing Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 15/69] u64_stats: fix u64_stats_init() for lockdep when used repeatedly in one file Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 16/69] xsk: validate user input for XDP_{UMEM|COMPLETION}_FILL_RING Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 17/69] geneve: fix header validation in geneve[6]_xmit_skb Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 18/69] bnxt_en: Reset PTP tx_avail after possible firmware reset Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 19/69] net: ks8851: Inline ks8851_rx_skb() Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 20/69] net: ks8851: Handle softirqs at the end of IRQ thread to fix hang Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 21/69] af_unix: Clear stale u->oob_skb Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 22/69] octeontx2-af: Fix NIX SQ mode and BP config Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 23/69] ipv6: fib: hide unused pn variable Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 24/69] ipv4/route: avoid unused-but-set-variable warning Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 25/69] ipv6: fix race condition between ipv6_get_ifaddr and ipv6_del_addr Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 26/69] Bluetooth: SCO: Fix not validating setsockopt user input Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 27/69] Bluetooth: L2CAP: " Greg Kroah-Hartman
2024-04-15 14:20 ` [PATCH 6.1 28/69] netfilter: complete validation of " Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 29/69] net/mlx5: Properly link new fs rules into the tree Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 30/69] net/mlx5e: Fix mlx5e_priv_init() cleanup flow Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 31/69] net/mlx5e: HTB, Fix inconsistencies with QoS SQs number Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 32/69] net: sparx5: fix wrong config being used when reconfiguring PCS Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 33/69] net: dsa: mt7530: trap link-local frames regardless of ST Port State Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 34/69] af_unix: Do not use atomic ops for unix_sk(sk)->inflight Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 35/69] af_unix: Fix garbage collector racing against connect() Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 36/69] net: ena: Fix potential sign extension issue Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 37/69] net: ena: Wrong missing IO completions check order Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 38/69] net: ena: Fix incorrect descriptor free behavior Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 39/69] tracing: hide unused ftrace_event_id_fops Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 40/69] iommu/vt-d: Allocate local memory for page request queue Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 41/69] btrfs: qgroup: correctly model root qgroup rsv in convert Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 42/69] btrfs: record delayed inode root in transaction Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 43/69] btrfs: qgroup: convert PREALLOC to PERTRANS after record_root_in_trans Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 44/69] io_uring/net: restore msg_control on sendzc retry Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 45/69] kprobes: Fix possible use-after-free issue on kprobe registration Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 46/69] drm/i915/vrr: Disable VRR when using bigjoiner Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 47/69] drm/amdkfd: Reset GPU on queue preemption failure Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 48/69] drm/ast: Fix soft lockup Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 49/69] drm/client: Fully protect modes[] with dev->mode_config.mutex Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 50/69] vhost: Add smp_rmb() in vhost_vq_avail_empty() Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 51/69] vhost: Add smp_rmb() in vhost_enable_notify() Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 52/69] perf/x86: Fix out of range data Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 53/69] x86/cpu: Actually turn off mitigations by default for SPECULATION_MITIGATIONS=n Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 54/69] selftests: timers: Fix abs() warning in posix_timers test Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 55/69] x86/apic: Force native_apic_mem_read() to use the MOV instruction Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 56/69] irqflags: Explicitly ignore lockdep_hrtimer_exit() argument Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 57/69] x86/bugs: Fix return type of spectre_bhi_state() Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 58/69] x86/bugs: Fix BHI documentation Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 59/69] x86/bugs: Cache the value of MSR_IA32_ARCH_CAPABILITIES Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 60/69] x86/bugs: Rename various ia32_cap variables to x86_arch_cap_msr Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 61/69] x86/bugs: Fix BHI handling of RRSBA Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 62/69] x86/bugs: Clarify that syscall hardening isnt a BHI mitigation Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 63/69] x86/bugs: Remove CONFIG_BHI_MITIGATION_AUTO and spectre_bhi=auto Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 64/69] x86/bugs: Replace CONFIG_SPECTRE_BHI_{ON,OFF} with CONFIG_MITIGATION_SPECTRE_BHI Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 65/69] drm/i915/cdclk: Fix CDCLK programming order when pipes are active Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 66/69] drm/i915: Disable port sync when bigjoiner is used Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 67/69] drm/amdgpu: Reset dGPU if suspend got aborted Greg Kroah-Hartman
2024-04-15 14:21 ` [PATCH 6.1 68/69] drm/amdgpu: always force full reset for SOC21 Greg Kroah-Hartman
2024-04-15 14:21 ` Greg Kroah-Hartman [this message]
2024-04-15 17:36 ` [PATCH 6.1 00/69] 6.1.87-rc1 review Florian Fainelli
2024-04-15 19:47 ` Pavel Machek
2024-04-15 23:53 ` Kelsey Steele
2024-04-16  0:17 ` Mark Brown
2024-04-16  6:34 ` Ron Economos
2024-04-16 11:55 ` Yann Sionneau
2024-04-16 12:03 ` Jon Hunter
2024-04-16 14:22 ` Pascal Ernster
2024-04-16 20:18 ` Mateusz Jończyk
2024-04-17  7:43 ` Naresh Kamboju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240415141948.248193251@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.deucher@amd.com \
    --cc=fudong.wang@amd.com \
    --cc=hamza.mahfooz@amd.com \
    --cc=nicholas.kazlauskas@amd.com \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox