AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Lewis.Huang@amd.com, aric.cyr@amd.com, haonan.wang2@amd.com,
	airlied@linux.ie, dri-devel@lists.freedesktop.org,
	meenakshikumar.somasundaram@amd.com, jun.lei@amd.com,
	lee.jones@linaro.org, Jimmy.Kizito@amd.com,
	Sasha Levin <sashal@kernel.org>,
	anthony1.wang@amd.com, Rodrigo.Siqueira@amd.com,
	amd-gfx@lists.freedesktop.org, sunpeng.li@amd.com,
	Jerry.Zuo@amd.com, aurabindo.pillai@amd.com,
	michael.strauss@amd.com, harry.wentland@amd.com,
	Anson.Jacob@amd.com, nikola.cornij@amd.com, Martin.Leung@amd.com,
	MarkAlbert.Morra@amd.com, Eric.Yang2@amd.com, shenshih@amd.com,
	qingqing.zhuo@amd.com, Xinhui.Pan@amd.com,
	Roman Li <Roman.Li@amd.com>,
	Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>,
	daniel@ffwll.ch, Wayne.Lin@amd.com,
	Alex Deucher <alexander.deucher@amd.com>,
	roy.chan@amd.com, christian.koenig@amd.com
Subject: [PATCH AUTOSEL 5.15 29/33] drm/amd/display: Cap pflip irqs per max otg number
Date: Tue, 15 Feb 2022 10:28:27 -0500	[thread overview]
Message-ID: <20220215152831.580780-29-sashal@kernel.org> (raw)
In-Reply-To: <20220215152831.580780-1-sashal@kernel.org>

From: Roman Li <Roman.Li@amd.com>

[ Upstream commit 328e34a5ad227399391891d454043e5d73e598d2 ]

[Why]
pflip interrupt order are mapped 1 to 1 to otg id.
e.g. if irq_src=26 corresponds to otg0 then 27->otg1, 28->otg2...

Linux DM registers pflip interrupts per number of crtcs.
In fused pipe case crtc numbers can be less than otg id.

e.g. if one pipe out of 3(otg#0-2) is fused adev->mode_info.num_crtc=2
so DM only registers irq_src 26,27.
This is a bug since if pipe#2 remains unfused DM never gets
otg2 pflip interrupt (irq_src=28)
That may results in gfx failure due to pflip timeout.

[How]
Register pflip interrupts per max num of otg instead of num_crtc

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c          | 2 ++
 drivers/gpu/drm/amd/display/dc/dc.h               | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 16556ae892d4a..5ae9b8133d6da 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3230,7 +3230,7 @@ static int dcn10_register_irq_handlers(struct amdgpu_device *adev)
 
 	/* Use GRPH_PFLIP interrupt */
 	for (i = DCN_1_0__SRCID__HUBP0_FLIP_INTERRUPT;
-			i <= DCN_1_0__SRCID__HUBP0_FLIP_INTERRUPT + adev->mode_info.num_crtc - 1;
+			i <= DCN_1_0__SRCID__HUBP0_FLIP_INTERRUPT + dc->caps.max_otg_num - 1;
 			i++) {
 		r = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_DCE, i, &adev->pageflip_irq);
 		if (r) {
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 1860ccc3f4f2c..4fae73478840c 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1118,6 +1118,8 @@ struct dc *dc_create(const struct dc_init_data *init_params)
 
 		dc->caps.max_dp_protocol_version = DP_VERSION_1_4;
 
+		dc->caps.max_otg_num = dc->res_pool->res_cap->num_timing_generator;
+
 		if (dc->res_pool->dmcu != NULL)
 			dc->versions.dmcu_version = dc->res_pool->dmcu->dmcu_version;
 	}
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 3ab52d9a82cf6..e0f58fab5e8ed 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -185,6 +185,7 @@ struct dc_caps {
 	struct dc_color_caps color;
 	bool vbios_lttpr_aware;
 	bool vbios_lttpr_enable;
+	uint32_t max_otg_num;
 };
 
 struct dc_bug_wa {
-- 
2.34.1


  parent reply	other threads:[~2022-02-15 15:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220215152831.580780-1-sashal@kernel.org>
2022-02-15 15:28 ` [PATCH AUTOSEL 5.15 28/33] display/amd: decrease message verbosity about watermarks table failure Sasha Levin
2022-02-15 15:28 ` Sasha Levin [this message]
2022-02-15 15:28 ` [PATCH AUTOSEL 5.15 30/33] drm/amd/display: fix yellow carp wm clamping Sasha Levin

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=20220215152831.580780-29-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Anson.Jacob@amd.com \
    --cc=Eric.Yang2@amd.com \
    --cc=Jerry.Zuo@amd.com \
    --cc=Jimmy.Kizito@amd.com \
    --cc=Lewis.Huang@amd.com \
    --cc=MarkAlbert.Morra@amd.com \
    --cc=Martin.Leung@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Roman.Li@amd.com \
    --cc=Wayne.Lin@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=anthony1.wang@amd.com \
    --cc=aric.cyr@amd.com \
    --cc=aurabindo.pillai@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=haonan.wang2@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=jun.lei@amd.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meenakshikumar.somasundaram@amd.com \
    --cc=michael.strauss@amd.com \
    --cc=nicholas.kazlauskas@amd.com \
    --cc=nikola.cornij@amd.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=roy.chan@amd.com \
    --cc=shenshih@amd.com \
    --cc=stable@vger.kernel.org \
    --cc=sunpeng.li@amd.com \
    /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