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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user