AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Don't stretch non-native images by default in eDP
@ 2025-10-30 19:39 Mario Limonciello (AMD)
  2025-10-30 20:49 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Mario Limonciello (AMD) @ 2025-10-30 19:39 UTC (permalink / raw)
  To: amd-gfx; +Cc: Mario Limonciello (AMD)

commit 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native
resolutions on eDP") started using the GPU scaler hardware to scale
when a non-native resolution was picked on eDP. This scaling was done
to fill the screen instead of maintain aspect ratio.

The idea was supposed to be that if a different scaling behavior is
preferred then the compositor would request it.  The not following
aspect ratio behavior however isn't desirable, so adjust it to follow
aspect ratio and still try to fill screen.

Note: This will lead to black bars in some cases for non-native
resolutions. Compositors can request the previous behavior if desired.

Fixes: 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native resolutions on eDP")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4538
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
 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 29b9197bbbc32..5b279182e66a8 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -8078,7 +8078,7 @@ static int dm_encoder_helper_atomic_check(struct drm_encoder *encoder,
 				       "mode %dx%d@%dHz is not native, enabling scaling\n",
 				       adjusted_mode->hdisplay, adjusted_mode->vdisplay,
 				       drm_mode_vrefresh(adjusted_mode));
-			dm_new_connector_state->scaling = RMX_FULL;
+			dm_new_connector_state->scaling = RMX_ASPECT;
 		}
 		return 0;
 	}
-- 
2.43.0


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

* Re: [PATCH] drm/amd/display: Don't stretch non-native images by default in eDP
  2025-10-30 19:39 [PATCH] drm/amd/display: Don't stretch non-native images by default in eDP Mario Limonciello (AMD)
@ 2025-10-30 20:49 ` Alex Deucher
  2025-10-30 20:50   ` Mario Limonciello (AMD) (kernel.org)
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2025-10-30 20:49 UTC (permalink / raw)
  To: Mario Limonciello (AMD); +Cc: amd-gfx

On Thu, Oct 30, 2025 at 4:16 PM Mario Limonciello (AMD)
<superm1@kernel.org> wrote:
>
> commit 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native
> resolutions on eDP") started using the GPU scaler hardware to scale
> when a non-native resolution was picked on eDP. This scaling was done
> to fill the screen instead of maintain aspect ratio.
>
> The idea was supposed to be that if a different scaling behavior is
> preferred then the compositor would request it.  The not following
> aspect ratio behavior however isn't desirable, so adjust it to follow
> aspect ratio and still try to fill screen.
>
> Note: This will lead to black bars in some cases for non-native
> resolutions. Compositors can request the previous behavior if desired.
>

We may end up getting bug reports about the black bars.  We had a
similar debate about what the right default was for radeon 15 years
ago.  That said, at least with this the pixels will be square with
this patch.

Acked-by: Alex Deucher <alexander.deucher@amd.com>

> Fixes: 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native resolutions on eDP")
> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4538
> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
>  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 29b9197bbbc32..5b279182e66a8 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -8078,7 +8078,7 @@ static int dm_encoder_helper_atomic_check(struct drm_encoder *encoder,
>                                        "mode %dx%d@%dHz is not native, enabling scaling\n",
>                                        adjusted_mode->hdisplay, adjusted_mode->vdisplay,
>                                        drm_mode_vrefresh(adjusted_mode));
> -                       dm_new_connector_state->scaling = RMX_FULL;
> +                       dm_new_connector_state->scaling = RMX_ASPECT;
>                 }
>                 return 0;
>         }
> --
> 2.43.0
>

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

* Re: [PATCH] drm/amd/display: Don't stretch non-native images by default in eDP
  2025-10-30 20:49 ` Alex Deucher
@ 2025-10-30 20:50   ` Mario Limonciello (AMD) (kernel.org)
  2025-10-31 19:15     ` Harry Wentland
  0 siblings, 1 reply; 4+ messages in thread
From: Mario Limonciello (AMD) (kernel.org) @ 2025-10-30 20:50 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx



On 10/30/2025 3:49 PM, Alex Deucher wrote:
> On Thu, Oct 30, 2025 at 4:16 PM Mario Limonciello (AMD)
> <superm1@kernel.org> wrote:
>>
>> commit 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native
>> resolutions on eDP") started using the GPU scaler hardware to scale
>> when a non-native resolution was picked on eDP. This scaling was done
>> to fill the screen instead of maintain aspect ratio.
>>
>> The idea was supposed to be that if a different scaling behavior is
>> preferred then the compositor would request it.  The not following
>> aspect ratio behavior however isn't desirable, so adjust it to follow
>> aspect ratio and still try to fill screen.
>>
>> Note: This will lead to black bars in some cases for non-native
>> resolutions. Compositors can request the previous behavior if desired.
>>
> 
> We may end up getting bug reports about the black bars.  We had a
> similar debate about what the right default was for radeon 15 years
> ago.  That said, at least with this the pixels will be square with
> this patch.
> 
> Acked-by: Alex Deucher <alexander.deucher@amd.com>

Thanks.  Yeah that was my thought too.

> 
>> Fixes: 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native resolutions on eDP")
>> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4538
>> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
>> ---
>>   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 29b9197bbbc32..5b279182e66a8 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -8078,7 +8078,7 @@ static int dm_encoder_helper_atomic_check(struct drm_encoder *encoder,
>>                                         "mode %dx%d@%dHz is not native, enabling scaling\n",
>>                                         adjusted_mode->hdisplay, adjusted_mode->vdisplay,
>>                                         drm_mode_vrefresh(adjusted_mode));
>> -                       dm_new_connector_state->scaling = RMX_FULL;
>> +                       dm_new_connector_state->scaling = RMX_ASPECT;
>>                  }
>>                  return 0;
>>          }
>> --
>> 2.43.0
>>


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

* Re: [PATCH] drm/amd/display: Don't stretch non-native images by default in eDP
  2025-10-30 20:50   ` Mario Limonciello (AMD) (kernel.org)
@ 2025-10-31 19:15     ` Harry Wentland
  0 siblings, 0 replies; 4+ messages in thread
From: Harry Wentland @ 2025-10-31 19:15 UTC (permalink / raw)
  To: Mario Limonciello (AMD) (kernel.org), Alex Deucher; +Cc: amd-gfx



On 2025-10-30 16:50, Mario Limonciello (AMD) (kernel.org) wrote:
> 
> 
> On 10/30/2025 3:49 PM, Alex Deucher wrote:
>> On Thu, Oct 30, 2025 at 4:16 PM Mario Limonciello (AMD)
>> <superm1@kernel.org> wrote:
>>>
>>> commit 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native
>>> resolutions on eDP") started using the GPU scaler hardware to scale
>>> when a non-native resolution was picked on eDP. This scaling was done
>>> to fill the screen instead of maintain aspect ratio.
>>>
>>> The idea was supposed to be that if a different scaling behavior is
>>> preferred then the compositor would request it.  The not following
>>> aspect ratio behavior however isn't desirable, so adjust it to follow
>>> aspect ratio and still try to fill screen.
>>>
>>> Note: This will lead to black bars in some cases for non-native
>>> resolutions. Compositors can request the previous behavior if desired.
>>>
>>
>> We may end up getting bug reports about the black bars.  We had a
>> similar debate about what the right default was for radeon 15 years
>> ago.  That said, at least with this the pixels will be square with
>> this patch.
>>
>> Acked-by: Alex Deucher <alexander.deucher@amd.com>
> 
> Thanks.  Yeah that was my thought too.

I think not preserving aspect ratio is rarely ever the right
call, especially since all modern displays have square pixels.

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

Harry

> 
>>
>>> Fixes: 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native resolutions on eDP")
>>> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4538
>>> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
>>> ---
>>>   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 29b9197bbbc32..5b279182e66a8 100644
>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> @@ -8078,7 +8078,7 @@ static int dm_encoder_helper_atomic_check(struct drm_encoder *encoder,
>>>                                         "mode %dx%d@%dHz is not native, enabling scaling\n",
>>>                                         adjusted_mode->hdisplay, adjusted_mode->vdisplay,
>>>                                         drm_mode_vrefresh(adjusted_mode));
>>> -                       dm_new_connector_state->scaling = RMX_FULL;
>>> +                       dm_new_connector_state->scaling = RMX_ASPECT;
>>>                  }
>>>                  return 0;
>>>          }
>>> -- 
>>> 2.43.0
>>>
> 


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

end of thread, other threads:[~2025-10-31 19:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30 19:39 [PATCH] drm/amd/display: Don't stretch non-native images by default in eDP Mario Limonciello (AMD)
2025-10-30 20:49 ` Alex Deucher
2025-10-30 20:50   ` Mario Limonciello (AMD) (kernel.org)
2025-10-31 19:15     ` Harry Wentland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox