igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1)
       [not found] <20190930224707.14904-1-matthew.d.roper@intel.com>
@ 2019-09-30 23:13 ` Matt Roper
  2019-10-01  2:18   ` Martin Peres
  2019-09-30 23:46 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Matt Roper @ 2019-09-30 23:13 UTC (permalink / raw)
  To: intel-gfx, dri-devel, igt-dev; +Cc: Heiko Stuebner, Daniel Vetter

CRTC background color kernel patches were written about 2.5 years ago
and floated on the upstream mailing list, but since no opensource
userspace materialized, we never actually merged them.  However the
corresponding IGT test did get merged and has basically been dead code
ever since.

A couple years later we finally have an open source userspace
(ChromeOS), so lets update the IGT test to match the ABI that's actually
going upstream and to remove some of the cruft from the original test
that wouldn't actually work.

It's worth noting that CRC's don't seem to work properly on Intel gen9.
The bspec does tell us that we must have one plane enabled before taking
a pipe-level ("dmux") CRC, so this test is violating that by disabling
all planes; it's quite possible that this is the source of the CRC
mismatch.  If running on an Intel platform, you may want to run in
interactive mode ("--interactive-debug=bgcolor --skip-crc-compare") to
ensure that the colors being generated actually do match visually since
the CRC's can't be trusted.

v2:
 - Swap red and blue ordering in property value to reflect change
   in v2 of kernel series.

v3:
 - Minor updates to proposed uapi helpers (s/rgba/argb/).

v4:
 - General restructuring into pipe/color subtests.
 - Use RGB2101010 framebuffers for comparison so that we match the bits
   of precision that Intel hardware background color accepts

v5:
 - Re-enable CRC comparisons; just because these don't work on Intel
   doesn't mean we shouldn't use them on other vendors' platforms
   (Daniel).
 - Use DRIVER_ANY rather than DRIVER_INTEL. (Heiko Stuebner)

v5.1:
 - Update commit message body discussion of CRC issues.

Cc: igt-dev@lists.freedesktop.org
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 lib/igt_kms.c                     |   2 +-
 tests/kms_crtc_background_color.c | 263 ++++++++++++++----------------
 2 files changed, 127 insertions(+), 138 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e9b80b9b..9a7f0e23 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -391,7 +391,7 @@ const char * const igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
 };
 
 const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
-	[IGT_CRTC_BACKGROUND] = "background_color",
+	[IGT_CRTC_BACKGROUND] = "BACKGROUND_COLOR",
 	[IGT_CRTC_CTM] = "CTM",
 	[IGT_CRTC_GAMMA_LUT] = "GAMMA_LUT",
 	[IGT_CRTC_GAMMA_LUT_SIZE] = "GAMMA_LUT_SIZE",
diff --git a/tests/kms_crtc_background_color.c b/tests/kms_crtc_background_color.c
index 3df3401f..58cdd7a9 100644
--- a/tests/kms_crtc_background_color.c
+++ b/tests/kms_crtc_background_color.c
@@ -25,164 +25,153 @@
 #include "igt.h"
 #include <math.h>
 
-
 IGT_TEST_DESCRIPTION("Test crtc background color feature");
 
+/*
+ * Paints a desired color into a full-screen primary plane and then compares
+ * that CRC with turning off all planes and setting the CRTC background to the
+ * same color.
+ *
+ * At least on current Intel platforms, the CRC tests appear to always fail,
+ * even though the resulting pipe output seems to be the same.  The bspec tells
+ * us that we must have at least one plane turned on when taking a pipe-level
+ * CRC, so the fact that we're violating that may explain the failures.  If
+ * your platform gives failures for all tests, you may want to run with
+ * --interactive-debug=bgcolor --skip-crc-compare to visually inspect that the
+ * background color matches the equivalent solid plane.
+ */
+
 typedef struct {
-	int gfx_fd;
 	igt_display_t display;
-	struct igt_fb fb;
-	igt_crc_t ref_crc;
+	int gfx_fd;
+	igt_output_t *output;
 	igt_pipe_crc_t *pipe_crc;
+	drmModeModeInfo *mode;
 } data_t;
 
-#define BLACK      0x000000           /* BGR 8bpc */
-#define CYAN       0xFFFF00           /* BGR 8bpc */
-#define PURPLE     0xFF00FF           /* BGR 8bpc */
-#define WHITE      0xFFFFFF           /* BGR 8bpc */
-
-#define BLACK64    0x000000000000     /* BGR 16bpc */
-#define CYAN64     0xFFFFFFFF0000     /* BGR 16bpc */
-#define PURPLE64   0xFFFF0000FFFF     /* BGR 16bpc */
-#define YELLOW64   0x0000FFFFFFFF     /* BGR 16bpc */
-#define WHITE64    0xFFFFFFFFFFFF     /* BGR 16bpc */
-#define RED64      0x00000000FFFF     /* BGR 16bpc */
-#define GREEN64    0x0000FFFF0000     /* BGR 16bpc */
-#define BLUE64     0xFFFF00000000     /* BGR 16bpc */
-
-static void
-paint_background(data_t *data, struct igt_fb *fb, drmModeModeInfo *mode,
-		uint32_t background, double alpha)
+/*
+ * Local copy of kernel uapi
+ */
+static inline __u64
+local_argb(__u8 bpc, __u16 alpha, __u16 red, __u16 green, __u16 blue)
 {
-	cairo_t *cr;
-	int w, h;
-	double r, g, b;
-
-	w = mode->hdisplay;
-	h = mode->vdisplay;
-
-	cr = igt_get_cairo_ctx(data->gfx_fd, &data->fb);
+       int msb_shift = 16 - bpc;
 
-	/* Paint with background color */
-	r = (double) (background & 0xFF) / 255.0;
-	g = (double) ((background & 0xFF00) >> 8) / 255.0;
-	b = (double) ((background & 0xFF0000) >> 16) / 255.0;
-	igt_paint_color_alpha(cr, 0, 0, w, h, r, g, b, alpha);
-
-	igt_put_cairo_ctx(data->gfx_fd, &data->fb, cr);
+       return (__u64)alpha << msb_shift << 48 |
+              (__u64)red   << msb_shift << 32 |
+              (__u64)green << msb_shift << 16 |
+              (__u64)blue  << msb_shift;
 }
 
-static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
-			igt_plane_t *plane, int opaque_buffer, int plane_color,
-			uint64_t pipe_background_color)
+static void test_background(data_t *data, enum pipe pipe, int w, int h,
+			    __u64 r, __u64 g, __u64 b)
 {
-	drmModeModeInfo *mode;
-	igt_display_t *display = &data->display;
-	int fb_id;
-	double alpha;
-
-	igt_output_set_pipe(output, pipe);
-
-	/* create the pipe_crc object for this pipe */
-	igt_pipe_crc_free(data->pipe_crc);
-	data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
-
-	mode = igt_output_get_mode(output);
-
-	fb_id = igt_create_fb(data->gfx_fd,
-			mode->hdisplay, mode->vdisplay,
-			DRM_FORMAT_XRGB8888,
-			LOCAL_DRM_FORMAT_MOD_NONE, /* tiled */
-			&data->fb);
-	igt_assert(fb_id);
-
-	/* To make FB pixel win with background color, set alpha as full opaque */
-	igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, pipe_background_color);
-	if (opaque_buffer)
-		alpha = 1.0;    /* alpha 1 is fully opque */
-	else
-		alpha = 0.0;    /* alpha 0 is fully transparent */
-	paint_background(data, &data->fb, mode, plane_color, alpha);
-
-	igt_plane_set_fb(plane, &data->fb);
-	igt_display_commit2(display, COMMIT_UNIVERSAL);
-}
-
-static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
-{
-	igt_display_t *display = &data->display;
-
-	igt_pipe_crc_free(data->pipe_crc);
-	data->pipe_crc = NULL;
-
-	igt_remove_fb(data->gfx_fd, &data->fb);
-
-	igt_pipe_obj_set_prop_value(plane->pipe, IGT_CRTC_BACKGROUND, BLACK64);
+	igt_crc_t plane_crc, bg_crc;
+	struct igt_fb colorfb;
+	igt_plane_t *plane = igt_output_get_plane_type(data->output,
+						       DRM_PLANE_TYPE_PRIMARY);
+
+
+	/* Fill the primary plane and set the background to the same color */
+	igt_create_color_fb(data->gfx_fd, w, h, DRM_FORMAT_XRGB2101010,
+			    LOCAL_DRM_FORMAT_MOD_NONE,
+			    (double)r / 0xFFFF,
+			    (double)g / 0xFFFF,
+			    (double)b / 0xFFFF,
+			    &colorfb);
+	igt_plane_set_fb(plane, &colorfb);
+	igt_pipe_set_prop_value(&data->display, pipe, IGT_CRTC_BACKGROUND,
+				local_argb(16, 0xffff, r, g, b));
+	igt_display_commit2(&data->display, COMMIT_ATOMIC);
+	igt_pipe_crc_collect_crc(data->pipe_crc, &plane_crc);
+	igt_debug_wait_for_keypress("bgcolor");
+
+	/* Turn off the primary plane so only bg shows */
 	igt_plane_set_fb(plane, NULL);
-	igt_output_set_pipe(output, PIPE_ANY);
-
-	igt_display_commit2(display, COMMIT_UNIVERSAL);
+	igt_display_commit2(&data->display, COMMIT_ATOMIC);
+	igt_pipe_crc_collect_crc(data->pipe_crc, &bg_crc);
+	igt_debug_wait_for_keypress("bgcolor");
+
+	/*
+	 * The following test relies on hardware that generates valid CRCs
+	 * even when no planes are on.  Sadly, this doesn't appear to be the
+	 * case for current Intel platforms; pipe CRC's never match bgcolor
+	 * CRC's, likely because we're violating the bspec's guidance that there
+	 * must always be at least one real plane turned on when taking the
+	 * pipe-level ("dmux") CRC.
+	 */
+	igt_assert_crc_equal(&plane_crc, &bg_crc);
 }
 
-static void test_crtc_background(data_t *data)
+igt_main
 {
-	igt_display_t *display = &data->display;
+	data_t data = {};
 	igt_output_t *output;
+	drmModeModeInfo *mode;
+	int w, h;
 	enum pipe pipe;
-	int valid_tests = 0;
-
-	for_each_pipe_with_valid_output(display, pipe, output) {
-		igt_plane_t *plane;
-
-		igt_output_set_pipe(output, pipe);
-
-		plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
-		igt_require(igt_pipe_has_prop(display, pipe, IGT_CRTC_BACKGROUND));
-
-		prepare_crtc(data, output, pipe, plane, 1, PURPLE, BLACK64);
-
-		/* Now set background without using a plane, i.e.,
-		 * Disable the plane to let hw background color win blend. */
-		igt_plane_set_fb(plane, NULL);
-		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, PURPLE64);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
-
-		/* Try few other background colors */
-		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, CYAN64);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
-
-		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, YELLOW64);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
 
-		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, RED64);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	igt_fixture {
+		data.gfx_fd = drm_open_driver_master(DRIVER_ANY);
+		kmstest_set_vt_graphics_mode();
 
-		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, GREEN64);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
-
-		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, BLUE64);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
-
-		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, WHITE64);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
-
-		valid_tests++;
-		cleanup_crtc(data, output, plane);
+		igt_require_pipe_crc(data.gfx_fd);
+		igt_display_require(&data.display, data.gfx_fd);
 	}
-	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
-}
 
-igt_simple_main
-{
-	data_t data = {};
-
-	igt_skip_on_simulation();
-
-	data.gfx_fd = drm_open_driver(DRIVER_INTEL);
-	igt_require_pipe_crc(data.gfx_fd);
-	igt_display_require(&data.display, data.gfx_fd);
-
-	test_crtc_background(&data);
+	for_each_pipe_static(pipe) igt_subtest_group {
+		igt_fixture {
+			igt_display_require_output_on_pipe(&data.display, pipe);
+			igt_require(igt_pipe_has_prop(&data.display, pipe,
+						      IGT_CRTC_BACKGROUND));
+
+			output = igt_get_single_output_for_pipe(&data.display,
+								pipe);
+			igt_output_set_pipe(output, pipe);
+			data.output = output;
+
+			mode = igt_output_get_mode(output);
+			w = mode->hdisplay;
+			h = mode->vdisplay;
+
+			data.pipe_crc = igt_pipe_crc_new(data.gfx_fd, pipe,
+							  INTEL_PIPE_CRC_SOURCE_AUTO);
+		}
+
+		igt_subtest_f("background-color-pipe-%s-black",
+			      kmstest_pipe_name(pipe))
+			test_background(&data, pipe, w, h,
+					0, 0, 0);
+
+		igt_subtest_f("background-color-pipe-%s-white",
+			      kmstest_pipe_name(pipe))
+			test_background(&data, pipe, w, h,
+					0xFFFF, 0xFFFF, 0xFFFF);
+
+		igt_subtest_f("background-color-pipe-%s-red",
+			      kmstest_pipe_name(pipe))
+			test_background(&data, pipe, w, h,
+					0xFFFF, 0, 0);
+
+		igt_subtest_f("background-color-pipe-%s-green",
+			      kmstest_pipe_name(pipe))
+
+			test_background(&data, pipe, w, h,
+					0, 0xFFFF, 0);
+
+		igt_subtest_f("background-color-pipe-%s-blue",
+			      kmstest_pipe_name(pipe))
+			test_background(&data, pipe, w, h,
+					0, 0, 0xFFFF);
+
+		igt_fixture {
+			igt_display_reset(&data.display);
+			igt_pipe_crc_free(data.pipe_crc);
+			data.pipe_crc = NULL;
+		}
+	}
 
-	igt_display_fini(&data.display);
+	igt_fixture {
+		igt_display_fini(&data.display);
+	}
 }
-- 
2.21.0

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

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

* [igt-dev] ✗ GitLab.Pipeline: warning for tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1)
       [not found] <20190930224707.14904-1-matthew.d.roper@intel.com>
  2019-09-30 23:13 ` [igt-dev] [PATCH i-g-t] tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1) Matt Roper
@ 2019-09-30 23:46 ` Patchwork
  2019-09-30 23:53 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
  2019-10-01  8:13 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-09-30 23:46 UTC (permalink / raw)
  To: Matt Roper; +Cc: igt-dev

== Series Details ==

Series: tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1)
URL   : https://patchwork.freedesktop.org/series/67425/
State : warning

== Summary ==

ERROR! This series introduces new undocumented tests:

kms_crtc_background_color@background-color-pipe-A-black
kms_crtc_background_color@background-color-pipe-A-blue
kms_crtc_background_color@background-color-pipe-A-green
kms_crtc_background_color@background-color-pipe-A-red
kms_crtc_background_color@background-color-pipe-A-white
kms_crtc_background_color@background-color-pipe-B-black
kms_crtc_background_color@background-color-pipe-B-blue
kms_crtc_background_color@background-color-pipe-B-green
kms_crtc_background_color@background-color-pipe-B-red
kms_crtc_background_color@background-color-pipe-B-white
kms_crtc_background_color@background-color-pipe-C-black
kms_crtc_background_color@background-color-pipe-C-blue
kms_crtc_background_color@background-color-pipe-C-green
kms_crtc_background_color@background-color-pipe-C-red
kms_crtc_background_color@background-color-pipe-C-white
kms_crtc_background_color@background-color-pipe-D-black
kms_crtc_background_color@background-color-pipe-D-blue
kms_crtc_background_color@background-color-pipe-D-green
kms_crtc_background_color@background-color-pipe-D-red
kms_crtc_background_color@background-color-pipe-D-white
kms_crtc_background_color@background-color-pipe-E-black
kms_crtc_background_color@background-color-pipe-E-blue
kms_crtc_background_color@background-color-pipe-E-green
kms_crtc_background_color@background-color-pipe-E-red
kms_crtc_background_color@background-color-pipe-E-white
kms_crtc_background_color@background-color-pipe-F-black
kms_crtc_background_color@background-color-pipe-F-blue
kms_crtc_background_color@background-color-pipe-F-green
kms_crtc_background_color@background-color-pipe-F-red
kms_crtc_background_color@background-color-pipe-F-white

Can you document them as per the requirement in the [CONTRIBUTING.md]?

[Documentation] has more details on how to do this.

Here are few examples:
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/0316695d03aa46108296b27f3982ec93200c7a6e
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/443cc658e1e6b492ee17bf4f4d891029eb7a205d

Thanks in advance!

[CONTRIBUTING.md]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/blob/master/CONTRIBUTING.md#L19
[Documentation]: https://drm.pages.freedesktop.org/igt-gpu-tools/igt-gpu-tools-Core.html#igt-describe

Other than that, pipeline status: SUCCESS.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/67589 for more details

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/67589
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1)
       [not found] <20190930224707.14904-1-matthew.d.roper@intel.com>
  2019-09-30 23:13 ` [igt-dev] [PATCH i-g-t] tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1) Matt Roper
  2019-09-30 23:46 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
@ 2019-09-30 23:53 ` Patchwork
  2019-10-01  8:13 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-09-30 23:53 UTC (permalink / raw)
  To: Matt Roper; +Cc: igt-dev

== Series Details ==

Series: tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1)
URL   : https://patchwork.freedesktop.org/series/67425/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6979 -> IGTPW_3516
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/67425/revisions/1/mbox/

Known issues
------------

  Here are the changes found in IGTPW_3516 that come from known issues:

### IGT changes ###

  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102505]: https://bugs.freedesktop.org/show_bug.cgi?id=102505
  [fdo#111049]: https://bugs.freedesktop.org/show_bug.cgi?id=111049
  [fdo#111647]: https://bugs.freedesktop.org/show_bug.cgi?id=111647


Participating hosts (15 -> 43)
------------------------------

  Additional (28): fi-bdw-gvtdvm fi-icl-u2 fi-apl-guc fi-snb-2520m fi-icl-u3 fi-skl-lmem fi-blb-e6850 fi-icl-guc fi-byt-n2820 fi-skl-6600u fi-hsw-4770r fi-bxt-dsi fi-cml-s fi-byt-j1900 fi-glk-dsi fi-bwr-2160 fi-ilk-650 fi-kbl-7500u fi-gdg-551 fi-elk-e7500 fi-skl-6700k2 fi-hsw-peppy fi-cfl-guc fi-whl-u fi-kbl-x1275 fi-cfl-8109u fi-skl-iommu fi-kbl-8809g 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5208 -> IGTPW_3516

  CI-20190529: 20190529
  CI_DRM_6979: 46637a3b58ef5e2c0fb6e53b7c50bba8f5de3455 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3516: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/index.html
  IGT_5208: c0131b4f132acf287d9d05b0f5078003d3159e1c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@kms_crtc_background_color@background-color-pipe-a-black
+igt@kms_crtc_background_color@background-color-pipe-a-blue
+igt@kms_crtc_background_color@background-color-pipe-a-green
+igt@kms_crtc_background_color@background-color-pipe-a-red
+igt@kms_crtc_background_color@background-color-pipe-a-white
+igt@kms_crtc_background_color@background-color-pipe-b-black
+igt@kms_crtc_background_color@background-color-pipe-b-blue
+igt@kms_crtc_background_color@background-color-pipe-b-green
+igt@kms_crtc_background_color@background-color-pipe-b-red
+igt@kms_crtc_background_color@background-color-pipe-b-white
+igt@kms_crtc_background_color@background-color-pipe-c-black
+igt@kms_crtc_background_color@background-color-pipe-c-blue
+igt@kms_crtc_background_color@background-color-pipe-c-green
+igt@kms_crtc_background_color@background-color-pipe-c-red
+igt@kms_crtc_background_color@background-color-pipe-c-white
+igt@kms_crtc_background_color@background-color-pipe-d-black
+igt@kms_crtc_background_color@background-color-pipe-d-blue
+igt@kms_crtc_background_color@background-color-pipe-d-green
+igt@kms_crtc_background_color@background-color-pipe-d-red
+igt@kms_crtc_background_color@background-color-pipe-d-white
+igt@kms_crtc_background_color@background-color-pipe-e-black
+igt@kms_crtc_background_color@background-color-pipe-e-blue
+igt@kms_crtc_background_color@background-color-pipe-e-green
+igt@kms_crtc_background_color@background-color-pipe-e-red
+igt@kms_crtc_background_color@background-color-pipe-e-white
+igt@kms_crtc_background_color@background-color-pipe-f-black
+igt@kms_crtc_background_color@background-color-pipe-f-blue
+igt@kms_crtc_background_color@background-color-pipe-f-green
+igt@kms_crtc_background_color@background-color-pipe-f-red
+igt@kms_crtc_background_color@background-color-pipe-f-white
-igt@kms_crtc_background_color

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1)
  2019-09-30 23:13 ` [igt-dev] [PATCH i-g-t] tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1) Matt Roper
@ 2019-10-01  2:18   ` Martin Peres
  2019-10-01 12:27     ` Ville Syrjälä
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Peres @ 2019-10-01  2:18 UTC (permalink / raw)
  To: Matt Roper, intel-gfx, dri-devel, igt-dev

[-- Attachment #1: Type: text/plain, Size: 13814 bytes --]

On 30/09/2019 19:13, Matt Roper wrote:
> CRTC background color kernel patches were written about 2.5 years ago
> and floated on the upstream mailing list, but since no opensource
> userspace materialized, we never actually merged them.  However the
> corresponding IGT test did get merged and has basically been dead code
> ever since.
> 
> A couple years later we finally have an open source userspace
> (ChromeOS), so lets update the IGT test to match the ABI that's actually
> going upstream and to remove some of the cruft from the original test
> that wouldn't actually work.
> 
> It's worth noting that CRC's don't seem to work properly on Intel gen9.
> The bspec does tell us that we must have one plane enabled before taking
> a pipe-level ("dmux") CRC, so this test is violating that by disabling
> all planes; it's quite possible that this is the source of the CRC
> mismatch.  If running on an Intel platform, you may want to run in
> interactive mode ("--interactive-debug=bgcolor --skip-crc-compare") to
> ensure that the colors being generated actually do match visually since
> the CRC's can't be trusted.

Hmm, landing a feature without automating testing for it is a bit too
much to ask IMO.

I have two proposals to make it happen:

- Could we add a workaround for the affected intel platforms? If the
problem really is because no planes are enabled, then surely a
fully-transparent plane would be a sufficient workaround.

- If CRCs really cannot be used for this, then we should use the
chamelium for it. The idea would be to detect if the connector is
connected to a chamelium, and if so use chamelium's CRC.

How does this sound?

Martin

> 
> v2:
>  - Swap red and blue ordering in property value to reflect change
>    in v2 of kernel series.
> 
> v3:
>  - Minor updates to proposed uapi helpers (s/rgba/argb/).
> 
> v4:
>  - General restructuring into pipe/color subtests.
>  - Use RGB2101010 framebuffers for comparison so that we match the bits
>    of precision that Intel hardware background color accepts
> 
> v5:
>  - Re-enable CRC comparisons; just because these don't work on Intel
>    doesn't mean we shouldn't use them on other vendors' platforms
>    (Daniel).
>  - Use DRIVER_ANY rather than DRIVER_INTEL. (Heiko Stuebner)
> 
> v5.1:
>  - Update commit message body discussion of CRC issues.
> 
> Cc: igt-dev@lists.freedesktop.org
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> ---
>  lib/igt_kms.c                     |   2 +-
>  tests/kms_crtc_background_color.c | 263 ++++++++++++++----------------
>  2 files changed, 127 insertions(+), 138 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index e9b80b9b..9a7f0e23 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -391,7 +391,7 @@ const char * const igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
>  };
>  
>  const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
> -	[IGT_CRTC_BACKGROUND] = "background_color",
> +	[IGT_CRTC_BACKGROUND] = "BACKGROUND_COLOR",
>  	[IGT_CRTC_CTM] = "CTM",
>  	[IGT_CRTC_GAMMA_LUT] = "GAMMA_LUT",
>  	[IGT_CRTC_GAMMA_LUT_SIZE] = "GAMMA_LUT_SIZE",
> diff --git a/tests/kms_crtc_background_color.c b/tests/kms_crtc_background_color.c
> index 3df3401f..58cdd7a9 100644
> --- a/tests/kms_crtc_background_color.c
> +++ b/tests/kms_crtc_background_color.c
> @@ -25,164 +25,153 @@
>  #include "igt.h"
>  #include <math.h>
>  
> -
>  IGT_TEST_DESCRIPTION("Test crtc background color feature");
>  
> +/*
> + * Paints a desired color into a full-screen primary plane and then compares
> + * that CRC with turning off all planes and setting the CRTC background to the
> + * same color.
> + *
> + * At least on current Intel platforms, the CRC tests appear to always fail,
> + * even though the resulting pipe output seems to be the same.  The bspec tells
> + * us that we must have at least one plane turned on when taking a pipe-level
> + * CRC, so the fact that we're violating that may explain the failures.  If
> + * your platform gives failures for all tests, you may want to run with
> + * --interactive-debug=bgcolor --skip-crc-compare to visually inspect that the
> + * background color matches the equivalent solid plane.
> + */
> +
>  typedef struct {
> -	int gfx_fd;
>  	igt_display_t display;
> -	struct igt_fb fb;
> -	igt_crc_t ref_crc;
> +	int gfx_fd;
> +	igt_output_t *output;
>  	igt_pipe_crc_t *pipe_crc;
> +	drmModeModeInfo *mode;
>  } data_t;
>  
> -#define BLACK      0x000000           /* BGR 8bpc */
> -#define CYAN       0xFFFF00           /* BGR 8bpc */
> -#define PURPLE     0xFF00FF           /* BGR 8bpc */
> -#define WHITE      0xFFFFFF           /* BGR 8bpc */
> -
> -#define BLACK64    0x000000000000     /* BGR 16bpc */
> -#define CYAN64     0xFFFFFFFF0000     /* BGR 16bpc */
> -#define PURPLE64   0xFFFF0000FFFF     /* BGR 16bpc */
> -#define YELLOW64   0x0000FFFFFFFF     /* BGR 16bpc */
> -#define WHITE64    0xFFFFFFFFFFFF     /* BGR 16bpc */
> -#define RED64      0x00000000FFFF     /* BGR 16bpc */
> -#define GREEN64    0x0000FFFF0000     /* BGR 16bpc */
> -#define BLUE64     0xFFFF00000000     /* BGR 16bpc */
> -
> -static void
> -paint_background(data_t *data, struct igt_fb *fb, drmModeModeInfo *mode,
> -		uint32_t background, double alpha)
> +/*
> + * Local copy of kernel uapi
> + */
> +static inline __u64
> +local_argb(__u8 bpc, __u16 alpha, __u16 red, __u16 green, __u16 blue)
>  {
> -	cairo_t *cr;
> -	int w, h;
> -	double r, g, b;
> -
> -	w = mode->hdisplay;
> -	h = mode->vdisplay;
> -
> -	cr = igt_get_cairo_ctx(data->gfx_fd, &data->fb);
> +       int msb_shift = 16 - bpc;
>  
> -	/* Paint with background color */
> -	r = (double) (background & 0xFF) / 255.0;
> -	g = (double) ((background & 0xFF00) >> 8) / 255.0;
> -	b = (double) ((background & 0xFF0000) >> 16) / 255.0;
> -	igt_paint_color_alpha(cr, 0, 0, w, h, r, g, b, alpha);
> -
> -	igt_put_cairo_ctx(data->gfx_fd, &data->fb, cr);
> +       return (__u64)alpha << msb_shift << 48 |
> +              (__u64)red   << msb_shift << 32 |
> +              (__u64)green << msb_shift << 16 |
> +              (__u64)blue  << msb_shift;
>  }
>  
> -static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
> -			igt_plane_t *plane, int opaque_buffer, int plane_color,
> -			uint64_t pipe_background_color)
> +static void test_background(data_t *data, enum pipe pipe, int w, int h,
> +			    __u64 r, __u64 g, __u64 b)
>  {
> -	drmModeModeInfo *mode;
> -	igt_display_t *display = &data->display;
> -	int fb_id;
> -	double alpha;
> -
> -	igt_output_set_pipe(output, pipe);
> -
> -	/* create the pipe_crc object for this pipe */
> -	igt_pipe_crc_free(data->pipe_crc);
> -	data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
> -
> -	mode = igt_output_get_mode(output);
> -
> -	fb_id = igt_create_fb(data->gfx_fd,
> -			mode->hdisplay, mode->vdisplay,
> -			DRM_FORMAT_XRGB8888,
> -			LOCAL_DRM_FORMAT_MOD_NONE, /* tiled */
> -			&data->fb);
> -	igt_assert(fb_id);
> -
> -	/* To make FB pixel win with background color, set alpha as full opaque */
> -	igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, pipe_background_color);
> -	if (opaque_buffer)
> -		alpha = 1.0;    /* alpha 1 is fully opque */
> -	else
> -		alpha = 0.0;    /* alpha 0 is fully transparent */
> -	paint_background(data, &data->fb, mode, plane_color, alpha);
> -
> -	igt_plane_set_fb(plane, &data->fb);
> -	igt_display_commit2(display, COMMIT_UNIVERSAL);
> -}
> -
> -static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
> -{
> -	igt_display_t *display = &data->display;
> -
> -	igt_pipe_crc_free(data->pipe_crc);
> -	data->pipe_crc = NULL;
> -
> -	igt_remove_fb(data->gfx_fd, &data->fb);
> -
> -	igt_pipe_obj_set_prop_value(plane->pipe, IGT_CRTC_BACKGROUND, BLACK64);
> +	igt_crc_t plane_crc, bg_crc;
> +	struct igt_fb colorfb;
> +	igt_plane_t *plane = igt_output_get_plane_type(data->output,
> +						       DRM_PLANE_TYPE_PRIMARY);
> +
> +
> +	/* Fill the primary plane and set the background to the same color */
> +	igt_create_color_fb(data->gfx_fd, w, h, DRM_FORMAT_XRGB2101010,
> +			    LOCAL_DRM_FORMAT_MOD_NONE,
> +			    (double)r / 0xFFFF,
> +			    (double)g / 0xFFFF,
> +			    (double)b / 0xFFFF,
> +			    &colorfb);
> +	igt_plane_set_fb(plane, &colorfb);
> +	igt_pipe_set_prop_value(&data->display, pipe, IGT_CRTC_BACKGROUND,
> +				local_argb(16, 0xffff, r, g, b));
> +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
> +	igt_pipe_crc_collect_crc(data->pipe_crc, &plane_crc);
> +	igt_debug_wait_for_keypress("bgcolor");
> +
> +	/* Turn off the primary plane so only bg shows */
>  	igt_plane_set_fb(plane, NULL);
> -	igt_output_set_pipe(output, PIPE_ANY);
> -
> -	igt_display_commit2(display, COMMIT_UNIVERSAL);
> +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
> +	igt_pipe_crc_collect_crc(data->pipe_crc, &bg_crc);
> +	igt_debug_wait_for_keypress("bgcolor");
> +
> +	/*
> +	 * The following test relies on hardware that generates valid CRCs
> +	 * even when no planes are on.  Sadly, this doesn't appear to be the
> +	 * case for current Intel platforms; pipe CRC's never match bgcolor
> +	 * CRC's, likely because we're violating the bspec's guidance that there
> +	 * must always be at least one real plane turned on when taking the
> +	 * pipe-level ("dmux") CRC.
> +	 */
> +	igt_assert_crc_equal(&plane_crc, &bg_crc);
>  }
>  
> -static void test_crtc_background(data_t *data)
> +igt_main
>  {
> -	igt_display_t *display = &data->display;
> +	data_t data = {};
>  	igt_output_t *output;
> +	drmModeModeInfo *mode;
> +	int w, h;
>  	enum pipe pipe;
> -	int valid_tests = 0;
> -
> -	for_each_pipe_with_valid_output(display, pipe, output) {
> -		igt_plane_t *plane;
> -
> -		igt_output_set_pipe(output, pipe);
> -
> -		plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> -		igt_require(igt_pipe_has_prop(display, pipe, IGT_CRTC_BACKGROUND));
> -
> -		prepare_crtc(data, output, pipe, plane, 1, PURPLE, BLACK64);
> -
> -		/* Now set background without using a plane, i.e.,
> -		 * Disable the plane to let hw background color win blend. */
> -		igt_plane_set_fb(plane, NULL);
> -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, PURPLE64);
> -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> -
> -		/* Try few other background colors */
> -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, CYAN64);
> -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> -
> -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, YELLOW64);
> -		igt_display_commit2(display, COMMIT_UNIVERSAL);
>  
> -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, RED64);
> -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> +	igt_fixture {
> +		data.gfx_fd = drm_open_driver_master(DRIVER_ANY);
> +		kmstest_set_vt_graphics_mode();
>  
> -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, GREEN64);
> -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> -
> -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, BLUE64);
> -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> -
> -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, WHITE64);
> -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> -
> -		valid_tests++;
> -		cleanup_crtc(data, output, plane);
> +		igt_require_pipe_crc(data.gfx_fd);
> +		igt_display_require(&data.display, data.gfx_fd);
>  	}
> -	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
> -}
>  
> -igt_simple_main
> -{
> -	data_t data = {};
> -
> -	igt_skip_on_simulation();
> -
> -	data.gfx_fd = drm_open_driver(DRIVER_INTEL);
> -	igt_require_pipe_crc(data.gfx_fd);
> -	igt_display_require(&data.display, data.gfx_fd);
> -
> -	test_crtc_background(&data);
> +	for_each_pipe_static(pipe) igt_subtest_group {
> +		igt_fixture {
> +			igt_display_require_output_on_pipe(&data.display, pipe);
> +			igt_require(igt_pipe_has_prop(&data.display, pipe,
> +						      IGT_CRTC_BACKGROUND));
> +
> +			output = igt_get_single_output_for_pipe(&data.display,
> +								pipe);
> +			igt_output_set_pipe(output, pipe);
> +			data.output = output;
> +
> +			mode = igt_output_get_mode(output);
> +			w = mode->hdisplay;
> +			h = mode->vdisplay;
> +
> +			data.pipe_crc = igt_pipe_crc_new(data.gfx_fd, pipe,
> +							  INTEL_PIPE_CRC_SOURCE_AUTO);
> +		}
> +
> +		igt_subtest_f("background-color-pipe-%s-black",
> +			      kmstest_pipe_name(pipe))
> +			test_background(&data, pipe, w, h,
> +					0, 0, 0);
> +
> +		igt_subtest_f("background-color-pipe-%s-white",
> +			      kmstest_pipe_name(pipe))
> +			test_background(&data, pipe, w, h,
> +					0xFFFF, 0xFFFF, 0xFFFF);
> +
> +		igt_subtest_f("background-color-pipe-%s-red",
> +			      kmstest_pipe_name(pipe))
> +			test_background(&data, pipe, w, h,
> +					0xFFFF, 0, 0);
> +
> +		igt_subtest_f("background-color-pipe-%s-green",
> +			      kmstest_pipe_name(pipe))
> +
> +			test_background(&data, pipe, w, h,
> +					0, 0xFFFF, 0);
> +
> +		igt_subtest_f("background-color-pipe-%s-blue",
> +			      kmstest_pipe_name(pipe))
> +			test_background(&data, pipe, w, h,
> +					0, 0, 0xFFFF);
> +
> +		igt_fixture {
> +			igt_display_reset(&data.display);
> +			igt_pipe_crc_free(data.pipe_crc);
> +			data.pipe_crc = NULL;
> +		}
> +	}
>  
> -	igt_display_fini(&data.display);
> +	igt_fixture {
> +		igt_display_fini(&data.display);
> +	}
>  }
> 


[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 1795 bytes --]

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

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

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

* [igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1)
       [not found] <20190930224707.14904-1-matthew.d.roper@intel.com>
                   ` (2 preceding siblings ...)
  2019-09-30 23:53 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
@ 2019-10-01  8:13 ` Patchwork
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-10-01  8:13 UTC (permalink / raw)
  To: Matt Roper; +Cc: igt-dev

== Series Details ==

Series: tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1)
URL   : https://patchwork.freedesktop.org/series/67425/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6979_full -> IGTPW_3516_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_3516_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_3516_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/67425/revisions/1/mbox/

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_3516_full:

### IGT changes ###

#### Possible regressions ####

  * igt@gem_eio@in-flight-contexts-10ms:
    - shard-snb:          [PASS][1] -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-snb2/igt@gem_eio@in-flight-contexts-10ms.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-snb1/igt@gem_eio@in-flight-contexts-10ms.html

  * igt@gem_mmap_gtt@hang:
    - shard-glk:          [PASS][3] -> [DMESG-WARN][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-glk6/igt@gem_mmap_gtt@hang.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-glk3/igt@gem_mmap_gtt@hang.html

  
New tests
---------

  New tests have been introduced between CI_DRM_6979_full and IGTPW_3516_full:

### New IGT tests (15) ###

  * igt@kms_crtc_background_color@background-color-pipe-a-black:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-a-blue:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-a-green:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-a-red:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-a-white:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-b-black:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-b-blue:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-b-green:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-b-red:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-b-white:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-c-black:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-c-blue:
    - Statuses : 5 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-c-green:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-c-red:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_crtc_background_color@background-color-pipe-c-white:
    - Statuses : 6 skip(s)
    - Exec time: [0.0] s

  

Known issues
------------

  Here are the changes found in IGTPW_3516_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_isolation@vecs0-s3:
    - shard-iclb:         [PASS][5] -> [DMESG-WARN][6] ([fdo#111764])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb3/igt@gem_ctx_isolation@vecs0-s3.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb8/igt@gem_ctx_isolation@vecs0-s3.html

  * igt@gem_exec_balancer@nop:
    - shard-apl:          [PASS][7] -> [INCOMPLETE][8] ([fdo#103927]) +2 similar issues
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-apl8/igt@gem_exec_balancer@nop.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-apl2/igt@gem_exec_balancer@nop.html

  * igt@gem_exec_balancer@smoke:
    - shard-iclb:         [PASS][9] -> [SKIP][10] ([fdo#110854])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb2/igt@gem_exec_balancer@smoke.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb6/igt@gem_exec_balancer@smoke.html

  * igt@gem_exec_schedule@preempt-contexts-bsd2:
    - shard-iclb:         [PASS][11] -> [SKIP][12] ([fdo#109276]) +19 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb4/igt@gem_exec_schedule@preempt-contexts-bsd2.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb8/igt@gem_exec_schedule@preempt-contexts-bsd2.html

  * igt@gem_exec_schedule@preempt-other-chain-bsd:
    - shard-iclb:         [PASS][13] -> [SKIP][14] ([fdo#111325]) +3 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb5/igt@gem_exec_schedule@preempt-other-chain-bsd.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb1/igt@gem_exec_schedule@preempt-other-chain-bsd.html

  * igt@gem_tiled_pread_pwrite:
    - shard-iclb:         [PASS][15] -> [INCOMPLETE][16] ([fdo#107713] / [fdo#109100])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb4/igt@gem_tiled_pread_pwrite.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb1/igt@gem_tiled_pread_pwrite.html

  * igt@gem_userptr_blits@map-fixed-invalidate-busy:
    - shard-glk:          [PASS][17] -> [DMESG-WARN][18] ([fdo#111870]) +1 similar issue
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-glk5/igt@gem_userptr_blits@map-fixed-invalidate-busy.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-glk8/igt@gem_userptr_blits@map-fixed-invalidate-busy.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy:
    - shard-apl:          [PASS][19] -> [DMESG-WARN][20] ([fdo#109385] / [fdo#111870])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-apl3/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-apl6/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup:
    - shard-iclb:         [PASS][21] -> [DMESG-WARN][22] ([fdo#111870])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb8/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb7/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup.html

  * igt@gem_userptr_blits@sync-unmap:
    - shard-hsw:          [PASS][23] -> [DMESG-WARN][24] ([fdo#111870]) +1 similar issue
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-hsw7/igt@gem_userptr_blits@sync-unmap.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-hsw5/igt@gem_userptr_blits@sync-unmap.html

  * igt@gem_userptr_blits@sync-unmap-after-close:
    - shard-kbl:          [PASS][25] -> [DMESG-WARN][26] ([fdo#111870]) +1 similar issue
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-kbl2/igt@gem_userptr_blits@sync-unmap-after-close.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-kbl4/igt@gem_userptr_blits@sync-unmap-after-close.html
    - shard-snb:          [PASS][27] -> [DMESG-WARN][28] ([fdo#111870]) +1 similar issue
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-snb1/igt@gem_userptr_blits@sync-unmap-after-close.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-snb2/igt@gem_userptr_blits@sync-unmap-after-close.html

  * igt@kms_color@pipe-c-legacy-gamma:
    - shard-kbl:          [PASS][29] -> [FAIL][30] ([fdo#104782])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-kbl2/igt@kms_color@pipe-c-legacy-gamma.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-kbl2/igt@kms_color@pipe-c-legacy-gamma.html
    - shard-apl:          [PASS][31] -> [FAIL][32] ([fdo#104782])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-apl1/igt@kms_color@pipe-c-legacy-gamma.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-apl1/igt@kms_color@pipe-c-legacy-gamma.html
    - shard-glk:          [PASS][33] -> [FAIL][34] ([fdo#104782])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-glk9/igt@kms_color@pipe-c-legacy-gamma.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-glk2/igt@kms_color@pipe-c-legacy-gamma.html

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
    - shard-hsw:          [PASS][35] -> [FAIL][36] ([fdo#105767])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-hsw1/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-hsw1/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy.html

  * igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions-varying-size:
    - shard-hsw:          [PASS][37] -> [FAIL][38] ([fdo#103355])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-hsw5/igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions-varying-size.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-hsw1/igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions-varying-size.html

  * igt@kms_cursor_legacy@pipe-c-torture-bo:
    - shard-kbl:          [PASS][39] -> [DMESG-WARN][40] ([fdo#107122])
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-kbl1/igt@kms_cursor_legacy@pipe-c-torture-bo.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-kbl4/igt@kms_cursor_legacy@pipe-c-torture-bo.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-apl:          [PASS][41] -> [DMESG-WARN][42] ([fdo#108566]) +1 similar issue
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-apl7/igt@kms_flip@flip-vs-suspend-interruptible.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-apl4/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite:
    - shard-iclb:         [PASS][43] -> [FAIL][44] ([fdo#103167]) +10 similar issues
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb6/igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite.html

  * igt@kms_psr@psr2_sprite_plane_move:
    - shard-iclb:         [PASS][45] -> [SKIP][46] ([fdo#109441]) +1 similar issue
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb5/igt@kms_psr@psr2_sprite_plane_move.html

  * igt@kms_psr@suspend:
    - shard-iclb:         [PASS][47] -> [INCOMPLETE][48] ([fdo#107713])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb1/igt@kms_psr@suspend.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb7/igt@kms_psr@suspend.html

  
#### Possible fixes ####

  * igt@gem_close@many-handles-one-vma:
    - shard-snb:          [INCOMPLETE][49] ([fdo#105411]) -> [PASS][50]
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-snb5/igt@gem_close@many-handles-one-vma.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-snb6/igt@gem_close@many-handles-one-vma.html

  * igt@gem_eio@unwedge-stress:
    - shard-snb:          [FAIL][51] ([fdo#109661]) -> [PASS][52]
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-snb4/igt@gem_eio@unwedge-stress.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-snb1/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_schedule@preempt-queue-bsd1:
    - shard-iclb:         [SKIP][53] ([fdo#109276]) -> [PASS][54] +12 similar issues
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb5/igt@gem_exec_schedule@preempt-queue-bsd1.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb2/igt@gem_exec_schedule@preempt-queue-bsd1.html

  * igt@gem_exec_schedule@wide-bsd:
    - shard-iclb:         [SKIP][55] ([fdo#111325]) -> [PASS][56] +2 similar issues
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb2/igt@gem_exec_schedule@wide-bsd.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb5/igt@gem_exec_schedule@wide-bsd.html

  * igt@gem_userptr_blits@coherency-sync:
    - shard-hsw:          [DMESG-WARN][57] ([fdo#111870]) -> [PASS][58] +1 similar issue
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-hsw1/igt@gem_userptr_blits@coherency-sync.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-hsw4/igt@gem_userptr_blits@coherency-sync.html

  * igt@gem_userptr_blits@dmabuf-sync:
    - shard-glk:          [DMESG-WARN][59] ([fdo#111870]) -> [PASS][60]
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-glk3/igt@gem_userptr_blits@dmabuf-sync.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-glk4/igt@gem_userptr_blits@dmabuf-sync.html

  * igt@gem_userptr_blits@map-fixed-invalidate-busy:
    - shard-snb:          [DMESG-WARN][61] ([fdo#111870]) -> [PASS][62] +1 similar issue
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-snb1/igt@gem_userptr_blits@map-fixed-invalidate-busy.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-snb1/igt@gem_userptr_blits@map-fixed-invalidate-busy.html
    - shard-kbl:          [DMESG-WARN][63] ([fdo#111870]) -> [PASS][64] +1 similar issue
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-kbl7/igt@gem_userptr_blits@map-fixed-invalidate-busy.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-kbl4/igt@gem_userptr_blits@map-fixed-invalidate-busy.html

  * igt@gem_userptr_blits@sync-unmap:
    - shard-iclb:         [DMESG-WARN][65] ([fdo#111870]) -> [PASS][66]
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb8/igt@gem_userptr_blits@sync-unmap.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb6/igt@gem_userptr_blits@sync-unmap.html

  * igt@i915_pm_rpm@system-suspend-modeset:
    - shard-apl:          [INCOMPLETE][67] ([fdo#103927]) -> [PASS][68] +1 similar issue
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-apl3/igt@i915_pm_rpm@system-suspend-modeset.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-apl1/igt@i915_pm_rpm@system-suspend-modeset.html

  * igt@i915_selftest@live_gem_contexts:
    - shard-hsw:          [DMESG-FAIL][69] ([fdo#111692]) -> [PASS][70]
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-hsw4/igt@i915_selftest@live_gem_contexts.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-hsw5/igt@i915_selftest@live_gem_contexts.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render:
    - shard-iclb:         [FAIL][71] ([fdo#103167]) -> [PASS][72] +3 similar issues
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb8/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb3/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render.html

  * igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-render:
    - shard-iclb:         [INCOMPLETE][73] ([fdo#107713]) -> [PASS][74]
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-render.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-render.html

  * igt@kms_frontbuffer_tracking@fbc-suspend:
    - shard-apl:          [DMESG-WARN][75] ([fdo#108566]) -> [PASS][76] +6 similar issues
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-apl4/igt@kms_frontbuffer_tracking@fbc-suspend.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-apl4/igt@kms_frontbuffer_tracking@fbc-suspend.html

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
    - shard-kbl:          [INCOMPLETE][77] ([fdo#103665]) -> [PASS][78]
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-kbl3/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-kbl4/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes.html

  * igt@kms_plane_lowres@pipe-a-tiling-y:
    - shard-iclb:         [FAIL][79] ([fdo#103166]) -> [PASS][80]
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb6/igt@kms_plane_lowres@pipe-a-tiling-y.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb6/igt@kms_plane_lowres@pipe-a-tiling-y.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [SKIP][81] ([fdo#109441]) -> [PASS][82]
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb1/igt@kms_psr@psr2_primary_mmap_cpu.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_vblank@pipe-b-query-forked-hang:
    - shard-hsw:          [INCOMPLETE][83] ([fdo#103540]) -> [PASS][84]
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-hsw8/igt@kms_vblank@pipe-b-query-forked-hang.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-hsw1/igt@kms_vblank@pipe-b-query-forked-hang.html

  * igt@perf@short-reads:
    - shard-kbl:          [FAIL][85] ([fdo#103183]) -> [PASS][86]
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-kbl1/igt@perf@short-reads.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-kbl1/igt@perf@short-reads.html

  
#### Warnings ####

  * igt@gem_ctx_isolation@vcs1-nonpriv:
    - shard-iclb:         [FAIL][87] ([fdo#111329]) -> [SKIP][88] ([fdo#109276])
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb4/igt@gem_ctx_isolation@vcs1-nonpriv.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb6/igt@gem_ctx_isolation@vcs1-nonpriv.html

  * igt@gem_mocs_settings@mocs-reset-bsd2:
    - shard-iclb:         [FAIL][89] ([fdo#111330]) -> [SKIP][90] ([fdo#109276]) +1 similar issue
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb1/igt@gem_mocs_settings@mocs-reset-bsd2.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-iclb6/igt@gem_mocs_settings@mocs-reset-bsd2.html

  * igt@gem_userptr_blits@map-fixed-invalidate-busy-gup:
    - shard-apl:          [DMESG-WARN][91] ([fdo#109385]) -> [DMESG-WARN][92] ([fdo#109385] / [fdo#111870]) +1 similar issue
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-apl7/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/shard-apl2/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html

  
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103183]: https://bugs.freedesktop.org/show_bug.cgi?id=103183
  [fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
  [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
  [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
  [fdo#107122]: https://bugs.freedesktop.org/show_bug.cgi?id=107122
  [fdo#1

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3516/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1)
  2019-10-01  2:18   ` Martin Peres
@ 2019-10-01 12:27     ` Ville Syrjälä
  2019-10-09 15:43       ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Ville Syrjälä @ 2019-10-01 12:27 UTC (permalink / raw)
  To: Martin Peres; +Cc: igt-dev, intel-gfx, dri-devel

On Mon, Sep 30, 2019 at 10:18:17PM -0400, Martin Peres wrote:
> On 30/09/2019 19:13, Matt Roper wrote:
> > CRTC background color kernel patches were written about 2.5 years ago
> > and floated on the upstream mailing list, but since no opensource
> > userspace materialized, we never actually merged them.  However the
> > corresponding IGT test did get merged and has basically been dead code
> > ever since.
> > 
> > A couple years later we finally have an open source userspace
> > (ChromeOS), so lets update the IGT test to match the ABI that's actually
> > going upstream and to remove some of the cruft from the original test
> > that wouldn't actually work.
> > 
> > It's worth noting that CRC's don't seem to work properly on Intel gen9.
> > The bspec does tell us that we must have one plane enabled before taking
> > a pipe-level ("dmux") CRC, so this test is violating that by disabling
> > all planes; it's quite possible that this is the source of the CRC
> > mismatch.  If running on an Intel platform, you may want to run in
> > interactive mode ("--interactive-debug=bgcolor --skip-crc-compare") to
> > ensure that the colors being generated actually do match visually since
> > the CRC's can't be trusted.
> 
> Hmm, landing a feature without automating testing for it is a bit too
> much to ask IMO.
> 
> I have two proposals to make it happen:
> 
> - Could we add a workaround for the affected intel platforms? If the
> problem really is because no planes are enabled, then surely a
> fully-transparent plane would be a sufficient workaround.

Just have to make sure that plane is the cursor since the blending
fail on the universal planes.

> 
> - If CRCs really cannot be used for this, then we should use the
> chamelium for it. The idea would be to detect if the connector is
> connected to a chamelium, and if so use chamelium's CRC.

Third option would be to use the port crc instead.

> 
> How does this sound?
> 
> Martin
> 
> > 
> > v2:
> >  - Swap red and blue ordering in property value to reflect change
> >    in v2 of kernel series.
> > 
> > v3:
> >  - Minor updates to proposed uapi helpers (s/rgba/argb/).
> > 
> > v4:
> >  - General restructuring into pipe/color subtests.
> >  - Use RGB2101010 framebuffers for comparison so that we match the bits
> >    of precision that Intel hardware background color accepts
> > 
> > v5:
> >  - Re-enable CRC comparisons; just because these don't work on Intel
> >    doesn't mean we shouldn't use them on other vendors' platforms
> >    (Daniel).
> >  - Use DRIVER_ANY rather than DRIVER_INTEL. (Heiko Stuebner)
> > 
> > v5.1:
> >  - Update commit message body discussion of CRC issues.
> > 
> > Cc: igt-dev@lists.freedesktop.org
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Heiko Stuebner <heiko@sntech.de>
> > Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> > ---
> >  lib/igt_kms.c                     |   2 +-
> >  tests/kms_crtc_background_color.c | 263 ++++++++++++++----------------
> >  2 files changed, 127 insertions(+), 138 deletions(-)
> > 
> > diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> > index e9b80b9b..9a7f0e23 100644
> > --- a/lib/igt_kms.c
> > +++ b/lib/igt_kms.c
> > @@ -391,7 +391,7 @@ const char * const igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
> >  };
> >  
> >  const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
> > -	[IGT_CRTC_BACKGROUND] = "background_color",
> > +	[IGT_CRTC_BACKGROUND] = "BACKGROUND_COLOR",
> >  	[IGT_CRTC_CTM] = "CTM",
> >  	[IGT_CRTC_GAMMA_LUT] = "GAMMA_LUT",
> >  	[IGT_CRTC_GAMMA_LUT_SIZE] = "GAMMA_LUT_SIZE",
> > diff --git a/tests/kms_crtc_background_color.c b/tests/kms_crtc_background_color.c
> > index 3df3401f..58cdd7a9 100644
> > --- a/tests/kms_crtc_background_color.c
> > +++ b/tests/kms_crtc_background_color.c
> > @@ -25,164 +25,153 @@
> >  #include "igt.h"
> >  #include <math.h>
> >  
> > -
> >  IGT_TEST_DESCRIPTION("Test crtc background color feature");
> >  
> > +/*
> > + * Paints a desired color into a full-screen primary plane and then compares
> > + * that CRC with turning off all planes and setting the CRTC background to the
> > + * same color.
> > + *
> > + * At least on current Intel platforms, the CRC tests appear to always fail,
> > + * even though the resulting pipe output seems to be the same.  The bspec tells
> > + * us that we must have at least one plane turned on when taking a pipe-level
> > + * CRC, so the fact that we're violating that may explain the failures.  If
> > + * your platform gives failures for all tests, you may want to run with
> > + * --interactive-debug=bgcolor --skip-crc-compare to visually inspect that the
> > + * background color matches the equivalent solid plane.
> > + */
> > +
> >  typedef struct {
> > -	int gfx_fd;
> >  	igt_display_t display;
> > -	struct igt_fb fb;
> > -	igt_crc_t ref_crc;
> > +	int gfx_fd;
> > +	igt_output_t *output;
> >  	igt_pipe_crc_t *pipe_crc;
> > +	drmModeModeInfo *mode;
> >  } data_t;
> >  
> > -#define BLACK      0x000000           /* BGR 8bpc */
> > -#define CYAN       0xFFFF00           /* BGR 8bpc */
> > -#define PURPLE     0xFF00FF           /* BGR 8bpc */
> > -#define WHITE      0xFFFFFF           /* BGR 8bpc */
> > -
> > -#define BLACK64    0x000000000000     /* BGR 16bpc */
> > -#define CYAN64     0xFFFFFFFF0000     /* BGR 16bpc */
> > -#define PURPLE64   0xFFFF0000FFFF     /* BGR 16bpc */
> > -#define YELLOW64   0x0000FFFFFFFF     /* BGR 16bpc */
> > -#define WHITE64    0xFFFFFFFFFFFF     /* BGR 16bpc */
> > -#define RED64      0x00000000FFFF     /* BGR 16bpc */
> > -#define GREEN64    0x0000FFFF0000     /* BGR 16bpc */
> > -#define BLUE64     0xFFFF00000000     /* BGR 16bpc */
> > -
> > -static void
> > -paint_background(data_t *data, struct igt_fb *fb, drmModeModeInfo *mode,
> > -		uint32_t background, double alpha)
> > +/*
> > + * Local copy of kernel uapi
> > + */
> > +static inline __u64
> > +local_argb(__u8 bpc, __u16 alpha, __u16 red, __u16 green, __u16 blue)
> >  {
> > -	cairo_t *cr;
> > -	int w, h;
> > -	double r, g, b;
> > -
> > -	w = mode->hdisplay;
> > -	h = mode->vdisplay;
> > -
> > -	cr = igt_get_cairo_ctx(data->gfx_fd, &data->fb);
> > +       int msb_shift = 16 - bpc;
> >  
> > -	/* Paint with background color */
> > -	r = (double) (background & 0xFF) / 255.0;
> > -	g = (double) ((background & 0xFF00) >> 8) / 255.0;
> > -	b = (double) ((background & 0xFF0000) >> 16) / 255.0;
> > -	igt_paint_color_alpha(cr, 0, 0, w, h, r, g, b, alpha);
> > -
> > -	igt_put_cairo_ctx(data->gfx_fd, &data->fb, cr);
> > +       return (__u64)alpha << msb_shift << 48 |
> > +              (__u64)red   << msb_shift << 32 |
> > +              (__u64)green << msb_shift << 16 |
> > +              (__u64)blue  << msb_shift;
> >  }
> >  
> > -static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
> > -			igt_plane_t *plane, int opaque_buffer, int plane_color,
> > -			uint64_t pipe_background_color)
> > +static void test_background(data_t *data, enum pipe pipe, int w, int h,
> > +			    __u64 r, __u64 g, __u64 b)
> >  {
> > -	drmModeModeInfo *mode;
> > -	igt_display_t *display = &data->display;
> > -	int fb_id;
> > -	double alpha;
> > -
> > -	igt_output_set_pipe(output, pipe);
> > -
> > -	/* create the pipe_crc object for this pipe */
> > -	igt_pipe_crc_free(data->pipe_crc);
> > -	data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
> > -
> > -	mode = igt_output_get_mode(output);
> > -
> > -	fb_id = igt_create_fb(data->gfx_fd,
> > -			mode->hdisplay, mode->vdisplay,
> > -			DRM_FORMAT_XRGB8888,
> > -			LOCAL_DRM_FORMAT_MOD_NONE, /* tiled */
> > -			&data->fb);
> > -	igt_assert(fb_id);
> > -
> > -	/* To make FB pixel win with background color, set alpha as full opaque */
> > -	igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, pipe_background_color);
> > -	if (opaque_buffer)
> > -		alpha = 1.0;    /* alpha 1 is fully opque */
> > -	else
> > -		alpha = 0.0;    /* alpha 0 is fully transparent */
> > -	paint_background(data, &data->fb, mode, plane_color, alpha);
> > -
> > -	igt_plane_set_fb(plane, &data->fb);
> > -	igt_display_commit2(display, COMMIT_UNIVERSAL);
> > -}
> > -
> > -static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
> > -{
> > -	igt_display_t *display = &data->display;
> > -
> > -	igt_pipe_crc_free(data->pipe_crc);
> > -	data->pipe_crc = NULL;
> > -
> > -	igt_remove_fb(data->gfx_fd, &data->fb);
> > -
> > -	igt_pipe_obj_set_prop_value(plane->pipe, IGT_CRTC_BACKGROUND, BLACK64);
> > +	igt_crc_t plane_crc, bg_crc;
> > +	struct igt_fb colorfb;
> > +	igt_plane_t *plane = igt_output_get_plane_type(data->output,
> > +						       DRM_PLANE_TYPE_PRIMARY);
> > +
> > +
> > +	/* Fill the primary plane and set the background to the same color */
> > +	igt_create_color_fb(data->gfx_fd, w, h, DRM_FORMAT_XRGB2101010,
> > +			    LOCAL_DRM_FORMAT_MOD_NONE,
> > +			    (double)r / 0xFFFF,
> > +			    (double)g / 0xFFFF,
> > +			    (double)b / 0xFFFF,
> > +			    &colorfb);
> > +	igt_plane_set_fb(plane, &colorfb);
> > +	igt_pipe_set_prop_value(&data->display, pipe, IGT_CRTC_BACKGROUND,
> > +				local_argb(16, 0xffff, r, g, b));
> > +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
> > +	igt_pipe_crc_collect_crc(data->pipe_crc, &plane_crc);
> > +	igt_debug_wait_for_keypress("bgcolor");
> > +
> > +	/* Turn off the primary plane so only bg shows */
> >  	igt_plane_set_fb(plane, NULL);
> > -	igt_output_set_pipe(output, PIPE_ANY);
> > -
> > -	igt_display_commit2(display, COMMIT_UNIVERSAL);
> > +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
> > +	igt_pipe_crc_collect_crc(data->pipe_crc, &bg_crc);
> > +	igt_debug_wait_for_keypress("bgcolor");
> > +
> > +	/*
> > +	 * The following test relies on hardware that generates valid CRCs
> > +	 * even when no planes are on.  Sadly, this doesn't appear to be the
> > +	 * case for current Intel platforms; pipe CRC's never match bgcolor
> > +	 * CRC's, likely because we're violating the bspec's guidance that there
> > +	 * must always be at least one real plane turned on when taking the
> > +	 * pipe-level ("dmux") CRC.
> > +	 */
> > +	igt_assert_crc_equal(&plane_crc, &bg_crc);
> >  }
> >  
> > -static void test_crtc_background(data_t *data)
> > +igt_main
> >  {
> > -	igt_display_t *display = &data->display;
> > +	data_t data = {};
> >  	igt_output_t *output;
> > +	drmModeModeInfo *mode;
> > +	int w, h;
> >  	enum pipe pipe;
> > -	int valid_tests = 0;
> > -
> > -	for_each_pipe_with_valid_output(display, pipe, output) {
> > -		igt_plane_t *plane;
> > -
> > -		igt_output_set_pipe(output, pipe);
> > -
> > -		plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> > -		igt_require(igt_pipe_has_prop(display, pipe, IGT_CRTC_BACKGROUND));
> > -
> > -		prepare_crtc(data, output, pipe, plane, 1, PURPLE, BLACK64);
> > -
> > -		/* Now set background without using a plane, i.e.,
> > -		 * Disable the plane to let hw background color win blend. */
> > -		igt_plane_set_fb(plane, NULL);
> > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, PURPLE64);
> > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > -
> > -		/* Try few other background colors */
> > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, CYAN64);
> > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > -
> > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, YELLOW64);
> > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> >  
> > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, RED64);
> > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > +	igt_fixture {
> > +		data.gfx_fd = drm_open_driver_master(DRIVER_ANY);
> > +		kmstest_set_vt_graphics_mode();
> >  
> > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, GREEN64);
> > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > -
> > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, BLUE64);
> > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > -
> > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, WHITE64);
> > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > -
> > -		valid_tests++;
> > -		cleanup_crtc(data, output, plane);
> > +		igt_require_pipe_crc(data.gfx_fd);
> > +		igt_display_require(&data.display, data.gfx_fd);
> >  	}
> > -	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
> > -}
> >  
> > -igt_simple_main
> > -{
> > -	data_t data = {};
> > -
> > -	igt_skip_on_simulation();
> > -
> > -	data.gfx_fd = drm_open_driver(DRIVER_INTEL);
> > -	igt_require_pipe_crc(data.gfx_fd);
> > -	igt_display_require(&data.display, data.gfx_fd);
> > -
> > -	test_crtc_background(&data);
> > +	for_each_pipe_static(pipe) igt_subtest_group {
> > +		igt_fixture {
> > +			igt_display_require_output_on_pipe(&data.display, pipe);
> > +			igt_require(igt_pipe_has_prop(&data.display, pipe,
> > +						      IGT_CRTC_BACKGROUND));
> > +
> > +			output = igt_get_single_output_for_pipe(&data.display,
> > +								pipe);
> > +			igt_output_set_pipe(output, pipe);
> > +			data.output = output;
> > +
> > +			mode = igt_output_get_mode(output);
> > +			w = mode->hdisplay;
> > +			h = mode->vdisplay;
> > +
> > +			data.pipe_crc = igt_pipe_crc_new(data.gfx_fd, pipe,
> > +							  INTEL_PIPE_CRC_SOURCE_AUTO);
> > +		}
> > +
> > +		igt_subtest_f("background-color-pipe-%s-black",
> > +			      kmstest_pipe_name(pipe))
> > +			test_background(&data, pipe, w, h,
> > +					0, 0, 0);
> > +
> > +		igt_subtest_f("background-color-pipe-%s-white",
> > +			      kmstest_pipe_name(pipe))
> > +			test_background(&data, pipe, w, h,
> > +					0xFFFF, 0xFFFF, 0xFFFF);
> > +
> > +		igt_subtest_f("background-color-pipe-%s-red",
> > +			      kmstest_pipe_name(pipe))
> > +			test_background(&data, pipe, w, h,
> > +					0xFFFF, 0, 0);
> > +
> > +		igt_subtest_f("background-color-pipe-%s-green",
> > +			      kmstest_pipe_name(pipe))
> > +
> > +			test_background(&data, pipe, w, h,
> > +					0, 0xFFFF, 0);
> > +
> > +		igt_subtest_f("background-color-pipe-%s-blue",
> > +			      kmstest_pipe_name(pipe))
> > +			test_background(&data, pipe, w, h,
> > +					0, 0, 0xFFFF);
> > +
> > +		igt_fixture {
> > +			igt_display_reset(&data.display);
> > +			igt_pipe_crc_free(data.pipe_crc);
> > +			data.pipe_crc = NULL;
> > +		}
> > +	}
> >  
> > -	igt_display_fini(&data.display);
> > +	igt_fixture {
> > +		igt_display_fini(&data.display);
> > +	}
> >  }
> > 
> 

[-- Error: unable to create PGP subprocess! --]

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


-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1)
  2019-10-01 12:27     ` Ville Syrjälä
@ 2019-10-09 15:43       ` Daniel Vetter
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2019-10-09 15:43 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev, Martin Peres, intel-gfx, dri-devel

On Tue, Oct 01, 2019 at 03:27:41PM +0300, Ville Syrjälä wrote:
> On Mon, Sep 30, 2019 at 10:18:17PM -0400, Martin Peres wrote:
> > On 30/09/2019 19:13, Matt Roper wrote:
> > > CRTC background color kernel patches were written about 2.5 years ago
> > > and floated on the upstream mailing list, but since no opensource
> > > userspace materialized, we never actually merged them.  However the
> > > corresponding IGT test did get merged and has basically been dead code
> > > ever since.
> > > 
> > > A couple years later we finally have an open source userspace
> > > (ChromeOS), so lets update the IGT test to match the ABI that's actually
> > > going upstream and to remove some of the cruft from the original test
> > > that wouldn't actually work.
> > > 
> > > It's worth noting that CRC's don't seem to work properly on Intel gen9.
> > > The bspec does tell us that we must have one plane enabled before taking
> > > a pipe-level ("dmux") CRC, so this test is violating that by disabling
> > > all planes; it's quite possible that this is the source of the CRC
> > > mismatch.  If running on an Intel platform, you may want to run in
> > > interactive mode ("--interactive-debug=bgcolor --skip-crc-compare") to
> > > ensure that the colors being generated actually do match visually since
> > > the CRC's can't be trusted.
> > 
> > Hmm, landing a feature without automating testing for it is a bit too
> > much to ask IMO.
> > 
> > I have two proposals to make it happen:
> > 
> > - Could we add a workaround for the affected intel platforms? If the
> > problem really is because no planes are enabled, then surely a
> > fully-transparent plane would be a sufficient workaround.
> 
> Just have to make sure that plane is the cursor since the blending
> fail on the universal planes.
> 
> > 
> > - If CRCs really cannot be used for this, then we should use the
> > chamelium for it. The idea would be to detect if the connector is
> > connected to a chamelium, and if so use chamelium's CRC.
> 
> Third option would be to use the port crc instead.

Yeah that might be a w/a, we're using that on gen4 already for some ports.
We'd have to use these port crcs always though, since we can't tell
upfront whether the testcase is testing the background color.
-Daniel

> 
> > 
> > How does this sound?
> > 
> > Martin
> > 
> > > 
> > > v2:
> > >  - Swap red and blue ordering in property value to reflect change
> > >    in v2 of kernel series.
> > > 
> > > v3:
> > >  - Minor updates to proposed uapi helpers (s/rgba/argb/).
> > > 
> > > v4:
> > >  - General restructuring into pipe/color subtests.
> > >  - Use RGB2101010 framebuffers for comparison so that we match the bits
> > >    of precision that Intel hardware background color accepts
> > > 
> > > v5:
> > >  - Re-enable CRC comparisons; just because these don't work on Intel
> > >    doesn't mean we shouldn't use them on other vendors' platforms
> > >    (Daniel).
> > >  - Use DRIVER_ANY rather than DRIVER_INTEL. (Heiko Stuebner)
> > > 
> > > v5.1:
> > >  - Update commit message body discussion of CRC issues.
> > > 
> > > Cc: igt-dev@lists.freedesktop.org
> > > Cc: Daniel Vetter <daniel@ffwll.ch>
> > > Cc: Heiko Stuebner <heiko@sntech.de>
> > > Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> > > ---
> > >  lib/igt_kms.c                     |   2 +-
> > >  tests/kms_crtc_background_color.c | 263 ++++++++++++++----------------
> > >  2 files changed, 127 insertions(+), 138 deletions(-)
> > > 
> > > diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> > > index e9b80b9b..9a7f0e23 100644
> > > --- a/lib/igt_kms.c
> > > +++ b/lib/igt_kms.c
> > > @@ -391,7 +391,7 @@ const char * const igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
> > >  };
> > >  
> > >  const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
> > > -	[IGT_CRTC_BACKGROUND] = "background_color",
> > > +	[IGT_CRTC_BACKGROUND] = "BACKGROUND_COLOR",
> > >  	[IGT_CRTC_CTM] = "CTM",
> > >  	[IGT_CRTC_GAMMA_LUT] = "GAMMA_LUT",
> > >  	[IGT_CRTC_GAMMA_LUT_SIZE] = "GAMMA_LUT_SIZE",
> > > diff --git a/tests/kms_crtc_background_color.c b/tests/kms_crtc_background_color.c
> > > index 3df3401f..58cdd7a9 100644
> > > --- a/tests/kms_crtc_background_color.c
> > > +++ b/tests/kms_crtc_background_color.c
> > > @@ -25,164 +25,153 @@
> > >  #include "igt.h"
> > >  #include <math.h>
> > >  
> > > -
> > >  IGT_TEST_DESCRIPTION("Test crtc background color feature");
> > >  
> > > +/*
> > > + * Paints a desired color into a full-screen primary plane and then compares
> > > + * that CRC with turning off all planes and setting the CRTC background to the
> > > + * same color.
> > > + *
> > > + * At least on current Intel platforms, the CRC tests appear to always fail,
> > > + * even though the resulting pipe output seems to be the same.  The bspec tells
> > > + * us that we must have at least one plane turned on when taking a pipe-level
> > > + * CRC, so the fact that we're violating that may explain the failures.  If
> > > + * your platform gives failures for all tests, you may want to run with
> > > + * --interactive-debug=bgcolor --skip-crc-compare to visually inspect that the
> > > + * background color matches the equivalent solid plane.
> > > + */
> > > +
> > >  typedef struct {
> > > -	int gfx_fd;
> > >  	igt_display_t display;
> > > -	struct igt_fb fb;
> > > -	igt_crc_t ref_crc;
> > > +	int gfx_fd;
> > > +	igt_output_t *output;
> > >  	igt_pipe_crc_t *pipe_crc;
> > > +	drmModeModeInfo *mode;
> > >  } data_t;
> > >  
> > > -#define BLACK      0x000000           /* BGR 8bpc */
> > > -#define CYAN       0xFFFF00           /* BGR 8bpc */
> > > -#define PURPLE     0xFF00FF           /* BGR 8bpc */
> > > -#define WHITE      0xFFFFFF           /* BGR 8bpc */
> > > -
> > > -#define BLACK64    0x000000000000     /* BGR 16bpc */
> > > -#define CYAN64     0xFFFFFFFF0000     /* BGR 16bpc */
> > > -#define PURPLE64   0xFFFF0000FFFF     /* BGR 16bpc */
> > > -#define YELLOW64   0x0000FFFFFFFF     /* BGR 16bpc */
> > > -#define WHITE64    0xFFFFFFFFFFFF     /* BGR 16bpc */
> > > -#define RED64      0x00000000FFFF     /* BGR 16bpc */
> > > -#define GREEN64    0x0000FFFF0000     /* BGR 16bpc */
> > > -#define BLUE64     0xFFFF00000000     /* BGR 16bpc */
> > > -
> > > -static void
> > > -paint_background(data_t *data, struct igt_fb *fb, drmModeModeInfo *mode,
> > > -		uint32_t background, double alpha)
> > > +/*
> > > + * Local copy of kernel uapi
> > > + */
> > > +static inline __u64
> > > +local_argb(__u8 bpc, __u16 alpha, __u16 red, __u16 green, __u16 blue)
> > >  {
> > > -	cairo_t *cr;
> > > -	int w, h;
> > > -	double r, g, b;
> > > -
> > > -	w = mode->hdisplay;
> > > -	h = mode->vdisplay;
> > > -
> > > -	cr = igt_get_cairo_ctx(data->gfx_fd, &data->fb);
> > > +       int msb_shift = 16 - bpc;
> > >  
> > > -	/* Paint with background color */
> > > -	r = (double) (background & 0xFF) / 255.0;
> > > -	g = (double) ((background & 0xFF00) >> 8) / 255.0;
> > > -	b = (double) ((background & 0xFF0000) >> 16) / 255.0;
> > > -	igt_paint_color_alpha(cr, 0, 0, w, h, r, g, b, alpha);
> > > -
> > > -	igt_put_cairo_ctx(data->gfx_fd, &data->fb, cr);
> > > +       return (__u64)alpha << msb_shift << 48 |
> > > +              (__u64)red   << msb_shift << 32 |
> > > +              (__u64)green << msb_shift << 16 |
> > > +              (__u64)blue  << msb_shift;
> > >  }
> > >  
> > > -static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
> > > -			igt_plane_t *plane, int opaque_buffer, int plane_color,
> > > -			uint64_t pipe_background_color)
> > > +static void test_background(data_t *data, enum pipe pipe, int w, int h,
> > > +			    __u64 r, __u64 g, __u64 b)
> > >  {
> > > -	drmModeModeInfo *mode;
> > > -	igt_display_t *display = &data->display;
> > > -	int fb_id;
> > > -	double alpha;
> > > -
> > > -	igt_output_set_pipe(output, pipe);
> > > -
> > > -	/* create the pipe_crc object for this pipe */
> > > -	igt_pipe_crc_free(data->pipe_crc);
> > > -	data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
> > > -
> > > -	mode = igt_output_get_mode(output);
> > > -
> > > -	fb_id = igt_create_fb(data->gfx_fd,
> > > -			mode->hdisplay, mode->vdisplay,
> > > -			DRM_FORMAT_XRGB8888,
> > > -			LOCAL_DRM_FORMAT_MOD_NONE, /* tiled */
> > > -			&data->fb);
> > > -	igt_assert(fb_id);
> > > -
> > > -	/* To make FB pixel win with background color, set alpha as full opaque */
> > > -	igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, pipe_background_color);
> > > -	if (opaque_buffer)
> > > -		alpha = 1.0;    /* alpha 1 is fully opque */
> > > -	else
> > > -		alpha = 0.0;    /* alpha 0 is fully transparent */
> > > -	paint_background(data, &data->fb, mode, plane_color, alpha);
> > > -
> > > -	igt_plane_set_fb(plane, &data->fb);
> > > -	igt_display_commit2(display, COMMIT_UNIVERSAL);
> > > -}
> > > -
> > > -static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
> > > -{
> > > -	igt_display_t *display = &data->display;
> > > -
> > > -	igt_pipe_crc_free(data->pipe_crc);
> > > -	data->pipe_crc = NULL;
> > > -
> > > -	igt_remove_fb(data->gfx_fd, &data->fb);
> > > -
> > > -	igt_pipe_obj_set_prop_value(plane->pipe, IGT_CRTC_BACKGROUND, BLACK64);
> > > +	igt_crc_t plane_crc, bg_crc;
> > > +	struct igt_fb colorfb;
> > > +	igt_plane_t *plane = igt_output_get_plane_type(data->output,
> > > +						       DRM_PLANE_TYPE_PRIMARY);
> > > +
> > > +
> > > +	/* Fill the primary plane and set the background to the same color */
> > > +	igt_create_color_fb(data->gfx_fd, w, h, DRM_FORMAT_XRGB2101010,
> > > +			    LOCAL_DRM_FORMAT_MOD_NONE,
> > > +			    (double)r / 0xFFFF,
> > > +			    (double)g / 0xFFFF,
> > > +			    (double)b / 0xFFFF,
> > > +			    &colorfb);
> > > +	igt_plane_set_fb(plane, &colorfb);
> > > +	igt_pipe_set_prop_value(&data->display, pipe, IGT_CRTC_BACKGROUND,
> > > +				local_argb(16, 0xffff, r, g, b));
> > > +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
> > > +	igt_pipe_crc_collect_crc(data->pipe_crc, &plane_crc);
> > > +	igt_debug_wait_for_keypress("bgcolor");
> > > +
> > > +	/* Turn off the primary plane so only bg shows */
> > >  	igt_plane_set_fb(plane, NULL);
> > > -	igt_output_set_pipe(output, PIPE_ANY);
> > > -
> > > -	igt_display_commit2(display, COMMIT_UNIVERSAL);
> > > +	igt_display_commit2(&data->display, COMMIT_ATOMIC);
> > > +	igt_pipe_crc_collect_crc(data->pipe_crc, &bg_crc);
> > > +	igt_debug_wait_for_keypress("bgcolor");
> > > +
> > > +	/*
> > > +	 * The following test relies on hardware that generates valid CRCs
> > > +	 * even when no planes are on.  Sadly, this doesn't appear to be the
> > > +	 * case for current Intel platforms; pipe CRC's never match bgcolor
> > > +	 * CRC's, likely because we're violating the bspec's guidance that there
> > > +	 * must always be at least one real plane turned on when taking the
> > > +	 * pipe-level ("dmux") CRC.
> > > +	 */
> > > +	igt_assert_crc_equal(&plane_crc, &bg_crc);
> > >  }
> > >  
> > > -static void test_crtc_background(data_t *data)
> > > +igt_main
> > >  {
> > > -	igt_display_t *display = &data->display;
> > > +	data_t data = {};
> > >  	igt_output_t *output;
> > > +	drmModeModeInfo *mode;
> > > +	int w, h;
> > >  	enum pipe pipe;
> > > -	int valid_tests = 0;
> > > -
> > > -	for_each_pipe_with_valid_output(display, pipe, output) {
> > > -		igt_plane_t *plane;
> > > -
> > > -		igt_output_set_pipe(output, pipe);
> > > -
> > > -		plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> > > -		igt_require(igt_pipe_has_prop(display, pipe, IGT_CRTC_BACKGROUND));
> > > -
> > > -		prepare_crtc(data, output, pipe, plane, 1, PURPLE, BLACK64);
> > > -
> > > -		/* Now set background without using a plane, i.e.,
> > > -		 * Disable the plane to let hw background color win blend. */
> > > -		igt_plane_set_fb(plane, NULL);
> > > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, PURPLE64);
> > > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > > -
> > > -		/* Try few other background colors */
> > > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, CYAN64);
> > > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > > -
> > > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, YELLOW64);
> > > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > >  
> > > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, RED64);
> > > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > > +	igt_fixture {
> > > +		data.gfx_fd = drm_open_driver_master(DRIVER_ANY);
> > > +		kmstest_set_vt_graphics_mode();
> > >  
> > > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, GREEN64);
> > > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > > -
> > > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, BLUE64);
> > > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > > -
> > > -		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND, WHITE64);
> > > -		igt_display_commit2(display, COMMIT_UNIVERSAL);
> > > -
> > > -		valid_tests++;
> > > -		cleanup_crtc(data, output, plane);
> > > +		igt_require_pipe_crc(data.gfx_fd);
> > > +		igt_display_require(&data.display, data.gfx_fd);
> > >  	}
> > > -	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
> > > -}
> > >  
> > > -igt_simple_main
> > > -{
> > > -	data_t data = {};
> > > -
> > > -	igt_skip_on_simulation();
> > > -
> > > -	data.gfx_fd = drm_open_driver(DRIVER_INTEL);
> > > -	igt_require_pipe_crc(data.gfx_fd);
> > > -	igt_display_require(&data.display, data.gfx_fd);
> > > -
> > > -	test_crtc_background(&data);
> > > +	for_each_pipe_static(pipe) igt_subtest_group {
> > > +		igt_fixture {
> > > +			igt_display_require_output_on_pipe(&data.display, pipe);
> > > +			igt_require(igt_pipe_has_prop(&data.display, pipe,
> > > +						      IGT_CRTC_BACKGROUND));
> > > +
> > > +			output = igt_get_single_output_for_pipe(&data.display,
> > > +								pipe);
> > > +			igt_output_set_pipe(output, pipe);
> > > +			data.output = output;
> > > +
> > > +			mode = igt_output_get_mode(output);
> > > +			w = mode->hdisplay;
> > > +			h = mode->vdisplay;
> > > +
> > > +			data.pipe_crc = igt_pipe_crc_new(data.gfx_fd, pipe,
> > > +							  INTEL_PIPE_CRC_SOURCE_AUTO);
> > > +		}
> > > +
> > > +		igt_subtest_f("background-color-pipe-%s-black",
> > > +			      kmstest_pipe_name(pipe))
> > > +			test_background(&data, pipe, w, h,
> > > +					0, 0, 0);
> > > +
> > > +		igt_subtest_f("background-color-pipe-%s-white",
> > > +			      kmstest_pipe_name(pipe))
> > > +			test_background(&data, pipe, w, h,
> > > +					0xFFFF, 0xFFFF, 0xFFFF);
> > > +
> > > +		igt_subtest_f("background-color-pipe-%s-red",
> > > +			      kmstest_pipe_name(pipe))
> > > +			test_background(&data, pipe, w, h,
> > > +					0xFFFF, 0, 0);
> > > +
> > > +		igt_subtest_f("background-color-pipe-%s-green",
> > > +			      kmstest_pipe_name(pipe))
> > > +
> > > +			test_background(&data, pipe, w, h,
> > > +					0, 0xFFFF, 0);
> > > +
> > > +		igt_subtest_f("background-color-pipe-%s-blue",
> > > +			      kmstest_pipe_name(pipe))
> > > +			test_background(&data, pipe, w, h,
> > > +					0, 0, 0xFFFF);
> > > +
> > > +		igt_fixture {
> > > +			igt_display_reset(&data.display);
> > > +			igt_pipe_crc_free(data.pipe_crc);
> > > +			data.pipe_crc = NULL;
> > > +		}
> > > +	}
> > >  
> > > -	igt_display_fini(&data.display);
> > > +	igt_fixture {
> > > +		igt_display_fini(&data.display);
> > > +	}
> > >  }
> > > 
> > 
> 
> [-- Error: unable to create PGP subprocess! --]
> 
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> 
> -- 
> Ville Syrjälä
> Intel
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-10-09 15:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20190930224707.14904-1-matthew.d.roper@intel.com>
2019-09-30 23:13 ` [igt-dev] [PATCH i-g-t] tests/kms_crtc_background_color: overhaul to match upstream ABI (v5.1) Matt Roper
2019-10-01  2:18   ` Martin Peres
2019-10-01 12:27     ` Ville Syrjälä
2019-10-09 15:43       ` Daniel Vetter
2019-09-30 23:46 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
2019-09-30 23:53 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-10-01  8:13 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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 NNTP newsgroup(s).