* [PATCH] drm/amd/display: do not copy invalid CRTC timing info
@ 2025-04-02 17:03 Gergo Koteles
2025-04-08 16:55 ` Alex Hung
0 siblings, 1 reply; 3+ messages in thread
From: Gergo Koteles @ 2025-04-02 17:03 UTC (permalink / raw)
To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
Christian König, David Airlie, Simona Vetter, Alex Hung,
Mario Limonciello, Tom Chung, Sunil Khatri, Aurabindo Pillai,
Hersen Wu, Melissa Wen, Maxime Ripard, Dmitry Baryshkov,
Thomas Zimmermann, Laurent Pinchart
Cc: amd-gfx, dri-devel, linux-kernel, regressions, Gergo Koteles
Since b255ce4388e0, it is possible that the CRTC timing
information for the preferred mode has not yet been
calculated while amdgpu_dm_connector_mode_valid() is running.
In this case use the CRTC timing information of the actual mode.
Fixes: b255ce4388e0 ("drm/amdgpu: don't change mode in amdgpu_dm_connector_mode_valid()")
Closes: https://lore.kernel.org/all/ed09edb167e74167a694f4854102a3de6d2f1433.camel@irl.hu/
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4085
Signed-off-by: Gergo Koteles <soyer@irl.hu>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 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 bae83a129b5f..0eb25cdcb52f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6500,12 +6500,12 @@ decide_crtc_timing_for_drm_display_mode(struct drm_display_mode *drm_mode,
const struct drm_display_mode *native_mode,
bool scale_enabled)
{
- if (scale_enabled) {
- copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
- } else if (native_mode->clock == drm_mode->clock &&
- native_mode->htotal == drm_mode->htotal &&
- native_mode->vtotal == drm_mode->vtotal) {
- copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
+ if (scale_enabled || (
+ native_mode->clock == drm_mode->clock &&
+ native_mode->htotal == drm_mode->htotal &&
+ native_mode->vtotal == drm_mode->vtotal)) {
+ if (native_mode->crtc_clock)
+ copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
} else {
/* no scaling nor amdgpu inserted, no need to patch */
}
--
2.49.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amd/display: do not copy invalid CRTC timing info
2025-04-02 17:03 [PATCH] drm/amd/display: do not copy invalid CRTC timing info Gergo Koteles
@ 2025-04-08 16:55 ` Alex Hung
2025-04-18 0:44 ` Alex Hung
0 siblings, 1 reply; 3+ messages in thread
From: Alex Hung @ 2025-04-08 16:55 UTC (permalink / raw)
To: Gergo Koteles, Harry Wentland, Leo Li, Rodrigo Siqueira,
Alex Deucher, Christian König, David Airlie, Simona Vetter,
Mario Limonciello, Tom Chung, Sunil Khatri, Aurabindo Pillai,
Hersen Wu, Melissa Wen, Maxime Ripard, Dmitry Baryshkov,
Thomas Zimmermann, Laurent Pinchart
Cc: amd-gfx, dri-devel, linux-kernel, regressions
Hi Gergo,
Thanks for the patch. I am sending this patch for testing and I will
update test result next week.
On 4/2/25 11:03, Gergo Koteles wrote:
> Since b255ce4388e0, it is possible that the CRTC timing
> information for the preferred mode has not yet been
> calculated while amdgpu_dm_connector_mode_valid() is running.
>
> In this case use the CRTC timing information of the actual mode.
>
> Fixes: b255ce4388e0 ("drm/amdgpu: don't change mode in amdgpu_dm_connector_mode_valid()")
> Closes: https://lore.kernel.org/all/ed09edb167e74167a694f4854102a3de6d2f1433.camel@irl.hu/
> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4085
> Signed-off-by: Gergo Koteles <soyer@irl.hu>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 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 bae83a129b5f..0eb25cdcb52f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -6500,12 +6500,12 @@ decide_crtc_timing_for_drm_display_mode(struct drm_display_mode *drm_mode,
> const struct drm_display_mode *native_mode,
> bool scale_enabled)
> {
> - if (scale_enabled) {
> - copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
> - } else if (native_mode->clock == drm_mode->clock &&
> - native_mode->htotal == drm_mode->htotal &&
> - native_mode->vtotal == drm_mode->vtotal) {
> - copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
> + if (scale_enabled || (
> + native_mode->clock == drm_mode->clock &&
> + native_mode->htotal == drm_mode->htotal &&
> + native_mode->vtotal == drm_mode->vtotal)) {
> + if (native_mode->crtc_clock)
> + copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
> } else {
> /* no scaling nor amdgpu inserted, no need to patch */
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amd/display: do not copy invalid CRTC timing info
2025-04-08 16:55 ` Alex Hung
@ 2025-04-18 0:44 ` Alex Hung
0 siblings, 0 replies; 3+ messages in thread
From: Alex Hung @ 2025-04-18 0:44 UTC (permalink / raw)
To: Gergo Koteles, Harry Wentland, Leo Li, Rodrigo Siqueira,
Alex Deucher, Christian König, David Airlie, Simona Vetter,
Mario Limonciello, Tom Chung, Sunil Khatri, Aurabindo Pillai,
Hersen Wu, Melissa Wen, Maxime Ripard, Dmitry Baryshkov,
Thomas Zimmermann, Laurent Pinchart
Cc: amd-gfx, dri-devel, linux-kernel, regressions
No issues from promotion tests.
Reviewed-by: Alex Hung <alex.hung@amd.com>
On 4/8/25 10:55, Alex Hung wrote:
> Hi Gergo,
>
> Thanks for the patch. I am sending this patch for testing and I will
> update test result next week.
>
>
> On 4/2/25 11:03, Gergo Koteles wrote:
>> Since b255ce4388e0, it is possible that the CRTC timing
>> information for the preferred mode has not yet been
>> calculated while amdgpu_dm_connector_mode_valid() is running.
>>
>> In this case use the CRTC timing information of the actual mode.
>>
>> Fixes: b255ce4388e0 ("drm/amdgpu: don't change mode in
>> amdgpu_dm_connector_mode_valid()")
>> Closes: https://lore.kernel.org/all/
>> ed09edb167e74167a694f4854102a3de6d2f1433.camel@irl.hu/
>> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4085
>> Signed-off-by: Gergo Koteles <soyer@irl.hu>
>> ---
>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++++------
>> 1 file changed, 6 insertions(+), 6 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 bae83a129b5f..0eb25cdcb52f 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -6500,12 +6500,12 @@ decide_crtc_timing_for_drm_display_mode(struct
>> drm_display_mode *drm_mode,
>> const struct drm_display_mode *native_mode,
>> bool scale_enabled)
>> {
>> - if (scale_enabled) {
>> - copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
>> - } else if (native_mode->clock == drm_mode->clock &&
>> - native_mode->htotal == drm_mode->htotal &&
>> - native_mode->vtotal == drm_mode->vtotal) {
>> - copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
>> + if (scale_enabled || (
>> + native_mode->clock == drm_mode->clock &&
>> + native_mode->htotal == drm_mode->htotal &&
>> + native_mode->vtotal == drm_mode->vtotal)) {
>> + if (native_mode->crtc_clock)
>> + copy_crtc_timing_for_drm_display_mode(native_mode,
>> drm_mode);
>> } else {
>> /* no scaling nor amdgpu inserted, no need to patch */
>> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-18 0:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-02 17:03 [PATCH] drm/amd/display: do not copy invalid CRTC timing info Gergo Koteles
2025-04-08 16:55 ` Alex Hung
2025-04-18 0:44 ` Alex Hung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®