Skip to contentSkip to conversation

drm/omap: invert dimensions on crtc when rotated

PATCH In review Rob Clark 1 participant 1 message Sep 4, 2012 Staging

lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 2/2 drm/omap: invert dimensions on crtc when rotated

From: Rob Clark <[email protected]>

If rotated 90 or 270, we need to invert the dimensions used by drm core for calculating if the dimensions of an attached fb are correct.

---
 drivers/staging/omapdrm/omap_crtc.c |    7 +++++++
 1 file changed, 7 insertions(+)
drivers/staging/omapdrm/omap_crtc.c +7 -0
index 98a10bc..dade3de 100644
@@ -195,6 +195,13 @@ static int omap_crtc_set_property(struct drm_crtc *crtc,
 		struct drm_property *property, uint64_t val)
 {
 	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+	struct omap_drm_private *priv = crtc->dev->dev_private;
+
+	if (property == priv->rotation_prop) {
+		crtc->invert_dimensions =
+				!!(val & ((1LL << DRM_ROTATE_90) | (1LL << DRM_ROTATE_270)));
+	}
+
 	return omap_plane_set_property(omap_crtc->plane, property, val);
 }
 
Signature · 1 line
1.7.9.5