mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: fix mode scaling (RMX_.*)
@ 2023-08-18 13:17 Hamza Mahfooz
  2023-08-18 13:28 ` Alex Deucher
  2023-08-18 15:01 ` Harry Wentland
  0 siblings, 2 replies; 4+ messages in thread
From: Hamza Mahfooz @ 2023-08-18 13:17 UTC (permalink / raw)
  To: amd-gfx
  Cc: Hamza Mahfooz, Harry Wentland, Rodrigo Siqueira, Leo Li,
	Rodrigo Siqueira, Alex Deucher, Christian König, Pan,
	Xinhui, David Airlie, Daniel Vetter, Qingqing Zhuo,
	Aurabindo Pillai, Hersen Wu, Srinivasan Shanmugam, Stylon Wang,
	Wayne Lin, Alan Liu, Joshua Ashton, dri-devel, linux-kernel

As made mention of in commit 4a2df0d1f28e ("drm/amd/display: Fixed
non-native modes not lighting up"), we shouldn't call
drm_mode_set_crtcinfo() once the crtc timings have been decided. Since,
it can cause settings to be unintentionally overwritten. So, since
dm_state is never NULL now, we can use old_stream to determine if we
should call drm_mode_set_crtcinfo() because we only need to set the crtc
timing parameters for entirely new streams.

Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Fixes: 712237a4a1b4 ("drm/amd/display: Always set crtcinfo from create_stream_for_sink")
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 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 3b27b7742854..e9aff5014e39 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6035,7 +6035,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
 
 	if (recalculate_timing)
 		drm_mode_set_crtcinfo(&saved_mode, 0);
-	else
+	else if (!old_stream)
 		drm_mode_set_crtcinfo(&mode, 0);
 
 	/*
-- 
2.41.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: fix mode scaling (RMX_.*)
  2023-08-18 13:17 [PATCH] drm/amd/display: fix mode scaling (RMX_.*) Hamza Mahfooz
@ 2023-08-18 13:28 ` Alex Deucher
  2023-08-18 13:47   ` Hamza Mahfooz
  2023-08-18 15:01 ` Harry Wentland
  1 sibling, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2023-08-18 13:28 UTC (permalink / raw)
  To: Hamza Mahfooz
  Cc: amd-gfx, Stylon Wang, Alan Liu, Srinivasan Shanmugam, Leo Li,
	Qingqing Zhuo, Pan, Xinhui, Rodrigo Siqueira, linux-kernel,
	dri-devel, Aurabindo Pillai, Hersen Wu, Wayne Lin, Alex Deucher,
	Christian König, Joshua Ashton

On Fri, Aug 18, 2023 at 9:25 AM Hamza Mahfooz <hamza.mahfooz@amd.com> wrote:
>
> As made mention of in commit 4a2df0d1f28e ("drm/amd/display: Fixed
> non-native modes not lighting up"), we shouldn't call
> drm_mode_set_crtcinfo() once the crtc timings have been decided. Since,
> it can cause settings to be unintentionally overwritten. So, since
> dm_state is never NULL now, we can use old_stream to determine if we
> should call drm_mode_set_crtcinfo() because we only need to set the crtc
> timing parameters for entirely new streams.
>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
> Fixes: 712237a4a1b4 ("drm/amd/display: Always set crtcinfo from create_stream_for_sink")
> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>

Does this fix:
https://gitlab.freedesktop.org/drm/amd/-/issues/2783
If so, add a link tag for that.

Alex

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
>  1 file changed, 1 insertion(+), 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 3b27b7742854..e9aff5014e39 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -6035,7 +6035,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
>
>         if (recalculate_timing)
>                 drm_mode_set_crtcinfo(&saved_mode, 0);
> -       else
> +       else if (!old_stream)
>                 drm_mode_set_crtcinfo(&mode, 0);
>
>         /*
> --
> 2.41.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: fix mode scaling (RMX_.*)
  2023-08-18 13:28 ` Alex Deucher
@ 2023-08-18 13:47   ` Hamza Mahfooz
  0 siblings, 0 replies; 4+ messages in thread
From: Hamza Mahfooz @ 2023-08-18 13:47 UTC (permalink / raw)
  To: Alex Deucher
  Cc: amd-gfx, Stylon Wang, Alan Liu, Srinivasan Shanmugam, Leo Li,
	Qingqing Zhuo, Pan, Xinhui, Rodrigo Siqueira, linux-kernel,
	dri-devel, Aurabindo Pillai, Hersen Wu, Wayne Lin, Alex Deucher,
	Christian König, Joshua Ashton


On 8/18/23 09:28, Alex Deucher wrote:
> On Fri, Aug 18, 2023 at 9:25 AM Hamza Mahfooz <hamza.mahfooz@amd.com> wrote:
>>
>> As made mention of in commit 4a2df0d1f28e ("drm/amd/display: Fixed
>> non-native modes not lighting up"), we shouldn't call
>> drm_mode_set_crtcinfo() once the crtc timings have been decided. Since,
>> it can cause settings to be unintentionally overwritten. So, since
>> dm_state is never NULL now, we can use old_stream to determine if we
>> should call drm_mode_set_crtcinfo() because we only need to set the crtc
>> timing parameters for entirely new streams.
>>
>> Cc: Harry Wentland <harry.wentland@amd.com>
>> Cc: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
>> Fixes: 712237a4a1b4 ("drm/amd/display: Always set crtcinfo from create_stream_for_sink")
>> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
> 
> Does this fix:
> https://gitlab.freedesktop.org/drm/amd/-/issues/2783
> If so, add a link tag for that.

The issue I'm addressing is specific to the colorspace patches (which
weren't ported to 6.4.y to my knowledge). So, that's probably unrelated.

> 
> Alex
> 
>> ---
>>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
>>   1 file changed, 1 insertion(+), 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 3b27b7742854..e9aff5014e39 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -6035,7 +6035,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
>>
>>          if (recalculate_timing)
>>                  drm_mode_set_crtcinfo(&saved_mode, 0);
>> -       else
>> +       else if (!old_stream)
>>                  drm_mode_set_crtcinfo(&mode, 0);
>>
>>          /*
>> --
>> 2.41.0
>>
-- 
Hamza


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: fix mode scaling (RMX_.*)
  2023-08-18 13:17 [PATCH] drm/amd/display: fix mode scaling (RMX_.*) Hamza Mahfooz
  2023-08-18 13:28 ` Alex Deucher
@ 2023-08-18 15:01 ` Harry Wentland
  1 sibling, 0 replies; 4+ messages in thread
From: Harry Wentland @ 2023-08-18 15:01 UTC (permalink / raw)
  To: Hamza Mahfooz, amd-gfx
  Cc: Rodrigo Siqueira, Leo Li, Alex Deucher, Christian König,
	Pan, Xinhui, David Airlie, Daniel Vetter, Qingqing Zhuo,
	Aurabindo Pillai, Hersen Wu, Srinivasan Shanmugam, Stylon Wang,
	Wayne Lin, Alan Liu, Joshua Ashton, dri-devel, linux-kernel



On 2023-08-18 09:17, Hamza Mahfooz wrote:
> As made mention of in commit 4a2df0d1f28e ("drm/amd/display: Fixed
> non-native modes not lighting up"), we shouldn't call
> drm_mode_set_crtcinfo() once the crtc timings have been decided. Since,
> it can cause settings to be unintentionally overwritten. So, since
> dm_state is never NULL now, we can use old_stream to determine if we
> should call drm_mode_set_crtcinfo() because we only need to set the crtc
> timing parameters for entirely new streams.
> 
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
> Fixes: 712237a4a1b4 ("drm/amd/display: Always set crtcinfo from create_stream_for_sink")
> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
>  1 file changed, 1 insertion(+), 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 3b27b7742854..e9aff5014e39 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -6035,7 +6035,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
>  
>  	if (recalculate_timing)
>  		drm_mode_set_crtcinfo(&saved_mode, 0);
> -	else
> +	else if (!old_stream)
>  		drm_mode_set_crtcinfo(&mode, 0);
>  
>  	/*


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-18 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-18 13:17 [PATCH] drm/amd/display: fix mode scaling (RMX_.*) Hamza Mahfooz
2023-08-18 13:28 ` Alex Deucher
2023-08-18 13:47   ` Hamza Mahfooz
2023-08-18 15:01 ` Harry Wentland

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®