All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: tomba@kernel.org
Cc: linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, khilman@baylibre.com,
	Benoit Parrot <bparrot@ti.com>,
	Neil Armstrong <narmstrong@baylibre.com>
Subject: [PATCH v6 3/9] drm/omap: Add ovl checking funcs to dispc_ops
Date: Mon, 18 Oct 2021 16:28:36 +0200	[thread overview]
Message-ID: <20211018142842.2511200-4-narmstrong@baylibre.com> (raw)
In-Reply-To: <20211018142842.2511200-1-narmstrong@baylibre.com>

From: Benoit Parrot <bparrot@ti.com>

In order to be able to dynamically assign overlays to planes we need to
be able to asses the overlay capabilities.

Add a helper function to be able to retrieve the supported capabilities
of an overlay.

And export the function to check if a fourcc is supported on a given
overlay.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 9 +++++++--
 drivers/gpu/drm/omapdrm/dss/dss.h   | 3 +++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 5ac90ba6b76d..dd36db75b4b4 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -1281,8 +1281,8 @@ static u32 dispc_ovl_get_burst_size(struct dispc_device *dispc,
 	return dispc->feat->burst_size_unit * 8;
 }
 
-static bool dispc_ovl_color_mode_supported(struct dispc_device *dispc,
-					   enum omap_plane_id plane, u32 fourcc)
+bool dispc_ovl_color_mode_supported(struct dispc_device *dispc,
+				    enum omap_plane_id plane, u32 fourcc)
 {
 	const u32 *modes;
 	unsigned int i;
@@ -2489,6 +2489,11 @@ static int dispc_ovl_calc_scaling_44xx(struct dispc_device *dispc,
 	return 0;
 }
 
+enum omap_overlay_caps dispc_ovl_get_caps(struct dispc_device *dispc, enum omap_plane_id plane)
+{
+	return dispc->feat->overlay_caps[plane];
+}
+
 #define DIV_FRAC(dividend, divisor) \
 	((dividend) * 100 / (divisor) - ((dividend) / (divisor) * 100))
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h
index 14c39f7c3988..4ff02fbc0e71 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss.h
@@ -398,6 +398,9 @@ const u32 *dispc_ovl_get_color_modes(struct dispc_device *dispc,
 					    enum omap_plane_id plane);
 
 void dispc_ovl_get_max_size(struct dispc_device *dispc, u16 *width, u16 *height);
+bool dispc_ovl_color_mode_supported(struct dispc_device *dispc,
+				    enum omap_plane_id plane, u32 fourcc);
+enum omap_overlay_caps dispc_ovl_get_caps(struct dispc_device *dispc, enum omap_plane_id plane);
 
 u32 dispc_read_irqstatus(struct dispc_device *dispc);
 void dispc_clear_irqstatus(struct dispc_device *dispc, u32 mask);
-- 
2.25.1


  parent reply	other threads:[~2021-10-18 14:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 14:28 [PATCH v6 0/9] drm/omap: Add virtual-planes support Neil Armstrong
2021-10-18 14:28 ` [PATCH v6 1/9] drm/omap: add sanity plane state check Neil Armstrong
2021-10-27  8:29   ` Tomi Valkeinen
2021-10-27  8:30     ` Tomi Valkeinen
2021-11-09 13:10       ` Neil Armstrong
2021-11-09 13:10         ` Neil Armstrong
2021-10-18 14:28 ` [PATCH v6 2/9] drm/omap: Add ability to check if requested plane modes can be supported Neil Armstrong
2021-10-27  8:34   ` Tomi Valkeinen
2021-10-18 14:28 ` Neil Armstrong [this message]
2021-10-27  8:35   ` [PATCH v6 3/9] drm/omap: Add ovl checking funcs to dispc_ops Tomi Valkeinen
2021-10-18 14:28 ` [PATCH v6 4/9] drm/omap: introduce omap_hw_overlay Neil Armstrong
2021-10-27 10:50   ` Tomi Valkeinen
2021-10-18 14:28 ` [PATCH v6 5/9] drm/omap: omap_plane: subclass drm_plane_state Neil Armstrong
2021-10-27 10:50   ` Tomi Valkeinen
2021-10-18 14:28 ` [PATCH v6 6/9] drm/omap: Add global state as a private atomic object Neil Armstrong
2021-10-18 14:28 ` [PATCH v6 7/9] drm/omap: dynamically assign hw overlays to planes Neil Armstrong
2021-10-18 14:28 ` [PATCH v6 8/9] drm/omap: add plane_atomic_print_state support Neil Armstrong
2021-10-27 12:23   ` Tomi Valkeinen
2021-10-27 12:46     ` Neil Armstrong
2021-10-18 14:28 ` [PATCH v6 9/9] drm/omap: Add a 'right overlay' to plane state Neil Armstrong
2021-10-27 12:50   ` Tomi Valkeinen
2021-11-09 13:31     ` Neil Armstrong
2021-11-09 13:31       ` Neil Armstrong

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=20211018142842.2511200-4-narmstrong@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=bparrot@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=khilman@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomba@kernel.org \
    /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.