linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Clark <rob.clark@linaro.org>
To: dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org
Cc: patches@linaro.org, Greg KH <greg@kroah.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Andy Gross <andy.gross@ti.com>,
	Andre Renaud <andre@bluewatersys.com>, Rob Clark <rob@ti.com>
Subject: [PATCH 2/2] Expose the OMAP Z-Order property through DRM
Date: Wed, 15 Aug 2012 15:18:02 -0500	[thread overview]
Message-ID: <1345061882-9743-3-git-send-email-rob.clark@linaro.org> (raw)
In-Reply-To: <1345061882-9743-1-git-send-email-rob.clark@linaro.org>

From: Andre Renaud <andre@bluewatersys.com>

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>
---
 drivers/staging/omapdrm/omap_drv.h   |    1 +
 drivers/staging/omapdrm/omap_plane.c |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/drivers/staging/omapdrm/omap_drv.h b/drivers/staging/omapdrm/omap_drv.h
index b103d28..9dc72d1 100644
--- a/drivers/staging/omapdrm/omap_drv.h
+++ b/drivers/staging/omapdrm/omap_drv.h
@@ -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 */
diff --git a/drivers/staging/omapdrm/omap_plane.c b/drivers/staging/omapdrm/omap_plane.c
index 6931d06..4bde639 100644
--- a/drivers/staging/omapdrm/omap_plane.c
+++ b/drivers/staging/omapdrm/omap_plane.c
@@ -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,
@@ -452,6 +461,16 @@ int omap_plane_set_property(struct drm_plane *plane,
 			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
+			ret = 0;
 	}
 
 	return ret;
-- 
1.7.9.5


  parent reply	other threads:[~2012-08-15 20:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-15 20:18 [PATCH 0/2] drm/omap: properties patches Rob Clark
2012-08-15 20:18 ` [PATCH 1/2] staging: drm/omap: add rotation properties Rob Clark
2012-08-15 20:18 ` Rob Clark [this message]
2012-08-16 13:00   ` [PATCH 2/2] Expose the OMAP Z-Order property through DRM Ville Syrjälä
2012-08-16 13:18     ` Rob Clark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345061882-9743-3-git-send-email-rob.clark@linaro.org \
    --to=rob.clark@linaro.org \
    --cc=andre@bluewatersys.com \
    --cc=andy.gross@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=greg@kroah.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rob@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).