Re: [PATCH 2/7] drm/atomic: Reject attempts to use multiple rotation angles at once

Joonas Lahtinen
2016-07-20T13:26:35Z

On ke, 2016-07-20 at 16:18 +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The rotation property should only accept exactly one rotation angle
> at once. Let's reject attempts to set none or multiple angles.
>
> Testcase: igt/kms_rotation_crc/bad-rotation
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

> ---
>  drivers/gpu/drm/drm_atomic.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 3cee084e9d28..5f0002897862 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -711,6 +711,8 @@ int drm_atomic_plane_set_property(struct drm_plane *plane,
>   } else if (property == config->prop_src_h) {
>   state->src_h = val;
>   } else if (property == config->rotation_property) {
> + if (!is_power_of_2(val & DRM_ROTATE_MASK))
> + return -EINVAL;
>   state->rotation = val;
>   } else if (plane->funcs->atomic_set_property) {
>   return plane->funcs->atomic_set_property(plane, state,
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org