All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: laurent.pinchart@ideasonboard.com, daniel@ffwll.ch, airlied@linux.ie
Cc: tomi.valkeinen@ti.com, dri-devel@lists.freedesktop.org
Subject: [PATCH v4 1/6] drm: Add drm_mode_config->normalize_zpos boolean
Date: Tue, 6 Feb 2018 14:05:51 +0200	[thread overview]
Message-ID: <20180206120556.30495-2-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <20180206120556.30495-1-peter.ujfalusi@ti.com>

Instead of drivers duplicating the drm_atomic_helper_check() code to be
able to normalize the zpos they can use the normalize_zpos flag to let the
drm core to do it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 11 +++++++++++
 include/drm/drm_mode_config.h       |  8 ++++++++
 include/drm/drm_plane.h             |  4 ++--
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index ab4032167094..0f6a4949e6dc 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -873,6 +873,11 @@ EXPORT_SYMBOL(drm_atomic_helper_check_planes);
  * functions depend upon an updated adjusted_mode.clock to e.g. properly compute
  * watermarks.
  *
+ * Note that zpos normalization will add all enable planes to the state which
+ * might not desired for some drivers.
+ * For example enable/disable of a cursor plane which have fixed zpos value
+ * would trigger all other enabled planes to be forced to the state change.
+ *
  * RETURNS:
  * Zero for success or -errno
  */
@@ -885,6 +890,12 @@ int drm_atomic_helper_check(struct drm_device *dev,
 	if (ret)
 		return ret;
 
+	if (dev->mode_config.normalize_zpos) {
+		ret = drm_atomic_normalize_zpos(dev, state);
+		if (ret)
+			return ret;
+	}
+
 	ret = drm_atomic_helper_check_planes(dev, state);
 	if (ret)
 		return ret;
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index 2cb6f02df64a..0743c01b9f69 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -783,6 +783,14 @@ struct drm_mode_config {
 	 */
 	bool allow_fb_modifiers;
 
+	/**
+	 * @normalize_zpos:
+	 *
+	 * If true the drm core will call drm_atomic_normalize_zpos() as part of
+	 * atomic mode checking from drm_atomic_helper_check()
+	 */
+	bool normalize_zpos;
+
 	/**
 	 * @modifiers_property: Plane property to list support modifier/format
 	 * combination.
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
index 8185e3468a23..2c0adb124e0f 100644
--- a/include/drm/drm_plane.h
+++ b/include/drm/drm_plane.h
@@ -50,8 +50,8 @@ struct drm_modeset_acquire_ctx;
  *	plane with a lower ID.
  * @normalized_zpos: normalized value of zpos: unique, range from 0 to N-1
  *	where N is the number of active planes for given crtc. Note that
- *	the driver must call drm_atomic_normalize_zpos() to update this before
- *	it can be trusted.
+ *	the driver must set drm_mode_config.normalize_zpos or call
+ *	drm_atomic_normalize_zpos() to update this before it can be trusted.
  * @src: clipped source coordinates of the plane (in 16.16)
  * @dst: clipped destination coordinates of the plane
  * @state: backpointer to global drm_atomic_state
-- 
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

  reply	other threads:[~2018-02-06 12:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 12:05 [PATCH v4 0/6] drm: zpos normalization cleanup and omapdrm to use it Peter Ujfalusi
2018-02-06 12:05 ` Peter Ujfalusi [this message]
2018-02-06 12:05 ` [PATCH v4 2/6] drm/exynos: Let core take care of normalizing the zpos Peter Ujfalusi
2018-02-06 12:05 ` [PATCH v4 3/6] drm/tegra: " Peter Ujfalusi
2018-02-06 12:05 ` [PATCH v4 4/6] drm/sti: " Peter Ujfalusi
2018-02-06 12:05 ` [PATCH v4 5/6] drm: rcar-du: " Peter Ujfalusi
2018-02-06 12:05 ` [PATCH v4 6/6] drm/omap: Use normalized zpos for plane placement Peter Ujfalusi
2018-03-01  7:31   ` Tomi Valkeinen
2018-03-07  9:18 ` [PATCH v4 0/6] drm: zpos normalization cleanup and omapdrm to use it Peter Ujfalusi
2018-03-28  9:30 ` Tomi Valkeinen
2018-03-28 12:10   ` Peter Ujfalusi
2018-03-28 12:13     ` Tomi Valkeinen

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=20180206120556.30495-2-peter.ujfalusi@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.