All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch
@ 2019-12-31 13:21 Swati Sharma
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 1/7] headers: Bump drm uapi headers Swati Sharma
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Swati Sharma @ 2019-12-31 13:21 UTC (permalink / raw)
  To: igt-dev

This series contains tests to validate HDR metadata interfaces
and bpc switch test cases (8bpc<->10bpc).
Minor changes are made in the original patch series 
https://patchwork.freedesktop.org/patch/255755/

Changes made to the original series:
*Current version is made compatible for both amd and intel driver,
earlier it could be used by amd driver only.
*No assumption is made regarding output. Tests will execute on
all availabe outputs, since there is no ROI to execute
tests on all the pipes; tests will execute on single pipe.
*To make tests generic, moved tests from tests/amdgpu/amd_hdr.c to
tests/kms_hdr.c.
*Also, splitted the hdr igt into multiple patches so that subtests
can be easily reviewed.
*Renaming of functions, addition of new flags, igt_describe()

As per current design, test will execute on all the attached
monitors even if its non-HDR because we haven't exposed any property
from kernel to tell userspace whether monitor is hdr or not.
TODO: Either expose debugfs entry (or) parse edid in IGT to know
      whether monitor supports hdr

Also, amd exposes max_bpc as a debugfs entry..so it's asserted for their
driver. i915 drives misses that.
TODO: Expose max_bpc as debugfs entry in i915 driver too, if required.

Nicholas Kazlauskas (7):
  headers: Bump drm uapi headers
  lib/igt_kms: Add max bpc connector property
  lib/igt_kms: Add HDR_OUTPUT_METADATA connector property
  tests/kms_hdr: Add bpc switch subtests
  tests/kms_hdr: Add static toggle SDR->HDR mode subtests
  tests/kms_hdr: Add subtest to validate HDR mode using luminance sensor
  tests/kms_hdr: Add subtest to swap static HDR metadata

 include/drm-uapi/drm_mode.h | 121 +++++-
 lib/igt_kms.c               |   6 +
 lib/igt_kms.h               |   2 +
 tests/Makefile.sources      |   1 +
 tests/kms_hdr.c             | 839 ++++++++++++++++++++++++++++++++++++
 tests/meson.build           |   1 +
 6 files changed, 968 insertions(+), 2 deletions(-)
 create mode 100644 tests/kms_hdr.c

-- 
2.24.1

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

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

* [igt-dev] [PATCH i-g-t 1/7] headers: Bump drm uapi headers
  2019-12-31 13:21 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
@ 2019-12-31 13:21 ` Swati Sharma
  2020-01-14 14:26   ` Shankar, Uma
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 2/7] lib/igt_kms: Add max bpc connector property Swati Sharma
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Swati Sharma @ 2019-12-31 13:21 UTC (permalink / raw)
  To: igt-dev

From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Updating them to the latest version from drm-next for HDR static
metadata uapi structures:

Commit: a09db883e5d9 ("drm: Fix docbook warnings in hdr metadata helper structures")

v2: Bumped to latest drm-next headers

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
 include/drm-uapi/drm_mode.h | 121 +++++++++++++++++++++++++++++++++++-
 1 file changed, 119 insertions(+), 2 deletions(-)

diff --git a/include/drm-uapi/drm_mode.h b/include/drm-uapi/drm_mode.h
index a439c2e6..5ab331e5 100644
--- a/include/drm-uapi/drm_mode.h
+++ b/include/drm-uapi/drm_mode.h
@@ -33,7 +33,15 @@
 extern "C" {
 #endif
 
-#define DRM_DISPLAY_INFO_LEN	32
+/**
+ * DOC: overview
+ *
+ * DRM exposes many UAPI and structure definition to have a consistent
+ * and standardized interface with user.
+ * Userspace can refer to these structure definitions and UAPI formats
+ * to communicate to driver
+ */
+
 #define DRM_CONNECTOR_NAME_LEN	32
 #define DRM_DISPLAY_MODE_LEN	32
 #define DRM_PROP_NAME_LEN	32
@@ -622,7 +630,8 @@ struct drm_color_ctm {
 
 struct drm_color_lut {
 	/*
-	 * Data is U0.16 fixed point format.
+	 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
+	 * 0xffff == 1.0.
 	 */
 	__u16 red;
 	__u16 green;
@@ -630,6 +639,92 @@ struct drm_color_lut {
 	__u16 reserved;
 };
 
+/**
+ * struct hdr_metadata_infoframe - HDR Metadata Infoframe Data.
+ *
+ * HDR Metadata Infoframe as per CTA 861.G spec. This is expected
+ * to match exactly with the spec.
+ *
+ * Userspace is expected to pass the metadata information as per
+ * the format described in this structure.
+ */
+struct hdr_metadata_infoframe {
+	/**
+	 * @eotf: Electro-Optical Transfer Function (EOTF)
+	 * used in the stream.
+	 */
+	__u8 eotf;
+	/**
+	 * @metadata_type: Static_Metadata_Descriptor_ID.
+	 */
+	__u8 metadata_type;
+	/**
+	 * @display_primaries: Color Primaries of the Data.
+	 * These are coded as unsigned 16-bit values in units of
+	 * 0.00002, where 0x0000 represents zero and 0xC350
+	 * represents 1.0000.
+	 * @display_primaries.x: X cordinate of color primary.
+	 * @display_primaries.y: Y cordinate of color primary.
+	 */
+	struct {
+		__u16 x, y;
+		} display_primaries[3];
+	/**
+	 * @white_point: White Point of Colorspace Data.
+	 * These are coded as unsigned 16-bit values in units of
+	 * 0.00002, where 0x0000 represents zero and 0xC350
+	 * represents 1.0000.
+	 * @white_point.x: X cordinate of whitepoint of color primary.
+	 * @white_point.y: Y cordinate of whitepoint of color primary.
+	 */
+	struct {
+		__u16 x, y;
+		} white_point;
+	/**
+	 * @max_display_mastering_luminance: Max Mastering Display Luminance.
+	 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
+	 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
+	 */
+	__u16 max_display_mastering_luminance;
+	/**
+	 * @min_display_mastering_luminance: Min Mastering Display Luminance.
+	 * This value is coded as an unsigned 16-bit value in units of
+	 * 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF
+	 * represents 6.5535 cd/m2.
+	 */
+	__u16 min_display_mastering_luminance;
+	/**
+	 * @max_cll: Max Content Light Level.
+	 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
+	 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
+	 */
+	__u16 max_cll;
+	/**
+	 * @max_fall: Max Frame Average Light Level.
+	 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
+	 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
+	 */
+	__u16 max_fall;
+};
+
+/**
+ * struct hdr_output_metadata - HDR output metadata
+ *
+ * Metadata Information to be passed from userspace
+ */
+struct hdr_output_metadata {
+	/**
+	 * @metadata_type: Static_Metadata_Descriptor_ID.
+	 */
+	__u32 metadata_type;
+	/**
+	 * @hdmi_metadata_type1: HDR Metadata Infoframe.
+	 */
+	union {
+		struct hdr_metadata_infoframe hdmi_metadata_type1;
+	};
+};
+
 #define DRM_MODE_PAGE_FLIP_EVENT 0x01
 #define DRM_MODE_PAGE_FLIP_ASYNC 0x02
 #define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
@@ -803,6 +898,10 @@ struct drm_format_modifier {
 };
 
 /**
+ * struct drm_mode_create_blob - Create New block property
+ * @data: Pointer to data to copy.
+ * @length: Length of data to copy.
+ * @blob_id: new property ID.
  * Create a new 'blob' data property, copying length bytes from data pointer,
  * and returning new blob ID.
  */
@@ -816,6 +915,8 @@ struct drm_mode_create_blob {
 };
 
 /**
+ * struct drm_mode_destroy_blob - Destroy user blob
+ * @blob_id: blob_id to destroy
  * Destroy a user-created blob property.
  */
 struct drm_mode_destroy_blob {
@@ -823,6 +924,12 @@ struct drm_mode_destroy_blob {
 };
 
 /**
+ * struct drm_mode_create_lease - Create lease
+ * @object_ids: Pointer to array of object ids.
+ * @object_count: Number of object ids.
+ * @flags: flags for new FD.
+ * @lessee_id: unique identifier for lessee.
+ * @fd: file descriptor to new drm_master file.
  * Lease mode resources, creating another drm_master.
  */
 struct drm_mode_create_lease {
@@ -840,6 +947,10 @@ struct drm_mode_create_lease {
 };
 
 /**
+ * struct drm_mode_list_lessees - List lessees
+ * @count_lessees: Number of lessees.
+ * @pad: pad.
+ * @lessees_ptr: Pointer to lessess.
  * List lesses from a drm_master
  */
 struct drm_mode_list_lessees {
@@ -860,6 +971,10 @@ struct drm_mode_list_lessees {
 };
 
 /**
+ * struct drm_mode_get_lease - Get Lease
+ * @count_objects: Number of leased objects.
+ * @pad: pad.
+ * @objects_ptr: Pointer to objects.
  * Get leased objects
  */
 struct drm_mode_get_lease {
@@ -880,6 +995,8 @@ struct drm_mode_get_lease {
 };
 
 /**
+ * struct drm_mode_revoke_lease - Revoke lease
+ * @lessee_id: Unique ID of lessee.
  * Revoke lease
  */
 struct drm_mode_revoke_lease {
-- 
2.24.1

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

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

* [igt-dev] [PATCH i-g-t 2/7] lib/igt_kms: Add max bpc connector property
  2019-12-31 13:21 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 1/7] headers: Bump drm uapi headers Swati Sharma
@ 2019-12-31 13:21 ` Swati Sharma
  2020-01-14 14:30   ` Shankar, Uma
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA " Swati Sharma
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Swati Sharma @ 2019-12-31 13:21 UTC (permalink / raw)
  To: igt-dev

From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

It's been in DRM for a while but was never added to IGT's internal list.

This property should be reset along with other properties between tests
since output color depth can affect CRC calculation... but it's not
really feasible since it's driver specific for what the value should
be reset to.

v2: rebase
v3: rebase

Cc: Leo Li <sunpeng.li@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 lib/igt_kms.c | 1 +
 lib/igt_kms.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d20daaad..b0b064c9 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -416,6 +416,7 @@ const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 	[IGT_CONNECTOR_VRR_CAPABLE] = "vrr_capable",
 	[IGT_CONNECTOR_HDCP_CONTENT_TYPE] = "HDCP Content Type",
 	[IGT_CONNECTOR_LINK_STATUS] = "link-status",
+	[IGT_CONNECTOR_MAX_BPC] = "max bpc",
 };
 
 /*
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 6c919e92..36077d41 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -125,6 +125,7 @@ enum igt_atomic_connector_properties {
        IGT_CONNECTOR_VRR_CAPABLE,
        IGT_CONNECTOR_HDCP_CONTENT_TYPE,
        IGT_CONNECTOR_LINK_STATUS,
+       IGT_CONNECTOR_MAX_BPC,
        IGT_NUM_CONNECTOR_PROPS
 };
 
-- 
2.24.1

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

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

* [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA connector property
  2019-12-31 13:21 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 1/7] headers: Bump drm uapi headers Swati Sharma
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 2/7] lib/igt_kms: Add max bpc connector property Swati Sharma
@ 2019-12-31 13:21 ` Swati Sharma
  2020-01-08  9:33   ` Petri Latvala
  2020-01-14 14:32   ` Shankar, Uma
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 4/7] tests/kms_hdr: Add bpc switch subtests Swati Sharma
                   ` (5 subsequent siblings)
  8 siblings, 2 replies; 24+ messages in thread
From: Swati Sharma @ 2019-12-31 13:21 UTC (permalink / raw)
  To: igt-dev

From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

...and also reset it when resetting outputs since that can definitely
affect CRC output on other tests when not reset.

v2: rebase
v3: rebase

Cc: Leo Li <sunpeng.li@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 lib/igt_kms.c | 5 +++++
 lib/igt_kms.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index b0b064c9..de7472cd 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -417,6 +417,7 @@ const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 	[IGT_CONNECTOR_HDCP_CONTENT_TYPE] = "HDCP Content Type",
 	[IGT_CONNECTOR_LINK_STATUS] = "link-status",
 	[IGT_CONNECTOR_MAX_BPC] = "max bpc",
+	[IGT_CONNECTOR_HDR_OUTPUT_METADATA] = "HDR_OUTPUT_METADATA",
 };
 
 /*
@@ -1794,6 +1795,10 @@ static void igt_output_reset(igt_output_t *output)
 	if (igt_output_has_prop(output, IGT_CONNECTOR_CONTENT_PROTECTION))
 		igt_output_set_prop_enum(output, IGT_CONNECTOR_CONTENT_PROTECTION,
 					 "Undesired");
+
+	if (igt_output_has_prop(output, IGT_CONNECTOR_HDR_OUTPUT_METADATA))
+		igt_output_set_prop_value(output,
+					  IGT_CONNECTOR_HDR_OUTPUT_METADATA, 0);
 }
 
 /**
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 36077d41..4766bfce 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -126,6 +126,7 @@ enum igt_atomic_connector_properties {
        IGT_CONNECTOR_HDCP_CONTENT_TYPE,
        IGT_CONNECTOR_LINK_STATUS,
        IGT_CONNECTOR_MAX_BPC,
+       IGT_CONNECTOR_HDR_OUTPUT_METADATA,
        IGT_NUM_CONNECTOR_PROPS
 };
 
-- 
2.24.1

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

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

* [igt-dev] [PATCH i-g-t 4/7] tests/kms_hdr: Add bpc switch subtests
  2019-12-31 13:21 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
                   ` (2 preceding siblings ...)
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA " Swati Sharma
@ 2019-12-31 13:21 ` Swati Sharma
  2020-01-14 14:51   ` Shankar, Uma
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 5/7] tests/kms_hdr: Add static toggle SDR->HDR mode subtests Swati Sharma
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Swati Sharma @ 2019-12-31 13:21 UTC (permalink / raw)
  To: igt-dev

From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Add subtests to validate transitions between 8bpc and 10bpc. Test is
made compatible for both amd and intel drivers. The test requires
the "output_bpc" debugfs entry to read current and maximum bpc.
This is exposed by amd driver, however intel driver doesn't expose it,
so made that restriction to assert output bpc only for amd driver.

Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/Makefile.sources |   1 +
 tests/kms_hdr.c        | 292 +++++++++++++++++++++++++++++++++++++++++
 tests/meson.build      |   1 +
 3 files changed, 294 insertions(+)
 create mode 100644 tests/kms_hdr.c

diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 2893f9bc..e8fcddf5 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -55,6 +55,7 @@ TESTS_progs = \
 	kms_frontbuffer_tracking \
 	kms_getfb \
 	kms_hdmi_inject \
+	kms_hdr \
 	kms_invalid_dotclock \
 	kms_lease \
 	kms_legacy_colorkey \
diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
new file mode 100644
index 00000000..212d246d
--- /dev/null
+++ b/tests/kms_hdr.c
@@ -0,0 +1,292 @@
+/*
+ * Copyright 2019 Advanced Micro Devices, 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 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
+ */
+
+#include "igt.h"
+#include <fcntl.h>
+#include <termios.h>
+#include <unistd.h>
+
+IGT_TEST_DESCRIPTION("Test HDR metadata interfaces and bpc switch");
+
+/* Test flags. */
+enum {
+	TEST_NONE = 0,
+	TEST_DPMS = 1 << 0,
+	TEST_SUSPEND = 1 << 1,
+};
+
+/* BPC connector state. */
+typedef struct output_bpc {
+	unsigned int current;
+	unsigned int maximum;
+} output_bpc_t;
+
+/* Common test data. */
+typedef struct data {
+	igt_display_t display;
+	igt_plane_t *primary;
+	igt_output_t *output;
+	igt_pipe_t *pipe;
+	igt_pipe_crc_t *pipe_crc;
+	drmModeModeInfo *mode;
+	enum pipe pipe_id;
+	int fd;
+	int w;
+	int h;
+} data_t;
+
+/* Common test cleanup. */
+static void test_fini(data_t *data)
+{
+	igt_pipe_crc_free(data->pipe_crc);
+	igt_display_reset(&data->display);
+}
+
+static void test_cycle_flags(data_t *data, uint32_t test_flags)
+{
+	if (test_flags & TEST_DPMS) {
+		kmstest_set_connector_dpms(data->fd,
+					   data->output->config.connector,
+					   DRM_MODE_DPMS_OFF);
+		kmstest_set_connector_dpms(data->fd,
+					   data->output->config.connector,
+					   DRM_MODE_DPMS_ON);
+	}
+
+	if (test_flags & TEST_SUSPEND)
+		igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
+					      SUSPEND_TEST_NONE);
+}
+
+/* Returns the current and maximum bpc from the connector debugfs. */
+static output_bpc_t get_output_bpc(data_t *data)
+{
+	char buf[256];
+	char *start_loc;
+	int fd, res;
+	output_bpc_t info;
+
+	fd = igt_debugfs_connector_dir(data->fd, data->output->name, O_RDONLY);
+	igt_assert(fd >= 0);
+
+	res = igt_debugfs_simple_read(fd, "output_bpc", buf, sizeof(buf));
+
+	igt_require(res > 0);
+
+	close(fd);
+
+	igt_assert(start_loc = strstr(buf, "Current: "));
+	igt_assert_eq(sscanf(start_loc, "Current: %u", &info.current), 1);
+
+	igt_assert(start_loc = strstr(buf, "Maximum: "));
+	igt_assert_eq(sscanf(start_loc, "Maximum: %u", &info.maximum), 1);
+
+	return info;
+}
+
+/* Verifies that connector has the correct output bpc. */
+static void assert_output_bpc(data_t *data, unsigned int bpc)
+{
+	output_bpc_t info = get_output_bpc(data);
+
+	igt_require_f(info.maximum >= bpc,
+		      "Monitor doesn't support %u bpc, max is %u\n", bpc,
+		      info.maximum);
+
+	igt_assert_eq(info.current, bpc);
+}
+
+/* Fills the FB with a test HDR pattern. */
+static void draw_hdr_pattern(igt_fb_t *fb)
+{
+	cairo_t *cr = igt_get_cairo_ctx(fb->fd, fb);
+
+	igt_paint_color(cr, 0, 0, fb->width, fb->height, 1.0, 1.0, 1.0);
+	igt_paint_test_pattern(cr, fb->width, fb->height);
+
+	igt_put_cairo_ctx(fb->fd, fb, cr);
+}
+
+/* Prepare test data. */
+static void prepare_test(data_t *data, igt_output_t *output, enum pipe pipe)
+{
+	igt_display_t *display = &data->display;
+
+        data->pipe_id = pipe;
+	data->pipe = &data->display.pipes[data->pipe_id];
+	igt_assert(data->pipe);
+
+	igt_display_reset(display);
+
+	data->output = output;
+	igt_assert(data->output);
+
+	data->mode = igt_output_get_mode(data->output);
+	igt_assert(data->mode);
+
+	data->primary =
+		igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_PRIMARY);
+
+	data->pipe_crc = igt_pipe_crc_new(data->fd, data->pipe_id,
+					  INTEL_PIPE_CRC_SOURCE_AUTO);
+
+	igt_output_set_pipe(data->output, data->pipe_id);
+
+	data->w = data->mode->hdisplay;
+	data->h = data->mode->vdisplay;
+}
+
+static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
+{
+	int i;
+
+	for (i = 0; i < display->n_outputs; i++)
+		if (display->outputs[i].pending_pipe == pipe)
+			return false;
+
+	return true;
+}
+
+static void test_bpc_switch_on_output(data_t *data, igt_output_t *output,
+				      uint32_t flags)
+{
+	igt_display_t *display = &data->display;
+	igt_crc_t ref_crc, new_crc;
+	enum pipe pipe;
+	igt_fb_t afb;
+	int afb_id;
+
+	for_each_pipe(display, pipe) {
+		if (!igt_pipe_connector_valid(pipe, output))
+			continue;
+
+		/*
+		 * If previous subtest of connector failed, pipe
+		 * attached to that connector is not released.
+		 * Because of that we have to choose the non
+		 * attached pipe for this subtest.
+		 */
+		if (!igt_pipe_is_free(display, pipe))
+			continue;
+
+		prepare_test(data, output, pipe);
+
+		/* 10-bit formats are slow, so limit the size. */
+		afb_id = igt_create_fb(data->fd, 512, 512, DRM_FORMAT_XRGB2101010, 0, &afb);
+		igt_assert(afb_id);
+
+		draw_hdr_pattern(&afb);
+
+		/* Start in 8bpc. */
+		igt_plane_set_fb(data->primary, &afb);
+		igt_plane_set_size(data->primary, data->w, data->h);
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		/*
+		 * i915 driver doesn't expose max bpc as debugfs entry,
+		 * so limiting assert only for amd driver.
+		 */
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 8);
+
+		/* Switch to 10bpc. */
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 10);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 10);
+
+		/* Verify that the CRC are equal after DPMS or suspend. */
+		igt_pipe_crc_collect_crc(data->pipe_crc, &ref_crc);
+		test_cycle_flags(data, flags);
+		igt_pipe_crc_collect_crc(data->pipe_crc, &new_crc);
+
+		/* Drop back to 8bpc. */
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 8);
+
+		/* CRC capture is clamped to 8bpc, so capture should match. */
+		igt_assert_crc_equal(&ref_crc, &new_crc);
+
+		test_fini(data);
+		igt_remove_fb(data->fd, &afb);
+
+		/*
+		 * Testing a output with a pipe is enough for HDR
+		 * testing. No ROI in testing the connector with other
+		 * pipes. So break the loop on pipe.
+		 */
+		break;
+	}
+}
+
+/* Returns true if an output supports max bpc property */
+static bool has_max_bpc(igt_output_t *output)
+{
+	return igt_output_has_prop(output, IGT_CONNECTOR_MAX_BPC) &&
+	       igt_output_get_prop(output, IGT_CONNECTOR_MAX_BPC);
+}
+
+static void test_bpc_switch(data_t *data, uint32_t flags)
+{
+	igt_output_t *output;
+	int valid_tests = 0;
+
+	for_each_connected_output(&data->display, output) {
+		if (!has_max_bpc(output))
+			continue;
+
+		igt_info("BPC switch test execution on %s\n", output->name);
+		test_bpc_switch_on_output(data, output, flags);
+		valid_tests++;
+	}
+
+	igt_require_f(valid_tests, "No connector found with MAX BPC connector property\n");
+}
+
+igt_main
+{
+	data_t data = { 0 };
+
+	igt_fixture {
+		data.fd = drm_open_driver_master(DRIVER_AMDGPU | DRIVER_INTEL);
+
+		kmstest_set_vt_graphics_mode();
+
+		igt_display_require(&data.display, data.fd);
+		igt_require(data.display.is_atomic);
+
+		igt_display_require_output(&data.display);
+	}
+
+	igt_describe("Tests switching between different display output bpc modes");
+	igt_subtest("bpc-switch") test_bpc_switch(&data, TEST_NONE);
+	igt_describe("Tests bpc switch with dpms");
+	igt_subtest("bpc-switch-dpms") test_bpc_switch(&data, TEST_DPMS);
+	igt_describe("Tests bpc switch with suspend");
+	igt_subtest("bpc-switch-suspend") test_bpc_switch(&data, TEST_SUSPEND);
+
+	igt_fixture {
+		igt_display_fini(&data.display);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index d931cc37..eed5e38f 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -39,6 +39,7 @@ test_progs = [
 	'kms_frontbuffer_tracking',
 	'kms_getfb',
 	'kms_hdmi_inject',
+	'kms_hdr',
 	'kms_invalid_dotclock',
 	'kms_lease',
 	'kms_legacy_colorkey',
-- 
2.24.1

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

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

* [igt-dev] [PATCH i-g-t 5/7] tests/kms_hdr: Add static toggle SDR->HDR mode subtests
  2019-12-31 13:21 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
                   ` (3 preceding siblings ...)
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 4/7] tests/kms_hdr: Add bpc switch subtests Swati Sharma
@ 2019-12-31 13:21 ` Swati Sharma
  2020-01-14 14:59   ` Shankar, Uma
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 6/7] tests/kms_hdr: Add subtest to validate HDR mode using luminance sensor Swati Sharma
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Swati Sharma @ 2019-12-31 13:21 UTC (permalink / raw)
  To: igt-dev

From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Add subtests to toggle between SDR to HDR mode with suspend
and dpms scenarios. Tests are made compatible for both amd
and intel drivers.

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/kms_hdr.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 167 insertions(+)

diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
index 212d246d..dfd377b5 100644
--- a/tests/kms_hdr.c
+++ b/tests/kms_hdr.c
@@ -27,6 +27,18 @@
 
 IGT_TEST_DESCRIPTION("Test HDR metadata interfaces and bpc switch");
 
+/* DRM HDR definitions. Not in the UAPI header, unfortunately. */
+
+enum hdmi_metadata_type {
+	HDMI_STATIC_METADATA_TYPE1 = 1,
+};
+
+enum hdmi_eotf {
+	HDMI_EOTF_TRADITIONAL_GAMMA_SDR,
+	HDMI_EOTF_TRADITIONAL_GAMMA_HDR,
+	HDMI_EOTF_SMPTE_ST2084,
+};
+
 /* Test flags. */
 enum {
 	TEST_NONE = 0,
@@ -264,6 +276,154 @@ static void test_bpc_switch(data_t *data, uint32_t flags)
 	igt_require_f(valid_tests, "No connector found with MAX BPC connector property\n");
 }
 
+/* Sets the HDR output metadata prop. */
+static void set_hdr_output_metadata(data_t *data,
+				    struct hdr_output_metadata const *meta)
+{
+	igt_output_replace_prop_blob(data->output,
+				     IGT_CONNECTOR_HDR_OUTPUT_METADATA, meta,
+				     meta ? sizeof(*meta) : 0);
+}
+
+/* Converts a double to 861-G spec FP format. */
+static uint16_t calc_hdr_float(double val)
+{
+	return (uint16_t)(val * 50000.0);
+}
+
+/* Fills some test values for ST2048 HDR output metadata.
+ *
+ * Note: there isn't really a standard for what the metadata is supposed
+ * to do on the display side of things. The display is free to ignore it
+ * and clip the output, use it to help tonemap to the content range,
+ * or do anything they want, really.
+ */
+static void fill_hdr_output_metadata_st2048(struct hdr_output_metadata *meta)
+{
+	memset(meta, 0, sizeof(*meta));
+
+	meta->metadata_type = HDMI_STATIC_METADATA_TYPE1;
+	meta->hdmi_metadata_type1.eotf = HDMI_EOTF_SMPTE_ST2084;
+
+	/* Rec. 2020 */
+	meta->hdmi_metadata_type1.display_primaries[0].x =
+		calc_hdr_float(0.708); /* Red */
+	meta->hdmi_metadata_type1.display_primaries[0].y =
+		calc_hdr_float(0.292);
+	meta->hdmi_metadata_type1.display_primaries[1].x =
+		calc_hdr_float(0.170); /* Green */
+	meta->hdmi_metadata_type1.display_primaries[1].y =
+		calc_hdr_float(0.797);
+	meta->hdmi_metadata_type1.display_primaries[2].x =
+		calc_hdr_float(0.131); /* Blue */
+	meta->hdmi_metadata_type1.display_primaries[2].y =
+		calc_hdr_float(0.046);
+	meta->hdmi_metadata_type1.white_point.x = calc_hdr_float(0.3127);
+	meta->hdmi_metadata_type1.white_point.y = calc_hdr_float(0.3290);
+
+	meta->hdmi_metadata_type1.max_display_mastering_luminance =
+		1000; /* 1000 nits */
+	meta->hdmi_metadata_type1.min_display_mastering_luminance =
+		500;				   /* 0.05 nits */
+	meta->hdmi_metadata_type1.max_fall = 1000; /* 1000 nits */
+	meta->hdmi_metadata_type1.max_cll = 500;   /* 500 nits */
+}
+
+static void test_static_toggle(data_t *data, igt_output_t *output,
+			       uint32_t flags)
+{
+	igt_display_t *display = &data->display;
+	struct hdr_output_metadata hdr;
+	igt_crc_t ref_crc, new_crc;
+	enum pipe pipe;
+	igt_fb_t afb;
+	int afb_id;
+
+	for_each_pipe(display, pipe) {
+		if (!igt_pipe_connector_valid(pipe, output))
+			continue;
+
+		if (!igt_pipe_is_free(display, pipe))
+			continue;
+
+		prepare_test(data, output, pipe);
+
+		/* 10-bit formats are slow, so limit the size. */
+		afb_id = igt_create_fb(data->fd, 512, 512, DRM_FORMAT_XRGB2101010, 0, &afb);
+		igt_assert(afb_id);
+
+		draw_hdr_pattern(&afb);
+
+		fill_hdr_output_metadata_st2048(&hdr);
+
+		/* Start with no metadata. */
+		igt_plane_set_fb(data->primary, &afb);
+		igt_plane_set_size(data->primary, data->w, data->h);
+		set_hdr_output_metadata(data, NULL);
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 8);
+
+		/* Apply HDR metadata and 10bpc. We expect a modeset for entering. */
+		set_hdr_output_metadata(data, &hdr);
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 10);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 10);
+
+		/* Verify that the CRC are equal after DPMS or suspend. */
+		igt_pipe_crc_collect_crc(data->pipe_crc, &ref_crc);
+		test_cycle_flags(data, flags);
+		igt_pipe_crc_collect_crc(data->pipe_crc, &new_crc);
+
+		/* Disable HDR metadata and drop back to 8bpc. We expect a modeset for exiting. */
+		set_hdr_output_metadata(data, NULL);
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 8);
+
+		igt_assert_crc_equal(&ref_crc, &new_crc);
+
+		test_fini(data);
+		igt_remove_fb(data->fd, &afb);
+
+		break;
+	}
+}
+
+/* Returns true if an output supports hdr metadata property */
+static bool has_hdr(igt_output_t *output)
+{
+	return igt_output_has_prop(output, IGT_CONNECTOR_HDR_OUTPUT_METADATA);
+}
+
+static void test_hdr(data_t *data, const char *test_name, uint32_t flags)
+{
+	igt_output_t *output;
+	int valid_tests = 0;
+
+	for_each_connected_output(&data->display, output) {
+		/* To test HDR, 10 bpc is required, so we need to
+		 * set MAX_BPC property to 10bpc prior to setting
+		 * HDR metadata property. Therefore, checking.
+		 */
+		if (!has_max_bpc(output))
+			continue;
+
+		if (!has_hdr(output))
+			continue;
+
+		igt_info("HDR %s test execution on %s\n", test_name, output->name);
+		if (flags & TEST_NONE || flags & TEST_DPMS || flags & TEST_SUSPEND)
+			test_static_toggle(data, output, flags);
+		valid_tests++;
+	}
+
+	igt_require_f(valid_tests, "No connector found with HDR metadata/MAX BPC connector property\n");
+}
+
 igt_main
 {
 	data_t data = { 0 };
@@ -286,6 +446,13 @@ igt_main
 	igt_describe("Tests bpc switch with suspend");
 	igt_subtest("bpc-switch-suspend") test_bpc_switch(&data, TEST_SUSPEND);
 
+	igt_describe("Tests entering and exiting HDR mode");
+	igt_subtest("static-toggle") test_hdr(&data, "static-toggle", TEST_NONE);
+	igt_describe("Tests static toggle with dpms");
+	igt_subtest("static-toggle-dpms") test_hdr(&data, "static-toggle-dpms", TEST_DPMS);
+	igt_describe("Tests static toggle with suspend");
+	igt_subtest("static-toggle-suspend") test_hdr(&data, "static-toggle-suspend", TEST_SUSPEND);
+
 	igt_fixture {
 		igt_display_fini(&data.display);
 	}
-- 
2.24.1

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

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

* [igt-dev] [PATCH i-g-t 6/7] tests/kms_hdr: Add subtest to validate HDR mode using luminance sensor
  2019-12-31 13:21 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
                   ` (4 preceding siblings ...)
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 5/7] tests/kms_hdr: Add static toggle SDR->HDR mode subtests Swati Sharma
@ 2019-12-31 13:21 ` Swati Sharma
  2020-01-08  9:28   ` Petri Latvala
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 7/7] tests/kms_hdr: Add subtest to swap static HDR metadata Swati Sharma
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Swati Sharma @ 2019-12-31 13:21 UTC (permalink / raw)
  To: igt-dev

From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Add subtest to validate HDR mode by setting the static metadata and
this involves display level verification for infoframes using a
luminance sensor. Therefore, luminance sensor is required for this
subtest, if sensor is not available test will skip.

On intel driver, haven't validated this subtest but included this
for amd driver.

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/kms_hdr.c | 271 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 271 insertions(+)

diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
index dfd377b5..a63021b1 100644
--- a/tests/kms_hdr.c
+++ b/tests/kms_hdr.c
@@ -44,6 +44,7 @@ enum {
 	TEST_NONE = 0,
 	TEST_DPMS = 1 << 0,
 	TEST_SUSPEND = 1 << 1,
+	TEST_OUTPUT = 1 << 2,
 };
 
 /* BPC connector state. */
@@ -61,6 +62,7 @@ typedef struct data {
 	igt_pipe_crc_t *pipe_crc;
 	drmModeModeInfo *mode;
 	enum pipe pipe_id;
+	int sensor_fd;
 	int fd;
 	int w;
 	int h;
@@ -165,6 +167,7 @@ static void prepare_test(data_t *data, igt_output_t *output, enum pipe pipe)
 
 	data->w = data->mode->hdisplay;
 	data->h = data->mode->vdisplay;
+	data->sensor_fd = -1;
 }
 
 static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
@@ -393,6 +396,269 @@ static void test_static_toggle(data_t *data, igt_output_t *output,
 	}
 }
 
+/*
+ * Loads the sensor if unloaded. The sensor is a serial to USB interface that
+ * prints the current measured luminance (nits) as a float, separated by a
+ * newline. Uses baudrate 9600.
+ */
+static void open_sensor(data_t *data)
+{
+	struct termios toptions;
+	int res;
+
+	/* Return if already loaded. */
+	if (data->sensor_fd >= 0)
+		return;
+
+	data->sensor_fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY);
+	if (data->sensor_fd < 0) {
+		igt_info("Luminance sensor not found.\n");
+		return;
+	}
+
+	res = tcgetattr(data->sensor_fd, &toptions);
+	igt_assert_lte(0, res);
+
+	cfsetispeed(&toptions, B9600);
+	cfsetospeed(&toptions, B9600);
+
+	toptions.c_cflag &= ~(PARENB | CSTOPB | CSIZE);
+	toptions.c_cflag |= (CS8 | CREAD | CLOCAL);
+	toptions.c_lflag |= ICANON;
+
+	cfmakeraw(&toptions);
+
+	res = tcsetattr(data->sensor_fd, TCSANOW, &toptions);
+	igt_assert_lte(0, res);
+
+	res = tcsetattr(data->sensor_fd, TCSAFLUSH, &toptions);
+	igt_assert_lte(0, res);
+}
+
+/* Reads a string from the sensor. */
+static void get_sensor_str(data_t *data, char *dst, int dst_bytes)
+{
+	char c = 0;
+	int i = 0;
+
+	igt_require(data->sensor_fd >= 0);
+	igt_set_timeout(3, "Waiting for sensor read\n");
+
+	dst_bytes -= 1;
+
+	while (c != '\n' && i < dst_bytes) {
+		int n = read(data->sensor_fd, &c, 1);
+		igt_assert_lte(0, n);
+
+		dst[i++] = c;
+	}
+
+	igt_reset_timeout();
+
+	if (dst_bytes > 0) {
+		dst[i] = 0;
+	}
+}
+
+/* Asserts that two given values in nits are equal within a given threshold. */
+static void assert_nits_equal(double n0, double n1, double threshold)
+{
+	double diff = fabs(n0 - n1);
+
+	igt_assert_f(diff <= threshold,
+		     "Nits not in threshold: | %.3f - %.3f | > %.3f\n",
+		     n0, n1, threshold);
+}
+
+/* Returns the current luminance reading from the sensor in cd/m^2. */
+static float get_sensor_nits(data_t *data)
+{
+	float nits = -1.0f;
+	char buf[32];
+
+	/* Sensor opening is deferred until we actually need it - here. */
+	open_sensor(data);
+
+	/* Flush old data from the buffer in case it's been a while. */
+	igt_require(data->sensor_fd >= 0);
+	tcflush(data->sensor_fd, TCIOFLUSH);
+
+	/* Read twice so we get a clean line. */
+	get_sensor_str(data, buf, ARRAY_SIZE(buf));
+	get_sensor_str(data, buf, ARRAY_SIZE(buf));
+
+	sscanf(buf, "%f", &nits);
+
+	return nits;
+}
+
+/* Logs the cursor sensor nits. */
+static void log_sensor_nits(double nits)
+{
+	igt_info("Sensor: %.3f nits\n", nits);
+}
+
+/*
+ * Waits for the monitor to light-up to a given threshold, useful for
+ * post-modeset measurement.
+ */
+static void wait_for_threshold(data_t *data, double threshold)
+{
+	/*
+	 * If we read too quick the sensor might still be lit up.
+	 * Easy hack: just wait a second.
+	 */
+	sleep(1);
+
+	/* Poll sensor until lightup. */
+	igt_set_timeout(5, "Waiting for sensor read\n");
+
+	for (;;) {
+		double nits = get_sensor_nits(data);
+
+		if (nits >= threshold)
+			break;
+	}
+
+	igt_reset_timeout();
+}
+
+/* PQ Inverse, L normalized luminance to signal value V. */
+static double calc_pq_inverse(double l)
+{
+	double c1 = 0.8359375;
+	double c2 = 18.8515625;
+	double c3 = 18.6875;
+	double m1 = 0.1593017578125;
+	double m2 = 78.84375;
+	double lm = pow(l, m1);
+
+	return pow((c1 + c2 * lm) / (1.0 + c3 * lm), m2);
+}
+
+/* Fills the FB with a solid color given mapping to a light value in nits. */
+static void draw_light(igt_fb_t *fb, double nits)
+{
+	cairo_t *cr;
+	double l, v;
+	int x, y, w, h;
+
+	cr = igt_get_cairo_ctx(fb->fd, fb);
+
+	l = nits / 10000.0;
+	v = calc_pq_inverse(l);
+
+	/*
+	 * Draw a white rect in the bottom center of the screen for the sensor.
+	 * It's only 10% of the width and height of the screen since not every
+	 * monitor is capable of full HDR brightness for the whole screen.
+	 */
+	w = fb->width * 0.10;
+	h = fb->height * 0.10;
+	x = (fb->width - w) / 2;
+	y = (fb->height - h);
+
+	igt_paint_color(cr, 0, 0, fb->width, fb->height, 0.0, 0.0, 0.0);
+	igt_paint_color(cr, x, y, w, h, v, v, v);
+
+	igt_put_cairo_ctx(fb->fd, fb, cr);
+}
+
+/*
+ * Note: This test is display specific in the sense that it requries
+ * a display that is capable of going above SDR brightness levels.
+ * Most HDR400 or higher certified displays should be capable of this.
+ *
+ * Some displays may require first limiting the output brightness
+ * in the OSD for this to work.
+ *
+ * Requires the luminance sensor to be attached to the test machine,
+ * if sensor isn't attached to the test machine, test will skip.
+ */
+static void test_static_output(data_t *data, igt_output_t *output)
+{
+	igt_display_t *display = &data->display;
+	struct hdr_output_metadata hdr;
+	enum pipe pipe;
+	igt_fb_t afb;
+	int afb_id;
+	double lightup = 100.0;
+	double threshold = 15.0;
+	double nits_sdr0, nits_sdr1, nits_sdr2, nits_hdr;
+
+	for_each_pipe(display, pipe) {
+		if (!igt_pipe_connector_valid(pipe, output))
+			continue;
+
+		if (!igt_pipe_is_free(display, pipe))
+			continue;
+
+		prepare_test(data, output, pipe);
+
+		afb_id = igt_create_fb(data->fd, data->w, data->h, DRM_FORMAT_XRGB2101010, 0, &afb);
+		igt_assert(afb_id);
+
+		draw_light(&afb, 10000.0);
+
+		igt_info("Test SDR, 8bpc\n");
+		igt_plane_set_fb(data->primary, &afb);
+		igt_plane_set_size(data->primary, data->w, data->h);
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 8);
+
+		wait_for_threshold(data, lightup);
+		nits_sdr0 = get_sensor_nits(data);
+		log_sensor_nits(nits_sdr0);
+
+		igt_info("Test SDR, 10bpc\n");
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 10);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 10);
+
+		wait_for_threshold(data, lightup);
+		nits_sdr1 = get_sensor_nits(data);
+		log_sensor_nits(nits_sdr1);
+
+		igt_info("Test HDR, 10bpc\n");
+		fill_hdr_output_metadata_st2048(&hdr);
+		set_hdr_output_metadata(data, &hdr);
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 10);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		wait_for_threshold(data, lightup);
+		nits_hdr = get_sensor_nits(data);
+		log_sensor_nits(nits_hdr);
+
+		igt_info("Exit HDR into SDR, 8bpc\n");
+		set_hdr_output_metadata(data, NULL);
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 8);
+
+		wait_for_threshold(data, lightup);
+		nits_sdr2 = get_sensor_nits(data);
+		log_sensor_nits(nits_sdr2);
+
+		/* Verify that all nit values were as expected. */
+		assert_nits_equal(nits_sdr0, nits_sdr1, threshold);
+		assert_nits_equal(nits_sdr0, nits_sdr2, threshold);
+
+		igt_assert_f(nits_hdr - nits_sdr0 > threshold * 2.0,
+		     "No measurable difference between SDR and HDR luminance: "
+		     "threshold=%.1f actual=%.1f\n",
+		     threshold * 2.0, nits_hdr - nits_sdr0);
+
+		test_fini(data);
+		igt_remove_fb(data->fd, &afb);
+
+		break;
+	}
+}
+
 /* Returns true if an output supports hdr metadata property */
 static bool has_hdr(igt_output_t *output)
 {
@@ -418,6 +684,8 @@ static void test_hdr(data_t *data, const char *test_name, uint32_t flags)
 		igt_info("HDR %s test execution on %s\n", test_name, output->name);
 		if (flags & TEST_NONE || flags & TEST_DPMS || flags & TEST_SUSPEND)
 			test_static_toggle(data, output, flags);
+		if (flags & TEST_OUTPUT)
+			test_static_output(data, output);
 		valid_tests++;
 	}
 
@@ -453,6 +721,9 @@ igt_main
 	igt_describe("Tests static toggle with suspend");
 	igt_subtest("static-toggle-suspend") test_hdr(&data, "static-toggle-suspend", TEST_SUSPEND);
 
+	igt_describe("Tests HDR mode by setting the static metadata");
+	igt_subtest("static-output") test_hdr(&data, "static-output", TEST_OUTPUT);
+
 	igt_fixture {
 		igt_display_fini(&data.display);
 	}
-- 
2.24.1

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

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

* [igt-dev] [PATCH i-g-t 7/7] tests/kms_hdr: Add subtest to swap static HDR metadata
  2019-12-31 13:21 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
                   ` (5 preceding siblings ...)
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 6/7] tests/kms_hdr: Add subtest to validate HDR mode using luminance sensor Swati Sharma
@ 2019-12-31 13:21 ` Swati Sharma
  2020-01-02 13:29   ` Kazlauskas, Nicholas
  2020-01-14 15:08   ` Shankar, Uma
  2019-12-31 14:05 ` [igt-dev] ✓ Fi.CI.BAT: success for Add tests for HDR metadata interfaces and bpc switch Patchwork
  2019-12-31 18:44 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  8 siblings, 2 replies; 24+ messages in thread
From: Swati Sharma @ 2019-12-31 13:21 UTC (permalink / raw)
  To: igt-dev

From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Add subtest to enable fast static metadata switches.

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/kms_hdr.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 109 insertions(+)

diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
index a63021b1..b2fc8fe3 100644
--- a/tests/kms_hdr.c
+++ b/tests/kms_hdr.c
@@ -45,6 +45,7 @@ enum {
 	TEST_DPMS = 1 << 0,
 	TEST_SUSPEND = 1 << 1,
 	TEST_OUTPUT = 1 << 2,
+	TEST_SWAP = 1 << 3,
 };
 
 /* BPC connector state. */
@@ -659,6 +660,110 @@ static void test_static_output(data_t *data, igt_output_t *output)
 	}
 }
 
+/* Fills some test values for HDR metadata targeting SDR. */
+static void fill_hdr_output_metadata_sdr(struct hdr_output_metadata *meta)
+{
+	memset(meta, 0, sizeof(*meta));
+
+	meta->metadata_type = HDMI_STATIC_METADATA_TYPE1;
+	meta->hdmi_metadata_type1.eotf = HDMI_EOTF_TRADITIONAL_GAMMA_SDR;
+
+	/* Rec. 709 */
+	meta->hdmi_metadata_type1.display_primaries[0].x =
+		calc_hdr_float(0.640); /* Red */
+	meta->hdmi_metadata_type1.display_primaries[0].y =
+		calc_hdr_float(0.330);
+	meta->hdmi_metadata_type1.display_primaries[1].x =
+		calc_hdr_float(0.300); /* Green */
+	meta->hdmi_metadata_type1.display_primaries[1].y =
+		calc_hdr_float(0.600);
+	meta->hdmi_metadata_type1.display_primaries[2].x =
+		calc_hdr_float(0.150); /* Blue */
+	meta->hdmi_metadata_type1.display_primaries[2].y =
+		calc_hdr_float(0.006);
+	meta->hdmi_metadata_type1.white_point.x = calc_hdr_float(0.3127);
+	meta->hdmi_metadata_type1.white_point.y = calc_hdr_float(0.3290);
+
+	meta->hdmi_metadata_type1.max_display_mastering_luminance = 0;
+	meta->hdmi_metadata_type1.min_display_mastering_luminance = 0;
+	meta->hdmi_metadata_type1.max_fall = 0;
+	meta->hdmi_metadata_type1.max_cll = 0;
+}
+
+static void test_static_swap(data_t *data, igt_output_t *output)
+{
+	igt_display_t *display = &data->display;
+	igt_crc_t ref_crc, new_crc;
+	enum pipe pipe;
+	igt_fb_t afb;
+	int afb_id;
+	struct hdr_output_metadata hdr;
+
+	for_each_pipe(display, pipe) {
+		if (!igt_pipe_connector_valid(pipe, output))
+			continue;
+
+		if (!igt_pipe_is_free(display, pipe))
+			continue;
+
+		prepare_test(data, output, pipe);
+
+		/* 10-bit formats are slow, so limit the size. */
+		afb_id = igt_create_fb(data->fd, 512, 512, DRM_FORMAT_XRGB2101010, 0, &afb);
+		igt_assert(afb_id);
+
+		draw_hdr_pattern(&afb);
+
+		/* Start in SDR. */
+		igt_plane_set_fb(data->primary, &afb);
+		igt_plane_set_size(data->primary, data->w, data->h);
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 8);
+
+		/* Enter HDR, a modeset is allowed here. */
+		fill_hdr_output_metadata_st2048(&hdr);
+		set_hdr_output_metadata(data, &hdr);
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 10);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 10);
+
+		igt_pipe_crc_collect_crc(data->pipe_crc, &ref_crc);
+
+		/* Change the mastering information, no modeset allowed. */
+		hdr.hdmi_metadata_type1.max_display_mastering_luminance = 200;
+		hdr.hdmi_metadata_type1.max_fall = 200;
+		hdr.hdmi_metadata_type1.max_cll = 100;
+
+		set_hdr_output_metadata(data, &hdr);
+		igt_display_commit_atomic(display, 0, NULL);
+
+		/* Enter SDR via metadata, no modeset allowed. */
+		fill_hdr_output_metadata_sdr(&hdr);
+		set_hdr_output_metadata(data, &hdr);
+		igt_display_commit_atomic(display, 0, NULL);
+
+		igt_pipe_crc_collect_crc(data->pipe_crc, &new_crc);
+
+		/* Exit SDR and enter 8bpc, cleanup. */
+		set_hdr_output_metadata(data, NULL);
+		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+		if (is_amdgpu_device(data->fd))
+			assert_output_bpc(data, 8);
+
+		/* Verify that the CRC didn't change while cycling metadata. */
+		igt_assert_crc_equal(&ref_crc, &new_crc);
+
+		test_fini(data);
+		igt_remove_fb(data->fd, &afb);
+
+		break;
+	}
+}
+
 /* Returns true if an output supports hdr metadata property */
 static bool has_hdr(igt_output_t *output)
 {
@@ -686,6 +791,8 @@ static void test_hdr(data_t *data, const char *test_name, uint32_t flags)
 			test_static_toggle(data, output, flags);
 		if (flags & TEST_OUTPUT)
 			test_static_output(data, output);
+		if (flags & TEST_SWAP)
+			test_static_swap(data, output);
 		valid_tests++;
 	}
 
@@ -723,6 +830,8 @@ igt_main
 
 	igt_describe("Tests HDR mode by setting the static metadata");
 	igt_subtest("static-output") test_hdr(&data, "static-output", TEST_OUTPUT);
+	igt_describe("Tests swapping static HDR metadata");
+	igt_subtest("static-swap") test_hdr(&data, "static-swap", TEST_SWAP);
 
 	igt_fixture {
 		igt_display_fini(&data.display);
-- 
2.24.1

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for Add tests for HDR metadata interfaces and bpc switch
  2019-12-31 13:21 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
                   ` (6 preceding siblings ...)
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 7/7] tests/kms_hdr: Add subtest to swap static HDR metadata Swati Sharma
@ 2019-12-31 14:05 ` Patchwork
  2019-12-31 18:44 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  8 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2019-12-31 14:05 UTC (permalink / raw)
  To: Swati Sharma; +Cc: igt-dev

== Series Details ==

Series: Add tests for HDR metadata interfaces and bpc switch
URL   : https://patchwork.freedesktop.org/series/71524/
State : success

== Summary ==

CI Bug Log - changes from IGT_5356 -> IGTPW_3893
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/index.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_module_load@reload-with-fault-injection:
    - fi-cfl-8700k:       [PASS][1] -> [INCOMPLETE][2] ([i915#505])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/fi-cfl-8700k/igt@i915_module_load@reload-with-fault-injection.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/fi-cfl-8700k/igt@i915_module_load@reload-with-fault-injection.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [PASS][3] -> [FAIL][4] ([fdo#111096] / [i915#323])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
#### Possible fixes ####

  * igt@i915_module_load@reload-with-fault-injection:
    - fi-skl-6700k2:      [INCOMPLETE][5] ([i915#671]) -> [PASS][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/fi-skl-6700k2/igt@i915_module_load@reload-with-fault-injection.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/fi-skl-6700k2/igt@i915_module_load@reload-with-fault-injection.html
    - fi-skl-lmem:        [INCOMPLETE][7] ([i915#671]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/fi-skl-lmem/igt@i915_module_load@reload-with-fault-injection.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/fi-skl-lmem/igt@i915_module_load@reload-with-fault-injection.html

  * igt@kms_busy@basic-flip-pipe-a:
    - {fi-tgl-guc}:       [DMESG-WARN][9] ([i915#402]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/fi-tgl-guc/igt@kms_busy@basic-flip-pipe-a.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/fi-tgl-guc/igt@kms_busy@basic-flip-pipe-a.html

  
#### Warnings ####

  * igt@i915_module_load@reload-with-fault-injection:
    - fi-cfl-guc:         [INCOMPLETE][11] ([i915#505] / [i915#671]) -> [DMESG-WARN][12] ([i915#889])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/fi-cfl-guc/igt@i915_module_load@reload-with-fault-injection.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/fi-cfl-guc/igt@i915_module_load@reload-with-fault-injection.html

  * igt@i915_selftest@live_blt:
    - fi-hsw-4770:        [DMESG-FAIL][13] ([i915#725]) -> [DMESG-FAIL][14] ([i915#553] / [i915#725])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/fi-hsw-4770/igt@i915_selftest@live_blt.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/fi-hsw-4770/igt@i915_selftest@live_blt.html

  * igt@kms_cursor_legacy@basic-flip-after-cursor-legacy:
    - fi-kbl-x1275:       [DMESG-WARN][15] ([i915#62] / [i915#92]) -> [DMESG-WARN][16] ([i915#62] / [i915#92] / [i915#95]) +9 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/fi-kbl-x1275/igt@kms_cursor_legacy@basic-flip-after-cursor-legacy.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/fi-kbl-x1275/igt@kms_cursor_legacy@basic-flip-after-cursor-legacy.html

  * igt@kms_flip@basic-flip-vs-modeset:
    - fi-kbl-x1275:       [DMESG-WARN][17] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][18] ([i915#62] / [i915#92]) +5 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/fi-kbl-x1275/igt@kms_flip@basic-flip-vs-modeset.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/fi-kbl-x1275/igt@kms_flip@basic-flip-vs-modeset.html

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

  [fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
  [i915#323]: https://gitlab.freedesktop.org/drm/intel/issues/323
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
  [i915#505]: https://gitlab.freedesktop.org/drm/intel/issues/505
  [i915#553]: https://gitlab.freedesktop.org/drm/intel/issues/553
  [i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
  [i915#671]: https://gitlab.freedesktop.org/drm/intel/issues/671
  [i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
  [i915#889]: https://gitlab.freedesktop.org/drm/intel/issues/889
  [i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (51 -> 47)
------------------------------

  Additional (3): fi-kbl-7560u fi-byt-n2820 fi-tgl-y 
  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5356 -> IGTPW_3893

  CI-20190529: 20190529
  CI_DRM_7657: 265f77c05e67b37169ac1a9d750a2e2936928ea0 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3893: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/index.html
  IGT_5356: 62146738c68abfa7497b023a049163932f5a9aa0 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@kms_hdr@bpc-switch
+igt@kms_hdr@bpc-switch-dpms
+igt@kms_hdr@bpc-switch-suspend
+igt@kms_hdr@static-output
+igt@kms_hdr@static-swap
+igt@kms_hdr@static-toggle
+igt@kms_hdr@static-toggle-dpms
+igt@kms_hdr@static-toggle-suspend

== Logs ==

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

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

* [igt-dev] ✗ Fi.CI.IGT: failure for Add tests for HDR metadata interfaces and bpc switch
  2019-12-31 13:21 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
                   ` (7 preceding siblings ...)
  2019-12-31 14:05 ` [igt-dev] ✓ Fi.CI.BAT: success for Add tests for HDR metadata interfaces and bpc switch Patchwork
@ 2019-12-31 18:44 ` Patchwork
  8 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2019-12-31 18:44 UTC (permalink / raw)
  To: Swati Sharma; +Cc: igt-dev

== Series Details ==

Series: Add tests for HDR metadata interfaces and bpc switch
URL   : https://patchwork.freedesktop.org/series/71524/
State : failure

== Summary ==

CI Bug Log - changes from IGT_5356_full -> IGTPW_3893_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_3893_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_3893_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://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@kms_big_fb@x-tiled-64bpp-rotate-0:
    - shard-snb:          [PASS][1] -> [DMESG-WARN][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-snb1/igt@kms_big_fb@x-tiled-64bpp-rotate-0.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-snb6/igt@kms_big_fb@x-tiled-64bpp-rotate-0.html

  * {igt@kms_hdr@bpc-switch} (NEW):
    - shard-hsw:          NOTRUN -> [FAIL][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-hsw8/igt@kms_hdr@bpc-switch.html

  * {igt@kms_hdr@static-output} (NEW):
    - shard-iclb:         NOTRUN -> [SKIP][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb5/igt@kms_hdr@static-output.html

  * {igt@kms_hdr@static-swap} (NEW):
    - shard-glk:          NOTRUN -> [FAIL][5] +2 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-glk2/igt@kms_hdr@static-swap.html

  
New tests
---------

  New tests have been introduced between IGT_5356_full and IGTPW_3893_full:

### New IGT tests (8) ###

  * igt@kms_hdr@bpc-switch:
    - Statuses : 1 fail(s) 5 pass(s) 1 skip(s)
    - Exec time: [0.0, 8.10] s

  * igt@kms_hdr@bpc-switch-dpms:
    - Statuses : 5 pass(s) 1 skip(s)
    - Exec time: [0.0, 9.35] s

  * igt@kms_hdr@bpc-switch-suspend:
    - Statuses : 4 pass(s) 1 skip(s)
    - Exec time: [0.0, 8.42] s

  * igt@kms_hdr@static-output:
    - Statuses : 6 skip(s)
    - Exec time: [0.0, 2.20] s

  * igt@kms_hdr@static-swap:
    - Statuses : 1 fail(s) 2 pass(s) 4 skip(s)
    - Exec time: [0.0, 8.11] s

  * igt@kms_hdr@static-toggle:
    - Statuses : 3 pass(s) 3 skip(s)
    - Exec time: [0.0, 0.00] s

  * igt@kms_hdr@static-toggle-dpms:
    - Statuses : 1 fail(s) 1 pass(s) 4 skip(s)
    - Exec time: [0.0, 4.75] s

  * igt@kms_hdr@static-toggle-suspend:
    - Statuses : 1 fail(s) 1 pass(s) 4 skip(s)
    - Exec time: [0.0, 8.43] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_persistence@vcs1-queued:
    - shard-iclb:         [PASS][6] -> [SKIP][7] ([fdo#109276] / [fdo#112080]) +5 similar issues
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb1/igt@gem_ctx_persistence@vcs1-queued.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb7/igt@gem_ctx_persistence@vcs1-queued.html

  * igt@gem_ctx_shared@q-smoketest-vebox:
    - shard-tglb:         [PASS][8] -> [INCOMPLETE][9] ([fdo#111735])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb7/igt@gem_ctx_shared@q-smoketest-vebox.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb3/igt@gem_ctx_shared@q-smoketest-vebox.html

  * igt@gem_eio@in-flight-suspend:
    - shard-kbl:          [PASS][10] -> [DMESG-WARN][11] ([i915#180]) +3 similar issues
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-kbl6/igt@gem_eio@in-flight-suspend.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-kbl7/igt@gem_eio@in-flight-suspend.html

  * igt@gem_eio@reset-stress:
    - shard-tglb:         [PASS][12] -> [INCOMPLETE][13] ([i915#470])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb2/igt@gem_eio@reset-stress.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb3/igt@gem_eio@reset-stress.html

  * igt@gem_eio@unwedge-stress:
    - shard-tglb:         [PASS][14] -> [INCOMPLETE][15] ([i915#469])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb5/igt@gem_eio@unwedge-stress.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb1/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_schedule@independent-bsd2:
    - shard-iclb:         [PASS][16] -> [SKIP][17] ([fdo#109276]) +9 similar issues
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb2/igt@gem_exec_schedule@independent-bsd2.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb5/igt@gem_exec_schedule@independent-bsd2.html

  * igt@gem_exec_schedule@preempt-queue-bsd2:
    - shard-tglb:         [PASS][18] -> [INCOMPLETE][19] ([fdo#111606] / [fdo#111677]) +1 similar issue
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb7/igt@gem_exec_schedule@preempt-queue-bsd2.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb8/igt@gem_exec_schedule@preempt-queue-bsd2.html

  * igt@gem_exec_schedule@reorder-wide-bsd:
    - shard-iclb:         [PASS][20] -> [SKIP][21] ([fdo#112146]) +1 similar issue
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb6/igt@gem_exec_schedule@reorder-wide-bsd.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb4/igt@gem_exec_schedule@reorder-wide-bsd.html

  * igt@gem_exec_suspend@basic-s3:
    - shard-apl:          [PASS][22] -> [DMESG-WARN][23] ([i915#180])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-apl6/igt@gem_exec_suspend@basic-s3.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-apl1/igt@gem_exec_suspend@basic-s3.html

  * igt@gem_persistent_relocs@forked-interruptible-thrashing:
    - shard-snb:          [PASS][24] -> [FAIL][25] ([i915#520])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-snb1/igt@gem_persistent_relocs@forked-interruptible-thrashing.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-snb2/igt@gem_persistent_relocs@forked-interruptible-thrashing.html

  * igt@gem_sync@basic-store-all:
    - shard-tglb:         [PASS][26] -> [INCOMPLETE][27] ([i915#472])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb2/igt@gem_sync@basic-store-all.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb8/igt@gem_sync@basic-store-all.html

  * igt@gem_userptr_blits@map-fixed-invalidate-busy-gup:
    - shard-snb:          [PASS][28] -> [DMESG-WARN][29] ([fdo#111870])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-snb6/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-snb6/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [PASS][30] -> [FAIL][31] ([i915#454])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb2/igt@i915_pm_dc@dc6-psr.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb4/igt@i915_pm_dc@dc6-psr.html

  * igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-pwrite:
    - shard-tglb:         [PASS][32] -> [FAIL][33] ([i915#49])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb2/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-pwrite.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb8/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-pwrite.html

  * igt@kms_psr@psr2_cursor_render:
    - shard-iclb:         [PASS][34] -> [SKIP][35] ([fdo#109441]) +3 similar issues
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb6/igt@kms_psr@psr2_cursor_render.html

  * igt@kms_rotation_crc@multiplane-rotation-cropping-top:
    - shard-apl:          [PASS][36] -> [DMESG-WARN][37] ([i915#109])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-apl6/igt@kms_rotation_crc@multiplane-rotation-cropping-top.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-apl3/igt@kms_rotation_crc@multiplane-rotation-cropping-top.html

  * igt@kms_setmode@basic:
    - shard-apl:          [PASS][38] -> [FAIL][39] ([i915#31])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-apl7/igt@kms_setmode@basic.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-apl3/igt@kms_setmode@basic.html

  * igt@perf_pmu@busy-no-semaphores-vcs1:
    - shard-iclb:         [PASS][40] -> [SKIP][41] ([fdo#112080]) +8 similar issues
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb2/igt@perf_pmu@busy-no-semaphores-vcs1.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb7/igt@perf_pmu@busy-no-semaphores-vcs1.html

  
#### Possible fixes ####

  * igt@gem_busy@busy-vcs1:
    - shard-iclb:         [SKIP][42] ([fdo#112080]) -> [PASS][43] +8 similar issues
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb3/igt@gem_busy@busy-vcs1.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb4/igt@gem_busy@busy-vcs1.html

  * igt@gem_ctx_persistence@vcs1-hostile-preempt:
    - shard-iclb:         [SKIP][44] ([fdo#109276] / [fdo#112080]) -> [PASS][45] +2 similar issues
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb6/igt@gem_ctx_persistence@vcs1-hostile-preempt.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb1/igt@gem_ctx_persistence@vcs1-hostile-preempt.html

  * igt@gem_eio@hibernate:
    - shard-iclb:         [INCOMPLETE][46] ([i915#140]) -> [PASS][47]
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb6/igt@gem_eio@hibernate.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb3/igt@gem_eio@hibernate.html

  * igt@gem_exec_parallel@contexts:
    - shard-tglb:         [INCOMPLETE][48] ([i915#470]) -> [PASS][49]
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb5/igt@gem_exec_parallel@contexts.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb7/igt@gem_exec_parallel@contexts.html

  * igt@gem_exec_schedule@in-order-bsd:
    - shard-iclb:         [SKIP][50] ([fdo#112146]) -> [PASS][51] +7 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb1/igt@gem_exec_schedule@in-order-bsd.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb8/igt@gem_exec_schedule@in-order-bsd.html

  * {igt@gem_exec_schedule@pi-distinct-iova-bsd}:
    - shard-iclb:         [SKIP][52] ([i915#677]) -> [PASS][53] +1 similar issue
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb1/igt@gem_exec_schedule@pi-distinct-iova-bsd.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb7/igt@gem_exec_schedule@pi-distinct-iova-bsd.html

  * igt@gem_exec_schedule@preempt-queue-contexts-chain-bsd2:
    - shard-tglb:         [INCOMPLETE][54] ([fdo#111677]) -> [PASS][55]
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb6/igt@gem_exec_schedule@preempt-queue-contexts-chain-bsd2.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb2/igt@gem_exec_schedule@preempt-queue-contexts-chain-bsd2.html

  * igt@gem_persistent_relocs@forked-interruptible-thrash-inactive:
    - shard-apl:          [TIMEOUT][56] ([i915#530]) -> [PASS][57]
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-apl8/igt@gem_persistent_relocs@forked-interruptible-thrash-inactive.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-apl4/igt@gem_persistent_relocs@forked-interruptible-thrash-inactive.html

  * igt@gem_sync@basic-all:
    - shard-tglb:         [INCOMPLETE][58] ([i915#470] / [i915#472]) -> [PASS][59]
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb8/igt@gem_sync@basic-all.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb7/igt@gem_sync@basic-all.html

  * igt@gem_sync@basic-each:
    - shard-tglb:         [INCOMPLETE][60] ([i915#472] / [i915#707]) -> [PASS][61] +1 similar issue
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb7/igt@gem_sync@basic-each.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb1/igt@gem_sync@basic-each.html

  * igt@gem_userptr_blits@sync-unmap-cycles:
    - shard-snb:          [DMESG-WARN][62] ([fdo#111870]) -> [PASS][63]
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-snb7/igt@gem_userptr_blits@sync-unmap-cycles.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-snb6/igt@gem_userptr_blits@sync-unmap-cycles.html

  * igt@i915_pm_dc@dc5-dpms:
    - shard-iclb:         [FAIL][64] ([i915#447]) -> [PASS][65]
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb3/igt@i915_pm_dc@dc5-dpms.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb5/igt@i915_pm_dc@dc5-dpms.html

  * igt@i915_selftest@live_requests:
    - shard-tglb:         [INCOMPLETE][66] ([i915#472]) -> [PASS][67]
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb3/igt@i915_selftest@live_requests.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb5/igt@i915_selftest@live_requests.html

  * igt@kms_cursor_crc@pipe-b-cursor-128x42-onscreen:
    - shard-kbl:          [FAIL][68] ([i915#54]) -> [PASS][69]
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-kbl7/igt@kms_cursor_crc@pipe-b-cursor-128x42-onscreen.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-kbl1/igt@kms_cursor_crc@pipe-b-cursor-128x42-onscreen.html
    - shard-apl:          [FAIL][70] ([i915#54]) -> [PASS][71]
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-apl6/igt@kms_cursor_crc@pipe-b-cursor-128x42-onscreen.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-apl8/igt@kms_cursor_crc@pipe-b-cursor-128x42-onscreen.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
    - shard-kbl:          [INCOMPLETE][72] ([fdo#103665]) -> [PASS][73]
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-kbl3/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-kbl3/igt@kms_cursor_crc@pipe-c-cursor-suspend.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-kbl:          [DMESG-WARN][74] ([i915#180]) -> [PASS][75] +1 similar issue
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-kbl4/igt@kms_flip@flip-vs-suspend-interruptible.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-kbl1/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-mmap-cpu:
    - shard-tglb:         [INCOMPLETE][76] ([i915#435] / [i915#474]) -> [PASS][77]
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-mmap-cpu.html
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-mmap-cpu.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render:
    - shard-tglb:         [FAIL][78] ([i915#49]) -> [PASS][79]
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render.html
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb7/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render.html

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
    - shard-apl:          [DMESG-WARN][80] ([i915#180]) -> [PASS][81] +2 similar issues
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-apl1/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-apl7/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
    - shard-tglb:         [INCOMPLETE][82] ([i915#456] / [i915#460]) -> [PASS][83] +1 similar issue
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb8/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb7/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html

  * igt@kms_plane@plane-position-covered-pipe-a-planes:
    - shard-apl:          [FAIL][84] ([i915#247]) -> [PASS][85]
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-apl7/igt@kms_plane@plane-position-covered-pipe-a-planes.html
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-apl4/igt@kms_plane@plane-position-covered-pipe-a-planes.html
    - shard-kbl:          [FAIL][86] ([i915#247]) -> [PASS][87]
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-kbl1/igt@kms_plane@plane-position-covered-pipe-a-planes.html
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-kbl6/igt@kms_plane@plane-position-covered-pipe-a-planes.html

  * igt@kms_psr2_su@page_flip:
    - shard-iclb:         [SKIP][88] ([fdo#109642] / [fdo#111068]) -> [PASS][89]
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb7/igt@kms_psr2_su@page_flip.html
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb2/igt@kms_psr2_su@page_flip.html

  * igt@kms_psr@psr2_sprite_plane_move:
    - shard-iclb:         [SKIP][90] ([fdo#109441]) -> [PASS][91] +1 similar issue
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb7/igt@kms_psr@psr2_sprite_plane_move.html
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html

  * igt@perf_pmu@cpu-hotplug:
    - shard-tglb:         [DMESG-WARN][92] ([i915#799]) -> [PASS][93]
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-tglb1/igt@perf_pmu@cpu-hotplug.html
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-tglb1/igt@perf_pmu@cpu-hotplug.html

  * igt@prime_busy@hang-bsd2:
    - shard-iclb:         [SKIP][94] ([fdo#109276]) -> [PASS][95] +22 similar issues
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb6/igt@prime_busy@hang-bsd2.html
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb4/igt@prime_busy@hang-bsd2.html

  
#### Warnings ####

  * igt@gem_eio@kms:
    - shard-snb:          [DMESG-WARN][96] ([i915#444]) -> [INCOMPLETE][97] ([i915#82])
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-snb4/igt@gem_eio@kms.html
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-snb2/igt@gem_eio@kms.html

  * igt@gem_tiled_blits@interruptible:
    - shard-hsw:          [FAIL][98] ([i915#818]) -> [FAIL][99] ([i915#832])
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-hsw5/igt@gem_tiled_blits@interruptible.html
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-hsw1/igt@gem_tiled_blits@interruptible.html

  * igt@kms_dp_dsc@basic-dsc-enable-edp:
    - shard-iclb:         [SKIP][100] ([fdo#109349]) -> [DMESG-WARN][101] ([fdo#107724])
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5356/shard-iclb8/igt@kms_dp_dsc@basic-dsc-enable-edp.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/shard-iclb2/igt@kms_dp_dsc@basic-dsc-enable-edp.html

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

  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111606]: https://bugs.freedesktop.org/show_bug.cgi?id=111606
  [fdo#111677]: https://bugs.freedesktop.org/show_bug.cgi?id=111677
  [fdo#111735]: https://bugs.freedesktop.org/show_bug.cgi?id=111735
  [fdo#111870]: https://bugs.freedesktop.org/show_bug.cgi?id=111870
  [fdo#112080]: https://bugs.freedesktop.org/show_bug.cgi?id=112080
  [fdo#112146]: https://bugs.freedesktop.org/show_bug.cgi?id=112146
  [i915#109]: https://gitlab.freedesktop.org/drm/intel/issues/109
  [i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#247]: https://gitlab.freedesktop.org/drm/intel/issues/247
  [i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
  [i915#435]: https://gitlab.freedesktop.org/drm/intel/issues/435
  [i915#444]: https://gitlab.freedesktop.org/drm/intel/issues/444
  [i915#447]: https://gitlab.freedesktop.org/drm/intel/issues/447
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#456]: https://gitlab.freedesktop.org/drm/intel/issues/456
  [i915#460]: https://gitlab.freedesktop.org/drm/intel/issues/460
  [i915#469]: https://gitlab.freedesktop.org/drm/intel/issues/469
  [i915#470]: https://gitlab.freedesktop.org/drm/intel/issues/470
  [i915#472]: https://gitlab.freedesktop.org/drm/intel/issues/472
  [i915#474]: https://gitlab.freedesktop.org/drm/intel/issues/474
  [i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
  [i915#520]: https://gitlab.freedesktop.org/drm/intel/issues/520
  [i915#530]: https://gitlab.freedesktop.org/drm/intel/issues/530
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#677]: https://gitlab.freedesktop.org/drm/intel/issues/677
  [i915#707]: https://gitlab.freedesktop.org/drm/intel/issues/707
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#799]: https://gitlab.freedesktop.org/drm/intel/issues/799
  [i915#818]: https://gitlab.freedesktop.org/drm/intel/issues/818
  [i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
  [i915#832]: https://gitlab.freedesktop.org/drm/intel/issues/832


Participating hosts (8 -> 8)
------------------------------

  No changes in participating hosts


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5356 -> IGTPW_3893

  CI-20190529: 20190529
  CI_DRM_7657: 265f77c05e67b37169ac1a9d750a2e2936928ea0 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3893: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3893/index.html
  IGT_5356: 62146738c68abfa7497b023a049163932f5a9aa0 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t 7/7] tests/kms_hdr: Add subtest to swap static HDR metadata
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 7/7] tests/kms_hdr: Add subtest to swap static HDR metadata Swati Sharma
@ 2020-01-02 13:29   ` Kazlauskas, Nicholas
  2020-01-03 13:35     ` Sharma, Swati2
  2020-01-14 15:08   ` Shankar, Uma
  1 sibling, 1 reply; 24+ messages in thread
From: Kazlauskas, Nicholas @ 2020-01-02 13:29 UTC (permalink / raw)
  To: Swati Sharma, igt-dev

On 2019-12-31 8:21 a.m., Swati Sharma wrote:
> From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> 
> Add subtest to enable fast static metadata switches.
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>

Thanks for picking up and updating this series - I like that you've 
moved this into a shared kms_hdr test.

You can have my:

Acked-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

on patches 4-7. They're split up logically and I don't see any glaring 
issues with them.

I'll leave the first three patches for review from others since I wrote 
those.

Regards,
Nicholas Kazlauskas

> ---
>   tests/kms_hdr.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 109 insertions(+)
> 
> diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
> index a63021b1..b2fc8fe3 100644
> --- a/tests/kms_hdr.c
> +++ b/tests/kms_hdr.c
> @@ -45,6 +45,7 @@ enum {
>   	TEST_DPMS = 1 << 0,
>   	TEST_SUSPEND = 1 << 1,
>   	TEST_OUTPUT = 1 << 2,
> +	TEST_SWAP = 1 << 3,
>   };
>   
>   /* BPC connector state. */
> @@ -659,6 +660,110 @@ static void test_static_output(data_t *data, igt_output_t *output)
>   	}
>   }
>   
> +/* Fills some test values for HDR metadata targeting SDR. */
> +static void fill_hdr_output_metadata_sdr(struct hdr_output_metadata *meta)
> +{
> +	memset(meta, 0, sizeof(*meta));
> +
> +	meta->metadata_type = HDMI_STATIC_METADATA_TYPE1;
> +	meta->hdmi_metadata_type1.eotf = HDMI_EOTF_TRADITIONAL_GAMMA_SDR;
> +
> +	/* Rec. 709 */
> +	meta->hdmi_metadata_type1.display_primaries[0].x =
> +		calc_hdr_float(0.640); /* Red */
> +	meta->hdmi_metadata_type1.display_primaries[0].y =
> +		calc_hdr_float(0.330);
> +	meta->hdmi_metadata_type1.display_primaries[1].x =
> +		calc_hdr_float(0.300); /* Green */
> +	meta->hdmi_metadata_type1.display_primaries[1].y =
> +		calc_hdr_float(0.600);
> +	meta->hdmi_metadata_type1.display_primaries[2].x =
> +		calc_hdr_float(0.150); /* Blue */
> +	meta->hdmi_metadata_type1.display_primaries[2].y =
> +		calc_hdr_float(0.006);
> +	meta->hdmi_metadata_type1.white_point.x = calc_hdr_float(0.3127);
> +	meta->hdmi_metadata_type1.white_point.y = calc_hdr_float(0.3290);
> +
> +	meta->hdmi_metadata_type1.max_display_mastering_luminance = 0;
> +	meta->hdmi_metadata_type1.min_display_mastering_luminance = 0;
> +	meta->hdmi_metadata_type1.max_fall = 0;
> +	meta->hdmi_metadata_type1.max_cll = 0;
> +}
> +
> +static void test_static_swap(data_t *data, igt_output_t *output)
> +{
> +	igt_display_t *display = &data->display;
> +	igt_crc_t ref_crc, new_crc;
> +	enum pipe pipe;
> +	igt_fb_t afb;
> +	int afb_id;
> +	struct hdr_output_metadata hdr;
> +
> +	for_each_pipe(display, pipe) {
> +		if (!igt_pipe_connector_valid(pipe, output))
> +			continue;
> +
> +		if (!igt_pipe_is_free(display, pipe))
> +			continue;
> +
> +		prepare_test(data, output, pipe);
> +
> +		/* 10-bit formats are slow, so limit the size. */
> +		afb_id = igt_create_fb(data->fd, 512, 512, DRM_FORMAT_XRGB2101010, 0, &afb);
> +		igt_assert(afb_id);
> +
> +		draw_hdr_pattern(&afb);
> +
> +		/* Start in SDR. */
> +		igt_plane_set_fb(data->primary, &afb);
> +		igt_plane_set_size(data->primary, data->w, data->h);
> +		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +		if (is_amdgpu_device(data->fd))
> +			assert_output_bpc(data, 8);
> +
> +		/* Enter HDR, a modeset is allowed here. */
> +		fill_hdr_output_metadata_st2048(&hdr);
> +		set_hdr_output_metadata(data, &hdr);
> +		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 10);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +		if (is_amdgpu_device(data->fd))
> +			assert_output_bpc(data, 10);
> +
> +		igt_pipe_crc_collect_crc(data->pipe_crc, &ref_crc);
> +
> +		/* Change the mastering information, no modeset allowed. */
> +		hdr.hdmi_metadata_type1.max_display_mastering_luminance = 200;
> +		hdr.hdmi_metadata_type1.max_fall = 200;
> +		hdr.hdmi_metadata_type1.max_cll = 100;
> +
> +		set_hdr_output_metadata(data, &hdr);
> +		igt_display_commit_atomic(display, 0, NULL);
> +
> +		/* Enter SDR via metadata, no modeset allowed. */
> +		fill_hdr_output_metadata_sdr(&hdr);
> +		set_hdr_output_metadata(data, &hdr);
> +		igt_display_commit_atomic(display, 0, NULL);
> +
> +		igt_pipe_crc_collect_crc(data->pipe_crc, &new_crc);
> +
> +		/* Exit SDR and enter 8bpc, cleanup. */
> +		set_hdr_output_metadata(data, NULL);
> +		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +		if (is_amdgpu_device(data->fd))
> +			assert_output_bpc(data, 8);
> +
> +		/* Verify that the CRC didn't change while cycling metadata. */
> +		igt_assert_crc_equal(&ref_crc, &new_crc);
> +
> +		test_fini(data);
> +		igt_remove_fb(data->fd, &afb);
> +
> +		break;
> +	}
> +}
> +
>   /* Returns true if an output supports hdr metadata property */
>   static bool has_hdr(igt_output_t *output)
>   {
> @@ -686,6 +791,8 @@ static void test_hdr(data_t *data, const char *test_name, uint32_t flags)
>   			test_static_toggle(data, output, flags);
>   		if (flags & TEST_OUTPUT)
>   			test_static_output(data, output);
> +		if (flags & TEST_SWAP)
> +			test_static_swap(data, output);
>   		valid_tests++;
>   	}
>   
> @@ -723,6 +830,8 @@ igt_main
>   
>   	igt_describe("Tests HDR mode by setting the static metadata");
>   	igt_subtest("static-output") test_hdr(&data, "static-output", TEST_OUTPUT);
> +	igt_describe("Tests swapping static HDR metadata");
> +	igt_subtest("static-swap") test_hdr(&data, "static-swap", TEST_SWAP);
>   
>   	igt_fixture {
>   		igt_display_fini(&data.display);
> 

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

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

* Re: [igt-dev] [PATCH i-g-t 7/7] tests/kms_hdr: Add subtest to swap static HDR metadata
  2020-01-02 13:29   ` Kazlauskas, Nicholas
@ 2020-01-03 13:35     ` Sharma, Swati2
  2020-01-08  9:35       ` Petri Latvala
  0 siblings, 1 reply; 24+ messages in thread
From: Sharma, Swati2 @ 2020-01-03 13:35 UTC (permalink / raw)
  To: Kazlauskas, Nicholas, igt-dev

On 02-Jan-20 6:59 PM, Kazlauskas, Nicholas wrote:
> On 2019-12-31 8:21 a.m., Swati Sharma wrote:
>> From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>>
>> Add subtest to enable fast static metadata switches.
>>
>> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> 
> Thanks for picking up and updating this series - I like that you've 
> moved this into a shared kms_hdr test.
> 
> You can have my:
> 
> Acked-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> 
> on patches 4-7. They're split up logically and I don't see any glaring 
> issues with them.

ThankYou :)
> 
> I'll leave the first three patches for review from others since I wrote 
> those.

Sure!
> 
> Regards,
> Nicholas Kazlauskas
> 
>> ---
>>   tests/kms_hdr.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 109 insertions(+)
>>
>> diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
>> index a63021b1..b2fc8fe3 100644
>> --- a/tests/kms_hdr.c
>> +++ b/tests/kms_hdr.c
>> @@ -45,6 +45,7 @@ enum {
>>       TEST_DPMS = 1 << 0,
>>       TEST_SUSPEND = 1 << 1,
>>       TEST_OUTPUT = 1 << 2,
>> +    TEST_SWAP = 1 << 3,
>>   };
>>   /* BPC connector state. */
>> @@ -659,6 +660,110 @@ static void test_static_output(data_t *data, 
>> igt_output_t *output)
>>       }
>>   }
>> +/* Fills some test values for HDR metadata targeting SDR. */
>> +static void fill_hdr_output_metadata_sdr(struct hdr_output_metadata 
>> *meta)
>> +{
>> +    memset(meta, 0, sizeof(*meta));
>> +
>> +    meta->metadata_type = HDMI_STATIC_METADATA_TYPE1;
>> +    meta->hdmi_metadata_type1.eotf = HDMI_EOTF_TRADITIONAL_GAMMA_SDR;
>> +
>> +    /* Rec. 709 */
>> +    meta->hdmi_metadata_type1.display_primaries[0].x =
>> +        calc_hdr_float(0.640); /* Red */
>> +    meta->hdmi_metadata_type1.display_primaries[0].y =
>> +        calc_hdr_float(0.330);
>> +    meta->hdmi_metadata_type1.display_primaries[1].x =
>> +        calc_hdr_float(0.300); /* Green */
>> +    meta->hdmi_metadata_type1.display_primaries[1].y =
>> +        calc_hdr_float(0.600);
>> +    meta->hdmi_metadata_type1.display_primaries[2].x =
>> +        calc_hdr_float(0.150); /* Blue */
>> +    meta->hdmi_metadata_type1.display_primaries[2].y =
>> +        calc_hdr_float(0.006);
>> +    meta->hdmi_metadata_type1.white_point.x = calc_hdr_float(0.3127);
>> +    meta->hdmi_metadata_type1.white_point.y = calc_hdr_float(0.3290);
>> +
>> +    meta->hdmi_metadata_type1.max_display_mastering_luminance = 0;
>> +    meta->hdmi_metadata_type1.min_display_mastering_luminance = 0;
>> +    meta->hdmi_metadata_type1.max_fall = 0;
>> +    meta->hdmi_metadata_type1.max_cll = 0;
>> +}
>> +
>> +static void test_static_swap(data_t *data, igt_output_t *output)
>> +{
>> +    igt_display_t *display = &data->display;
>> +    igt_crc_t ref_crc, new_crc;
>> +    enum pipe pipe;
>> +    igt_fb_t afb;
>> +    int afb_id;
>> +    struct hdr_output_metadata hdr;
>> +
>> +    for_each_pipe(display, pipe) {
>> +        if (!igt_pipe_connector_valid(pipe, output))
>> +            continue;
>> +
>> +        if (!igt_pipe_is_free(display, pipe))
>> +            continue;
>> +
>> +        prepare_test(data, output, pipe);
>> +
>> +        /* 10-bit formats are slow, so limit the size. */
>> +        afb_id = igt_create_fb(data->fd, 512, 512, 
>> DRM_FORMAT_XRGB2101010, 0, &afb);
>> +        igt_assert(afb_id);
>> +
>> +        draw_hdr_pattern(&afb);
>> +
>> +        /* Start in SDR. */
>> +        igt_plane_set_fb(data->primary, &afb);
>> +        igt_plane_set_size(data->primary, data->w, data->h);
>> +        igt_output_set_prop_value(data->output, 
>> IGT_CONNECTOR_MAX_BPC, 8);
>> +        igt_display_commit_atomic(display, 
>> DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>> +        if (is_amdgpu_device(data->fd))
>> +            assert_output_bpc(data, 8);
>> +
>> +        /* Enter HDR, a modeset is allowed here. */
>> +        fill_hdr_output_metadata_st2048(&hdr);
>> +        set_hdr_output_metadata(data, &hdr);
>> +        igt_output_set_prop_value(data->output, 
>> IGT_CONNECTOR_MAX_BPC, 10);
>> +        igt_display_commit_atomic(display, 
>> DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>> +        if (is_amdgpu_device(data->fd))
>> +            assert_output_bpc(data, 10);
>> +
>> +        igt_pipe_crc_collect_crc(data->pipe_crc, &ref_crc);
>> +
>> +        /* Change the mastering information, no modeset allowed. */
>> +        hdr.hdmi_metadata_type1.max_display_mastering_luminance = 200;
>> +        hdr.hdmi_metadata_type1.max_fall = 200;
>> +        hdr.hdmi_metadata_type1.max_cll = 100;
>> +
>> +        set_hdr_output_metadata(data, &hdr);
>> +        igt_display_commit_atomic(display, 0, NULL);
>> +
>> +        /* Enter SDR via metadata, no modeset allowed. */
>> +        fill_hdr_output_metadata_sdr(&hdr);
>> +        set_hdr_output_metadata(data, &hdr);
>> +        igt_display_commit_atomic(display, 0, NULL);
>> +
>> +        igt_pipe_crc_collect_crc(data->pipe_crc, &new_crc);
>> +
>> +        /* Exit SDR and enter 8bpc, cleanup. */
>> +        set_hdr_output_metadata(data, NULL);
>> +        igt_output_set_prop_value(data->output, 
>> IGT_CONNECTOR_MAX_BPC, 8);
>> +        igt_display_commit_atomic(display, 
>> DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>> +        if (is_amdgpu_device(data->fd))
>> +            assert_output_bpc(data, 8);
>> +
>> +        /* Verify that the CRC didn't change while cycling metadata. */
>> +        igt_assert_crc_equal(&ref_crc, &new_crc);
>> +
>> +        test_fini(data);
>> +        igt_remove_fb(data->fd, &afb);
>> +
>> +        break;
>> +    }
>> +}
>> +
>>   /* Returns true if an output supports hdr metadata property */
>>   static bool has_hdr(igt_output_t *output)
>>   {
>> @@ -686,6 +791,8 @@ static void test_hdr(data_t *data, const char 
>> *test_name, uint32_t flags)
>>               test_static_toggle(data, output, flags);
>>           if (flags & TEST_OUTPUT)
>>               test_static_output(data, output);
>> +        if (flags & TEST_SWAP)
>> +            test_static_swap(data, output);
>>           valid_tests++;
>>       }
>> @@ -723,6 +830,8 @@ igt_main
>>       igt_describe("Tests HDR mode by setting the static metadata");
>>       igt_subtest("static-output") test_hdr(&data, "static-output", 
>> TEST_OUTPUT);
>> +    igt_describe("Tests swapping static HDR metadata");
>> +    igt_subtest("static-swap") test_hdr(&data, "static-swap", 
>> TEST_SWAP);
>>       igt_fixture {
>>           igt_display_fini(&data.display);
>>
> 


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

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

* Re: [igt-dev] [PATCH i-g-t 6/7] tests/kms_hdr: Add subtest to validate HDR mode using luminance sensor
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 6/7] tests/kms_hdr: Add subtest to validate HDR mode using luminance sensor Swati Sharma
@ 2020-01-08  9:28   ` Petri Latvala
  2020-01-14 15:03     ` Shankar, Uma
  0 siblings, 1 reply; 24+ messages in thread
From: Petri Latvala @ 2020-01-08  9:28 UTC (permalink / raw)
  To: Swati Sharma; +Cc: igt-dev

On Tue, Dec 31, 2019 at 06:51:57PM +0530, Swati Sharma wrote:
> From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> 
> Add subtest to validate HDR mode by setting the static metadata and
> this involves display level verification for infoframes using a
> luminance sensor. Therefore, luminance sensor is required for this
> subtest, if sensor is not available test will skip.
> 
> On intel driver, haven't validated this subtest but included this
> for amd driver.
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>  tests/kms_hdr.c | 271 ++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 271 insertions(+)
> 
> diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
> index dfd377b5..a63021b1 100644
> --- a/tests/kms_hdr.c
> +++ b/tests/kms_hdr.c
> @@ -44,6 +44,7 @@ enum {
>  	TEST_NONE = 0,
>  	TEST_DPMS = 1 << 0,
>  	TEST_SUSPEND = 1 << 1,
> +	TEST_OUTPUT = 1 << 2,
>  };
>  
>  /* BPC connector state. */
> @@ -61,6 +62,7 @@ typedef struct data {
>  	igt_pipe_crc_t *pipe_crc;
>  	drmModeModeInfo *mode;
>  	enum pipe pipe_id;
> +	int sensor_fd;
>  	int fd;
>  	int w;
>  	int h;
> @@ -165,6 +167,7 @@ static void prepare_test(data_t *data, igt_output_t *output, enum pipe pipe)
>  
>  	data->w = data->mode->hdisplay;
>  	data->h = data->mode->vdisplay;
> +	data->sensor_fd = -1;
>  }
>  
>  static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
> @@ -393,6 +396,269 @@ static void test_static_toggle(data_t *data, igt_output_t *output,
>  	}
>  }
>  
> +/*
> + * Loads the sensor if unloaded. The sensor is a serial to USB interface that
> + * prints the current measured luminance (nits) as a float, separated by a
> + * newline. Uses baudrate 9600.
> + */
> +static void open_sensor(data_t *data)
> +{
> +	struct termios toptions;
> +	int res;
> +
> +	/* Return if already loaded. */
> +	if (data->sensor_fd >= 0)
> +		return;
> +
> +	data->sensor_fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY);

What is the sensor device in question? How can you even know this
device, if it exists, is the sensor?

Connecting a usb-serial cable for a debug terminal is common enough to
warrant not using ttyUSB0 blindly.


> +	if (data->sensor_fd < 0) {
> +		igt_info("Luminance sensor not found.\n");
> +		return;
> +	}
> +
> +	res = tcgetattr(data->sensor_fd, &toptions);
> +	igt_assert_lte(0, res);
> +
> +	cfsetispeed(&toptions, B9600);
> +	cfsetospeed(&toptions, B9600);
> +
> +	toptions.c_cflag &= ~(PARENB | CSTOPB | CSIZE);
> +	toptions.c_cflag |= (CS8 | CREAD | CLOCAL);
> +	toptions.c_lflag |= ICANON;
> +
> +	cfmakeraw(&toptions);
> +
> +	res = tcsetattr(data->sensor_fd, TCSANOW, &toptions);
> +	igt_assert_lte(0, res);
> +
> +	res = tcsetattr(data->sensor_fd, TCSAFLUSH, &toptions);
> +	igt_assert_lte(0, res);
> +}
> +
> +/* Reads a string from the sensor. */
> +static void get_sensor_str(data_t *data, char *dst, int dst_bytes)
> +{
> +	char c = 0;
> +	int i = 0;
> +
> +	igt_require(data->sensor_fd >= 0);
> +	igt_set_timeout(3, "Waiting for sensor read\n");
> +
> +	dst_bytes -= 1;
> +
> +	while (c != '\n' && i < dst_bytes) {
> +		int n = read(data->sensor_fd, &c, 1);
> +		igt_assert_lte(0, n);
> +
> +		dst[i++] = c;
> +	}
> +
> +	igt_reset_timeout();
> +
> +	if (dst_bytes > 0) {
> +		dst[i] = 0;
> +	}


The buffer can be left non-nul-terminated if the device gives too much text.


-- 
Petri Latvala




> +}
> +
> +/* Asserts that two given values in nits are equal within a given threshold. */
> +static void assert_nits_equal(double n0, double n1, double threshold)
> +{
> +	double diff = fabs(n0 - n1);
> +
> +	igt_assert_f(diff <= threshold,
> +		     "Nits not in threshold: | %.3f - %.3f | > %.3f\n",
> +		     n0, n1, threshold);
> +}
> +
> +/* Returns the current luminance reading from the sensor in cd/m^2. */
> +static float get_sensor_nits(data_t *data)
> +{
> +	float nits = -1.0f;
> +	char buf[32];
> +
> +	/* Sensor opening is deferred until we actually need it - here. */
> +	open_sensor(data);
> +
> +	/* Flush old data from the buffer in case it's been a while. */
> +	igt_require(data->sensor_fd >= 0);
> +	tcflush(data->sensor_fd, TCIOFLUSH);
> +
> +	/* Read twice so we get a clean line. */
> +	get_sensor_str(data, buf, ARRAY_SIZE(buf));
> +	get_sensor_str(data, buf, ARRAY_SIZE(buf));
> +
> +	sscanf(buf, "%f", &nits);
> +
> +	return nits;
> +}
> +
> +/* Logs the cursor sensor nits. */
> +static void log_sensor_nits(double nits)
> +{
> +	igt_info("Sensor: %.3f nits\n", nits);
> +}
> +
> +/*
> + * Waits for the monitor to light-up to a given threshold, useful for
> + * post-modeset measurement.
> + */
> +static void wait_for_threshold(data_t *data, double threshold)
> +{
> +	/*
> +	 * If we read too quick the sensor might still be lit up.
> +	 * Easy hack: just wait a second.
> +	 */
> +	sleep(1);
> +
> +	/* Poll sensor until lightup. */
> +	igt_set_timeout(5, "Waiting for sensor read\n");
> +
> +	for (;;) {
> +		double nits = get_sensor_nits(data);
> +
> +		if (nits >= threshold)
> +			break;
> +	}
> +
> +	igt_reset_timeout();
> +}
> +
> +/* PQ Inverse, L normalized luminance to signal value V. */
> +static double calc_pq_inverse(double l)
> +{
> +	double c1 = 0.8359375;
> +	double c2 = 18.8515625;
> +	double c3 = 18.6875;
> +	double m1 = 0.1593017578125;
> +	double m2 = 78.84375;
> +	double lm = pow(l, m1);
> +
> +	return pow((c1 + c2 * lm) / (1.0 + c3 * lm), m2);
> +}
> +
> +/* Fills the FB with a solid color given mapping to a light value in nits. */
> +static void draw_light(igt_fb_t *fb, double nits)
> +{
> +	cairo_t *cr;
> +	double l, v;
> +	int x, y, w, h;
> +
> +	cr = igt_get_cairo_ctx(fb->fd, fb);
> +
> +	l = nits / 10000.0;
> +	v = calc_pq_inverse(l);
> +
> +	/*
> +	 * Draw a white rect in the bottom center of the screen for the sensor.
> +	 * It's only 10% of the width and height of the screen since not every
> +	 * monitor is capable of full HDR brightness for the whole screen.
> +	 */
> +	w = fb->width * 0.10;
> +	h = fb->height * 0.10;
> +	x = (fb->width - w) / 2;
> +	y = (fb->height - h);
> +
> +	igt_paint_color(cr, 0, 0, fb->width, fb->height, 0.0, 0.0, 0.0);
> +	igt_paint_color(cr, x, y, w, h, v, v, v);
> +
> +	igt_put_cairo_ctx(fb->fd, fb, cr);
> +}
> +
> +/*
> + * Note: This test is display specific in the sense that it requries
> + * a display that is capable of going above SDR brightness levels.
> + * Most HDR400 or higher certified displays should be capable of this.
> + *
> + * Some displays may require first limiting the output brightness
> + * in the OSD for this to work.
> + *
> + * Requires the luminance sensor to be attached to the test machine,
> + * if sensor isn't attached to the test machine, test will skip.
> + */
> +static void test_static_output(data_t *data, igt_output_t *output)
> +{
> +	igt_display_t *display = &data->display;
> +	struct hdr_output_metadata hdr;
> +	enum pipe pipe;
> +	igt_fb_t afb;
> +	int afb_id;
> +	double lightup = 100.0;
> +	double threshold = 15.0;
> +	double nits_sdr0, nits_sdr1, nits_sdr2, nits_hdr;
> +
> +	for_each_pipe(display, pipe) {
> +		if (!igt_pipe_connector_valid(pipe, output))
> +			continue;
> +
> +		if (!igt_pipe_is_free(display, pipe))
> +			continue;
> +
> +		prepare_test(data, output, pipe);
> +
> +		afb_id = igt_create_fb(data->fd, data->w, data->h, DRM_FORMAT_XRGB2101010, 0, &afb);
> +		igt_assert(afb_id);
> +
> +		draw_light(&afb, 10000.0);
> +
> +		igt_info("Test SDR, 8bpc\n");
> +		igt_plane_set_fb(data->primary, &afb);
> +		igt_plane_set_size(data->primary, data->w, data->h);
> +		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +		if (is_amdgpu_device(data->fd))
> +			assert_output_bpc(data, 8);
> +
> +		wait_for_threshold(data, lightup);
> +		nits_sdr0 = get_sensor_nits(data);
> +		log_sensor_nits(nits_sdr0);
> +
> +		igt_info("Test SDR, 10bpc\n");
> +		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 10);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +		if (is_amdgpu_device(data->fd))
> +			assert_output_bpc(data, 10);
> +
> +		wait_for_threshold(data, lightup);
> +		nits_sdr1 = get_sensor_nits(data);
> +		log_sensor_nits(nits_sdr1);
> +
> +		igt_info("Test HDR, 10bpc\n");
> +		fill_hdr_output_metadata_st2048(&hdr);
> +		set_hdr_output_metadata(data, &hdr);
> +		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 10);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		wait_for_threshold(data, lightup);
> +		nits_hdr = get_sensor_nits(data);
> +		log_sensor_nits(nits_hdr);
> +
> +		igt_info("Exit HDR into SDR, 8bpc\n");
> +		set_hdr_output_metadata(data, NULL);
> +		igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 8);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +		if (is_amdgpu_device(data->fd))
> +			assert_output_bpc(data, 8);
> +
> +		wait_for_threshold(data, lightup);
> +		nits_sdr2 = get_sensor_nits(data);
> +		log_sensor_nits(nits_sdr2);
> +
> +		/* Verify that all nit values were as expected. */
> +		assert_nits_equal(nits_sdr0, nits_sdr1, threshold);
> +		assert_nits_equal(nits_sdr0, nits_sdr2, threshold);
> +
> +		igt_assert_f(nits_hdr - nits_sdr0 > threshold * 2.0,
> +		     "No measurable difference between SDR and HDR luminance: "
> +		     "threshold=%.1f actual=%.1f\n",
> +		     threshold * 2.0, nits_hdr - nits_sdr0);
> +
> +		test_fini(data);
> +		igt_remove_fb(data->fd, &afb);
> +
> +		break;
> +	}
> +}
> +
>  /* Returns true if an output supports hdr metadata property */
>  static bool has_hdr(igt_output_t *output)
>  {
> @@ -418,6 +684,8 @@ static void test_hdr(data_t *data, const char *test_name, uint32_t flags)
>  		igt_info("HDR %s test execution on %s\n", test_name, output->name);
>  		if (flags & TEST_NONE || flags & TEST_DPMS || flags & TEST_SUSPEND)
>  			test_static_toggle(data, output, flags);
> +		if (flags & TEST_OUTPUT)
> +			test_static_output(data, output);
>  		valid_tests++;
>  	}
>  
> @@ -453,6 +721,9 @@ igt_main
>  	igt_describe("Tests static toggle with suspend");
>  	igt_subtest("static-toggle-suspend") test_hdr(&data, "static-toggle-suspend", TEST_SUSPEND);
>  
> +	igt_describe("Tests HDR mode by setting the static metadata");
> +	igt_subtest("static-output") test_hdr(&data, "static-output", TEST_OUTPUT);
> +
>  	igt_fixture {
>  		igt_display_fini(&data.display);
>  	}
> -- 
> 2.24.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA connector property
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA " Swati Sharma
@ 2020-01-08  9:33   ` Petri Latvala
  2020-01-14 14:32   ` Shankar, Uma
  1 sibling, 0 replies; 24+ messages in thread
From: Petri Latvala @ 2020-01-08  9:33 UTC (permalink / raw)
  To: Swati Sharma; +Cc: igt-dev

On Tue, Dec 31, 2019 at 06:51:54PM +0530, Swati Sharma wrote:
> From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> 
> ...and also reset it when resetting outputs since that can definitely
> affect CRC output on other tests when not reset.
> 
> v2: rebase
> v3: rebase
> 
> Cc: Leo Li <sunpeng.li@amd.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>  lib/igt_kms.c | 5 +++++
>  lib/igt_kms.h | 1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index b0b064c9..de7472cd 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -417,6 +417,7 @@ const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
>  	[IGT_CONNECTOR_HDCP_CONTENT_TYPE] = "HDCP Content Type",
>  	[IGT_CONNECTOR_LINK_STATUS] = "link-status",
>  	[IGT_CONNECTOR_MAX_BPC] = "max bpc",
> +	[IGT_CONNECTOR_HDR_OUTPUT_METADATA] = "HDR_OUTPUT_METADATA",
>  };
>  
>  /*
> @@ -1794,6 +1795,10 @@ static void igt_output_reset(igt_output_t *output)
>  	if (igt_output_has_prop(output, IGT_CONNECTOR_CONTENT_PROTECTION))
>  		igt_output_set_prop_enum(output, IGT_CONNECTOR_CONTENT_PROTECTION,
>  					 "Undesired");
> +
> +	if (igt_output_has_prop(output, IGT_CONNECTOR_HDR_OUTPUT_METADATA))
> +		igt_output_set_prop_value(output,
> +					  IGT_CONNECTOR_HDR_OUTPUT_METADATA, 0);
>  }


Also update the docs to reflect what gets automatically reset. The
documentation is in the function igt_display_reset for all resets.


-- 
Petri Latvala



>  
>  /**
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 36077d41..4766bfce 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -126,6 +126,7 @@ enum igt_atomic_connector_properties {
>         IGT_CONNECTOR_HDCP_CONTENT_TYPE,
>         IGT_CONNECTOR_LINK_STATUS,
>         IGT_CONNECTOR_MAX_BPC,
> +       IGT_CONNECTOR_HDR_OUTPUT_METADATA,
>         IGT_NUM_CONNECTOR_PROPS
>  };
>  
> -- 
> 2.24.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 7/7] tests/kms_hdr: Add subtest to swap static HDR metadata
  2020-01-03 13:35     ` Sharma, Swati2
@ 2020-01-08  9:35       ` Petri Latvala
  0 siblings, 0 replies; 24+ messages in thread
From: Petri Latvala @ 2020-01-08  9:35 UTC (permalink / raw)
  To: Sharma, Swati2; +Cc: igt-dev

On Fri, Jan 03, 2020 at 07:05:11PM +0530, Sharma, Swati2 wrote:
> On 02-Jan-20 6:59 PM, Kazlauskas, Nicholas wrote:
> > I'll leave the first three patches for review from others since I wrote
> > those.
> 
> Sure!


One comment sent on patch 3, with that 1-3 are
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 1/7] headers: Bump drm uapi headers
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 1/7] headers: Bump drm uapi headers Swati Sharma
@ 2020-01-14 14:26   ` Shankar, Uma
  0 siblings, 0 replies; 24+ messages in thread
From: Shankar, Uma @ 2020-01-14 14:26 UTC (permalink / raw)
  To: Sharma, Swati2, igt-dev



>-----Original Message-----
>From: Sharma, Swati2 <swati2.sharma@intel.com>
>Sent: Tuesday, December 31, 2019 6:52 PM
>To: igt-dev@lists.freedesktop.org
>Cc: ville.syrjala@linux.intel.com; Shankar, Uma <uma.shankar@intel.com>; Hiler,
>Arkadiusz <arkadiusz.hiler@intel.com>; Nicholas Kazlauskas
><nicholas.kazlauskas@amd.com>
>Subject: [igt-dev][PATCH i-g-t 1/7] headers: Bump drm uapi headers
>
>From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>
>Updating them to the latest version from drm-next for HDR static metadata uapi
>structures:
>
>Commit: a09db883e5d9 ("drm: Fix docbook warnings in hdr metadata helper
>structures")
>
>v2: Bumped to latest drm-next headers

Looks good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

>Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>---
> include/drm-uapi/drm_mode.h | 121 +++++++++++++++++++++++++++++++++++-
> 1 file changed, 119 insertions(+), 2 deletions(-)
>
>diff --git a/include/drm-uapi/drm_mode.h b/include/drm-uapi/drm_mode.h index
>a439c2e6..5ab331e5 100644
>--- a/include/drm-uapi/drm_mode.h
>+++ b/include/drm-uapi/drm_mode.h
>@@ -33,7 +33,15 @@
> extern "C" {
> #endif
>
>-#define DRM_DISPLAY_INFO_LEN	32
>+/**
>+ * DOC: overview
>+ *
>+ * DRM exposes many UAPI and structure definition to have a consistent
>+ * and standardized interface with user.
>+ * Userspace can refer to these structure definitions and UAPI formats
>+ * to communicate to driver
>+ */
>+
> #define DRM_CONNECTOR_NAME_LEN	32
> #define DRM_DISPLAY_MODE_LEN	32
> #define DRM_PROP_NAME_LEN	32
>@@ -622,7 +630,8 @@ struct drm_color_ctm {
>
> struct drm_color_lut {
> 	/*
>-	 * Data is U0.16 fixed point format.
>+	 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
>+	 * 0xffff == 1.0.
> 	 */
> 	__u16 red;
> 	__u16 green;
>@@ -630,6 +639,92 @@ struct drm_color_lut {
> 	__u16 reserved;
> };
>
>+/**
>+ * struct hdr_metadata_infoframe - HDR Metadata Infoframe Data.
>+ *
>+ * HDR Metadata Infoframe as per CTA 861.G spec. This is expected
>+ * to match exactly with the spec.
>+ *
>+ * Userspace is expected to pass the metadata information as per
>+ * the format described in this structure.
>+ */
>+struct hdr_metadata_infoframe {
>+	/**
>+	 * @eotf: Electro-Optical Transfer Function (EOTF)
>+	 * used in the stream.
>+	 */
>+	__u8 eotf;
>+	/**
>+	 * @metadata_type: Static_Metadata_Descriptor_ID.
>+	 */
>+	__u8 metadata_type;
>+	/**
>+	 * @display_primaries: Color Primaries of the Data.
>+	 * These are coded as unsigned 16-bit values in units of
>+	 * 0.00002, where 0x0000 represents zero and 0xC350
>+	 * represents 1.0000.
>+	 * @display_primaries.x: X cordinate of color primary.
>+	 * @display_primaries.y: Y cordinate of color primary.
>+	 */
>+	struct {
>+		__u16 x, y;
>+		} display_primaries[3];
>+	/**
>+	 * @white_point: White Point of Colorspace Data.
>+	 * These are coded as unsigned 16-bit values in units of
>+	 * 0.00002, where 0x0000 represents zero and 0xC350
>+	 * represents 1.0000.
>+	 * @white_point.x: X cordinate of whitepoint of color primary.
>+	 * @white_point.y: Y cordinate of whitepoint of color primary.
>+	 */
>+	struct {
>+		__u16 x, y;
>+		} white_point;
>+	/**
>+	 * @max_display_mastering_luminance: Max Mastering Display Luminance.
>+	 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
>+	 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
>+	 */
>+	__u16 max_display_mastering_luminance;
>+	/**
>+	 * @min_display_mastering_luminance: Min Mastering Display Luminance.
>+	 * This value is coded as an unsigned 16-bit value in units of
>+	 * 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF
>+	 * represents 6.5535 cd/m2.
>+	 */
>+	__u16 min_display_mastering_luminance;
>+	/**
>+	 * @max_cll: Max Content Light Level.
>+	 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
>+	 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
>+	 */
>+	__u16 max_cll;
>+	/**
>+	 * @max_fall: Max Frame Average Light Level.
>+	 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
>+	 * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
>+	 */
>+	__u16 max_fall;
>+};
>+
>+/**
>+ * struct hdr_output_metadata - HDR output metadata
>+ *
>+ * Metadata Information to be passed from userspace  */ struct
>+hdr_output_metadata {
>+	/**
>+	 * @metadata_type: Static_Metadata_Descriptor_ID.
>+	 */
>+	__u32 metadata_type;
>+	/**
>+	 * @hdmi_metadata_type1: HDR Metadata Infoframe.
>+	 */
>+	union {
>+		struct hdr_metadata_infoframe hdmi_metadata_type1;
>+	};
>+};
>+
> #define DRM_MODE_PAGE_FLIP_EVENT 0x01
> #define DRM_MODE_PAGE_FLIP_ASYNC 0x02
> #define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4 @@ -803,6 +898,10 @@
>struct drm_format_modifier {  };
>
> /**
>+ * struct drm_mode_create_blob - Create New block property
>+ * @data: Pointer to data to copy.
>+ * @length: Length of data to copy.
>+ * @blob_id: new property ID.
>  * Create a new 'blob' data property, copying length bytes from data pointer,
>  * and returning new blob ID.
>  */
>@@ -816,6 +915,8 @@ struct drm_mode_create_blob {  };
>
> /**
>+ * struct drm_mode_destroy_blob - Destroy user blob
>+ * @blob_id: blob_id to destroy
>  * Destroy a user-created blob property.
>  */
> struct drm_mode_destroy_blob {
>@@ -823,6 +924,12 @@ struct drm_mode_destroy_blob {  };
>
> /**
>+ * struct drm_mode_create_lease - Create lease
>+ * @object_ids: Pointer to array of object ids.
>+ * @object_count: Number of object ids.
>+ * @flags: flags for new FD.
>+ * @lessee_id: unique identifier for lessee.
>+ * @fd: file descriptor to new drm_master file.
>  * Lease mode resources, creating another drm_master.
>  */
> struct drm_mode_create_lease {
>@@ -840,6 +947,10 @@ struct drm_mode_create_lease {  };
>
> /**
>+ * struct drm_mode_list_lessees - List lessees
>+ * @count_lessees: Number of lessees.
>+ * @pad: pad.
>+ * @lessees_ptr: Pointer to lessess.
>  * List lesses from a drm_master
>  */
> struct drm_mode_list_lessees {
>@@ -860,6 +971,10 @@ struct drm_mode_list_lessees {  };
>
> /**
>+ * struct drm_mode_get_lease - Get Lease
>+ * @count_objects: Number of leased objects.
>+ * @pad: pad.
>+ * @objects_ptr: Pointer to objects.
>  * Get leased objects
>  */
> struct drm_mode_get_lease {
>@@ -880,6 +995,8 @@ struct drm_mode_get_lease {  };
>
> /**
>+ * struct drm_mode_revoke_lease - Revoke lease
>+ * @lessee_id: Unique ID of lessee.
>  * Revoke lease
>  */
> struct drm_mode_revoke_lease {
>--
>2.24.1

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

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

* Re: [igt-dev] [PATCH i-g-t 2/7] lib/igt_kms: Add max bpc connector property
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 2/7] lib/igt_kms: Add max bpc connector property Swati Sharma
@ 2020-01-14 14:30   ` Shankar, Uma
  0 siblings, 0 replies; 24+ messages in thread
From: Shankar, Uma @ 2020-01-14 14:30 UTC (permalink / raw)
  To: Sharma, Swati2, igt-dev



>-----Original Message-----
>From: Sharma, Swati2 <swati2.sharma@intel.com>
>Sent: Tuesday, December 31, 2019 6:52 PM
>To: igt-dev@lists.freedesktop.org
>Cc: ville.syrjala@linux.intel.com; Shankar, Uma <uma.shankar@intel.com>; Hiler,
>Arkadiusz <arkadiusz.hiler@intel.com>; Nicholas Kazlauskas
><nicholas.kazlauskas@amd.com>; Leo Li <sunpeng.li@amd.com>; Harry Wentland
><harry.wentland@amd.com>; Sharma, Swati2 <swati2.sharma@intel.com>
>Subject: [igt-dev][PATCH i-g-t 2/7] lib/igt_kms: Add max bpc connector property
>
>From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>
>It's been in DRM for a while but was never added to IGT's internal list.
>
>This property should be reset along with other properties between tests since output
>color depth can affect CRC calculation... but it's not really feasible since it's driver
>specific for what the value should be reset to.
>
>v2: rebase
>v3: rebase

Looks good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

>Cc: Leo Li <sunpeng.li@amd.com>
>Cc: Harry Wentland <harry.wentland@amd.com>
>Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>---
> lib/igt_kms.c | 1 +
> lib/igt_kms.h | 1 +
> 2 files changed, 2 insertions(+)
>
>diff --git a/lib/igt_kms.c b/lib/igt_kms.c index d20daaad..b0b064c9 100644
>--- a/lib/igt_kms.c
>+++ b/lib/igt_kms.c
>@@ -416,6 +416,7 @@ const char * const
>igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
> 	[IGT_CONNECTOR_VRR_CAPABLE] = "vrr_capable",
> 	[IGT_CONNECTOR_HDCP_CONTENT_TYPE] = "HDCP Content Type",
> 	[IGT_CONNECTOR_LINK_STATUS] = "link-status",
>+	[IGT_CONNECTOR_MAX_BPC] = "max bpc",
> };
>
> /*
>diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 6c919e92..36077d41 100644
>--- a/lib/igt_kms.h
>+++ b/lib/igt_kms.h
>@@ -125,6 +125,7 @@ enum igt_atomic_connector_properties {
>        IGT_CONNECTOR_VRR_CAPABLE,
>        IGT_CONNECTOR_HDCP_CONTENT_TYPE,
>        IGT_CONNECTOR_LINK_STATUS,
>+       IGT_CONNECTOR_MAX_BPC,
>        IGT_NUM_CONNECTOR_PROPS
> };
>
>--
>2.24.1

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

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

* Re: [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA connector property
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA " Swati Sharma
  2020-01-08  9:33   ` Petri Latvala
@ 2020-01-14 14:32   ` Shankar, Uma
  1 sibling, 0 replies; 24+ messages in thread
From: Shankar, Uma @ 2020-01-14 14:32 UTC (permalink / raw)
  To: Sharma, Swati2, igt-dev



>-----Original Message-----
>From: Sharma, Swati2 <swati2.sharma@intel.com>
>Sent: Tuesday, December 31, 2019 6:52 PM
>To: igt-dev@lists.freedesktop.org
>Cc: ville.syrjala@linux.intel.com; Shankar, Uma <uma.shankar@intel.com>; Hiler,
>Arkadiusz <arkadiusz.hiler@intel.com>; Nicholas Kazlauskas
><nicholas.kazlauskas@amd.com>; Leo Li <sunpeng.li@amd.com>; Harry Wentland
><harry.wentland@amd.com>; Sharma, Swati2 <swati2.sharma@intel.com>
>Subject: [igt-dev][PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA
>connector property
>
>From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>
>...and also reset it when resetting outputs since that can definitely affect CRC output
>on other tests when not reset.
>
>v2: rebase
>v3: rebase

Looks good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

>Cc: Leo Li <sunpeng.li@amd.com>
>Cc: Harry Wentland <harry.wentland@amd.com>
>Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>---
> lib/igt_kms.c | 5 +++++
> lib/igt_kms.h | 1 +
> 2 files changed, 6 insertions(+)
>
>diff --git a/lib/igt_kms.c b/lib/igt_kms.c index b0b064c9..de7472cd 100644
>--- a/lib/igt_kms.c
>+++ b/lib/igt_kms.c
>@@ -417,6 +417,7 @@ const char * const
>igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
> 	[IGT_CONNECTOR_HDCP_CONTENT_TYPE] = "HDCP Content Type",
> 	[IGT_CONNECTOR_LINK_STATUS] = "link-status",
> 	[IGT_CONNECTOR_MAX_BPC] = "max bpc",
>+	[IGT_CONNECTOR_HDR_OUTPUT_METADATA] =
>"HDR_OUTPUT_METADATA",
> };
>
> /*
>@@ -1794,6 +1795,10 @@ static void igt_output_reset(igt_output_t *output)
> 	if (igt_output_has_prop(output, IGT_CONNECTOR_CONTENT_PROTECTION))
> 		igt_output_set_prop_enum(output,
>IGT_CONNECTOR_CONTENT_PROTECTION,
> 					 "Undesired");
>+
>+	if (igt_output_has_prop(output,
>IGT_CONNECTOR_HDR_OUTPUT_METADATA))
>+		igt_output_set_prop_value(output,
>+
>IGT_CONNECTOR_HDR_OUTPUT_METADATA, 0);
> }
>
> /**
>diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 36077d41..4766bfce 100644
>--- a/lib/igt_kms.h
>+++ b/lib/igt_kms.h
>@@ -126,6 +126,7 @@ enum igt_atomic_connector_properties {
>        IGT_CONNECTOR_HDCP_CONTENT_TYPE,
>        IGT_CONNECTOR_LINK_STATUS,
>        IGT_CONNECTOR_MAX_BPC,
>+       IGT_CONNECTOR_HDR_OUTPUT_METADATA,
>        IGT_NUM_CONNECTOR_PROPS
> };
>
>--
>2.24.1

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

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

* Re: [igt-dev] [PATCH i-g-t 4/7] tests/kms_hdr: Add bpc switch subtests
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 4/7] tests/kms_hdr: Add bpc switch subtests Swati Sharma
@ 2020-01-14 14:51   ` Shankar, Uma
  0 siblings, 0 replies; 24+ messages in thread
From: Shankar, Uma @ 2020-01-14 14:51 UTC (permalink / raw)
  To: Sharma, Swati2, igt-dev



>-----Original Message-----
>From: Sharma, Swati2 <swati2.sharma@intel.com>
>Sent: Tuesday, December 31, 2019 6:52 PM
>To: igt-dev@lists.freedesktop.org
>Cc: ville.syrjala@linux.intel.com; Shankar, Uma <uma.shankar@intel.com>; Hiler,
>Arkadiusz <arkadiusz.hiler@intel.com>; Nicholas Kazlauskas
><nicholas.kazlauskas@amd.com>; Harry Wentland <harry.wentland@amd.com>; Leo
>Li <sunpeng.li@amd.com>; Sharma, Swati2 <swati2.sharma@intel.com>
>Subject: [igt-dev][PATCH i-g-t 4/7] tests/kms_hdr: Add bpc switch subtests
>
>From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>
>Add subtests to validate transitions between 8bpc and 10bpc. Test is made compatible
>for both amd and intel drivers. The test requires the "output_bpc" debugfs entry to
>read current and maximum bpc.
>This is exposed by amd driver, however intel driver doesn't expose it, so made that
>restriction to assert output bpc only for amd driver.
>
>Cc: Harry Wentland <harry.wentland@amd.com>
>Cc: Leo Li <sunpeng.li@amd.com>
>Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>---
> tests/Makefile.sources |   1 +
> tests/kms_hdr.c        | 292 +++++++++++++++++++++++++++++++++++++++++
> tests/meson.build      |   1 +
> 3 files changed, 294 insertions(+)
> create mode 100644 tests/kms_hdr.c
>
>diff --git a/tests/Makefile.sources b/tests/Makefile.sources index 2893f9bc..e8fcddf5
>100644
>--- a/tests/Makefile.sources
>+++ b/tests/Makefile.sources
>@@ -55,6 +55,7 @@ TESTS_progs = \
> 	kms_frontbuffer_tracking \
> 	kms_getfb \
> 	kms_hdmi_inject \
>+	kms_hdr \
> 	kms_invalid_dotclock \
> 	kms_lease \
> 	kms_legacy_colorkey \
>diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c new file mode 100644 index
>00000000..212d246d
>--- /dev/null
>+++ b/tests/kms_hdr.c
>@@ -0,0 +1,292 @@
>+/*
>+ * Copyright 2019 Advanced Micro Devices, 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 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
>+ */
>+
>+#include "igt.h"
>+#include <fcntl.h>
>+#include <termios.h>
>+#include <unistd.h>
>+
>+IGT_TEST_DESCRIPTION("Test HDR metadata interfaces and bpc switch");
>+
>+/* Test flags. */
>+enum {
>+	TEST_NONE = 0,
>+	TEST_DPMS = 1 << 0,
>+	TEST_SUSPEND = 1 << 1,
>+};
>+
>+/* BPC connector state. */
>+typedef struct output_bpc {
>+	unsigned int current;
>+	unsigned int maximum;
>+} output_bpc_t;
>+
>+/* Common test data. */
>+typedef struct data {
>+	igt_display_t display;
>+	igt_plane_t *primary;
>+	igt_output_t *output;
>+	igt_pipe_t *pipe;
>+	igt_pipe_crc_t *pipe_crc;
>+	drmModeModeInfo *mode;
>+	enum pipe pipe_id;
>+	int fd;
>+	int w;
>+	int h;
>+} data_t;
>+
>+/* Common test cleanup. */
>+static void test_fini(data_t *data)
>+{
>+	igt_pipe_crc_free(data->pipe_crc);
>+	igt_display_reset(&data->display);
>+}
>+
>+static void test_cycle_flags(data_t *data, uint32_t test_flags) {
>+	if (test_flags & TEST_DPMS) {
>+		kmstest_set_connector_dpms(data->fd,
>+					   data->output->config.connector,
>+					   DRM_MODE_DPMS_OFF);
>+		kmstest_set_connector_dpms(data->fd,
>+					   data->output->config.connector,
>+					   DRM_MODE_DPMS_ON);
>+	}
>+
>+	if (test_flags & TEST_SUSPEND)
>+		igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
>+					      SUSPEND_TEST_NONE);
>+}
>+
>+/* Returns the current and maximum bpc from the connector debugfs. */
>+static output_bpc_t get_output_bpc(data_t *data) {
>+	char buf[256];
>+	char *start_loc;
>+	int fd, res;
>+	output_bpc_t info;
>+
>+	fd = igt_debugfs_connector_dir(data->fd, data->output->name, O_RDONLY);
>+	igt_assert(fd >= 0);
>+
>+	res = igt_debugfs_simple_read(fd, "output_bpc", buf, sizeof(buf));
>+
>+	igt_require(res > 0);
>+
>+	close(fd);
>+
>+	igt_assert(start_loc = strstr(buf, "Current: "));
>+	igt_assert_eq(sscanf(start_loc, "Current: %u", &info.current), 1);
>+
>+	igt_assert(start_loc = strstr(buf, "Maximum: "));
>+	igt_assert_eq(sscanf(start_loc, "Maximum: %u", &info.maximum), 1);
>+
>+	return info;
>+}
>+
>+/* Verifies that connector has the correct output bpc. */ static void
>+assert_output_bpc(data_t *data, unsigned int bpc) {
>+	output_bpc_t info = get_output_bpc(data);
>+
>+	igt_require_f(info.maximum >= bpc,
>+		      "Monitor doesn't support %u bpc, max is %u\n", bpc,
>+		      info.maximum);
>+
>+	igt_assert_eq(info.current, bpc);
>+}
>+
>+/* Fills the FB with a test HDR pattern. */ static void
>+draw_hdr_pattern(igt_fb_t *fb) {
>+	cairo_t *cr = igt_get_cairo_ctx(fb->fd, fb);
>+
>+	igt_paint_color(cr, 0, 0, fb->width, fb->height, 1.0, 1.0, 1.0);
>+	igt_paint_test_pattern(cr, fb->width, fb->height);
>+
>+	igt_put_cairo_ctx(fb->fd, fb, cr);
>+}
>+
>+/* Prepare test data. */
>+static void prepare_test(data_t *data, igt_output_t *output, enum pipe
>+pipe) {
>+	igt_display_t *display = &data->display;
>+
>+        data->pipe_id = pipe;

Alignment seems to off. Rest looks good.

With this fixed, this is
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

>+	data->pipe = &data->display.pipes[data->pipe_id];
>+	igt_assert(data->pipe);
>+
>+	igt_display_reset(display);
>+
>+	data->output = output;
>+	igt_assert(data->output);
>+
>+	data->mode = igt_output_get_mode(data->output);
>+	igt_assert(data->mode);
>+
>+	data->primary =
>+		igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_PRIMARY);
>+
>+	data->pipe_crc = igt_pipe_crc_new(data->fd, data->pipe_id,
>+					  INTEL_PIPE_CRC_SOURCE_AUTO);
>+
>+	igt_output_set_pipe(data->output, data->pipe_id);
>+
>+	data->w = data->mode->hdisplay;
>+	data->h = data->mode->vdisplay;
>+}
>+
>+static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe) {
>+	int i;
>+
>+	for (i = 0; i < display->n_outputs; i++)
>+		if (display->outputs[i].pending_pipe == pipe)
>+			return false;
>+
>+	return true;
>+}
>+
>+static void test_bpc_switch_on_output(data_t *data, igt_output_t *output,
>+				      uint32_t flags)
>+{
>+	igt_display_t *display = &data->display;
>+	igt_crc_t ref_crc, new_crc;
>+	enum pipe pipe;
>+	igt_fb_t afb;
>+	int afb_id;
>+
>+	for_each_pipe(display, pipe) {
>+		if (!igt_pipe_connector_valid(pipe, output))
>+			continue;
>+
>+		/*
>+		 * If previous subtest of connector failed, pipe
>+		 * attached to that connector is not released.
>+		 * Because of that we have to choose the non
>+		 * attached pipe for this subtest.
>+		 */
>+		if (!igt_pipe_is_free(display, pipe))
>+			continue;
>+
>+		prepare_test(data, output, pipe);
>+
>+		/* 10-bit formats are slow, so limit the size. */
>+		afb_id = igt_create_fb(data->fd, 512, 512,
>DRM_FORMAT_XRGB2101010, 0, &afb);
>+		igt_assert(afb_id);
>+
>+		draw_hdr_pattern(&afb);
>+
>+		/* Start in 8bpc. */
>+		igt_plane_set_fb(data->primary, &afb);
>+		igt_plane_set_size(data->primary, data->w, data->h);
>+		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 8);
>+		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>+		/*
>+		 * i915 driver doesn't expose max bpc as debugfs entry,
>+		 * so limiting assert only for amd driver.
>+		 */
>+		if (is_amdgpu_device(data->fd))
>+			assert_output_bpc(data, 8);
>+
>+		/* Switch to 10bpc. */
>+		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 10);
>+		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>+		if (is_amdgpu_device(data->fd))
>+			assert_output_bpc(data, 10);
>+
>+		/* Verify that the CRC are equal after DPMS or suspend. */
>+		igt_pipe_crc_collect_crc(data->pipe_crc, &ref_crc);
>+		test_cycle_flags(data, flags);
>+		igt_pipe_crc_collect_crc(data->pipe_crc, &new_crc);
>+
>+		/* Drop back to 8bpc. */
>+		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 8);
>+		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>+		if (is_amdgpu_device(data->fd))
>+			assert_output_bpc(data, 8);
>+
>+		/* CRC capture is clamped to 8bpc, so capture should match. */
>+		igt_assert_crc_equal(&ref_crc, &new_crc);
>+
>+		test_fini(data);
>+		igt_remove_fb(data->fd, &afb);
>+
>+		/*
>+		 * Testing a output with a pipe is enough for HDR
>+		 * testing. No ROI in testing the connector with other
>+		 * pipes. So break the loop on pipe.
>+		 */
>+		break;
>+	}
>+}
>+
>+/* Returns true if an output supports max bpc property */ static bool
>+has_max_bpc(igt_output_t *output) {
>+	return igt_output_has_prop(output, IGT_CONNECTOR_MAX_BPC) &&
>+	       igt_output_get_prop(output, IGT_CONNECTOR_MAX_BPC); }
>+
>+static void test_bpc_switch(data_t *data, uint32_t flags) {
>+	igt_output_t *output;
>+	int valid_tests = 0;
>+
>+	for_each_connected_output(&data->display, output) {
>+		if (!has_max_bpc(output))
>+			continue;
>+
>+		igt_info("BPC switch test execution on %s\n", output->name);
>+		test_bpc_switch_on_output(data, output, flags);
>+		valid_tests++;
>+	}
>+
>+	igt_require_f(valid_tests, "No connector found with MAX BPC connector
>+property\n"); }
>+
>+igt_main
>+{
>+	data_t data = { 0 };
>+
>+	igt_fixture {
>+		data.fd = drm_open_driver_master(DRIVER_AMDGPU |
>DRIVER_INTEL);
>+
>+		kmstest_set_vt_graphics_mode();
>+
>+		igt_display_require(&data.display, data.fd);
>+		igt_require(data.display.is_atomic);
>+
>+		igt_display_require_output(&data.display);
>+	}
>+
>+	igt_describe("Tests switching between different display output bpc modes");
>+	igt_subtest("bpc-switch") test_bpc_switch(&data, TEST_NONE);
>+	igt_describe("Tests bpc switch with dpms");
>+	igt_subtest("bpc-switch-dpms") test_bpc_switch(&data, TEST_DPMS);
>+	igt_describe("Tests bpc switch with suspend");
>+	igt_subtest("bpc-switch-suspend") test_bpc_switch(&data,
>+TEST_SUSPEND);
>+
>+	igt_fixture {
>+		igt_display_fini(&data.display);
>+	}
>+}
>diff --git a/tests/meson.build b/tests/meson.build index d931cc37..eed5e38f 100644
>--- a/tests/meson.build
>+++ b/tests/meson.build
>@@ -39,6 +39,7 @@ test_progs = [
> 	'kms_frontbuffer_tracking',
> 	'kms_getfb',
> 	'kms_hdmi_inject',
>+	'kms_hdr',
> 	'kms_invalid_dotclock',
> 	'kms_lease',
> 	'kms_legacy_colorkey',
>--
>2.24.1

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

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

* Re: [igt-dev] [PATCH i-g-t 5/7] tests/kms_hdr: Add static toggle SDR->HDR mode subtests
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 5/7] tests/kms_hdr: Add static toggle SDR->HDR mode subtests Swati Sharma
@ 2020-01-14 14:59   ` Shankar, Uma
  0 siblings, 0 replies; 24+ messages in thread
From: Shankar, Uma @ 2020-01-14 14:59 UTC (permalink / raw)
  To: Sharma, Swati2, igt-dev



>-----Original Message-----
>From: Sharma, Swati2 <swati2.sharma@intel.com>
>Sent: Tuesday, December 31, 2019 6:52 PM
>To: igt-dev@lists.freedesktop.org
>Cc: ville.syrjala@linux.intel.com; Shankar, Uma <uma.shankar@intel.com>; Hiler,
>Arkadiusz <arkadiusz.hiler@intel.com>; Nicholas Kazlauskas
><nicholas.kazlauskas@amd.com>; Sharma, Swati2 <swati2.sharma@intel.com>
>Subject: [igt-dev][PATCH i-g-t 5/7] tests/kms_hdr: Add static toggle SDR->HDR mode
>subtests
>
>From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>
>Add subtests to toggle between SDR to HDR mode with suspend and dpms scenarios.
>Tests are made compatible for both amd and intel drivers.

Would be good to detect monitors capable of driving HDR by extracting and parsing EDID,
but this can be added as follow up.

Overall patch looks good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

>Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>---
> tests/kms_hdr.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 167 insertions(+)
>
>diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c index 212d246d..dfd377b5 100644
>--- a/tests/kms_hdr.c
>+++ b/tests/kms_hdr.c
>@@ -27,6 +27,18 @@
>
> IGT_TEST_DESCRIPTION("Test HDR metadata interfaces and bpc switch");
>
>+/* DRM HDR definitions. Not in the UAPI header, unfortunately. */
>+
>+enum hdmi_metadata_type {
>+	HDMI_STATIC_METADATA_TYPE1 = 1,
>+};
>+
>+enum hdmi_eotf {
>+	HDMI_EOTF_TRADITIONAL_GAMMA_SDR,
>+	HDMI_EOTF_TRADITIONAL_GAMMA_HDR,
>+	HDMI_EOTF_SMPTE_ST2084,
>+};
>+
> /* Test flags. */
> enum {
> 	TEST_NONE = 0,
>@@ -264,6 +276,154 @@ static void test_bpc_switch(data_t *data, uint32_t flags)
> 	igt_require_f(valid_tests, "No connector found with MAX BPC connector
>property\n");  }
>
>+/* Sets the HDR output metadata prop. */ static void
>+set_hdr_output_metadata(data_t *data,
>+				    struct hdr_output_metadata const *meta) {
>+	igt_output_replace_prop_blob(data->output,
>+				     IGT_CONNECTOR_HDR_OUTPUT_METADATA,
>meta,
>+				     meta ? sizeof(*meta) : 0);
>+}
>+
>+/* Converts a double to 861-G spec FP format. */ static uint16_t
>+calc_hdr_float(double val) {
>+	return (uint16_t)(val * 50000.0);
>+}
>+
>+/* Fills some test values for ST2048 HDR output metadata.
>+ *
>+ * Note: there isn't really a standard for what the metadata is
>+supposed
>+ * to do on the display side of things. The display is free to ignore
>+it
>+ * and clip the output, use it to help tonemap to the content range,
>+ * or do anything they want, really.
>+ */
>+static void fill_hdr_output_metadata_st2048(struct hdr_output_metadata
>+*meta) {
>+	memset(meta, 0, sizeof(*meta));
>+
>+	meta->metadata_type = HDMI_STATIC_METADATA_TYPE1;
>+	meta->hdmi_metadata_type1.eotf = HDMI_EOTF_SMPTE_ST2084;
>+
>+	/* Rec. 2020 */
>+	meta->hdmi_metadata_type1.display_primaries[0].x =
>+		calc_hdr_float(0.708); /* Red */
>+	meta->hdmi_metadata_type1.display_primaries[0].y =
>+		calc_hdr_float(0.292);
>+	meta->hdmi_metadata_type1.display_primaries[1].x =
>+		calc_hdr_float(0.170); /* Green */
>+	meta->hdmi_metadata_type1.display_primaries[1].y =
>+		calc_hdr_float(0.797);
>+	meta->hdmi_metadata_type1.display_primaries[2].x =
>+		calc_hdr_float(0.131); /* Blue */
>+	meta->hdmi_metadata_type1.display_primaries[2].y =
>+		calc_hdr_float(0.046);
>+	meta->hdmi_metadata_type1.white_point.x = calc_hdr_float(0.3127);
>+	meta->hdmi_metadata_type1.white_point.y = calc_hdr_float(0.3290);
>+
>+	meta->hdmi_metadata_type1.max_display_mastering_luminance =
>+		1000; /* 1000 nits */
>+	meta->hdmi_metadata_type1.min_display_mastering_luminance =
>+		500;				   /* 0.05 nits */
>+	meta->hdmi_metadata_type1.max_fall = 1000; /* 1000 nits */
>+	meta->hdmi_metadata_type1.max_cll = 500;   /* 500 nits */
>+}
>+
>+static void test_static_toggle(data_t *data, igt_output_t *output,
>+			       uint32_t flags)
>+{
>+	igt_display_t *display = &data->display;
>+	struct hdr_output_metadata hdr;
>+	igt_crc_t ref_crc, new_crc;
>+	enum pipe pipe;
>+	igt_fb_t afb;
>+	int afb_id;
>+
>+	for_each_pipe(display, pipe) {
>+		if (!igt_pipe_connector_valid(pipe, output))
>+			continue;
>+
>+		if (!igt_pipe_is_free(display, pipe))
>+			continue;
>+
>+		prepare_test(data, output, pipe);
>+
>+		/* 10-bit formats are slow, so limit the size. */
>+		afb_id = igt_create_fb(data->fd, 512, 512,
>DRM_FORMAT_XRGB2101010, 0, &afb);
>+		igt_assert(afb_id);
>+
>+		draw_hdr_pattern(&afb);
>+
>+		fill_hdr_output_metadata_st2048(&hdr);
>+
>+		/* Start with no metadata. */
>+		igt_plane_set_fb(data->primary, &afb);
>+		igt_plane_set_size(data->primary, data->w, data->h);
>+		set_hdr_output_metadata(data, NULL);
>+		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 8);
>+		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>+		if (is_amdgpu_device(data->fd))
>+			assert_output_bpc(data, 8);
>+
>+		/* Apply HDR metadata and 10bpc. We expect a modeset for
>entering. */
>+		set_hdr_output_metadata(data, &hdr);
>+		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 10);
>+		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>+		if (is_amdgpu_device(data->fd))
>+			assert_output_bpc(data, 10);
>+
>+		/* Verify that the CRC are equal after DPMS or suspend. */
>+		igt_pipe_crc_collect_crc(data->pipe_crc, &ref_crc);
>+		test_cycle_flags(data, flags);
>+		igt_pipe_crc_collect_crc(data->pipe_crc, &new_crc);
>+
>+		/* Disable HDR metadata and drop back to 8bpc. We expect a
>modeset for exiting. */
>+		set_hdr_output_metadata(data, NULL);
>+		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 8);
>+		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>+		if (is_amdgpu_device(data->fd))
>+			assert_output_bpc(data, 8);
>+
>+		igt_assert_crc_equal(&ref_crc, &new_crc);
>+
>+		test_fini(data);
>+		igt_remove_fb(data->fd, &afb);
>+
>+		break;
>+	}
>+}
>+
>+/* Returns true if an output supports hdr metadata property */ static
>+bool has_hdr(igt_output_t *output) {
>+	return igt_output_has_prop(output,
>IGT_CONNECTOR_HDR_OUTPUT_METADATA);
>+}
>+
>+static void test_hdr(data_t *data, const char *test_name, uint32_t
>+flags) {
>+	igt_output_t *output;
>+	int valid_tests = 0;
>+
>+	for_each_connected_output(&data->display, output) {
>+		/* To test HDR, 10 bpc is required, so we need to
>+		 * set MAX_BPC property to 10bpc prior to setting
>+		 * HDR metadata property. Therefore, checking.
>+		 */
>+		if (!has_max_bpc(output))
>+			continue;
>+
>+		if (!has_hdr(output))
>+			continue;
>+
>+		igt_info("HDR %s test execution on %s\n", test_name, output-
>>name);
>+		if (flags & TEST_NONE || flags & TEST_DPMS || flags &
>TEST_SUSPEND)
>+			test_static_toggle(data, output, flags);
>+		valid_tests++;
>+	}
>+
>+	igt_require_f(valid_tests, "No connector found with HDR metadata/MAX
>+BPC connector property\n"); }
>+
> igt_main
> {
> 	data_t data = { 0 };
>@@ -286,6 +446,13 @@ igt_main
> 	igt_describe("Tests bpc switch with suspend");
> 	igt_subtest("bpc-switch-suspend") test_bpc_switch(&data, TEST_SUSPEND);
>
>+	igt_describe("Tests entering and exiting HDR mode");
>+	igt_subtest("static-toggle") test_hdr(&data, "static-toggle", TEST_NONE);
>+	igt_describe("Tests static toggle with dpms");
>+	igt_subtest("static-toggle-dpms") test_hdr(&data, "static-toggle-dpms",
>TEST_DPMS);
>+	igt_describe("Tests static toggle with suspend");
>+	igt_subtest("static-toggle-suspend") test_hdr(&data,
>+"static-toggle-suspend", TEST_SUSPEND);
>+
> 	igt_fixture {
> 		igt_display_fini(&data.display);
> 	}
>--
>2.24.1

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

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

* Re: [igt-dev] [PATCH i-g-t 6/7] tests/kms_hdr: Add subtest to validate HDR mode using luminance sensor
  2020-01-08  9:28   ` Petri Latvala
@ 2020-01-14 15:03     ` Shankar, Uma
  0 siblings, 0 replies; 24+ messages in thread
From: Shankar, Uma @ 2020-01-14 15:03 UTC (permalink / raw)
  To: Latvala, Petri, Sharma, Swati2; +Cc: igt-dev



>-----Original Message-----
>From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Petri Latvala
>Sent: Wednesday, January 8, 2020 2:59 PM
>To: Sharma, Swati2 <swati2.sharma@intel.com>
>Cc: igt-dev@lists.freedesktop.org
>Subject: Re: [igt-dev] [PATCH i-g-t 6/7] tests/kms_hdr: Add subtest to validate HDR
>mode using luminance sensor
>
>On Tue, Dec 31, 2019 at 06:51:57PM +0530, Swati Sharma wrote:
>> From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>>
>> Add subtest to validate HDR mode by setting the static metadata and
>> this involves display level verification for infoframes using a
>> luminance sensor. Therefore, luminance sensor is required for this
>> subtest, if sensor is not available test will skip.
>>
>> On intel driver, haven't validated this subtest but included this for
>> amd driver.
>>
>> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>> ---
>>  tests/kms_hdr.c | 271
>> ++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 271 insertions(+)
>>
>> diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c index
>> dfd377b5..a63021b1 100644
>> --- a/tests/kms_hdr.c
>> +++ b/tests/kms_hdr.c
>> @@ -44,6 +44,7 @@ enum {
>>  	TEST_NONE = 0,
>>  	TEST_DPMS = 1 << 0,
>>  	TEST_SUSPEND = 1 << 1,
>> +	TEST_OUTPUT = 1 << 2,
>>  };
>>
>>  /* BPC connector state. */
>> @@ -61,6 +62,7 @@ typedef struct data {
>>  	igt_pipe_crc_t *pipe_crc;
>>  	drmModeModeInfo *mode;
>>  	enum pipe pipe_id;
>> +	int sensor_fd;
>>  	int fd;
>>  	int w;
>>  	int h;
>> @@ -165,6 +167,7 @@ static void prepare_test(data_t *data,
>> igt_output_t *output, enum pipe pipe)
>>
>>  	data->w = data->mode->hdisplay;
>>  	data->h = data->mode->vdisplay;
>> +	data->sensor_fd = -1;
>>  }
>>
>>  static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
>> @@ -393,6 +396,269 @@ static void test_static_toggle(data_t *data, igt_output_t
>*output,
>>  	}
>>  }
>>
>> +/*
>> + * Loads the sensor if unloaded. The sensor is a serial to USB
>> +interface that
>> + * prints the current measured luminance (nits) as a float, separated
>> +by a
>> + * newline. Uses baudrate 9600.
>> + */
>> +static void open_sensor(data_t *data) {
>> +	struct termios toptions;
>> +	int res;
>> +
>> +	/* Return if already loaded. */
>> +	if (data->sensor_fd >= 0)
>> +		return;
>> +
>> +	data->sensor_fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY);
>
>What is the sensor device in question? How can you even know this device, if it exists,
>is the sensor?
>
>Connecting a usb-serial cable for a debug terminal is common enough to warrant not
>using ttyUSB0 blindly.

I agree, this is a hard coding and need to have better detection mechanism to identify
if a luminance sensor is actually present.

>
>> +	if (data->sensor_fd < 0) {
>> +		igt_info("Luminance sensor not found.\n");
>> +		return;
>> +	}
>> +
>> +	res = tcgetattr(data->sensor_fd, &toptions);
>> +	igt_assert_lte(0, res);
>> +
>> +	cfsetispeed(&toptions, B9600);
>> +	cfsetospeed(&toptions, B9600);
>> +
>> +	toptions.c_cflag &= ~(PARENB | CSTOPB | CSIZE);
>> +	toptions.c_cflag |= (CS8 | CREAD | CLOCAL);
>> +	toptions.c_lflag |= ICANON;
>> +
>> +	cfmakeraw(&toptions);
>> +
>> +	res = tcsetattr(data->sensor_fd, TCSANOW, &toptions);
>> +	igt_assert_lte(0, res);
>> +
>> +	res = tcsetattr(data->sensor_fd, TCSAFLUSH, &toptions);
>> +	igt_assert_lte(0, res);
>> +}
>> +
>> +/* Reads a string from the sensor. */ static void
>> +get_sensor_str(data_t *data, char *dst, int dst_bytes) {
>> +	char c = 0;
>> +	int i = 0;
>> +
>> +	igt_require(data->sensor_fd >= 0);
>> +	igt_set_timeout(3, "Waiting for sensor read\n");
>> +
>> +	dst_bytes -= 1;
>> +
>> +	while (c != '\n' && i < dst_bytes) {
>> +		int n = read(data->sensor_fd, &c, 1);
>> +		igt_assert_lte(0, n);
>> +
>> +		dst[i++] = c;
>> +	}
>> +
>> +	igt_reset_timeout();
>> +
>> +	if (dst_bytes > 0) {
>> +		dst[i] = 0;
>> +	}
>
>
>The buffer can be left non-nul-terminated if the device gives too much text.
>
>
>--
>Petri Latvala
>
>
>
>
>> +}
>> +
>> +/* Asserts that two given values in nits are equal within a given threshold. */
>> +static void assert_nits_equal(double n0, double n1, double threshold)
>> +{
>> +	double diff = fabs(n0 - n1);
>> +
>> +	igt_assert_f(diff <= threshold,
>> +		     "Nits not in threshold: | %.3f - %.3f | > %.3f\n",
>> +		     n0, n1, threshold);
>> +}
>> +
>> +/* Returns the current luminance reading from the sensor in cd/m^2. */
>> +static float get_sensor_nits(data_t *data)
>> +{
>> +	float nits = -1.0f;
>> +	char buf[32];
>> +
>> +	/* Sensor opening is deferred until we actually need it - here. */
>> +	open_sensor(data);
>> +
>> +	/* Flush old data from the buffer in case it's been a while. */
>> +	igt_require(data->sensor_fd >= 0);
>> +	tcflush(data->sensor_fd, TCIOFLUSH);
>> +
>> +	/* Read twice so we get a clean line. */
>> +	get_sensor_str(data, buf, ARRAY_SIZE(buf));
>> +	get_sensor_str(data, buf, ARRAY_SIZE(buf));
>> +
>> +	sscanf(buf, "%f", &nits);
>> +
>> +	return nits;
>> +}
>> +
>> +/* Logs the cursor sensor nits. */
>> +static void log_sensor_nits(double nits)
>> +{
>> +	igt_info("Sensor: %.3f nits\n", nits);
>> +}
>> +
>> +/*
>> + * Waits for the monitor to light-up to a given threshold, useful for
>> + * post-modeset measurement.
>> + */
>> +static void wait_for_threshold(data_t *data, double threshold)
>> +{
>> +	/*
>> +	 * If we read too quick the sensor might still be lit up.
>> +	 * Easy hack: just wait a second.
>> +	 */
>> +	sleep(1);
>> +
>> +	/* Poll sensor until lightup. */
>> +	igt_set_timeout(5, "Waiting for sensor read\n");
>> +
>> +	for (;;) {
>> +		double nits = get_sensor_nits(data);
>> +
>> +		if (nits >= threshold)
>> +			break;
>> +	}
>> +
>> +	igt_reset_timeout();
>> +}
>> +
>> +/* PQ Inverse, L normalized luminance to signal value V. */
>> +static double calc_pq_inverse(double l)
>> +{
>> +	double c1 = 0.8359375;
>> +	double c2 = 18.8515625;
>> +	double c3 = 18.6875;
>> +	double m1 = 0.1593017578125;
>> +	double m2 = 78.84375;
>> +	double lm = pow(l, m1);
>> +
>> +	return pow((c1 + c2 * lm) / (1.0 + c3 * lm), m2);
>> +}
>> +
>> +/* Fills the FB with a solid color given mapping to a light value in nits. */
>> +static void draw_light(igt_fb_t *fb, double nits)
>> +{
>> +	cairo_t *cr;
>> +	double l, v;
>> +	int x, y, w, h;
>> +
>> +	cr = igt_get_cairo_ctx(fb->fd, fb);
>> +
>> +	l = nits / 10000.0;
>> +	v = calc_pq_inverse(l);
>> +
>> +	/*
>> +	 * Draw a white rect in the bottom center of the screen for the sensor.
>> +	 * It's only 10% of the width and height of the screen since not every
>> +	 * monitor is capable of full HDR brightness for the whole screen.
>> +	 */
>> +	w = fb->width * 0.10;
>> +	h = fb->height * 0.10;
>> +	x = (fb->width - w) / 2;
>> +	y = (fb->height - h);
>> +
>> +	igt_paint_color(cr, 0, 0, fb->width, fb->height, 0.0, 0.0, 0.0);
>> +	igt_paint_color(cr, x, y, w, h, v, v, v);
>> +
>> +	igt_put_cairo_ctx(fb->fd, fb, cr);
>> +}
>> +
>> +/*
>> + * Note: This test is display specific in the sense that it requries
>> + * a display that is capable of going above SDR brightness levels.
>> + * Most HDR400 or higher certified displays should be capable of this.
>> + *
>> + * Some displays may require first limiting the output brightness
>> + * in the OSD for this to work.
>> + *
>> + * Requires the luminance sensor to be attached to the test machine,
>> + * if sensor isn't attached to the test machine, test will skip.
>> + */
>> +static void test_static_output(data_t *data, igt_output_t *output)
>> +{
>> +	igt_display_t *display = &data->display;
>> +	struct hdr_output_metadata hdr;
>> +	enum pipe pipe;
>> +	igt_fb_t afb;
>> +	int afb_id;
>> +	double lightup = 100.0;
>> +	double threshold = 15.0;
>> +	double nits_sdr0, nits_sdr1, nits_sdr2, nits_hdr;
>> +
>> +	for_each_pipe(display, pipe) {
>> +		if (!igt_pipe_connector_valid(pipe, output))
>> +			continue;
>> +
>> +		if (!igt_pipe_is_free(display, pipe))
>> +			continue;
>> +
>> +		prepare_test(data, output, pipe);
>> +
>> +		afb_id = igt_create_fb(data->fd, data->w, data->h,
>DRM_FORMAT_XRGB2101010, 0, &afb);
>> +		igt_assert(afb_id);
>> +
>> +		draw_light(&afb, 10000.0);
>> +
>> +		igt_info("Test SDR, 8bpc\n");
>> +		igt_plane_set_fb(data->primary, &afb);
>> +		igt_plane_set_size(data->primary, data->w, data->h);
>> +		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 8);
>> +		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>> +		if (is_amdgpu_device(data->fd))
>> +			assert_output_bpc(data, 8);
>> +
>> +		wait_for_threshold(data, lightup);
>> +		nits_sdr0 = get_sensor_nits(data);
>> +		log_sensor_nits(nits_sdr0);
>> +
>> +		igt_info("Test SDR, 10bpc\n");
>> +		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 10);
>> +		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>> +		if (is_amdgpu_device(data->fd))
>> +			assert_output_bpc(data, 10);
>> +
>> +		wait_for_threshold(data, lightup);
>> +		nits_sdr1 = get_sensor_nits(data);
>> +		log_sensor_nits(nits_sdr1);
>> +
>> +		igt_info("Test HDR, 10bpc\n");
>> +		fill_hdr_output_metadata_st2048(&hdr);
>> +		set_hdr_output_metadata(data, &hdr);
>> +		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 10);
>> +		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>> +
>> +		wait_for_threshold(data, lightup);
>> +		nits_hdr = get_sensor_nits(data);
>> +		log_sensor_nits(nits_hdr);
>> +
>> +		igt_info("Exit HDR into SDR, 8bpc\n");
>> +		set_hdr_output_metadata(data, NULL);
>> +		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 8);
>> +		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>> +		if (is_amdgpu_device(data->fd))
>> +			assert_output_bpc(data, 8);
>> +
>> +		wait_for_threshold(data, lightup);
>> +		nits_sdr2 = get_sensor_nits(data);
>> +		log_sensor_nits(nits_sdr2);
>> +
>> +		/* Verify that all nit values were as expected. */
>> +		assert_nits_equal(nits_sdr0, nits_sdr1, threshold);
>> +		assert_nits_equal(nits_sdr0, nits_sdr2, threshold);
>> +
>> +		igt_assert_f(nits_hdr - nits_sdr0 > threshold * 2.0,
>> +		     "No measurable difference between SDR and HDR luminance: "
>> +		     "threshold=%.1f actual=%.1f\n",
>> +		     threshold * 2.0, nits_hdr - nits_sdr0);
>> +
>> +		test_fini(data);
>> +		igt_remove_fb(data->fd, &afb);
>> +
>> +		break;
>> +	}
>> +}
>> +
>>  /* Returns true if an output supports hdr metadata property */
>>  static bool has_hdr(igt_output_t *output)
>>  {
>> @@ -418,6 +684,8 @@ static void test_hdr(data_t *data, const char *test_name,
>uint32_t flags)
>>  		igt_info("HDR %s test execution on %s\n", test_name, output-
>>name);
>>  		if (flags & TEST_NONE || flags & TEST_DPMS || flags &
>TEST_SUSPEND)
>>  			test_static_toggle(data, output, flags);
>> +		if (flags & TEST_OUTPUT)
>> +			test_static_output(data, output);
>>  		valid_tests++;
>>  	}
>>
>> @@ -453,6 +721,9 @@ igt_main
>>  	igt_describe("Tests static toggle with suspend");
>>  	igt_subtest("static-toggle-suspend") test_hdr(&data, "static-toggle-suspend",
>TEST_SUSPEND);
>>
>> +	igt_describe("Tests HDR mode by setting the static metadata");
>> +	igt_subtest("static-output") test_hdr(&data, "static-output", TEST_OUTPUT);
>> +
>>  	igt_fixture {
>>  		igt_display_fini(&data.display);
>>  	}
>> --
>> 2.24.1
>>
>> _______________________________________________
>> igt-dev mailing list
>> igt-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/igt-dev
>_______________________________________________
>igt-dev mailing list
>igt-dev@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 7/7] tests/kms_hdr: Add subtest to swap static HDR metadata
  2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 7/7] tests/kms_hdr: Add subtest to swap static HDR metadata Swati Sharma
  2020-01-02 13:29   ` Kazlauskas, Nicholas
@ 2020-01-14 15:08   ` Shankar, Uma
  1 sibling, 0 replies; 24+ messages in thread
From: Shankar, Uma @ 2020-01-14 15:08 UTC (permalink / raw)
  To: Sharma, Swati2, igt-dev



>-----Original Message-----
>From: Sharma, Swati2 <swati2.sharma@intel.com>
>Sent: Tuesday, December 31, 2019 6:52 PM
>To: igt-dev@lists.freedesktop.org
>Cc: ville.syrjala@linux.intel.com; Shankar, Uma <uma.shankar@intel.com>; Hiler,
>Arkadiusz <arkadiusz.hiler@intel.com>; Nicholas Kazlauskas
><nicholas.kazlauskas@amd.com>; Sharma, Swati2 <swati2.sharma@intel.com>
>Subject: [igt-dev][PATCH i-g-t 7/7] tests/kms_hdr: Add subtest to swap static HDR
>metadata
>
>From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>
>Add subtest to enable fast static metadata switches.
>
>Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>---
> tests/kms_hdr.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 109 insertions(+)
>
>diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c index a63021b1..b2fc8fe3 100644
>--- a/tests/kms_hdr.c
>+++ b/tests/kms_hdr.c
>@@ -45,6 +45,7 @@ enum {
> 	TEST_DPMS = 1 << 0,
> 	TEST_SUSPEND = 1 << 1,
> 	TEST_OUTPUT = 1 << 2,
>+	TEST_SWAP = 1 << 3,
> };
>
> /* BPC connector state. */
>@@ -659,6 +660,110 @@ static void test_static_output(data_t *data, igt_output_t
>*output)
> 	}
> }
>
>+/* Fills some test values for HDR metadata targeting SDR. */ static
>+void fill_hdr_output_metadata_sdr(struct hdr_output_metadata *meta) {
>+	memset(meta, 0, sizeof(*meta));
>+
>+	meta->metadata_type = HDMI_STATIC_METADATA_TYPE1;
>+	meta->hdmi_metadata_type1.eotf =
>HDMI_EOTF_TRADITIONAL_GAMMA_SDR;
>+
>+	/* Rec. 709 */
>+	meta->hdmi_metadata_type1.display_primaries[0].x =
>+		calc_hdr_float(0.640); /* Red */
>+	meta->hdmi_metadata_type1.display_primaries[0].y =
>+		calc_hdr_float(0.330);
>+	meta->hdmi_metadata_type1.display_primaries[1].x =
>+		calc_hdr_float(0.300); /* Green */
>+	meta->hdmi_metadata_type1.display_primaries[1].y =
>+		calc_hdr_float(0.600);
>+	meta->hdmi_metadata_type1.display_primaries[2].x =
>+		calc_hdr_float(0.150); /* Blue */
>+	meta->hdmi_metadata_type1.display_primaries[2].y =
>+		calc_hdr_float(0.006);
>+	meta->hdmi_metadata_type1.white_point.x = calc_hdr_float(0.3127);
>+	meta->hdmi_metadata_type1.white_point.y = calc_hdr_float(0.3290);
>+
>+	meta->hdmi_metadata_type1.max_display_mastering_luminance = 0;
>+	meta->hdmi_metadata_type1.min_display_mastering_luminance = 0;
>+	meta->hdmi_metadata_type1.max_fall = 0;
>+	meta->hdmi_metadata_type1.max_cll = 0; }
>+
>+static void test_static_swap(data_t *data, igt_output_t *output) {
>+	igt_display_t *display = &data->display;
>+	igt_crc_t ref_crc, new_crc;
>+	enum pipe pipe;
>+	igt_fb_t afb;
>+	int afb_id;
>+	struct hdr_output_metadata hdr;
>+
>+	for_each_pipe(display, pipe) {
>+		if (!igt_pipe_connector_valid(pipe, output))
>+			continue;
>+
>+		if (!igt_pipe_is_free(display, pipe))
>+			continue;
>+
>+		prepare_test(data, output, pipe);
>+
>+		/* 10-bit formats are slow, so limit the size. */
>+		afb_id = igt_create_fb(data->fd, 512, 512,
>DRM_FORMAT_XRGB2101010, 0, &afb);
>+		igt_assert(afb_id);
>+
>+		draw_hdr_pattern(&afb);
>+
>+		/* Start in SDR. */
>+		igt_plane_set_fb(data->primary, &afb);
>+		igt_plane_set_size(data->primary, data->w, data->h);
>+		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 8);
>+		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>+		if (is_amdgpu_device(data->fd))
>+			assert_output_bpc(data, 8);
>+
>+		/* Enter HDR, a modeset is allowed here. */
>+		fill_hdr_output_metadata_st2048(&hdr);
>+		set_hdr_output_metadata(data, &hdr);
>+		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 10);
>+		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>+		if (is_amdgpu_device(data->fd))
>+			assert_output_bpc(data, 10);
>+
>+		igt_pipe_crc_collect_crc(data->pipe_crc, &ref_crc);
>+
>+		/* Change the mastering information, no modeset allowed. */
>+		hdr.hdmi_metadata_type1.max_display_mastering_luminance = 200;
>+		hdr.hdmi_metadata_type1.max_fall = 200;
>+		hdr.hdmi_metadata_type1.max_cll = 100;
>+
>+		set_hdr_output_metadata(data, &hdr);
>+		igt_display_commit_atomic(display, 0, NULL);

We don't allow infoframe change in normal flip call in i915 without modeset, this will fail. 
Please add a check for allow modeset for i915 and execute the test.

With this fixed,
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

>+
>+		/* Enter SDR via metadata, no modeset allowed. */
>+		fill_hdr_output_metadata_sdr(&hdr);
>+		set_hdr_output_metadata(data, &hdr);
>+		igt_display_commit_atomic(display, 0, NULL);
>+
>+		igt_pipe_crc_collect_crc(data->pipe_crc, &new_crc);
>+
>+		/* Exit SDR and enter 8bpc, cleanup. */
>+		set_hdr_output_metadata(data, NULL);
>+		igt_output_set_prop_value(data->output,
>IGT_CONNECTOR_MAX_BPC, 8);
>+		igt_display_commit_atomic(display,
>DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>+		if (is_amdgpu_device(data->fd))
>+			assert_output_bpc(data, 8);
>+
>+		/* Verify that the CRC didn't change while cycling metadata. */
>+		igt_assert_crc_equal(&ref_crc, &new_crc);
>+
>+		test_fini(data);
>+		igt_remove_fb(data->fd, &afb);
>+
>+		break;
>+	}
>+}
>+
> /* Returns true if an output supports hdr metadata property */  static bool
>has_hdr(igt_output_t *output)  { @@ -686,6 +791,8 @@ static void test_hdr(data_t
>*data, const char *test_name, uint32_t flags)
> 			test_static_toggle(data, output, flags);
> 		if (flags & TEST_OUTPUT)
> 			test_static_output(data, output);
>+		if (flags & TEST_SWAP)
>+			test_static_swap(data, output);
> 		valid_tests++;
> 	}
>
>@@ -723,6 +830,8 @@ igt_main
>
> 	igt_describe("Tests HDR mode by setting the static metadata");
> 	igt_subtest("static-output") test_hdr(&data, "static-output", TEST_OUTPUT);
>+	igt_describe("Tests swapping static HDR metadata");
>+	igt_subtest("static-swap") test_hdr(&data, "static-swap", TEST_SWAP);
>
> 	igt_fixture {
> 		igt_display_fini(&data.display);
>--
>2.24.1

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

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

* [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA connector property
  2020-01-29  6:50 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
@ 2020-01-29  6:50 ` Swati Sharma
  0 siblings, 0 replies; 24+ messages in thread
From: Swati Sharma @ 2020-01-29  6:50 UTC (permalink / raw)
  To: igt-dev; +Cc: matthew.d.ropper, petri.latvala

From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

...and also reset it when resetting outputs since that can definitely
affect CRC output on other tests when not reset.

v2: rebase
v3: rebase
v4: Updated doc for igt_display_reset [Petri]

Cc: Leo Li <sunpeng.li@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
---
 lib/igt_kms.c | 6 ++++++
 lib/igt_kms.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index b0b064c9..b636b86f 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -417,6 +417,7 @@ const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 	[IGT_CONNECTOR_HDCP_CONTENT_TYPE] = "HDCP Content Type",
 	[IGT_CONNECTOR_LINK_STATUS] = "link-status",
 	[IGT_CONNECTOR_MAX_BPC] = "max bpc",
+	[IGT_CONNECTOR_HDR_OUTPUT_METADATA] = "HDR_OUTPUT_METADATA",
 };
 
 /*
@@ -1794,6 +1795,10 @@ static void igt_output_reset(igt_output_t *output)
 	if (igt_output_has_prop(output, IGT_CONNECTOR_CONTENT_PROTECTION))
 		igt_output_set_prop_enum(output, IGT_CONNECTOR_CONTENT_PROTECTION,
 					 "Undesired");
+
+	if (igt_output_has_prop(output, IGT_CONNECTOR_HDR_OUTPUT_METADATA))
+		igt_output_set_prop_value(output,
+					  IGT_CONNECTOR_HDR_OUTPUT_METADATA, 0);
 }
 
 /**
@@ -1807,6 +1812,7 @@ static void igt_output_reset(igt_output_t *output)
  * - %IGT_CONNECTOR_CRTC_ID
  * - %IGT_CONNECTOR_BROADCAST_RGB (if applicable)
  *   %IGT_CONNECTOR_CONTENT_PROTECTION (if applicable)
+ *   %IGT_CONNECTOR_HDR_OUTPUT_METADATA (if applicable)
  * - igt_output_override_mode() to default.
  *
  * For pipes:
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 36077d41..4766bfce 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -126,6 +126,7 @@ enum igt_atomic_connector_properties {
        IGT_CONNECTOR_HDCP_CONTENT_TYPE,
        IGT_CONNECTOR_LINK_STATUS,
        IGT_CONNECTOR_MAX_BPC,
+       IGT_CONNECTOR_HDR_OUTPUT_METADATA,
        IGT_NUM_CONNECTOR_PROPS
 };
 
-- 
2.24.1

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

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

* [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA connector property
  2020-01-24 14:24 [igt-dev] [PATCH i-g-t 0/7] " Swati Sharma
@ 2020-01-24 14:24 ` Swati Sharma
  0 siblings, 0 replies; 24+ messages in thread
From: Swati Sharma @ 2020-01-24 14:24 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala, maarten.lankhorst

From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

...and also reset it when resetting outputs since that can definitely
affect CRC output on other tests when not reset.

v2: rebase
v3: rebase
v4: Updated doc for igt_display_reset [Petri]

Cc: Leo Li <sunpeng.li@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
---
 lib/igt_kms.c | 6 ++++++
 lib/igt_kms.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index b0b064c9..b636b86f 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -417,6 +417,7 @@ const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 	[IGT_CONNECTOR_HDCP_CONTENT_TYPE] = "HDCP Content Type",
 	[IGT_CONNECTOR_LINK_STATUS] = "link-status",
 	[IGT_CONNECTOR_MAX_BPC] = "max bpc",
+	[IGT_CONNECTOR_HDR_OUTPUT_METADATA] = "HDR_OUTPUT_METADATA",
 };
 
 /*
@@ -1794,6 +1795,10 @@ static void igt_output_reset(igt_output_t *output)
 	if (igt_output_has_prop(output, IGT_CONNECTOR_CONTENT_PROTECTION))
 		igt_output_set_prop_enum(output, IGT_CONNECTOR_CONTENT_PROTECTION,
 					 "Undesired");
+
+	if (igt_output_has_prop(output, IGT_CONNECTOR_HDR_OUTPUT_METADATA))
+		igt_output_set_prop_value(output,
+					  IGT_CONNECTOR_HDR_OUTPUT_METADATA, 0);
 }
 
 /**
@@ -1807,6 +1812,7 @@ static void igt_output_reset(igt_output_t *output)
  * - %IGT_CONNECTOR_CRTC_ID
  * - %IGT_CONNECTOR_BROADCAST_RGB (if applicable)
  *   %IGT_CONNECTOR_CONTENT_PROTECTION (if applicable)
+ *   %IGT_CONNECTOR_HDR_OUTPUT_METADATA (if applicable)
  * - igt_output_override_mode() to default.
  *
  * For pipes:
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 36077d41..4766bfce 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -126,6 +126,7 @@ enum igt_atomic_connector_properties {
        IGT_CONNECTOR_HDCP_CONTENT_TYPE,
        IGT_CONNECTOR_LINK_STATUS,
        IGT_CONNECTOR_MAX_BPC,
+       IGT_CONNECTOR_HDR_OUTPUT_METADATA,
        IGT_NUM_CONNECTOR_PROPS
 };
 
-- 
2.24.1

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

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

end of thread, other threads:[~2020-01-29  7:01 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-31 13:21 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 1/7] headers: Bump drm uapi headers Swati Sharma
2020-01-14 14:26   ` Shankar, Uma
2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 2/7] lib/igt_kms: Add max bpc connector property Swati Sharma
2020-01-14 14:30   ` Shankar, Uma
2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA " Swati Sharma
2020-01-08  9:33   ` Petri Latvala
2020-01-14 14:32   ` Shankar, Uma
2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 4/7] tests/kms_hdr: Add bpc switch subtests Swati Sharma
2020-01-14 14:51   ` Shankar, Uma
2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 5/7] tests/kms_hdr: Add static toggle SDR->HDR mode subtests Swati Sharma
2020-01-14 14:59   ` Shankar, Uma
2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 6/7] tests/kms_hdr: Add subtest to validate HDR mode using luminance sensor Swati Sharma
2020-01-08  9:28   ` Petri Latvala
2020-01-14 15:03     ` Shankar, Uma
2019-12-31 13:21 ` [igt-dev] [PATCH i-g-t 7/7] tests/kms_hdr: Add subtest to swap static HDR metadata Swati Sharma
2020-01-02 13:29   ` Kazlauskas, Nicholas
2020-01-03 13:35     ` Sharma, Swati2
2020-01-08  9:35       ` Petri Latvala
2020-01-14 15:08   ` Shankar, Uma
2019-12-31 14:05 ` [igt-dev] ✓ Fi.CI.BAT: success for Add tests for HDR metadata interfaces and bpc switch Patchwork
2019-12-31 18:44 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-01-24 14:24 [igt-dev] [PATCH i-g-t 0/7] " Swati Sharma
2020-01-24 14:24 ` [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA connector property Swati Sharma
2020-01-29  6:50 [igt-dev] [PATCH i-g-t 0/7] Add tests for HDR metadata interfaces and bpc switch Swati Sharma
2020-01-29  6:50 ` [igt-dev] [PATCH i-g-t 3/7] lib/igt_kms: Add HDR_OUTPUT_METADATA connector property Swati Sharma

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.