public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/2] tests/kms_rotation_crc: add NV12 support for multiplane* tests
Date: Fri, 21 Dec 2018 16:05:34 +0200	[thread overview]
Message-ID: <1545401134-25041-2-git-send-email-juhapekka.heikkila@gmail.com> (raw)
In-Reply-To: <1545401134-25041-1-git-send-email-juhapekka.heikkila@gmail.com>

Add NV12 support for testing where available.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 796115a..6197faf 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -426,7 +426,7 @@ typedef struct {
 	igt_rotation_t rotation_sw, rotation_hw;
 } planeinfos;
 
-static void get_multiplane_crc(data_t *data, igt_output_t *output,
+static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 			       igt_crc_t *crc_output, planeinfos *planeinfo,
 			       int numplanes)
 {
@@ -436,7 +436,7 @@ static void get_multiplane_crc(data_t *data, igt_output_t *output,
 	int c, ret;
 
 	oldplanes = data->multiplaneoldview;
-	planes = malloc(sizeof(*planes) * numplanes);
+	planes = calloc(sizeof(*planes), numplanes);
 
 	for (c = 0; c < numplanes; c++) {
 		planes[c].plane = igt_output_get_plane_type(output,
@@ -452,6 +452,11 @@ static void get_multiplane_crc(data_t *data, igt_output_t *output,
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
 
+		if(!igt_plane_has_format_mod(planes[c].plane,
+					    planeinfo[c].format,
+					    planeinfo[c].tiling))
+			return false;
+
 		igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
 			      planeinfo[c].tiling, &planes[c].fb);
 
@@ -475,6 +480,7 @@ static void get_multiplane_crc(data_t *data, igt_output_t *output,
 
 	free(oldplanes);
 	data->multiplaneoldview = (void*)planes;
+	return true;
 }
 
 static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,
@@ -523,13 +529,10 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 
 	/*
 	* These are those modes which are tested. For testing feel interesting
-	* case with tiling are 2 byte wide and 4 byte wide.
-	*
-	* TODO:
-	* Built support for NV12 here.
+	* case with tiling are 2 bpp, 4 bpp and NV12.
 	*/
 	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
-		DRM_FORMAT_XRGB8888};
+		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
 
 	for_each_valid_output_on_pipe(display, pipe, output) {
 		int i, j, k, l;
@@ -581,13 +584,15 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						p[0].rotation_hw = IGT_ROTATION_0;
 						p[1].rotation_sw = planeconfigs[j].rotation;
 						p[1].rotation_hw = IGT_ROTATION_0;
-						get_multiplane_crc(data, output, &retcrc_sw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT);
+						if (!get_multiplane_crc(data, output, &retcrc_sw,
+								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+							continue;
 
 						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
 						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
-						get_multiplane_crc(data, output, &retcrc_hw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT);
+						if (!get_multiplane_crc(data, output, &retcrc_hw,
+								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+							continue;
 
 						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
 					}
-- 
2.7.4

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-12-21 14:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 14:05 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation: align rendered image correctly for rotation Juha-Pekka Heikkila
2018-12-21 14:05 ` Juha-Pekka Heikkila [this message]
2018-12-21 14:52 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] " Patchwork
2018-12-21 22:01 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-12-27  8:00 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_rotation: align rendered image correctly for rotation (rev2) Patchwork
2018-12-27  8:51 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2018-12-28  9:29 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation: align rendered image correctly for rotation Juha-Pekka Heikkila
2018-12-28  9:29 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_rotation_crc: add NV12 support for multiplane* tests Juha-Pekka Heikkila
2019-01-11 14:35   ` Ville Syrjälä
2019-01-15 16:28     ` Ville Syrjälä

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=1545401134-25041-2-git-send-email-juhapekka.heikkila@gmail.com \
    --to=juhapekka.heikkila@gmail.com \
    --cc=igt-dev@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox