diff options
author | Ville Syrjälä <[email protected]> | 2016-09-26 19:30:47 +0300 |
---|---|---|
committer | Daniel Vetter <[email protected]> | 2016-10-21 18:22:14 +0200 |
commit | 6e0c7c3358d4e8e9917a97348e6f77da88226cbe (patch) | |
tree | efdc77bb795d810682447c0afde8c4751504c8a7 | |
parent | bd2ef25d921c0d937e4bc4f5a4f98f534424c6aa (diff) |
drm/atomic: Reject attempts to use multiple rotation angles at once
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ä <[email protected]>
Reviewed-by: Joonas Lahtinen <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/drm_atomic.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 5dd70540219c..13ce95ee458e 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -706,6 +706,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 (property == plane->zpos_property) { state->zpos = val; |