[PATCH] drm/amd/display: Create plane rotation property

Kazlauskas, Nicholas Nicholas.Kazlauskas at amd.com
Thu Sep 12 17:01:52 UTC 2019


On 2019-09-12 12:44 p.m., Pierre-Loup A. Griffais wrote:
> It's otherwise properly supported, just needs exposing to userspace.
> 
> Signed-off-by: Pierre-Loup A. Griffais <pgriffais at valvesoftware.com>
I know IGT has some tests for plane rotation, do you happen to know what 
tests pass or fail when exposing this?

I think DCN1 (Raven) should work as expected but I'd be concerned about 
DCE or DCN2. I think we have had some cursor bugs in the past with 
cursor rotation but they might only be exposed when used in conjunction 
with overlay planes.

I'd just like to make sure there's suitable testing at least if we're 
going to expose this to userspace.

Nicholas Kazlauskas

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> 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 45be7a2132bb..3772763c6449 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -4680,6 +4680,7 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
>   	uint32_t formats[32];
>   	int num_formats;
>   	int res = -EPERM;
> +	unsigned int supported_rotations;
>   
>   	num_formats = get_plane_formats(plane, plane_cap, formats,
>   					ARRAY_SIZE(formats));
> @@ -4711,6 +4712,13 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
>   			DRM_COLOR_YCBCR_BT709, DRM_COLOR_YCBCR_LIMITED_RANGE);
>   	}
>   
> +	supported_rotations =
> +		DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
> +		DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270;
> +
> +	drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0,
> +					   supported_rotations);
> +
>   	drm_plane_helper_add(plane, &dm_plane_helper_funcs);
>   
>   	/* Create (reset) the plane state */
> 



More information about the amd-gfx mailing list