From 3c810c613a9d61eb70735cfb85fe5db6e0331bae Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 15 Aug 2012 15:18:01 -0500 Subject: staging: drm/omap: add rotation properties Use tiled buffers for rotated/reflected scanout, with CRTC and plane properties as the interface for userspace to configure rotation. Signed-off-by: Rob Clark Signed-off-by: Greg Kroah-Hartman --- drivers/staging/omapdrm/omap_drv.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'drivers/staging/omapdrm/omap_drv.c') diff --git a/drivers/staging/omapdrm/omap_drv.c b/drivers/staging/omapdrm/omap_drv.c index 44149eeb97ae..b8e79eb7cd5e 100644 --- a/drivers/staging/omapdrm/omap_drv.c +++ b/drivers/staging/omapdrm/omap_drv.c @@ -649,6 +649,8 @@ static int dev_firstopen(struct drm_device *dev) */ static void dev_lastclose(struct drm_device *dev) { + int i; + /* we don't support vga-switcheroo.. so just make sure the fbdev * mode is active */ @@ -657,6 +659,21 @@ static void dev_lastclose(struct drm_device *dev) DBG("lastclose: dev=%p", dev); + /* need to restore default rotation state.. not sure if there is + * a cleaner way to restore properties to default state? Maybe + * a flag that properties should automatically be restored to + * default state on lastclose? + */ + for (i = 0; i < priv->num_crtcs; i++) { + drm_object_property_set_value(&priv->crtcs[i]->base, + priv->rotation_prop, 0); + } + + for (i = 0; i < priv->num_planes; i++) { + drm_object_property_set_value(&priv->planes[i]->base, + priv->rotation_prop, 0); + } + ret = drm_fb_helper_restore_fbdev_mode(priv->fbdev); if (ret) DBG("failed to restore crtc mode"); -- cgit v1.2.3