staging: omapdrm: Expose the OMAP Z-Order property through DRM
authorAndre Renaud <andre@bluewatersys.com>
Wed, 15 Aug 2012 20:18:02 +0000 (15:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Aug 2012 22:25:15 +0000 (15:25 -0700)
Added support for zorder changes through DRM plane properties

Signed-off-by: Andre Renaud <andre@bluewatersys.com>
Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/omapdrm/omap_drv.h
drivers/staging/omapdrm/omap_plane.c

index b103d28a36ae8429dcb68b77736565c8106f63f6..9dc72d143ff3fd70c7bfcf95721eff42fbe09986 100644 (file)
@@ -62,6 +62,7 @@ struct omap_drm_private {
 
        /* properties: */
        struct drm_property *rotation_prop;
+       struct drm_property *zorder_prop;
 };
 
 /* this should probably be in drm-core to standardize amongst drivers */
index 6931d06a8c81d1f0d39f4d83c1428cf25acea17a..4bde639dd02c21a95b06ba0636134634c74c7d99 100644 (file)
@@ -433,6 +433,15 @@ void omap_plane_install_properties(struct drm_plane *plane,
                priv->rotation_prop = prop;
        }
        drm_object_attach_property(obj, prop, 0);
+
+        prop = priv->zorder_prop;
+        if (!prop) {
+               prop = drm_property_create_range(dev, 0, "zorder", 0, 3);
+               if (prop == NULL)
+                       return;
+               priv->zorder_prop = prop;
+       }
+       drm_object_attach_property(obj, prop, 0);
 }
 
 int omap_plane_set_property(struct drm_plane *plane,
@@ -448,6 +457,16 @@ int omap_plane_set_property(struct drm_plane *plane,
                DBG("%s: rotation: %02x", ovl->name, (uint32_t)val);
                omap_plane->win.rotation = val;
 
+               if (ovl->is_enabled(ovl))
+                       ret = omap_plane_dpms(plane, DRM_MODE_DPMS_ON);
+               else
+                       ret = 0;
+       } else if (property == priv->zorder_prop) {
+               struct omap_overlay *ovl = omap_plane->ovl;
+
+               DBG("%s: zorder: %d", ovl->name, (uint32_t)val);
+               omap_plane->info.zorder = val;
+
                if (ovl->is_enabled(ovl))
                        ret = omap_plane_dpms(plane, DRM_MODE_DPMS_ON);
                else