summaryrefslogtreecommitdiff
path: root/drivers/staging/omapdrm/omap_drv.c
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2012-08-15 15:18:01 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-15 15:22:42 -0700
commit3c810c613a9d61eb70735cfb85fe5db6e0331bae (patch)
tree81269a522459356eee349ec9b11cb83cd01065bf /drivers/staging/omapdrm/omap_drv.c
parent69af59970bec925d182ca5ebd80e643fdd90b1cc (diff)
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 <rob@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/omapdrm/omap_drv.c')
-rw-r--r--drivers/staging/omapdrm/omap_drv.c17
1 files changed, 17 insertions, 0 deletions
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");