diff mbox series

drm/amdgpu: fix set scaling mode Full/Full aspect/Center not works on vga and dvi connectors

Message ID 20211111033207.28565-1-hongao@uniontech.com (mailing list archive)
State New, archived
Headers show
Series drm/amdgpu: fix set scaling mode Full/Full aspect/Center not works on vga and dvi connectors | expand

Commit Message

hongao Nov. 11, 2021, 3:32 a.m. UTC
amdgpu_connector_vga_get_modes missed function amdgpu_get_native_mode
which assign amdgpu_encoder->native_mode with *preferred_mode result in
amdgpu_encoder->native_mode.clock always be 0. That will cause
amdgpu_connector_set_property returned early on:
if ((rmx_type != DRM_MODE_SCALE_NONE) &&
	(amdgpu_encoder->native_mode.clock == 0))
when we try to set scaling mode Full/Full aspect/Center.
Add the missing function to amdgpu_connector_vga_get_mode can fix this.
It also works on dvi connectors because
amdgpu_connector_dvi_helper_funcs.get_mode use the same method.

Signed-off-by: hongao <hongao@uniontech.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Alex Deucher Nov. 12, 2021, 10:51 p.m. UTC | #1
Applied.  Thanks!

On Wed, Nov 10, 2021 at 10:54 PM hongao <hongao@uniontech.com> wrote:
>
> amdgpu_connector_vga_get_modes missed function amdgpu_get_native_mode
> which assign amdgpu_encoder->native_mode with *preferred_mode result in
> amdgpu_encoder->native_mode.clock always be 0. That will cause
> amdgpu_connector_set_property returned early on:
> if ((rmx_type != DRM_MODE_SCALE_NONE) &&
>         (amdgpu_encoder->native_mode.clock == 0))
> when we try to set scaling mode Full/Full aspect/Center.
> Add the missing function to amdgpu_connector_vga_get_mode can fix this.
> It also works on dvi connectors because
> amdgpu_connector_dvi_helper_funcs.get_mode use the same method.
>
> Signed-off-by: hongao <hongao@uniontech.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> index b9c11c2b2885..0de66f59adb8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> @@ -827,6 +827,7 @@ static int amdgpu_connector_vga_get_modes(struct drm_connector *connector)
>
>         amdgpu_connector_get_edid(connector);
>         ret = amdgpu_connector_ddc_get_modes(connector);
> +       amdgpu_get_native_mode(connector);
>
>         return ret;
>  }
> --
> 2.20.1
>
>
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index b9c11c2b2885..0de66f59adb8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -827,6 +827,7 @@  static int amdgpu_connector_vga_get_modes(struct drm_connector *connector)
 
 	amdgpu_connector_get_edid(connector);
 	ret = amdgpu_connector_ddc_get_modes(connector);
+	amdgpu_get_native_mode(connector);
 
 	return ret;
 }