All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH i-g-t 0/3] Test the plane formats on the Chamelium
@ 2018-03-05 14:21 Maxime Ripard
  2018-03-05 14:21 ` [RFC PATCH i-g-t 1/3] tests/chamelium: Move some functions and structures to a common place Maxime Ripard
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Maxime Ripard @ 2018-03-05 14:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: Maxime Ripard, eben, Thomas Petazzoni

Hi,

Here is an RFC at starting to test the plane formats using the
Chamelium over the HDMI. This was tested using the vc4 DRM driver
found on the RaspberryPi.

This is still pretty rough around the edges at this point, but I'd
like to get feedback on a few issues before getting any further.

  * I've used pixman for now to convert back and forth the pattern and
    the captured frame. While this worked quite well for the RGB
    formats since pixman supports most (but not all) of them. However,
    the long term plan is to also test YUV and more exotic (like
    vendor specific) formats that pixman has 0 support for. So I
    really wonder whether this is the right approach compared to:
    - Using something else (but what?)?
    - Rolling our own format conversion library?

  * I've so far had a single big test that will test all the formats
    exposed by the planes that have a pixman representation. I wonder
    whether this is preferrable, or if we want to have a subtest per
    format. I guess the latter will be slightly better since we would
    be able to catch regressions in the number of formats exposed that
    we wouldn't be able to with the former.

  * Kind of related, I'm not sure what is the policy when it comes to
    tests, and whether I should merge this tests with kms_chamelium or
    leave it as a separate file.

  * One of the biggest challenge of the serie is to support formats
    that have less bits than the reference frame. Indeed, the flow of
    patterns is this one: the pattern will first be generated in
    ARGB8888. It will then be converted to whatever format we want to
    test, be fed into the display engine, that will output it, and the
    Chamelium will capture it in ARGB8888.
    However, when the plane format has less than 8 bits per color,
    some upsampling will happen, where the less significant bits will
    be filled with values that probably depend on the display
    engine. Another side effect is that the CRC used in the Chamelium
    tests cannot be used anymore.
    The way I'm testing currently is that I'm retrieving the frame,
    and then compare each pixels on their most significant bits. This
    sounds inefficient, and it is, especially on the RPi that doesn't
    have the best networking throughput out there.
    I guess we could also generate a CRC for both an upsampling with
    the lowest bits set to 1, and one for the lowest bits set to 0,
    and try to see if one of them match. I guess this should cover
    most of the situation.

Let me know what you think,
Thanks!
Maxime

Maxime Ripard (3):
  tests/chamelium: Move some functions and structures to a common place
  tests/chamelium: Add test case for plane formats
  tests: Add vc4 test suite

 tests/Makefile.am                        |   1 +
 tests/Makefile.sources                   |  10 +
 tests/helpers_chamelium.c                | 165 +++++++++++++++++
 tests/helpers_chamelium.h                |  65 +++++++
 tests/kms_chamelium.c                    | 170 +----------------
 tests/kms_chamelium_formats.c            | 305 +++++++++++++++++++++++++++++++
 tests/meson.build                        |   1 +
 tests/vc4_ci/vc4-chamelium-fast.testlist |   4 +
 tests/vc4_ci/vc4-chamelium.testlist      |   9 +
 tests/vc4_ci/vc4.testlist                |  35 ++++
 10 files changed, 596 insertions(+), 169 deletions(-)
 create mode 100644 tests/helpers_chamelium.c
 create mode 100644 tests/helpers_chamelium.h
 create mode 100644 tests/kms_chamelium_formats.c
 create mode 100644 tests/vc4_ci/vc4-chamelium-fast.testlist
 create mode 100644 tests/vc4_ci/vc4-chamelium.testlist
 create mode 100644 tests/vc4_ci/vc4.testlist

-- 
2.14.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [RFC PATCH i-g-t 1/3] tests/chamelium: Move some functions and structures to a common place
  2018-03-05 14:21 [RFC PATCH i-g-t 0/3] Test the plane formats on the Chamelium Maxime Ripard
@ 2018-03-05 14:21 ` Maxime Ripard
  2018-03-05 14:21 ` [RFC PATCH i-g-t 2/3] tests/chamelium: Add test case for plane formats Maxime Ripard
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Maxime Ripard @ 2018-03-05 14:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: Maxime Ripard, eben, Thomas Petazzoni

We are going to use a few functions already defined in kms_chamelium in
other tests. Let's move them out in a separate file / header.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 tests/Makefile.sources    |   5 ++
 tests/helpers_chamelium.c | 165 ++++++++++++++++++++++++++++++++++++++++++++
 tests/helpers_chamelium.h |  65 ++++++++++++++++++
 tests/kms_chamelium.c     | 170 +---------------------------------------------
 4 files changed, 236 insertions(+), 169 deletions(-)
 create mode 100644 tests/helpers_chamelium.c
 create mode 100644 tests/helpers_chamelium.h

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 23f859beecef..c27226fc96c9 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -275,6 +275,11 @@ scripts = \
 
 IMAGES = pass.png 1080p-left.png 1080p-right.png
 
+kms_chamelium_SOURCES = \
+	kms_chamelium.c \
+	helpers_chamelium.h \
+	helpers_chamelium.c
+
 testdisplay_SOURCES = \
 	testdisplay.c \
 	testdisplay.h \
diff --git a/tests/helpers_chamelium.c b/tests/helpers_chamelium.c
new file mode 100644
index 000000000000..2d60a8c5f944
--- /dev/null
+++ b/tests/helpers_chamelium.c
@@ -0,0 +1,165 @@
+/*
+ * Copyright © 2016 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Lyude Paul <lyude@redhat.com>
+ */
+#include "helpers_chamelium.h"
+
+void require_connector_present(data_t *data, unsigned int type)
+{
+	int i;
+	bool found = false;
+
+	for (i = 0; i < data->port_count && !found; i++) {
+		if (chamelium_port_get_type(data->ports[i]) == type)
+			found = true;
+	}
+
+	igt_require_f(found, "No port of type %s was found\n",
+		      kmstest_connector_type_str(type));
+}
+
+drmModeConnection reprobe_connector(data_t *data, struct chamelium_port *port)
+{
+	drmModeConnector *connector;
+	drmModeConnection status;
+
+	igt_debug("Reprobing %s...\n", chamelium_port_get_name(port));
+	connector = chamelium_port_get_connector(data->chamelium, port, true);
+	igt_assert(connector);
+	status = connector->connection;
+
+	drmModeFreeConnector(connector);
+	return status;
+}
+
+void wait_for_connector(data_t *data, struct chamelium_port *port,
+			drmModeConnection status)
+{
+	bool finished = false;
+
+	igt_debug("Waiting for %s to %sconnect...\n",
+		  chamelium_port_get_name(port),
+		  status == DRM_MODE_DISCONNECTED ? "dis" : "");
+
+	/*
+	 * Rely on simple reprobing so we don't fail tests that don't require
+	 * that hpd events work in the event that hpd doesn't work on the system
+	 */
+	igt_until_timeout(HOTPLUG_TIMEOUT) {
+		if (reprobe_connector(data, port) == status) {
+			finished = true;
+			return;
+		}
+
+		usleep(50000);
+	}
+
+	igt_assert(finished);
+}
+
+void reset_state(data_t *data, struct chamelium_port *port)
+{
+	int p;
+
+	chamelium_reset(data->chamelium);
+
+	if (port) {
+		wait_for_connector(data, port, DRM_MODE_DISCONNECTED);
+	} else {
+		for (p = 0; p < data->port_count; p++) {
+			port = data->ports[p];
+			wait_for_connector(data, port, DRM_MODE_DISCONNECTED);
+		}
+	}
+}
+
+igt_output_t *prepare_output(data_t *data, struct chamelium_port *port)
+{
+	igt_display_t *display = &data->display;
+	igt_output_t *output;
+	drmModeRes *res;
+	drmModeConnector *connector =
+		chamelium_port_get_connector(data->chamelium, port, false);
+	enum pipe pipe;
+	bool found = false;
+
+	igt_assert(res = drmModeGetResources(data->drm_fd));
+
+	/* The chamelium's default EDID has a lot of resolutions, way more then
+	 * we need to test
+	 */
+	chamelium_port_set_edid(data->chamelium, port, data->edid_id);
+
+	chamelium_plug(data->chamelium, port);
+	wait_for_connector(data, port, DRM_MODE_CONNECTED);
+
+	igt_display_reset(display);
+
+	output = igt_output_from_connector(display, connector);
+
+	for_each_pipe(display, pipe) {
+		if (!igt_pipe_connector_valid(pipe, output))
+			continue;
+
+		found = true;
+		break;
+	}
+
+	igt_assert_f(found, "No pipe found for output %s\n", igt_output_name(output));
+
+	igt_output_set_pipe(output, pipe);
+
+	drmModeFreeConnector(connector);
+	drmModeFreeResources(res);
+
+	return output;
+}
+
+void enable_output(data_t *data, struct chamelium_port *port,
+		   igt_output_t *output, drmModeModeInfo *mode,
+		   struct igt_fb *fb)
+{
+	igt_display_t *display = output->display;
+	igt_plane_t *primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+	drmModeConnector *connector = chamelium_port_get_connector(
+	    data->chamelium, port, false);
+
+	igt_assert(primary);
+
+	igt_plane_set_size(primary, mode->hdisplay, mode->vdisplay);
+	igt_plane_set_fb(primary, fb);
+	igt_output_override_mode(output, mode);
+
+	/* Clear any color correction values that might be enabled */
+	igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_DEGAMMA_LUT, NULL, 0);
+	igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_GAMMA_LUT, NULL, 0);
+	igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_CTM, NULL, 0);
+
+	igt_display_commit2(display, COMMIT_ATOMIC);
+
+	if (chamelium_port_get_type(port) == DRM_MODE_CONNECTOR_VGA)
+		usleep(250000);
+
+	drmModeFreeConnector(connector);
+}
diff --git a/tests/helpers_chamelium.h b/tests/helpers_chamelium.h
new file mode 100644
index 000000000000..5ae67bc4410d
--- /dev/null
+++ b/tests/helpers_chamelium.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright © 2016 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Lyude Paul <lyude@redhat.com>
+ */
+#include "igt.h"
+
+#define HOTPLUG_TIMEOUT 20 /* seconds */
+
+#define HPD_STORM_PULSE_INTERVAL_DP 100 /* ms */
+#define HPD_STORM_PULSE_INTERVAL_HDMI 200 /* ms */
+
+#define HPD_TOGGLE_COUNT_VGA 5
+#define HPD_TOGGLE_COUNT_DP_HDMI 15
+#define HPD_TOGGLE_COUNT_FAST 3
+
+struct chamelium_frame_dump {
+	unsigned char *bgr;
+	size_t size;
+	int width;
+	int height;
+	struct chamelium_port *port;
+};
+
+typedef struct {
+	struct chamelium *chamelium;
+	struct chamelium_port **ports;
+	igt_display_t display;
+	int port_count;
+
+	int drm_fd;
+
+	int edid_id;
+	int alt_edid_id;
+} data_t;
+
+void require_connector_present(data_t *data, unsigned int type);
+drmModeConnection reprobe_connector(data_t *data, struct chamelium_port *port);
+void wait_for_connector(data_t *data, struct chamelium_port *port,
+			drmModeConnection status);
+void reset_state(data_t *data, struct chamelium_port *port);
+igt_output_t *prepare_output(data_t *data, struct chamelium_port *port);
+void enable_output(data_t *data, struct chamelium_port *port,
+		   igt_output_t *output, drmModeModeInfo *mode,
+		   struct igt_fb *fb);
diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index 8855a8300049..6419b72fcc9f 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -25,32 +25,12 @@
  */
 
 #include "config.h"
+#include "helpers_chamelium.h"
 #include "igt.h"
 
 #include <fcntl.h>
 #include <string.h>
 
-typedef struct {
-	struct chamelium *chamelium;
-	struct chamelium_port **ports;
-	igt_display_t display;
-	int port_count;
-
-	int drm_fd;
-
-	int edid_id;
-	int alt_edid_id;
-} data_t;
-
-#define HOTPLUG_TIMEOUT 20 /* seconds */
-
-#define HPD_STORM_PULSE_INTERVAL_DP 100 /* ms */
-#define HPD_STORM_PULSE_INTERVAL_HDMI 200 /* ms */
-
-#define HPD_TOGGLE_COUNT_VGA 5
-#define HPD_TOGGLE_COUNT_DP_HDMI 15
-#define HPD_TOGGLE_COUNT_FAST 3
-
 static void
 get_connectors_link_status_failed(data_t *data, bool *link_status_failed)
 {
@@ -76,62 +56,6 @@ get_connectors_link_status_failed(data_t *data, bool *link_status_failed)
 	}
 }
 
-static void
-require_connector_present(data_t *data, unsigned int type)
-{
-	int i;
-	bool found = false;
-
-	for (i = 0; i < data->port_count && !found; i++) {
-		if (chamelium_port_get_type(data->ports[i]) == type)
-			found = true;
-	}
-
-	igt_require_f(found, "No port of type %s was found\n",
-		      kmstest_connector_type_str(type));
-}
-
-static drmModeConnection
-reprobe_connector(data_t *data, struct chamelium_port *port)
-{
-	drmModeConnector *connector;
-	drmModeConnection status;
-
-	igt_debug("Reprobing %s...\n", chamelium_port_get_name(port));
-	connector = chamelium_port_get_connector(data->chamelium, port, true);
-	igt_assert(connector);
-	status = connector->connection;
-
-	drmModeFreeConnector(connector);
-	return status;
-}
-
-static void
-wait_for_connector(data_t *data, struct chamelium_port *port,
-		   drmModeConnection status)
-{
-	bool finished = false;
-
-	igt_debug("Waiting for %s to %sconnect...\n",
-		  chamelium_port_get_name(port),
-		  status == DRM_MODE_DISCONNECTED ? "dis" : "");
-
-	/*
-	 * Rely on simple reprobing so we don't fail tests that don't require
-	 * that hpd events work in the event that hpd doesn't work on the system
-	 */
-	igt_until_timeout(HOTPLUG_TIMEOUT) {
-		if (reprobe_connector(data, port) == status) {
-			finished = true;
-			return;
-		}
-
-		usleep(50000);
-	}
-
-	igt_assert(finished);
-}
-
 static int chamelium_vga_modes[][2] = {
 	{ 1600, 1200 },
 	{ 1920, 1200 },
@@ -202,23 +126,6 @@ check_analog_bridge(data_t *data, struct chamelium_port *port)
 	return false;
 }
 
-static void
-reset_state(data_t *data, struct chamelium_port *port)
-{
-	int p;
-
-	chamelium_reset(data->chamelium);
-
-	if (port) {
-		wait_for_connector(data, port, DRM_MODE_DISCONNECTED);
-	} else {
-		for (p = 0; p < data->port_count; p++) {
-			port = data->ports[p];
-			wait_for_connector(data, port, DRM_MODE_DISCONNECTED);
-		}
-	}
-}
-
 static void
 test_basic_hotplug(data_t *data, struct chamelium_port *port, int toggle_count)
 {
@@ -408,81 +315,6 @@ test_suspend_resume_edid_change(data_t *data, struct chamelium_port *port,
 		igt_skip_on(!link_status_failed[0][p] && link_status_failed[1][p]);
 }
 
-static igt_output_t *
-prepare_output(data_t *data,
-	       struct chamelium_port *port)
-{
-	igt_display_t *display = &data->display;
-	igt_output_t *output;
-	drmModeRes *res;
-	drmModeConnector *connector =
-		chamelium_port_get_connector(data->chamelium, port, false);
-	enum pipe pipe;
-	bool found = false;
-
-	igt_assert(res = drmModeGetResources(data->drm_fd));
-
-	/* The chamelium's default EDID has a lot of resolutions, way more then
-	 * we need to test
-	 */
-	chamelium_port_set_edid(data->chamelium, port, data->edid_id);
-
-	chamelium_plug(data->chamelium, port);
-	wait_for_connector(data, port, DRM_MODE_CONNECTED);
-
-	igt_display_reset(display);
-
-	output = igt_output_from_connector(display, connector);
-
-	for_each_pipe(display, pipe) {
-		if (!igt_pipe_connector_valid(pipe, output))
-			continue;
-
-		found = true;
-		break;
-	}
-
-	igt_assert_f(found, "No pipe found for output %s\n", igt_output_name(output));
-
-	igt_output_set_pipe(output, pipe);
-
-	drmModeFreeConnector(connector);
-	drmModeFreeResources(res);
-
-	return output;
-}
-
-static void
-enable_output(data_t *data,
-	      struct chamelium_port *port,
-	      igt_output_t *output,
-	      drmModeModeInfo *mode,
-	      struct igt_fb *fb)
-{
-	igt_display_t *display = output->display;
-	igt_plane_t *primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
-	drmModeConnector *connector = chamelium_port_get_connector(
-	    data->chamelium, port, false);
-
-	igt_assert(primary);
-
-	igt_plane_set_size(primary, mode->hdisplay, mode->vdisplay);
-	igt_plane_set_fb(primary, fb);
-	igt_output_override_mode(output, mode);
-
-	/* Clear any color correction values that might be enabled */
-	igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_DEGAMMA_LUT, NULL, 0);
-	igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_GAMMA_LUT, NULL, 0);
-	igt_pipe_obj_replace_prop_blob(primary->pipe, IGT_CRTC_CTM, NULL, 0);
-
-	igt_display_commit2(display, COMMIT_ATOMIC);
-
-	if (chamelium_port_get_type(port) == DRM_MODE_CONNECTOR_VGA)
-		usleep(250000);
-
-	drmModeFreeConnector(connector);
-}
-
 static void
 test_display_crc(data_t *data, struct chamelium_port *port, int count,
 		 bool fast)
-- 
2.14.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [RFC PATCH i-g-t 2/3] tests/chamelium: Add test case for plane formats
  2018-03-05 14:21 [RFC PATCH i-g-t 0/3] Test the plane formats on the Chamelium Maxime Ripard
  2018-03-05 14:21 ` [RFC PATCH i-g-t 1/3] tests/chamelium: Move some functions and structures to a common place Maxime Ripard
@ 2018-03-05 14:21 ` Maxime Ripard
  2018-03-12 19:02   ` Eric Anholt
  2018-03-05 14:21 ` [RFC PATCH i-g-t 3/3] tests: Add vc4 test suite Maxime Ripard
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Maxime Ripard @ 2018-03-05 14:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: Maxime Ripard, eben, Thomas Petazzoni

KMS can support a lot of different plane formats that are not being tested
by the current chamelium tests.

Add some preliminary tests to exert the RGB formats exposed by the KMS
planes.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 tests/Makefile.am             |   1 +
 tests/Makefile.sources        |   5 +
 tests/kms_chamelium_formats.c | 305 ++++++++++++++++++++++++++++++++++++++++++
 tests/meson.build             |   1 +
 4 files changed, 312 insertions(+)
 create mode 100644 tests/kms_chamelium_formats.c

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8472a6bf0a73..becc23de895b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -17,6 +17,7 @@ endif
 if HAVE_CHAMELIUM
 TESTS_progs += \
 	kms_chamelium \
+	kms_chamelium_formats \
 	$(NULL)
 endif
 
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index c27226fc96c9..8476b63a245c 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -280,6 +280,11 @@ kms_chamelium_SOURCES = \
 	helpers_chamelium.h \
 	helpers_chamelium.c
 
+kms_chamelium_formats_SOURCES = \
+	kms_chamelium_formats.c \
+	helpers_chamelium.h \
+	helpers_chamelium.c
+
 testdisplay_SOURCES = \
 	testdisplay.c \
 	testdisplay.h \
diff --git a/tests/kms_chamelium_formats.c b/tests/kms_chamelium_formats.c
new file mode 100644
index 000000000000..6d61f2fa34d8
--- /dev/null
+++ b/tests/kms_chamelium_formats.c
@@ -0,0 +1,305 @@
+/*
+ * Copyright © 2016 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Lyude Paul <lyude@redhat.com>
+ */
+
+#include "config.h"
+#include "helpers_chamelium.h"
+#include "igt.h"
+
+#include <fcntl.h>
+#include <pixman.h>
+#include <string.h>
+
+struct formats {
+	uint32_t		drm_fmt;
+	pixman_format_code_t	pixman_fmt;
+} formats_map[] = {
+	{ DRM_FORMAT_XRGB8888, PIXMAN_x8r8g8b8 },
+	{ DRM_FORMAT_ARGB8888, PIXMAN_a8r8g8b8 },
+	{ DRM_FORMAT_ABGR8888, PIXMAN_a8b8g8r8 },
+	{ DRM_FORMAT_RGB565, PIXMAN_r5g6b5 },
+	{ DRM_FORMAT_BGR565, PIXMAN_b5g6r5 },
+	{ DRM_FORMAT_ARGB1555, PIXMAN_a1r5g5b5 },
+	{ DRM_FORMAT_XRGB1555, PIXMAN_x1r5g5b5 },
+};
+
+static pixman_image_t *paint_ar24_pattern(size_t width, size_t height)
+{
+	uint32_t colors[] = { 0xff000000,
+			      0xffff0000,
+			      0xff00ff00,
+			      0xff0000ff,
+			      0xffffffff };
+	unsigned i, j;
+	uint32_t *data;
+
+	data = malloc(width * height * sizeof(*data));
+	igt_assert(data);
+
+	for (i = 0; i < height; i++)
+		for (j = 0; j < width; j++)
+			*(data + i * width + j) = colors[((j / 64) + (i / 64)) % 5];
+
+	return pixman_image_create_bits(PIXMAN_a8r8g8b8, width, height,
+					data, width * 4);
+}
+
+static void free_pattern(pixman_image_t *pattern)
+{
+	void *data = pixman_image_get_data(pattern);
+
+	pixman_image_unref(pattern);
+	free(data);
+}
+
+static pixman_image_t *pattern_to_fb(pixman_image_t *pattern, struct igt_fb *fb,
+				     pixman_format_code_t pixman_fmt)
+{
+	pixman_image_t *converted;
+	void *ptr;
+
+	igt_assert(fb->is_dumb);
+
+	ptr = kmstest_dumb_map_buffer(fb->fd, fb->gem_handle, fb->size,
+				      PROT_READ | PROT_WRITE);
+	igt_assert(ptr);
+
+	converted = pixman_image_create_bits(pixman_fmt, fb->width, fb->height,
+					     ptr, fb->stride);
+	pixman_image_composite(PIXMAN_OP_ADD, pattern, NULL, converted,
+			       0, 0, 0, 0, 0, 0, fb->width, fb->height);
+
+	return converted;
+}
+
+static pixman_image_t *convert_frame_format(pixman_image_t *src,
+					    int format)
+{
+	pixman_image_t *converted;
+	unsigned int w = pixman_image_get_width(src);
+	unsigned int h = pixman_image_get_height(src);
+	void *data = malloc(w * h * 4);
+
+	memset(data, 0, w * h * 4);
+	converted = pixman_image_create_bits(format, w, h, data,
+					     PIXMAN_FORMAT_BPP(format) / 8 * w);
+	pixman_image_composite(PIXMAN_OP_ADD, src, NULL, converted,
+			       0, 0, 0, 0, 0, 0, w, h);
+	return converted;
+}
+
+#define PIXEL_MASK	0x00f8f8f8
+
+static bool format_compare_pixels(void *reference, void *frame,
+				  size_t height, size_t width)
+{
+	uint32_t *ref_frame = reference;
+	uint32_t *new_frame = frame;
+	unsigned int h, w;
+
+	for (h = 0; h < height; h++) {
+		for (w = 0; w < width; w++) {
+			uint32_t *ref = ref_frame + h * width + w;
+			uint32_t m_ref = *ref & PIXEL_MASK;
+			uint32_t *new = new_frame + h * width + w;
+			uint32_t m_new = *new & PIXEL_MASK;
+
+			if (m_new != m_ref) {
+				igt_info("pix %d:%d mismatch: 0x%08x vs 0x%08x\n",
+					 h, w, m_ref, m_new);
+				return false;
+			}
+		}
+	}
+
+	return true;
+}	
+
+static bool format_compare_frames(pixman_image_t *reference,
+				  struct chamelium_frame_dump *frame,
+				  uint32_t format, int index)
+{
+	pixman_image_t *frame_bgr, *frame_ar24;
+	bool match;
+
+	frame_bgr = pixman_image_create_bits(PIXMAN_b8g8r8,
+					     frame->width, frame->height,
+					     (uint32_t *)frame->bgr,
+					     PIXMAN_FORMAT_BPP(PIXMAN_b8g8r8) / 8 * frame->width);
+	/*
+	 * Convert the reference image into the same format as the chamelium
+	 * image
+	 */
+
+        frame_ar24 = convert_frame_format(frame_bgr, PIXMAN_a8r8g8b8);
+
+	match = format_compare_pixels(pixman_image_get_data(reference),
+				      pixman_image_get_data(frame_ar24),
+				      frame->height, frame->width);
+
+	pixman_image_unref(frame_ar24);
+	pixman_image_unref(frame_bgr);
+
+	return match;
+}
+
+static void
+test_display_frame_dump(data_t *data, struct chamelium_port *port)
+{
+	igt_output_t *output;
+	igt_plane_t *primary;
+	drmModeConnector *connector;
+	int i;
+
+	reset_state(data, port);
+
+	output = prepare_output(data, port);
+	connector = chamelium_port_get_connector(data->chamelium, port, false);
+	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+	igt_assert(primary);
+
+	for (i = 0; i < connector->count_modes; i++) {
+		drmModePlanePtr plane = primary->drm_plane;
+		drmModeModeInfo *mode;
+		pixman_image_t *pattern;
+		int j;
+
+		mode = &connector->modes[i];
+		if (!(mode->type & DRM_MODE_TYPE_PREFERRED))
+			continue;
+
+		pattern = paint_ar24_pattern(mode->hdisplay, mode->vdisplay);
+		igt_assert(pattern);
+
+		for (j = 0; j < plane->count_formats; j++) {
+			uint32_t format = plane->formats[j];
+			struct formats *format_map = NULL;
+			pixman_image_t *patternfb;
+			struct igt_fb fb;
+			int fb_id, k;
+
+			for (k = 0; k < ARRAY_SIZE(formats_map); k++)
+				if (formats_map[k].drm_fmt == format)
+					format_map = &formats_map[k];
+
+			if (!format_map)
+				continue;
+
+			igt_info("Using mode %ux%u with format %s\n",
+				 mode->hdisplay, mode->vdisplay,
+				 igt_format_str(format));
+
+			fb_id = igt_create_fb(data->drm_fd,
+					      mode->hdisplay,
+					      mode->vdisplay,
+					      format_map->drm_fmt,
+					      LOCAL_DRM_FORMAT_MOD_NONE,
+					      &fb);
+			igt_assert(fb_id > 0);
+
+			patternfb = pattern_to_fb(pattern, &fb,
+						  format_map->pixman_fmt);
+			enable_output(data, port, output, mode, &fb);
+			chamelium_capture(data->chamelium, port, 0, 0, 0, 0, 5);
+
+			for (k = 0; k < 5; k++) {
+				struct chamelium_frame_dump *frame;
+				bool match;
+
+				frame = chamelium_read_captured_frame(data->chamelium, k);
+				match = format_compare_frames(pattern, frame, format, k);
+				chamelium_destroy_frame_dump(frame);
+
+				igt_info("Frame %d/5: %s\n",
+					 k + 1, match ? "passed" : "failed");
+			}
+
+			pixman_image_unref(patternfb);
+			igt_remove_fb(data->drm_fd, &fb);
+		}
+
+		free_pattern(pattern);
+	}
+
+	drmModeFreeConnector(connector);
+}
+
+#define for_each_port(p, port)            \
+	for (p = 0, port = data.ports[p]; \
+	     p < data.port_count;         \
+	     p++, port = data.ports[p])
+
+#define connector_subtest(name__, type__)                    \
+	igt_subtest(name__)                                  \
+		for_each_port(p, port)                       \
+			if (chamelium_port_get_type(port) == \
+			    DRM_MODE_CONNECTOR_ ## type__)
+
+static data_t data;
+
+igt_main
+{
+	struct chamelium_port *port;
+	int edid_id, alt_edid_id, p;
+
+	igt_fixture {
+		igt_skip_on_simulation();
+
+		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
+		data.chamelium = chamelium_init(data.drm_fd);
+		igt_require(data.chamelium);
+
+		data.ports = chamelium_get_ports(data.chamelium,
+						 &data.port_count);
+
+		edid_id = chamelium_new_edid(data.chamelium,
+					     igt_kms_get_base_edid());
+		alt_edid_id = chamelium_new_edid(data.chamelium,
+						 igt_kms_get_alt_edid());
+		data.edid_id = edid_id;
+		data.alt_edid_id = alt_edid_id;
+
+		/* So fbcon doesn't try to reprobe things itself */
+		kmstest_set_vt_graphics_mode();
+
+		igt_display_init(&data.display, data.drm_fd);
+		igt_require(data.display.is_atomic);
+	}
+
+	igt_subtest_group {
+		igt_fixture {
+			require_connector_present(
+			    &data, DRM_MODE_CONNECTOR_HDMIA);
+		}
+
+		connector_subtest("hdmi-frame-dump", HDMIA)
+			test_display_frame_dump(&data, port);
+	}
+
+	igt_fixture {
+		igt_display_fini(&data.display);
+		close(data.drm_fd);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index 2a1e6f19e374..98365c33e3ce 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -244,6 +244,7 @@ endif
 if chamelium.found()
 	test_progs += [
 		'kms_chamelium',
+		'kms_chamelium_formats',
 	]
 	test_deps += chamelium
 endif
-- 
2.14.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [RFC PATCH i-g-t 3/3] tests: Add vc4 test suite
  2018-03-05 14:21 [RFC PATCH i-g-t 0/3] Test the plane formats on the Chamelium Maxime Ripard
  2018-03-05 14:21 ` [RFC PATCH i-g-t 1/3] tests/chamelium: Move some functions and structures to a common place Maxime Ripard
  2018-03-05 14:21 ` [RFC PATCH i-g-t 2/3] tests/chamelium: Add test case for plane formats Maxime Ripard
@ 2018-03-05 14:21 ` Maxime Ripard
  2018-03-13 10:42   ` Petri Latvala
  2018-03-05 16:49 ` ✓ Fi.CI.BAT: success for Test the plane formats on the Chamelium Patchwork
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Maxime Ripard @ 2018-03-05 14:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: Maxime Ripard, eben, Thomas Petazzoni

Add some various test suites relevant for the vc4 drm driver.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 tests/vc4_ci/vc4-chamelium-fast.testlist |  4 ++++
 tests/vc4_ci/vc4-chamelium.testlist      |  9 ++++++++
 tests/vc4_ci/vc4.testlist                | 35 ++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 tests/vc4_ci/vc4-chamelium-fast.testlist
 create mode 100644 tests/vc4_ci/vc4-chamelium.testlist
 create mode 100644 tests/vc4_ci/vc4.testlist

diff --git a/tests/vc4_ci/vc4-chamelium-fast.testlist b/tests/vc4_ci/vc4-chamelium-fast.testlist
new file mode 100644
index 000000000000..964167b82d00
--- /dev/null
+++ b/tests/vc4_ci/vc4-chamelium-fast.testlist
@@ -0,0 +1,4 @@
+igt@kms_chamelium@hdmi-crc-fast
+igt@kms_chamelium@hdmi-edid-read
+igt@kms_chamelium@hdmi-hpd
+igt@kms_chamelium@hdmi-hpd-fast
diff --git a/tests/vc4_ci/vc4-chamelium.testlist b/tests/vc4_ci/vc4-chamelium.testlist
new file mode 100644
index 000000000000..2651d03b6ceb
--- /dev/null
+++ b/tests/vc4_ci/vc4-chamelium.testlist
@@ -0,0 +1,9 @@
+igt@kms_chamelium@hdmi-crc-single
+igt@kms_chamelium@hdmi-crc-multiple
+igt@kms_chamelium@hdmi-frame-dump
+igt@kms_chamelium@hdmi-hpd-storm
+igt@kms_chamelium@hdmi-hpd-storm-disable
+igt@kms_chamelium@hdmi-crc-fast
+igt@kms_chamelium@hdmi-edid-read
+igt@kms_chamelium@hdmi-hpd
+igt@kms_chamelium@hdmi-hpd-fast
diff --git a/tests/vc4_ci/vc4.testlist b/tests/vc4_ci/vc4.testlist
new file mode 100644
index 000000000000..e86d4c815c56
--- /dev/null
+++ b/tests/vc4_ci/vc4.testlist
@@ -0,0 +1,35 @@
+igt@vc4_create_bo@create-bo-0
+igt@vc4_create_bo@create-bo-4096
+igt@vc4_create_bo@create-bo-zeroed
+igt@vc4_dmabuf_poll@poll-read-waits-until-write-done
+igt@vc4_dmabuf_poll@poll-write-waits-until-write-done
+igt@vc4_label_bo@set-label
+igt@vc4_label_bo@set-bad-handle
+igt@vc4_label_bo@set-bad-name
+igt@vc4_label_bo@set-kernel-name
+igt@vc4_lookup_fail@bad-color-write
+igt@vc4_purgeable_bo@mark-willneed
+igt@vc4_purgeable_bo@mark-purgeable
+igt@vc4_purgeable_bo@mark-purgeable-twice
+igt@vc4_purgeable_bo@access-purgeable-bo-mem
+igt@vc4_purgeable_bo@access-purged-bo-mem
+igt@vc4_purgeable_bo@mark-unpurgeable-check-retained
+igt@vc4_purgeable_bo@mark-unpurgeable-purged
+igt@vc4_purgeable_bo@free-purged-bo
+igt@vc4_tiling@get-bad-handle
+igt@vc4_tiling@set-bad-handle
+igt@vc4_tiling@get-bad-flags
+igt@vc4_tiling@set-bad-flags
+igt@vc4_tiling@get-bad-modifier
+igt@vc4_tiling@set-bad-modifier
+igt@vc4_tiling@set-get
+igt@vc4_tiling@get-after-free
+igt@vc4_wait_bo@bad-bo
+igt@vc4_wait_bo@bad-pad
+igt@vc4_wait_bo@unused-bo-0ns
+igt@vc4_wait_bo@unused-bo-1ns
+igt@vc4_wait_bo@used-bo
+igt@vc4_wait_bo@used-bo-0ns
+igt@vc4_wait_bo@used-bo-1ns
+igt@vc4_wait_seqno@bad-seqno-0ns
+igt@vc4_wait_seqno@bad-seqno-1ns
-- 
2.14.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for Test the plane formats on the Chamelium
  2018-03-05 14:21 [RFC PATCH i-g-t 0/3] Test the plane formats on the Chamelium Maxime Ripard
                   ` (2 preceding siblings ...)
  2018-03-05 14:21 ` [RFC PATCH i-g-t 3/3] tests: Add vc4 test suite Maxime Ripard
@ 2018-03-05 16:49 ` Patchwork
  2018-03-05 21:51 ` ✗ Fi.CI.IGT: warning " Patchwork
  2018-03-21 11:25 ` [RFC PATCH i-g-t 0/3] " Maxime Ripard
  5 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2018-03-05 16:49 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: intel-gfx

== Series Details ==

Series: Test the plane formats on the Chamelium
URL   : https://patchwork.freedesktop.org/series/39380/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
23f7da18a92059610792299cfdb03d2c922a9948 lib/igt_pm: Restore runtime pm state on test exit

with latest DRM-Tip kernel build CI_DRM_3872
4a3784737699 drm-tip: 2018y-03m-05d-14h-32m-57s UTC integration manifest

Testlist changes:
+igt@kms_chamelium_formats@hdmi-frame-dump

---- Known issues:

Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                pass       -> FAIL       (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713
Test prime_vgem:
        Subgroup basic-fence-flip:
                fail       -> PASS       (fi-ilk-650) fdo#104008

fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:416s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:423s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:373s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:484s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:279s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:485s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:487s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:470s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:463s
fi-cfl-8700k     total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:394s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:563s
fi-cfl-u         total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:493s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:572s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:414s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:293s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:506s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:392s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:414s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:449s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:410s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:451s
fi-kbl-7560u     total:108  pass:104  dwarn:0   dfail:0   fail:0   skip:3  
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:452s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:494s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:581s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:428s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:504s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:521s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:491s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:493s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:406s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:431s
fi-snb-2520m     total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:394s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1061/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.IGT: warning for Test the plane formats on the Chamelium
  2018-03-05 14:21 [RFC PATCH i-g-t 0/3] Test the plane formats on the Chamelium Maxime Ripard
                   ` (3 preceding siblings ...)
  2018-03-05 16:49 ` ✓ Fi.CI.BAT: success for Test the plane formats on the Chamelium Patchwork
@ 2018-03-05 21:51 ` Patchwork
  2018-03-21 11:25 ` [RFC PATCH i-g-t 0/3] " Maxime Ripard
  5 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2018-03-05 21:51 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: intel-gfx

== Series Details ==

Series: Test the plane formats on the Chamelium
URL   : https://patchwork.freedesktop.org/series/39380/
State : warning

== Summary ==

---- Possible new issues:

Test gem_exec_blt:
        Subgroup cold-max:
                pass       -> DMESG-WARN (shard-hsw)
Test kms_flip:
        Subgroup flip-vs-modeset-interruptible:
                pass       -> DMESG-WARN (shard-hsw)
Test kms_vblank:
        Subgroup pipe-a-ts-continuation-modeset:
                skip       -> PASS       (shard-snb)

---- Known issues:

Test gem_eio:
        Subgroup in-flight-contexts:
                pass       -> INCOMPLETE (shard-apl) fdo#104945
Test kms_chv_cursor_fail:
        Subgroup pipe-b-256x256-right-edge:
                dmesg-warn -> PASS       (shard-snb) fdo#105185
Test kms_cursor_legacy:
        Subgroup flip-vs-cursor-atomic:
                skip       -> PASS       (shard-snb) fdo#102670
Test kms_flip:
        Subgroup dpms-vs-vblank-race:
                fail       -> PASS       (shard-hsw) fdo#103060
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-spr-indfb-draw-render:
                pass       -> DMESG-FAIL (shard-hsw) fdo#103167

fdo#104945 https://bugs.freedesktop.org/show_bug.cgi?id=104945
fdo#105185 https://bugs.freedesktop.org/show_bug.cgi?id=105185
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167

shard-apl        total:3424 pass:1802 dwarn:1   dfail:0   fail:7   skip:1612 time:11586s
shard-hsw        total:3469 pass:1771 dwarn:3   dfail:1   fail:1   skip:1692 time:11814s
shard-snb        total:3469 pass:1365 dwarn:1   dfail:0   fail:1   skip:2102 time:7171s
Blacklisted hosts:
shard-kbl        total:3424 pass:1928 dwarn:1   dfail:0   fail:7   skip:1487 time:8867s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1061/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC PATCH i-g-t 2/3] tests/chamelium: Add test case for plane formats
  2018-03-05 14:21 ` [RFC PATCH i-g-t 2/3] tests/chamelium: Add test case for plane formats Maxime Ripard
@ 2018-03-12 19:02   ` Eric Anholt
  2018-03-13 15:05     ` Maxime Ripard
  0 siblings, 1 reply; 15+ messages in thread
From: Eric Anholt @ 2018-03-12 19:02 UTC (permalink / raw)
  To: intel-gfx; +Cc: Maxime Ripard, Thomas Petazzoni, eben


[-- Attachment #1.1: Type: text/plain, Size: 6060 bytes --]

Maxime Ripard <maxime.ripard@bootlin.com> writes:

> KMS can support a lot of different plane formats that are not being tested
> by the current chamelium tests.
>
> Add some preliminary tests to exert the RGB formats exposed by the KMS
> planes.

I'm really excited for this test.  A few comments...

> ---
>  tests/Makefile.am             |   1 +
>  tests/Makefile.sources        |   5 +
>  tests/kms_chamelium_formats.c | 305 ++++++++++++++++++++++++++++++++++++++++++
>  tests/meson.build             |   1 +
>  4 files changed, 312 insertions(+)
>  create mode 100644 tests/kms_chamelium_formats.c
>
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index 8472a6bf0a73..becc23de895b 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -17,6 +17,7 @@ endif
>  if HAVE_CHAMELIUM
>  TESTS_progs += \
>  	kms_chamelium \
> +	kms_chamelium_formats \
>  	$(NULL)
>  endif
>  
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index c27226fc96c9..8476b63a245c 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -280,6 +280,11 @@ kms_chamelium_SOURCES = \
>  	helpers_chamelium.h \
>  	helpers_chamelium.c
>  
> +kms_chamelium_formats_SOURCES = \
> +	kms_chamelium_formats.c \
> +	helpers_chamelium.h \
> +	helpers_chamelium.c
> +
>  testdisplay_SOURCES = \
>  	testdisplay.c \
>  	testdisplay.h \
> diff --git a/tests/kms_chamelium_formats.c b/tests/kms_chamelium_formats.c
> new file mode 100644
> index 000000000000..6d61f2fa34d8
> --- /dev/null
> +++ b/tests/kms_chamelium_formats.c
> @@ -0,0 +1,305 @@
> +/*
> + * Copyright © 2016 Red Hat Inc.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + *    Lyude Paul <lyude@redhat.com>
> + */
> +
> +#include "config.h"
> +#include "helpers_chamelium.h"
> +#include "igt.h"
> +
> +#include <fcntl.h>
> +#include <pixman.h>
> +#include <string.h>
> +
> +struct formats {
> +	uint32_t		drm_fmt;
> +	pixman_format_code_t	pixman_fmt;
> +} formats_map[] = {
> +	{ DRM_FORMAT_XRGB8888, PIXMAN_x8r8g8b8 },
> +	{ DRM_FORMAT_ARGB8888, PIXMAN_a8r8g8b8 },
> +	{ DRM_FORMAT_ABGR8888, PIXMAN_a8b8g8r8 },
> +	{ DRM_FORMAT_RGB565, PIXMAN_r5g6b5 },
> +	{ DRM_FORMAT_BGR565, PIXMAN_b5g6r5 },
> +	{ DRM_FORMAT_ARGB1555, PIXMAN_a1r5g5b5 },
> +	{ DRM_FORMAT_XRGB1555, PIXMAN_x1r5g5b5 },
> +};
> +
> +static pixman_image_t *paint_ar24_pattern(size_t width, size_t height)
> +{
> +	uint32_t colors[] = { 0xff000000,
> +			      0xffff0000,
> +			      0xff00ff00,
> +			      0xff0000ff,
> +			      0xffffffff };
> +	unsigned i, j;
> +	uint32_t *data;
> +
> +	data = malloc(width * height * sizeof(*data));
> +	igt_assert(data);
> +
> +	for (i = 0; i < height; i++)
> +		for (j = 0; j < width; j++)
> +			*(data + i * width + j) = colors[((j / 64) + (i / 64)) % 5];
> +
> +	return pixman_image_create_bits(PIXMAN_a8r8g8b8, width, height,
> +					data, width * 4);
> +}
> +
> +static void free_pattern(pixman_image_t *pattern)
> +{
> +	void *data = pixman_image_get_data(pattern);
> +
> +	pixman_image_unref(pattern);
> +	free(data);
> +}
> +
> +static pixman_image_t *pattern_to_fb(pixman_image_t *pattern, struct igt_fb *fb,
> +				     pixman_format_code_t pixman_fmt)
> +{
> +	pixman_image_t *converted;
> +	void *ptr;
> +
> +	igt_assert(fb->is_dumb);
> +
> +	ptr = kmstest_dumb_map_buffer(fb->fd, fb->gem_handle, fb->size,
> +				      PROT_READ | PROT_WRITE);
> +	igt_assert(ptr);
> +
> +	converted = pixman_image_create_bits(pixman_fmt, fb->width, fb->height,
> +					     ptr, fb->stride);
> +	pixman_image_composite(PIXMAN_OP_ADD, pattern, NULL, converted,
> +			       0, 0, 0, 0, 0, 0, fb->width, fb->height);

If you're trying to fill the FB with the incoming pattern, then
PIXMAN_OP_SRC is the thing you want (and will be *much* faster).

> +
> +	return converted;
> +}
> +
> +static pixman_image_t *convert_frame_format(pixman_image_t *src,
> +					    int format)
> +{
> +	pixman_image_t *converted;
> +	unsigned int w = pixman_image_get_width(src);
> +	unsigned int h = pixman_image_get_height(src);
> +	void *data = malloc(w * h * 4);
> +
> +	memset(data, 0, w * h * 4);
> +	converted = pixman_image_create_bits(format, w, h, data,
> +					     PIXMAN_FORMAT_BPP(format) / 8 * w);
> +	pixman_image_composite(PIXMAN_OP_ADD, src, NULL, converted,
> +			       0, 0, 0, 0, 0, 0, w, h);
> +	return converted;
> +}

Instead of the memset, you could just use PIXMAN_OP_SRC.

Also, instead of "* 4", probably want "* PIXMAN_FORMAT_BPP(format) / 8"
there too.

> +#define PIXEL_MASK	0x00f8f8f8

If we're going to have some tolerance, the tolerance should probably
depend on the lowest depth of the channel involved.  However, I'm not
sure this is needed -- we should be able to get bit-exact from VC4 by
filling in the size-extension bits in the HVS.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC PATCH i-g-t 3/3] tests: Add vc4 test suite
  2018-03-05 14:21 ` [RFC PATCH i-g-t 3/3] tests: Add vc4 test suite Maxime Ripard
@ 2018-03-13 10:42   ` Petri Latvala
  2018-03-13 15:18     ` Maxime Ripard
  0 siblings, 1 reply; 15+ messages in thread
From: Petri Latvala @ 2018-03-13 10:42 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: intel-gfx, Thomas Petazzoni, eben

On Mon, Mar 05, 2018 at 03:21:29PM +0100, Maxime Ripard wrote:
> Add some various test suites relevant for the vc4 drm driver.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
>  tests/vc4_ci/vc4-chamelium-fast.testlist |  4 ++++
>  tests/vc4_ci/vc4-chamelium.testlist      |  9 ++++++++
>  tests/vc4_ci/vc4.testlist                | 35 ++++++++++++++++++++++++++++++++
>  3 files changed, 48 insertions(+)
>  create mode 100644 tests/vc4_ci/vc4-chamelium-fast.testlist
>  create mode 100644 tests/vc4_ci/vc4-chamelium.testlist
>  create mode 100644 tests/vc4_ci/vc4.testlist


Can you also add a README explaining where vc4_ci results can be found
(or statement for the lack of a public view) and how these testlist
files are used?

No general kms tests in vc4.testlist?

What is the contact information for people who will be responsible for
tests/vc4_ci?

FWIW,
Acked-by: Petri Latvala <petri.latvala@intel.com>




> 
> diff --git a/tests/vc4_ci/vc4-chamelium-fast.testlist b/tests/vc4_ci/vc4-chamelium-fast.testlist
> new file mode 100644
> index 000000000000..964167b82d00
> --- /dev/null
> +++ b/tests/vc4_ci/vc4-chamelium-fast.testlist
> @@ -0,0 +1,4 @@
> +igt@kms_chamelium@hdmi-crc-fast
> +igt@kms_chamelium@hdmi-edid-read
> +igt@kms_chamelium@hdmi-hpd
> +igt@kms_chamelium@hdmi-hpd-fast
> diff --git a/tests/vc4_ci/vc4-chamelium.testlist b/tests/vc4_ci/vc4-chamelium.testlist
> new file mode 100644
> index 000000000000..2651d03b6ceb
> --- /dev/null
> +++ b/tests/vc4_ci/vc4-chamelium.testlist
> @@ -0,0 +1,9 @@
> +igt@kms_chamelium@hdmi-crc-single
> +igt@kms_chamelium@hdmi-crc-multiple
> +igt@kms_chamelium@hdmi-frame-dump
> +igt@kms_chamelium@hdmi-hpd-storm
> +igt@kms_chamelium@hdmi-hpd-storm-disable
> +igt@kms_chamelium@hdmi-crc-fast
> +igt@kms_chamelium@hdmi-edid-read
> +igt@kms_chamelium@hdmi-hpd
> +igt@kms_chamelium@hdmi-hpd-fast
> diff --git a/tests/vc4_ci/vc4.testlist b/tests/vc4_ci/vc4.testlist
> new file mode 100644
> index 000000000000..e86d4c815c56
> --- /dev/null
> +++ b/tests/vc4_ci/vc4.testlist
> @@ -0,0 +1,35 @@
> +igt@vc4_create_bo@create-bo-0
> +igt@vc4_create_bo@create-bo-4096
> +igt@vc4_create_bo@create-bo-zeroed
> +igt@vc4_dmabuf_poll@poll-read-waits-until-write-done
> +igt@vc4_dmabuf_poll@poll-write-waits-until-write-done
> +igt@vc4_label_bo@set-label
> +igt@vc4_label_bo@set-bad-handle
> +igt@vc4_label_bo@set-bad-name
> +igt@vc4_label_bo@set-kernel-name
> +igt@vc4_lookup_fail@bad-color-write
> +igt@vc4_purgeable_bo@mark-willneed
> +igt@vc4_purgeable_bo@mark-purgeable
> +igt@vc4_purgeable_bo@mark-purgeable-twice
> +igt@vc4_purgeable_bo@access-purgeable-bo-mem
> +igt@vc4_purgeable_bo@access-purged-bo-mem
> +igt@vc4_purgeable_bo@mark-unpurgeable-check-retained
> +igt@vc4_purgeable_bo@mark-unpurgeable-purged
> +igt@vc4_purgeable_bo@free-purged-bo
> +igt@vc4_tiling@get-bad-handle
> +igt@vc4_tiling@set-bad-handle
> +igt@vc4_tiling@get-bad-flags
> +igt@vc4_tiling@set-bad-flags
> +igt@vc4_tiling@get-bad-modifier
> +igt@vc4_tiling@set-bad-modifier
> +igt@vc4_tiling@set-get
> +igt@vc4_tiling@get-after-free
> +igt@vc4_wait_bo@bad-bo
> +igt@vc4_wait_bo@bad-pad
> +igt@vc4_wait_bo@unused-bo-0ns
> +igt@vc4_wait_bo@unused-bo-1ns
> +igt@vc4_wait_bo@used-bo
> +igt@vc4_wait_bo@used-bo-0ns
> +igt@vc4_wait_bo@used-bo-1ns
> +igt@vc4_wait_seqno@bad-seqno-0ns
> +igt@vc4_wait_seqno@bad-seqno-1ns
> -- 
> 2.14.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC PATCH i-g-t 2/3] tests/chamelium: Add test case for plane formats
  2018-03-12 19:02   ` Eric Anholt
@ 2018-03-13 15:05     ` Maxime Ripard
  0 siblings, 0 replies; 15+ messages in thread
From: Maxime Ripard @ 2018-03-13 15:05 UTC (permalink / raw)
  To: Eric Anholt; +Cc: intel-gfx, Thomas Petazzoni, eben


[-- Attachment #1.1: Type: text/plain, Size: 2041 bytes --]

Hi Eric,

On Mon, Mar 12, 2018 at 12:02:26PM -0700, Eric Anholt wrote:
> > +static pixman_image_t *convert_frame_format(pixman_image_t *src,
> > +					    int format)
> > +{
> > +	pixman_image_t *converted;
> > +	unsigned int w = pixman_image_get_width(src);
> > +	unsigned int h = pixman_image_get_height(src);
> > +	void *data = malloc(w * h * 4);
> > +
> > +	memset(data, 0, w * h * 4);
> > +	converted = pixman_image_create_bits(format, w, h, data,
> > +					     PIXMAN_FORMAT_BPP(format) / 8 * w);
> > +	pixman_image_composite(PIXMAN_OP_ADD, src, NULL, converted,
> > +			       0, 0, 0, 0, 0, 0, w, h);
> > +	return converted;
> > +}
> 
> Instead of the memset, you could just use PIXMAN_OP_SRC.

I guess PIXMAN_OP_ADD will do a composition between the existing
buffer content and the new one, while PIXMAN_OP_SRC will just take
whatever comes from the buffer and overwrite the previous content?

> Also, instead of "* 4", probably want "* PIXMAN_FORMAT_BPP(format) / 8"
> there too.

Ah, yes, definitely.

> > +#define PIXEL_MASK	0x00f8f8f8
> 
> If we're going to have some tolerance, the tolerance should probably
> depend on the lowest depth of the channel involved.

Indeed, yes.

> However, I'm not sure this is needed -- we should be able to get
> bit-exact from VC4 by filling in the size-extension bits in the HVS.

I guess it really depends on what we're aiming for here. While it
would probably work with VC4, I think this part is rather generic, so
I guess we could end up in scenarios where the CRTC will not fill the
bits to our expected value and where it wouldn't be something we can
change.

I just looked at the Allwinner display engine for example, and it
didn't have such configuration (documented, at least).

That's why I went with this approach here (but I can definitely change
it if we want to deal with that theorical case later).

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC PATCH i-g-t 3/3] tests: Add vc4 test suite
  2018-03-13 10:42   ` Petri Latvala
@ 2018-03-13 15:18     ` Maxime Ripard
  2018-03-14 10:44       ` Petri Latvala
  0 siblings, 1 reply; 15+ messages in thread
From: Maxime Ripard @ 2018-03-13 15:18 UTC (permalink / raw)
  To: intel-gfx, eben, Thomas Petazzoni


[-- Attachment #1.1: Type: text/plain, Size: 1453 bytes --]

Hi,

On Tue, Mar 13, 2018 at 12:42:02PM +0200, Petri Latvala wrote:
> On Mon, Mar 05, 2018 at 03:21:29PM +0100, Maxime Ripard wrote:
> > Add some various test suites relevant for the vc4 drm driver.
> > 
> > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> > ---
> >  tests/vc4_ci/vc4-chamelium-fast.testlist |  4 ++++
> >  tests/vc4_ci/vc4-chamelium.testlist      |  9 ++++++++
> >  tests/vc4_ci/vc4.testlist                | 35 ++++++++++++++++++++++++++++++++
> >  3 files changed, 48 insertions(+)
> >  create mode 100644 tests/vc4_ci/vc4-chamelium-fast.testlist
> >  create mode 100644 tests/vc4_ci/vc4-chamelium.testlist
> >  create mode 100644 tests/vc4_ci/vc4.testlist
> 
> Can you also add a README explaining where vc4_ci results can be found
> (or statement for the lack of a public view) and how these testlist
> files are used?

There isn't any publicly visible CI plan at the moment (that I know
of). This patch was more to get a list of meaningful tests into the
tree so that the various people involved could share the tests run for
now at least. I'm not sure what the policy is for that to be honest.

> No general kms tests in vc4.testlist?
> 
> What is the contact information for people who will be responsible for
> tests/vc4_ci?

Eric? I guess that would be you?

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC PATCH i-g-t 3/3] tests: Add vc4 test suite
  2018-03-13 15:18     ` Maxime Ripard
@ 2018-03-14 10:44       ` Petri Latvala
  2018-03-21 10:41         ` Maxime Ripard
  0 siblings, 1 reply; 15+ messages in thread
From: Petri Latvala @ 2018-03-14 10:44 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: intel-gfx, Thomas Petazzoni, eben

On Tue, Mar 13, 2018 at 04:18:54PM +0100, Maxime Ripard wrote:
> Hi,
> 
> On Tue, Mar 13, 2018 at 12:42:02PM +0200, Petri Latvala wrote:
> > On Mon, Mar 05, 2018 at 03:21:29PM +0100, Maxime Ripard wrote:
> > > Add some various test suites relevant for the vc4 drm driver.
> > > 
> > > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> > > ---
> > >  tests/vc4_ci/vc4-chamelium-fast.testlist |  4 ++++
> > >  tests/vc4_ci/vc4-chamelium.testlist      |  9 ++++++++
> > >  tests/vc4_ci/vc4.testlist                | 35 ++++++++++++++++++++++++++++++++
> > >  3 files changed, 48 insertions(+)
> > >  create mode 100644 tests/vc4_ci/vc4-chamelium-fast.testlist
> > >  create mode 100644 tests/vc4_ci/vc4-chamelium.testlist
> > >  create mode 100644 tests/vc4_ci/vc4.testlist
> > 
> > Can you also add a README explaining where vc4_ci results can be found
> > (or statement for the lack of a public view) and how these testlist
> > files are used?
> 
> There isn't any publicly visible CI plan at the moment (that I know
> of). This patch was more to get a list of meaningful tests into the
> tree so that the various people involved could share the tests run for
> now at least. I'm not sure what the policy is for that to be honest.


From IGT's side the policy is that the people who need such a
directory will set it up and it becomes their turf, in both
directions. Their responsibility to maintain, and their ack is
required for changes.



-- 
Petri Latvala
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC PATCH i-g-t 3/3] tests: Add vc4 test suite
  2018-03-14 10:44       ` Petri Latvala
@ 2018-03-21 10:41         ` Maxime Ripard
  0 siblings, 0 replies; 15+ messages in thread
From: Maxime Ripard @ 2018-03-21 10:41 UTC (permalink / raw)
  To: intel-gfx, eben, Thomas Petazzoni

Hi,

On Wed, Mar 14, 2018 at 12:44:10PM +0200, Petri Latvala wrote:
> On Tue, Mar 13, 2018 at 04:18:54PM +0100, Maxime Ripard wrote:
> > Hi,
> > 
> > On Tue, Mar 13, 2018 at 12:42:02PM +0200, Petri Latvala wrote:
> > > On Mon, Mar 05, 2018 at 03:21:29PM +0100, Maxime Ripard wrote:
> > > > Add some various test suites relevant for the vc4 drm driver.
> > > > 
> > > > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> > > > ---
> > > >  tests/vc4_ci/vc4-chamelium-fast.testlist |  4 ++++
> > > >  tests/vc4_ci/vc4-chamelium.testlist      |  9 ++++++++
> > > >  tests/vc4_ci/vc4.testlist                | 35 ++++++++++++++++++++++++++++++++
> > > >  3 files changed, 48 insertions(+)
> > > >  create mode 100644 tests/vc4_ci/vc4-chamelium-fast.testlist
> > > >  create mode 100644 tests/vc4_ci/vc4-chamelium.testlist
> > > >  create mode 100644 tests/vc4_ci/vc4.testlist
> > > 
> > > Can you also add a README explaining where vc4_ci results can be found
> > > (or statement for the lack of a public view) and how these testlist
> > > files are used?
> > 
> > There isn't any publicly visible CI plan at the moment (that I know
> > of). This patch was more to get a list of meaningful tests into the
> > tree so that the various people involved could share the tests run for
> > now at least. I'm not sure what the policy is for that to be honest.
> 
> From IGT's side the policy is that the people who need such a
> directory will set it up and it becomes their turf, in both
> directions. Their responsibility to maintain, and their ack is
> required for changes.

Ok, so I guess it would become mostly Eric's garden then :)

Eric, are you ok with such a test suite?

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC PATCH i-g-t 0/3] Test the plane formats on the Chamelium
  2018-03-05 14:21 [RFC PATCH i-g-t 0/3] Test the plane formats on the Chamelium Maxime Ripard
                   ` (4 preceding siblings ...)
  2018-03-05 21:51 ` ✗ Fi.CI.IGT: warning " Patchwork
@ 2018-03-21 11:25 ` Maxime Ripard
  2018-03-21 17:10   ` Eric Anholt
  5 siblings, 1 reply; 15+ messages in thread
From: Maxime Ripard @ 2018-03-21 11:25 UTC (permalink / raw)
  To: intel-gfx; +Cc: eben, Thomas Petazzoni


[-- Attachment #1.1: Type: text/plain, Size: 2898 bytes --]

Hi,

On Mon, Mar 05, 2018 at 03:21:26PM +0100, Maxime Ripard wrote:
> Here is an RFC at starting to test the plane formats using the
> Chamelium over the HDMI. This was tested using the vc4 DRM driver
> found on the RaspberryPi.
> 
> This is still pretty rough around the edges at this point, but I'd
> like to get feedback on a few issues before getting any further.
> 
>   * I've used pixman for now to convert back and forth the pattern and
>     the captured frame. While this worked quite well for the RGB
>     formats since pixman supports most (but not all) of them. However,
>     the long term plan is to also test YUV and more exotic (like
>     vendor specific) formats that pixman has 0 support for. So I
>     really wonder whether this is the right approach compared to:
>     - Using something else (but what?)?
>     - Rolling our own format conversion library?
> 
>   * I've so far had a single big test that will test all the formats
>     exposed by the planes that have a pixman representation. I wonder
>     whether this is preferrable, or if we want to have a subtest per
>     format. I guess the latter will be slightly better since we would
>     be able to catch regressions in the number of formats exposed that
>     we wouldn't be able to with the former.
> 
>   * Kind of related, I'm not sure what is the policy when it comes to
>     tests, and whether I should merge this tests with kms_chamelium or
>     leave it as a separate file.
> 
>   * One of the biggest challenge of the serie is to support formats
>     that have less bits than the reference frame. Indeed, the flow of
>     patterns is this one: the pattern will first be generated in
>     ARGB8888. It will then be converted to whatever format we want to
>     test, be fed into the display engine, that will output it, and the
>     Chamelium will capture it in ARGB8888.
>     However, when the plane format has less than 8 bits per color,
>     some upsampling will happen, where the less significant bits will
>     be filled with values that probably depend on the display
>     engine. Another side effect is that the CRC used in the Chamelium
>     tests cannot be used anymore.
>     The way I'm testing currently is that I'm retrieving the frame,
>     and then compare each pixels on their most significant bits. This
>     sounds inefficient, and it is, especially on the RPi that doesn't
>     have the best networking throughput out there.
>     I guess we could also generate a CRC for both an upsampling with
>     the lowest bits set to 1, and one for the lowest bits set to 0,
>     and try to see if one of them match. I guess this should cover
>     most of the situation.

Any comments on these points?
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC PATCH i-g-t 0/3] Test the plane formats on the Chamelium
  2018-03-21 11:25 ` [RFC PATCH i-g-t 0/3] " Maxime Ripard
@ 2018-03-21 17:10   ` Eric Anholt
  2018-03-28  8:30     ` Maxime Ripard
  0 siblings, 1 reply; 15+ messages in thread
From: Eric Anholt @ 2018-03-21 17:10 UTC (permalink / raw)
  To: Maxime Ripard, intel-gfx; +Cc: Thomas Petazzoni, eben


[-- Attachment #1.1: Type: text/plain, Size: 3394 bytes --]

Maxime Ripard <maxime.ripard@bootlin.com> writes:

> [ Unknown signature status ]
> Hi,
>
> On Mon, Mar 05, 2018 at 03:21:26PM +0100, Maxime Ripard wrote:
>> Here is an RFC at starting to test the plane formats using the
>> Chamelium over the HDMI. This was tested using the vc4 DRM driver
>> found on the RaspberryPi.
>> 
>> This is still pretty rough around the edges at this point, but I'd
>> like to get feedback on a few issues before getting any further.
>> 
>>   * I've used pixman for now to convert back and forth the pattern and
>>     the captured frame. While this worked quite well for the RGB
>>     formats since pixman supports most (but not all) of them. However,
>>     the long term plan is to also test YUV and more exotic (like
>>     vendor specific) formats that pixman has 0 support for. So I
>>     really wonder whether this is the right approach compared to:
>>     - Using something else (but what?)?
>>     - Rolling our own format conversion library?

Let's start with pixman and either extend pixman if we have formats we
need (they should be pretty amenable for non-yuv channel layouts), or
roll our own YUV bits.  For tiling, I think we can just take
pixman-generated linear image content and do the tiling in igt.

>>   * I've so far had a single big test that will test all the formats
>>     exposed by the planes that have a pixman representation. I wonder
>>     whether this is preferrable, or if we want to have a subtest per
>>     format. I guess the latter will be slightly better since we would
>>     be able to catch regressions in the number of formats exposed that
>>     we wouldn't be able to with the former.

Yeah, exposing the formats as subtests is probably a good idea.

>>   * Kind of related, I'm not sure what is the policy when it comes to
>>     tests, and whether I should merge this tests with kms_chamelium or
>>     leave it as a separate file.

I'll leave this up to the original test author.

>>   * One of the biggest challenge of the serie is to support formats
>>     that have less bits than the reference frame. Indeed, the flow of
>>     patterns is this one: the pattern will first be generated in
>>     ARGB8888. It will then be converted to whatever format we want to
>>     test, be fed into the display engine, that will output it, and the
>>     Chamelium will capture it in ARGB8888.
>>     However, when the plane format has less than 8 bits per color,
>>     some upsampling will happen, where the less significant bits will
>>     be filled with values that probably depend on the display
>>     engine. Another side effect is that the CRC used in the Chamelium
>>     tests cannot be used anymore.
>>     The way I'm testing currently is that I'm retrieving the frame,
>>     and then compare each pixels on their most significant bits. This
>>     sounds inefficient, and it is, especially on the RPi that doesn't
>>     have the best networking throughput out there.
>>     I guess we could also generate a CRC for both an upsampling with
>>     the lowest bits set to 1, and one for the lowest bits set to 0,
>>     and try to see if one of them match. I guess this should cover
>>     most of the situation.

I still think that we should expect the top bits to be replicated into
the low bits, until we find hardware that just can't do that.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC PATCH i-g-t 0/3] Test the plane formats on the Chamelium
  2018-03-21 17:10   ` Eric Anholt
@ 2018-03-28  8:30     ` Maxime Ripard
  0 siblings, 0 replies; 15+ messages in thread
From: Maxime Ripard @ 2018-03-28  8:30 UTC (permalink / raw)
  To: Eric Anholt; +Cc: intel-gfx, Thomas Petazzoni, eben


[-- Attachment #1.1: Type: text/plain, Size: 4059 bytes --]

Hi Eric,

Thanks for your input.

On Wed, Mar 21, 2018 at 10:10:00AM -0700, Eric Anholt wrote:
> Maxime Ripard <maxime.ripard@bootlin.com> writes:
> 
> > [ Unknown signature status ]
> > Hi,
> >
> > On Mon, Mar 05, 2018 at 03:21:26PM +0100, Maxime Ripard wrote:
> >> Here is an RFC at starting to test the plane formats using the
> >> Chamelium over the HDMI. This was tested using the vc4 DRM driver
> >> found on the RaspberryPi.
> >> 
> >> This is still pretty rough around the edges at this point, but I'd
> >> like to get feedback on a few issues before getting any further.
> >> 
> >>   * I've used pixman for now to convert back and forth the pattern and
> >>     the captured frame. While this worked quite well for the RGB
> >>     formats since pixman supports most (but not all) of them. However,
> >>     the long term plan is to also test YUV and more exotic (like
> >>     vendor specific) formats that pixman has 0 support for. So I
> >>     really wonder whether this is the right approach compared to:
> >>     - Using something else (but what?)?
> >>     - Rolling our own format conversion library?
> 
> Let's start with pixman and either extend pixman if we have formats we
> need (they should be pretty amenable for non-yuv channel layouts), or
> roll our own YUV bits.  For tiling, I think we can just take
> pixman-generated linear image content and do the tiling in igt.

Ok. I guess another alternative could be to use libv4lconvert that
already has a number of rgb to yuv conversions routines. I'm not sure
whether adding a new dependency is ok though.

> >>   * I've so far had a single big test that will test all the formats
> >>     exposed by the planes that have a pixman representation. I wonder
> >>     whether this is preferrable, or if we want to have a subtest per
> >>     format. I guess the latter will be slightly better since we would
> >>     be able to catch regressions in the number of formats exposed that
> >>     we wouldn't be able to with the former.
> 
> Yeah, exposing the formats as subtests is probably a good idea.

I'll do that then.

> >>   * Kind of related, I'm not sure what is the policy when it comes to
> >>     tests, and whether I should merge this tests with kms_chamelium or
> >>     leave it as a separate file.
> 
> I'll leave this up to the original test author.
> 
> >>   * One of the biggest challenge of the serie is to support formats
> >>     that have less bits than the reference frame. Indeed, the flow of
> >>     patterns is this one: the pattern will first be generated in
> >>     ARGB8888. It will then be converted to whatever format we want to
> >>     test, be fed into the display engine, that will output it, and the
> >>     Chamelium will capture it in ARGB8888.
> >>     However, when the plane format has less than 8 bits per color,
> >>     some upsampling will happen, where the less significant bits will
> >>     be filled with values that probably depend on the display
> >>     engine. Another side effect is that the CRC used in the Chamelium
> >>     tests cannot be used anymore.
> >>     The way I'm testing currently is that I'm retrieving the frame,
> >>     and then compare each pixels on their most significant bits. This
> >>     sounds inefficient, and it is, especially on the RPi that doesn't
> >>     have the best networking throughput out there.
> >>     I guess we could also generate a CRC for both an upsampling with
> >>     the lowest bits set to 1, and one for the lowest bits set to 0,
> >>     and try to see if one of them match. I guess this should cover
> >>     most of the situation.
> 
> I still think that we should expect the top bits to be replicated into
> the low bits, until we find hardware that just can't do that.

That works for me then.

I'll try to have all these changes, and send a new version then.

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2018-03-28  8:30 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-05 14:21 [RFC PATCH i-g-t 0/3] Test the plane formats on the Chamelium Maxime Ripard
2018-03-05 14:21 ` [RFC PATCH i-g-t 1/3] tests/chamelium: Move some functions and structures to a common place Maxime Ripard
2018-03-05 14:21 ` [RFC PATCH i-g-t 2/3] tests/chamelium: Add test case for plane formats Maxime Ripard
2018-03-12 19:02   ` Eric Anholt
2018-03-13 15:05     ` Maxime Ripard
2018-03-05 14:21 ` [RFC PATCH i-g-t 3/3] tests: Add vc4 test suite Maxime Ripard
2018-03-13 10:42   ` Petri Latvala
2018-03-13 15:18     ` Maxime Ripard
2018-03-14 10:44       ` Petri Latvala
2018-03-21 10:41         ` Maxime Ripard
2018-03-05 16:49 ` ✓ Fi.CI.BAT: success for Test the plane formats on the Chamelium Patchwork
2018-03-05 21:51 ` ✗ Fi.CI.IGT: warning " Patchwork
2018-03-21 11:25 ` [RFC PATCH i-g-t 0/3] " Maxime Ripard
2018-03-21 17:10   ` Eric Anholt
2018-03-28  8:30     ` Maxime Ripard

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.