[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220530092902.810336-1-tsung-hua.lin@amd.com>
Date: Mon, 30 May 2022 17:29:02 +0800
From: Ryan Lin <tsung-hua.lin@....com>
To: unlisted-recipients:; (no To-header on input)
CC: <leon.li@....com>, <praful.swarnakar@....com>, <shirish.s@....com>,
<ching-shih.li@....com>, Alex Deucher <alexander.deucher@....com>,
"Daniel Vetter" <daniel@...ll.ch>,
Nicholas Kazlauskas <nicholas.kazlauskas@....com>,
<stable@...r.kernel.org>, Harry Wentland <harry.wentland@....com>,
Leo Li <sunpeng.li@....com>,
Christian König <christian.koenig@....com>,
"David (ChunMing) Zhou" <David1.Zhou@....com>,
David Airlie <airlied@...ux.ie>,
Bas Nieuwenhuizen <bas@...nieuwenhuizen.nl>,
Sean Paul <seanpaul@...omium.org>,
Sasha Levin <sashal@...nel.org>,
"Mark Yacoub" <markyacoub@...gle.com>, Roman Li <Roman.Li@....com>,
Ikshwaku Chauhan <ikshwaku.chauhan@....corp-partner.google.com>,
Simon Ser <contact@...rsion.fr>,
<amd-gfx@...ts.freedesktop.org>, <dri-devel@...ts.freedesktop.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] BACKPORT: drm/amdgpu/disply: set num_crtc earlier
From: Alex Deucher <alexander.deucher@....com>
To avoid a recently added warning:
Bogus possible_crtcs: [ENCODER:65:TMDS-65] possible_crtcs=0xf (full crtc mask=0x7)
WARNING: CPU: 3 PID: 439 at drivers/gpu/drm/drm_mode_config.c:617 drm_mode_config_validate+0x178/0x200 [drm]
In this case the warning is harmless, but confusing to users.
Fixes: 0df108237433 ("drm: Validate encoder->possible_crtcs")
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=209123
Reviewed-by: Daniel Vetter <daniel@...ll.ch>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@....com>
Signed-off-by: Alex Deucher <alexander.deucher@....com>
Cc: stable@...r.kernel.org
Conflicts:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
[Ryan Lin: Fixed the conflict, remove the non-main changed part
of this patch]
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
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 fb918b7890ac..5ef88a2d2161 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -766,9 +766,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
goto error;
}
- /* Update the actual used number of crtc */
- adev->mode_info.num_crtc = adev->dm.display_indexes_num;
-
/* TODO: Add_display_info? */
/* TODO use dynamic cursor width */
@@ -2448,6 +2445,10 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
enum dc_connection_type new_connection_type = dc_connection_none;
const struct dc_plane_cap *plane;
+ dm->display_indexes_num = dm->dc->caps.max_streams;
+ /* Update the actual used number of crtc */
+ adev->mode_info.num_crtc = adev->dm.display_indexes_num;
+
link_cnt = dm->dc->caps.max_links;
if (amdgpu_dm_mode_config_init(dm->adev)) {
DRM_ERROR("DM: Failed to initialize mode config\n");
@@ -2509,8 +2510,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
goto fail;
}
- dm->display_indexes_num = dm->dc->caps.max_streams;
-
/* loops over all connectors on the board */
for (i = 0; i < link_cnt; i++) {
struct dc_link *link = NULL;
--
2.25.1
Powered by blists - more mailing lists