dri-devel Archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] modetest: make middle SMPTE colors transparent
@ 2015-05-06 12:22 Tobias Jakobi
  2015-05-06 12:22 ` [PATCH 2/2] modetest: only select plane with matching format Tobias Jakobi
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Jakobi @ 2015-05-06 12:22 UTC (permalink / raw
  To: dri-devel; +Cc: Tobias Jakobi, emil.l.velikov

This enables us to check for overlay planes which are located
'below' the primary plane.

Since the alpha value only has an effect when creating surfaces
with an alpha-pixelformat this doesn't affect the regular
XRGB8888 primary surface.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 tests/modetest/buffers.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/tests/modetest/buffers.c b/tests/modetest/buffers.c
index 7e214e8..30ac033 100644
--- a/tests/modetest/buffers.c
+++ b/tests/modetest/buffers.c
@@ -423,13 +423,13 @@ fill_smpte_rgb16(const struct rgb_info *rgb, unsigned char *mem,
 		MAKE_RGBA(rgb, 0, 0, 192, 255),		/* blue */
 	};
 	const uint16_t colors_middle[] = {
-		MAKE_RGBA(rgb, 0, 0, 192, 255),		/* blue */
-		MAKE_RGBA(rgb, 19, 19, 19, 255),	/* black */
-		MAKE_RGBA(rgb, 192, 0, 192, 255),	/* magenta */
-		MAKE_RGBA(rgb, 19, 19, 19, 255),	/* black */
-		MAKE_RGBA(rgb, 0, 192, 192, 255),	/* cyan */
-		MAKE_RGBA(rgb, 19, 19, 19, 255),	/* black */
-		MAKE_RGBA(rgb, 192, 192, 192, 255),	/* grey */
+		MAKE_RGBA(rgb, 0, 0, 192, 127),		/* blue */
+		MAKE_RGBA(rgb, 19, 19, 19, 127),	/* black */
+		MAKE_RGBA(rgb, 192, 0, 192, 127),	/* magenta */
+		MAKE_RGBA(rgb, 19, 19, 19, 127),	/* black */
+		MAKE_RGBA(rgb, 0, 192, 192, 127),	/* cyan */
+		MAKE_RGBA(rgb, 19, 19, 19, 127),	/* black */
+		MAKE_RGBA(rgb, 192, 192, 192, 127),	/* grey */
 	};
 	const uint16_t colors_bottom[] = {
 		MAKE_RGBA(rgb, 0, 33, 76, 255),		/* in-phase */
@@ -547,13 +547,13 @@ fill_smpte_rgb32(const struct rgb_info *rgb, unsigned char *mem,
 		MAKE_RGBA(rgb, 0, 0, 192, 255),		/* blue */
 	};
 	const uint32_t colors_middle[] = {
-		MAKE_RGBA(rgb, 0, 0, 192, 255),		/* blue */
-		MAKE_RGBA(rgb, 19, 19, 19, 255),	/* black */
-		MAKE_RGBA(rgb, 192, 0, 192, 255),	/* magenta */
-		MAKE_RGBA(rgb, 19, 19, 19, 255),	/* black */
-		MAKE_RGBA(rgb, 0, 192, 192, 255),	/* cyan */
-		MAKE_RGBA(rgb, 19, 19, 19, 255),	/* black */
-		MAKE_RGBA(rgb, 192, 192, 192, 255),	/* grey */
+		MAKE_RGBA(rgb, 0, 0, 192, 127),		/* blue */
+		MAKE_RGBA(rgb, 19, 19, 19, 127),	/* black */
+		MAKE_RGBA(rgb, 192, 0, 192, 127),	/* magenta */
+		MAKE_RGBA(rgb, 19, 19, 19, 127),	/* black */
+		MAKE_RGBA(rgb, 0, 192, 192, 127),	/* cyan */
+		MAKE_RGBA(rgb, 19, 19, 19, 127),	/* black */
+		MAKE_RGBA(rgb, 192, 192, 192, 127),	/* grey */
 	};
 	const uint32_t colors_bottom[] = {
 		MAKE_RGBA(rgb, 0, 33, 76, 255),		/* in-phase */
-- 
2.0.5

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] modetest: only select plane with matching format
  2015-05-06 12:22 [PATCH 1/2] modetest: make middle SMPTE colors transparent Tobias Jakobi
@ 2015-05-06 12:22 ` Tobias Jakobi
  0 siblings, 0 replies; 2+ messages in thread
From: Tobias Jakobi @ 2015-05-06 12:22 UTC (permalink / raw
  To: dri-devel; +Cc: Tobias Jakobi, emil.l.velikov

Don't assume that a plane supports any kind of pixelformat
but do a check first.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 tests/modetest/modetest.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 7f0c1cc..f5f00ba 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -969,6 +969,22 @@ page_flip_handler(int fd, unsigned int frame,
 	}
 }
 
+static bool format_support(const drmModePlanePtr ovr, uint32_t fmt)
+{
+	unsigned int i;
+	bool ret = false;
+
+	for (i = 0; i < ovr->count_formats; ++i) {
+		if (ovr->formats[i] != fmt)
+			continue;
+
+		ret = true;
+		break;
+	}
+
+	return ret;
+}
+
 static int set_plane(struct device *dev, struct plane_arg *p)
 {
 	drmModePlane *ovr;
@@ -999,7 +1015,7 @@ static int set_plane(struct device *dev, struct plane_arg *p)
 
 	for (i = 0; i < dev->resources->plane_res->count_planes && !plane_id; i++) {
 		ovr = dev->resources->planes[i].plane;
-		if (!ovr)
+		if (!ovr || !format_support(ovr, p->fourcc))
 			continue;
 
 		if ((ovr->possible_crtcs & (1 << pipe)) && !ovr->crtc_id)
-- 
2.0.5

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-06 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-06 12:22 [PATCH 1/2] modetest: make middle SMPTE colors transparent Tobias Jakobi
2015-05-06 12:22 ` [PATCH 2/2] modetest: only select plane with matching format Tobias Jakobi

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 read-only IMAP folder(s) and NNTP newsgroup(s).