dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.com
Cc: airlied@linux.ie, jsarha@ti.com, dri-devel@lists.freedesktop.org
Subject: [PATCH 2/2] drm/omap: Normalize the zpos and use the normalized_zpos in runtime
Date: Thu, 21 Dec 2017 14:11:01 +0200	[thread overview]
Message-ID: <20171221121101.29161-3-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <20171221121101.29161-1-peter.ujfalusi@ti.com>

To avoid zpos collision, use the normalized_zpos when configuring the
zorder of the plane.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c   | 26 +++++++++++++++++++++++++-
 drivers/gpu/drm/omapdrm/omap_plane.c |  2 +-
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 6bfc2d9ebb46..230df6d8edd1 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -21,6 +21,7 @@
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_blend.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
 
@@ -54,6 +55,29 @@ MODULE_PARM_DESC(displays,
  *                 devices
  */
 
+int omap_atomic_helper_check(struct drm_device *dev,
+			     struct drm_atomic_state *state)
+{
+	int ret;
+
+	ret = drm_atomic_helper_check_modeset(dev, state);
+	if (ret)
+		return ret;
+
+	ret = drm_atomic_normalize_zpos(dev, state);
+	if (ret)
+		return ret;
+
+	ret = drm_atomic_helper_check_planes(dev, state);
+	if (ret)
+		return ret;
+
+	if (state->legacy_cursor_update)
+		state->async_update = !drm_atomic_helper_async_check(dev, state);
+
+	return ret;
+}
+
 static void omap_atomic_wait_for_completion(struct drm_device *dev,
 					    struct drm_atomic_state *old_state)
 {
@@ -133,7 +157,7 @@ static const struct drm_mode_config_helper_funcs omap_mode_config_helper_funcs =
 static const struct drm_mode_config_funcs omap_mode_config_funcs = {
 	.fb_create = omap_framebuffer_create,
 	.output_poll_changed = drm_fb_helper_output_poll_changed,
-	.atomic_check = drm_atomic_helper_check,
+	.atomic_check = omap_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
 
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index bbbdd560e503..abd78b511e6d 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -65,7 +65,7 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
 	info.rotation_type = OMAP_DSS_ROT_NONE;
 	info.rotation = DRM_MODE_ROTATE_0;
 	info.global_alpha = 0xff;
-	info.zorder = state->zpos;
+	info.zorder = state->normalized_zpos;
 
 	/* update scanout: */
 	omap_framebuffer_update_scanout(state->fb, state, &info);
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-12-21 12:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21 12:10 [PATCH 0/2] drm blend/omap: normalized zpos handling Peter Ujfalusi
2017-12-21 12:11 ` [PATCH 1/2] drm/blend: Account also the primary plane of the crtc for normalized_zpos Peter Ujfalusi
2017-12-21 12:55   ` Ville Syrjälä
2017-12-21 13:44     ` Tomi Valkeinen
2017-12-21 14:20       ` Ville Syrjälä
2017-12-21 14:31         ` Tomi Valkeinen
2017-12-21 15:12           ` Ville Syrjälä
2017-12-22  9:16             ` Tomi Valkeinen
2017-12-22 10:12               ` Ville Syrjälä
2017-12-22 15:15                 ` Peter Ujfalusi
2018-01-09 12:42                   ` Daniel Vetter
2018-01-09 13:40                     ` Laurent Pinchart
2018-01-09 14:29                       ` Daniel Vetter
2017-12-21 12:11 ` Peter Ujfalusi [this message]
2017-12-21 13:17   ` [PATCH 2/2] drm/omap: Normalize the zpos and use the normalized_zpos in runtime Daniel Vetter
2017-12-22  6:38     ` Peter Ujfalusi
2018-01-09  8:51       ` Daniel Vetter

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=20171221121101.29161-3-peter.ujfalusi@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=laurent.pinchart@ideasonboard.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