diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-08-27 13:09:22 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-03-03 17:36:44 +0200 |
commit | bfeece553335f9b9bf0d4dc9ea8a602a2248dfd6 (patch) | |
tree | d1a83329d4cc2be8ed3a89de3ebda42e889ac430 /drivers/gpu/drm/omapdrm/omap_plane.c | |
parent | 6bdad6cf98844e76f678da35dea09193bfb78be1 (diff) | |
download | linux-bfeece553335f9b9bf0d4dc9ea8a602a2248dfd6.tar.gz linux-bfeece553335f9b9bf0d4dc9ea8a602a2248dfd6.tar.bz2 linux-bfeece553335f9b9bf0d4dc9ea8a602a2248dfd6.zip |
drm/omap: check if rotation is supported before commit
omapdrm is missing a check on the validity of the rotation property.
This leads to omapdrm possibly trying to use rotation on non-rotateable
framebuffer, which causes the overlay setup to fail.
This patch adds the necessary check to omap_plane_atomic_check().
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_plane.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_plane.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index d75b197eff46..93ee538a99f5 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -177,6 +177,12 @@ static int omap_plane_atomic_check(struct drm_plane *plane, if (state->crtc_y + state->crtc_h > crtc_state->adjusted_mode.vdisplay) return -EINVAL; + if (state->fb) { + if (state->rotation != BIT(DRM_ROTATE_0) && + !omap_framebuffer_supports_rotation(state->fb)) + return -EINVAL; + } + return 0; } |