drm/amd/display: Don't stretch non-native images by default in eDP
Subsystems (3)
PATCH 1/1 drm/amd/display: Don't stretch non-native images by default in eDP
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.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -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 ; }
Signature · 1 line
2.43.0
Quoted 6 lines · 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.
Quoted 8 lines
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.
Quoted 23 lines
Fixes 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native resolutions on eDP")Signed-off-by Mario Limonciello (AMD) <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-2@@ -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
Quoted 17 lines · Alex Deucher
Quoted 6 lines · 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.Quoted 8 lines
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.
Quoted 6 lines
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 <[email protected]>
Thanks. Yeah that was my thought too.
Quoted 24 lines
Quoted 24 lines
Fixes 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native resolutions on eDP")Signed-off-by Mario Limonciello (AMD) <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-2@@ -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
Quoted 20 lines · Mario Limonciello (AMD) (kernel.org)
Quoted 17 lines · Alex Deucher
Quoted 14 lines · 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.
Quoted 8 lines
Quoted 6 lines
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 <[email protected]>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.
Harry
Quoted 26 lines
Quoted 25 lines
Quoted 25 lines
Fixes 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native resolutions on eDP")Signed-off-by Mario Limonciello (AMD) <[email protected]>---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-1@@ -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; }Signature · 1 line
2.43.0