All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
@ 2021-11-19 15:00 Rodrigo Siqueira
  2021-11-19 16:34 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Rodrigo Siqueira @ 2021-11-19 15:00 UTC (permalink / raw)
  To: igt-dev, harry.wentland, Nicholas.Choi, markyacoub
  Cc: Mikita Lipski, Eryk Brol

From: Eryk Brol <eryk.brol@amd.com>

This commit introduces a DP DSC test that checks:

* Forces DSC on/off and ensures it is reset properly
* Check DSC slice height property
* Verify various DSC slice dimensions
* Tests various combinations of link_rate + lane_count and logs if DSC
  enabled/disabled Tests different bpc settings and logs if DSC is
  enabled/disabled

Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Nicholas Choi <Nicholas.Choi@amd.com>
Cc: Mark Yacoub <markyacoub@chromium.org>
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Signed-off-by: Eryk Brol <eryk.brol@amd.com>
---
 lib/igt_amd.c             | 494 +++++++++++++++++++++++++--
 lib/igt_amd.h             |  35 ++
 lib/igt_kms.h             |   1 +
 tests/amdgpu/amd_dp_dsc.c | 685 ++++++++++++++++++++++++++++++++++++++
 tests/amdgpu/meson.build  |   1 +
 5 files changed, 1194 insertions(+), 22 deletions(-)
 create mode 100644 tests/amdgpu/amd_dp_dsc.c

diff --git a/lib/igt_amd.c b/lib/igt_amd.c
index f1bfb421..4bcfd594 100644
--- a/lib/igt_amd.c
+++ b/lib/igt_amd.c
@@ -251,11 +251,11 @@ bool igt_amd_is_tiled(uint64_t modifier)
 }
 
 /**
- * igt_amd_output_has_hpd: check if connector has HPD debugfs entry
+ * igt_amd_output_has_dsc: check if connector has dsc debugfs entry
  * @drm_fd: DRM file descriptor
  * @connector_name: The connector's name, on which we're reading the status
  */
-static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
+static bool igt_amd_output_has_dsc(int drm_fd, char *connector_name)
 {
 	int fd;
 	int res;
@@ -267,9 +267,9 @@ static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
 		return false;
 	}
 
-	res = fstatat(fd, DEBUGFS_HPD_TRIGGER, &stat, 0);
+	res = fstatat(fd, DEBUGFS_DSC_CLOCK_EN , &stat, 0);
 	if (res != 0) {
-		igt_info("%s debugfs not supported\n", DEBUGFS_HPD_TRIGGER);
+		igt_info("%s debugfs not supported\n", DEBUGFS_DSC_CLOCK_EN);
 		close(fd);
 		return false;
 	}
@@ -279,49 +279,499 @@ static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
 }
 
 /**
- * igt_amd_require_hpd: Checks if connectors have HPD debugfs
+ * is_dp_dsc_supported: Checks if connector is DSC capable
+ * @display: A pointer to an #igt_display_t structure
+ * @drm_fd: DRM file descriptor
+ */
+bool is_dp_dsc_supported(int drm_fd, char *connector_name)
+{
+	char buf[512];
+	int fd, ret;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+
+	if (fd < 0) {
+		igt_info("Couldn't open connector %s debugfs directory\n",
+			 connector_name);
+		return false;
+	}
+
+	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
+	close(fd);
+
+	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
+		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
+
+	return strstr(buf, "DSC_Sink_Support: yes");
+}
+
+/**
+ * is_dp_fec_supported: Checks if connector is FEC capable
+ * @display: A pointer to an #igt_display_t structure
+ * @drm_fd: DRM file descriptor
+ */
+bool is_dp_fec_supported(int drm_fd, char *connector_name)
+{
+	char buf[512];
+	int fd, ret;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+
+	if (fd < 0) {
+		igt_info("Couldn't open connector %s debugfs directory\n",
+			 connector_name);
+		return false;
+	}
+
+	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
+	close(fd);
+
+	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
+		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
+
+	return strstr(buf, "FEC_Sink_Support: yes");
+}
+
+/**
+ * igt_amd_require_dsc: Checks if connectors have DSC debugfs
  * @display: A pointer to an #igt_display_t structure
  * @drm_fd: DRM file descriptor
  *
- * Checks if the AMDGPU driver has support the 'trigger_hotplug'
- * entry for HPD. Skip test if HPD is not supported.
+ * Checks if the AMDGPU driver has support of debugfs entries for
+ * DSC. Skip test if DSC is not supported.
  */
-void igt_amd_require_hpd(igt_display_t *display, int drm_fd)
+void igt_amd_require_dsc(igt_display_t *display, int drm_fd)
 {
 	igt_output_t *output;
 
 	for_each_connected_output(display, output) {
-		if (igt_amd_output_has_hpd(drm_fd, output->name))
+		if (igt_amd_output_has_dsc(drm_fd, output->name))
 			return;
 	}
 
-	igt_skip("No HPD debugfs support.\n");
+	igt_skip("No DSC debugfs support.\n");
 }
 
 /**
- * igt_amd_trigger_hotplut: Triggers a debugfs HPD
+ * igt_amd_read_dsc_clock_status: Read the DSC Clock Enable debugfs
  * @drm_fd: DRM file descriptor
- * @connector_name: The connector's name, which we trigger the hotplug on
+ * @connector_name: The connector's name, which we use to read status on
  *
- * igt_amd_require_hpd should be called before calling this.
  */
-int igt_amd_trigger_hotplug(int drm_fd, char *connector_name)
+int igt_amd_read_dsc_clock_status(int drm_fd, char *connector_name)
+{
+	char buf[4];
+	int fd, ret;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+	if (fd < 0) {
+		igt_info("Couldn't open connector %s debugfs directory\n",
+			 connector_name);
+		return false;
+	}
+	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_CLOCK_EN, buf, sizeof(buf));
+	close(fd);
+
+	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
+		     DEBUGFS_DSC_CLOCK_EN, connector_name);
+
+	return strtol(buf, NULL, 0);
+}
+
+
+/**
+ * igt_amd_write_dsc_clock_en: Write the DSC Clock Enable debugfs
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we use to read status on
+ * @dsc_force: DSC force parameter, 0 - DSC automatic, 1 - DSC force on,
+ * 2 - DSC force off
+ *
+ */
+void igt_amd_write_dsc_clock_en(int drm_fd, char *connector_name, int dsc_force)
+{
+	int fd, dsc_fd;
+	char src[4];
+	int wr_len;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+	igt_assert(fd >= 0);
+	dsc_fd = openat(fd, DEBUGFS_DSC_CLOCK_EN, O_WRONLY);
+	close(fd);
+	igt_assert(dsc_fd >= 0);
+
+	if (dsc_force == DSC_FORCE_ON)
+		snprintf(src, sizeof(src), "%d", 1);
+	else if (dsc_force == DSC_FORCE_OFF)
+		snprintf(src, sizeof(src), "%d", 2);
+	else
+		snprintf(src, sizeof(src), "%d", 0);
+
+	igt_info("DSC Clock force, write %s > dsc_clock_en\n", src);
+
+	wr_len = write(dsc_fd, src, strlen(src));
+	close(dsc_fd);
+	igt_assert_eq(wr_len, strlen(src));
+}
+
+/**
+ * igt_amd_write_dsc_param_slice_height: Write the DSC Slice Height debugfs
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we use to read status on
+ * @slice_height: DSC slice height parameter, accepts any positive integer,
+ * 		  if parameter is negative - it will not write to debugfs.
+ *
+ */
+void igt_amd_write_dsc_param_slice_height(int drm_fd, char *connector_name, int slice_height)
+{
+	int fd, dsc_fd;
+	char src[32];
+	int wr_len;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+	igt_assert(fd >= 0);
+	dsc_fd = openat(fd, DEBUGFS_DSC_SLICE_HEIGHT, O_WRONLY);
+	close(fd);
+	igt_assert(dsc_fd >= 0);
+
+	if (slice_height >= 0) {
+		snprintf(src, sizeof(src), "%#x", slice_height);
+	} else {
+		igt_warn("DSC SLICE HEIGHT, slice height parameter is invalid (%d)\n", slice_height);
+		goto exit;
+	}
+
+	igt_info("DSC SLICE HEIGHT, write %s > dsc_slice_height\n", src);
+
+	wr_len = write(dsc_fd, src, strlen(src));
+	igt_assert_eq(wr_len, strlen(src));
+exit:
+	close(dsc_fd);
+}
+
+/**
+ * igt_amd_read_dsc_param_slice_height: Read the DSC Slice Height debugfs
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we use to read status on
+ *
+ */
+int igt_amd_read_dsc_param_slice_height(int drm_fd, char *connector_name)
+{
+	char buf[32];
+	int fd, ret;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+	if (fd < 0) {
+		igt_info("Couldn't open connector %s debugfs directory\n",
+			 connector_name);
+		return false;
+	}
+	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_HEIGHT, buf, sizeof(buf));
+	close(fd);
+
+	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
+		     DEBUGFS_DSC_SLICE_HEIGHT, connector_name);
+
+	return strtol(buf, NULL, 0);
+}
+
+/**
+ * igt_amd_write_dsc_param_slice_width: Write the DSC Slice Width debugfs
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we use to read status on
+ * @slice_width: DSC slice width parameter, accepts any positive integer,
+ * 		 if parameter is negative - it will not write to debugfs.
+ *
+ */
+void igt_amd_write_dsc_param_slice_width(int drm_fd, char *connector_name, int slice_width)
 {
-	int fd, hpd_fd;
+	int fd, dsc_fd;
+	char src[32];
 	int wr_len;
-	const char *enable_hpd = "1";
 
 	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
 	igt_assert(fd >= 0);
-	hpd_fd = openat(fd, DEBUGFS_HPD_TRIGGER, O_WRONLY);
+	dsc_fd = openat(fd, DEBUGFS_DSC_SLICE_WIDTH, O_WRONLY);
+	close(fd);
+	igt_assert(dsc_fd >= 0);
+
+	if (slice_width >= 0) {
+		snprintf(src, sizeof(src), "%#x", slice_width);
+	} else {
+		igt_warn("DSC SLICE WIDTH, slice width parameter is invalid (%d)\n", slice_width);
+		goto exit;
+	}
+
+	igt_info("DSC SLICE WIDTH, write %s > dsc_slice_width\n", src);
+
+	wr_len = write(dsc_fd, src, strlen(src));
+	igt_assert_eq(wr_len, strlen(src));
+exit:
+	close(dsc_fd);
+}
+
+/**
+ * igt_amd_read_dsc_param_slice_width: Read the DSC Slice Width debugfs
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we use to read status on
+ *
+ */
+int igt_amd_read_dsc_param_slice_width(int drm_fd, char *connector_name)
+{
+	char buf[32];
+	int fd, ret;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+	if (fd < 0) {
+		igt_info("Couldn't open connector %s debugfs directory\n",
+			 connector_name);
+		return false;
+	}
+	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_WIDTH, buf, sizeof(buf));
 	close(fd);
-	igt_assert(hpd_fd >= 0);
 
-	wr_len = write(hpd_fd, enable_hpd, strlen(enable_hpd));
-	close(hpd_fd);
-	igt_assert_eq(wr_len, strlen(enable_hpd));
+	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
+		     DEBUGFS_DSC_SLICE_WIDTH, connector_name);
+
+	return strtol(buf, NULL, 0);
+}
+
+/**
+ * igt_amd_write_dsc_param_bpp: Write the DSC Bits Per Pixel debugfs
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we use to read status on
+ * @bpp: DSC bits per pixel parameter, accepts any positive integer,
+ * 	 if parameter is negative - it will not write to debugfs.
+ *
+ */
+void igt_amd_write_dsc_param_bpp(int drm_fd, char *connector_name, int bpp)
+{
+	int fd, dsc_fd;
+	char src[32];
+	int wr_len;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+	igt_assert(fd >= 0);
+	dsc_fd = openat(fd, DEBUGFS_DSC_BITS_PER_PIXEL, O_WRONLY);
+	close(fd);
+	igt_assert(dsc_fd >= 0);
+
+	if (bpp >= 0) {
+		snprintf(src, sizeof(src), "%#x", bpp);
+	} else {
+		igt_warn("DSC BITS PER PIXEL, bits per pixel parameter is invalid (%d)\n", bpp);
+		goto exit;
+	}
+
+	igt_info("DSC BITS PER PIXEL, write %s > dsc_bits_per_pixel\n", src);
+
+	wr_len = write(dsc_fd, src, strlen(src));
+	igt_assert_eq(wr_len, strlen(src));
+exit:
+	close(dsc_fd);
+}
+
+/**
+ * igt_amd_read_dsc_param_bpp: Read the DSC Bits Per Pixel debugfs
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we use to read status on
+ *
+ */
+int igt_amd_read_dsc_param_bpp(int drm_fd, char *connector_name)
+{
+	char buf[32];
+	int fd, ret;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+	if (fd < 0) {
+		igt_info("Couldn't open connector %s debugfs directory\n",
+			 connector_name);
+		return false;
+	}
+	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_BITS_PER_PIXEL, buf, sizeof(buf));
+	close(fd);
+
+	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
+		     DEBUGFS_DSC_BITS_PER_PIXEL, connector_name);
+
+	return strtol(buf, NULL, 0);
+}
+
+/**
+ * igt_amd_read_dsc_param_pic_width: Read the DSC Picture Width debugfs
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we use to read status on
+ *
+ */
+int igt_amd_read_dsc_param_pic_width(int drm_fd, char *connector_name)
+{
+	char buf[4];
+	int fd, ret;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+	if (fd < 0) {
+		igt_info("Couldn't open connector %s debugfs directory\n",
+			 connector_name);
+		return false;
+	}
+	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_PIC_WIDTH, buf, sizeof(buf));
+	close(fd);
+
+	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
+		     DEBUGFS_DSC_PIC_WIDTH, connector_name);
+
+	return strtol(buf, NULL, 0);
+}
+
+/**
+ * igt_amd_read_dsc_param_pic_height: Read the DSC Picture Height debugfs
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we use to read status on
+ *
+ */
+int igt_amd_read_dsc_param_pic_height(int drm_fd, char *connector_name)
+{
+	char buf[4];
+	int fd, ret;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+	if (fd < 0) {
+		igt_info("Couldn't open connector %s debugfs directory\n",
+			 connector_name);
+		return false;
+	}
+	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_PIC_HEIGHT, buf, sizeof(buf));
+	close(fd);
+
+	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
+		     DEBUGFS_DSC_PIC_HEIGHT, connector_name);
+
+	return strtol(buf, NULL, 0);
+}
+
+/**
+ * igt_amd_read_dsc_param_chunk_size: Read the DSC Chunk Size debugfs
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we use to read status on
+ *
+ */
+int igt_amd_read_dsc_param_chunk_size(int drm_fd, char *connector_name)
+{
+	char buf[4];
+	int fd, ret;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+	if (fd < 0) {
+		igt_info("Couldn't open connector %s debugfs directory\n",
+			 connector_name);
+		return false;
+	}
+	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_CHUNK_SIZE, buf, sizeof(buf));
+	close(fd);
+
+	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
+		     DEBUGFS_DSC_CHUNK_SIZE, connector_name);
+
+	return strtol(buf, NULL, 0);
+}
+
+/**
+ * igt_amd_read_dsc_param_slice_bpg: Read the DSC Slice BPG Offset debugfs
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we use to read status on
+ *
+ */
+int igt_amd_read_dsc_param_slice_bpg(int drm_fd, char *connector_name)
+{
+	char buf[4];
+	int fd, ret;
+
+	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+	if (fd < 0) {
+		igt_info("Couldn't open connector %s debugfs directory\n",
+			 connector_name);
+		return false;
+	}
+	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_BPG, buf, sizeof(buf));
+	close(fd);
+
+	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
+		     DEBUGFS_DSC_SLICE_BPG, connector_name);
+
+	return strtol(buf, NULL, 0);
+}
+
+/**
+ * igt_amd_output_has_hpd: check if connector has HPD debugfs entry
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, on which we're reading the status
+ */
+static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
+{
+        int fd;
+        int res;
+        struct stat stat;
+
+        fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+        if (fd < 0) {
+                igt_info("output %s: debugfs not found\n", connector_name);
+                return false;
+        }
+
+        res = fstatat(fd, DEBUGFS_HPD_TRIGGER, &stat, 0);
+        if (res != 0) {
+                igt_info("%s debugfs not supported\n", DEBUGFS_HPD_TRIGGER);
+                close(fd);
+                return false;
+        }
+
+        close(fd);
+        return true;
+}
+
+/**
+ * igt_amd_require_hpd: Checks if connectors have HPD debugfs
+ * @display: A pointer to an #igt_display_t structure
+ * @drm_fd: DRM file descriptor
+ *
+ * Checks if the AMDGPU driver has support the 'trigger_hotplug'
+ * entry for HPD. Skip test if HPD is not supported.
+ */
+void igt_amd_require_hpd(igt_display_t *display, int drm_fd)
+{
+        igt_output_t *output;
+
+        for_each_connected_output(display, output) {
+                if (igt_amd_output_has_hpd(drm_fd, output->name))
+                        return;
+        }
+
+        igt_skip("No HPD debugfs support.\n");
+}
+
+/**
+ * igt_amd_trigger_hotplut: Triggers a debugfs HPD
+ * @drm_fd: DRM file descriptor
+ * @connector_name: The connector's name, which we trigger the hotplug on
+ *
+ * igt_amd_require_hpd should be called before calling this.
+ */
+int igt_amd_trigger_hotplug(int drm_fd, char *connector_name)
+{
+        int fd, hpd_fd;
+        int wr_len;
+        const char *enable_hpd = "1";
+
+        fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
+        igt_assert(fd >= 0);
+        hpd_fd = openat(fd, DEBUGFS_HPD_TRIGGER, O_WRONLY);
+        close(fd);
+        igt_assert(hpd_fd >= 0);
+
+        wr_len = write(hpd_fd, enable_hpd, strlen(enable_hpd));
+        close(hpd_fd);
+        igt_assert_eq(wr_len, strlen(enable_hpd));
 
-	return 0;
+        return 0;
 }
 
 /*
diff --git a/lib/igt_amd.h b/lib/igt_amd.h
index e5bdbf33..7a91cbff 100644
--- a/lib/igt_amd.h
+++ b/lib/igt_amd.h
@@ -27,9 +27,27 @@
 #include "igt.h"
 #include "igt_fb.h"
 
+/* Read & Write DSC parameters */
+#define DEBUGFS_DSC_CLOCK_EN "dsc_clock_en"
+#define DEBUGFS_DSC_SLICE_WIDTH "dsc_slice_width"
+#define DEBUGFS_DSC_SLICE_HEIGHT "dsc_slice_height"
+#define DEBUGFS_DSC_BITS_PER_PIXEL "dsc_bits_per_pixel"
+/* Read only DSC parameters */
+#define DEBUGFS_DSC_PIC_WIDTH "dsc_pic_width"
+#define DEBUGFS_DSC_PIC_HEIGHT "dsc_pic_height"
+#define DEBUGFS_DSC_CHUNK_SIZE "dsc_chunk_size"
+#define DEBUGFS_DSC_SLICE_BPG "dsc_slice_bpg"
+#define DEBUGFS_DSC_FEC_SUPPORT "dp_dsc_fec_support"
+
 #define DEBUGFS_DP_LINK_SETTINGS "link_settings"
 #define DEBUGFS_HPD_TRIGGER "trigger_hotplug"
 
+enum amd_dsc_clock_force {
+	DSC_AUTOMATIC = 0,
+	DSC_FORCE_ON,
+	DSC_FORCE_OFF,
+};
+
 enum dc_lane_count {
 	LANE_COUNT_UNKNOWN = 0,
 	LANE_COUNT_ONE = 1,
@@ -80,6 +98,23 @@ void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void *dst_buf,
 				       struct igt_fb *src, void *src_buf);
 bool igt_amd_is_tiled(uint64_t modifier);
 
+/* IGT DSC helper functions */
+bool is_dp_dsc_supported(int drm_fd, char *connector_name);
+bool is_dp_fec_supported(int drm_fd, char *connector_name);
+void igt_amd_require_dsc(igt_display_t *display, int drm_fd);
+int igt_amd_read_dsc_clock_status(int drm_fd, char *connector_name);
+void igt_amd_write_dsc_clock_en(int drm_fd, char *connector_name, int dsc_force);
+void igt_amd_write_dsc_param_slice_height(int drm_fd, char *connector_name, int slice_height);
+int igt_amd_read_dsc_param_slice_height(int drm_fd, char *connector_name);
+void igt_amd_write_dsc_param_slice_width(int drm_fd, char *connector_name, int slice_width);
+int igt_amd_read_dsc_param_slice_width(int drm_fd, char *connector_name);
+void igt_amd_write_dsc_param_bpp(int drm_fd, char *connector_name, int bpp);
+int igt_amd_read_dsc_param_bpp(int drm_fd, char *connector_name);
+int igt_amd_read_dsc_param_pic_width(int drm_fd, char *connector_name);
+int igt_amd_read_dsc_param_pic_height(int drm_fd, char *connector_name);
+int igt_amd_read_dsc_param_chunk_size(int drm_fd, char *connector_name);
+int igt_amd_read_dsc_param_slice_bpg(int drm_fd, char *connector_name);
+
 /* IGT HPD helper functions */
 void igt_amd_require_hpd(igt_display_t *display, int drm_fd);
 int igt_amd_trigger_hotplug(int drm_fd, char *connector_name);
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index e9ecd21e..5c7d7481 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -125,6 +125,7 @@ enum igt_atomic_crtc_properties {
        IGT_CRTC_ACTIVE,
        IGT_CRTC_OUT_FENCE_PTR,
        IGT_CRTC_VRR_ENABLED,
+       IGT_CRTC_DSC_SLICE_HEIGHT,
        IGT_NUM_CRTC_PROPS
 };
 
diff --git a/tests/amdgpu/amd_dp_dsc.c b/tests/amdgpu/amd_dp_dsc.c
new file mode 100644
index 00000000..d73425e2
--- /dev/null
+++ b/tests/amdgpu/amd_dp_dsc.c
@@ -0,0 +1,685 @@
+/*
+ * Copyright 2021 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 "igt_amd.h"
+#include "sw_sync.h"
+#include <fcntl.h>
+#include <signal.h>
+
+#define NUM_SLICE_SLOTS 4
+
+/* Maximumm pipes on any AMD ASIC. */
+#define MAX_PIPES 6
+
+/* Common test data. */
+typedef struct data {
+	igt_display_t display;
+	igt_plane_t *primary[MAX_PIPES];
+	igt_output_t *output[MAX_PIPES];
+	igt_pipe_t *pipe[MAX_PIPES];
+	igt_pipe_crc_t *pipe_crc[MAX_PIPES];
+	drmModeModeInfo mode[MAX_PIPES];
+	enum pipe pipe_id[MAX_PIPES];
+	int fd;
+} data_t;
+
+/* BPC connector state. */
+typedef struct output_bpc {
+	unsigned int current;
+	unsigned int maximum;
+} output_bpc_t;
+
+/* Common test cleanup. */
+static void test_fini(data_t *data)
+{
+	igt_display_t *display = &data->display;
+	int i;
+
+	for (i = 0; i < display->n_pipes; ++i) {
+		igt_pipe_crc_free(data->pipe_crc[i]);
+	}
+
+	igt_display_reset(display);
+	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
+}
+
+/* Common test setup. */
+static void test_init(data_t *data)
+{
+	igt_display_t *display = &data->display;
+	int i, n;
+
+	for (i = 0; i < display->n_pipes; ++i) {
+		data->pipe_id[i] = PIPE_A + i;
+		data->pipe[i] = &data->display.pipes[data->pipe_id[i]];
+		data->primary[i] = igt_pipe_get_plane_type(
+				data->pipe[i], DRM_PLANE_TYPE_PRIMARY);
+		data->pipe_crc[i] =
+				igt_pipe_crc_new(data->fd, data->pipe_id[i], "auto");
+	}
+
+	for (i = 0, n = 0; i < display->n_outputs && n < display->n_pipes; ++i) {
+		igt_output_t *output = &display->outputs[i];
+		data->output[n] = output;
+
+		/* Only allow physically connected displays for the tests. */
+		if (!igt_output_is_connected(output))
+				continue;
+
+		/* Ensure that outpus are DP, DSC & FEC capable*/
+		if (!(is_dp_fec_supported(data->fd, output->name) &&
+			is_dp_dsc_supported(data->fd, output->name)))
+			continue;
+
+		if (output->config.connector->connector_type !=
+			DRM_MODE_CONNECTOR_DisplayPort)
+			continue;
+
+		igt_assert(kmstest_get_connector_default_mode(
+				data->fd, output->config.connector, &data->mode[n]));
+
+		n += 1;
+	}
+
+	igt_display_reset(display);
+}
+
+static void test_dsc_enable(data_t *data)
+{
+	bool dsc_on, dsc_after, dsc_before;
+	igt_display_t *display = &data->display;
+	igt_output_t *output;
+	igt_fb_t ref_fb;
+	int i, test_conn_cnt = 0;
+
+	test_init(data);
+	igt_enable_connectors(data->fd);
+
+	for (i = 0; i < display->n_pipes; i++) {
+		/* Setup the output */
+		output = data->output[i];
+		if (!output || !igt_output_is_connected(output))
+			continue;
+
+		igt_create_pattern_fb(data->fd,
+					data->mode[i].hdisplay,
+					data->mode[i].vdisplay,
+					DRM_FORMAT_XRGB8888,
+					0,
+					&ref_fb);
+		igt_output_set_pipe(output, data->pipe_id[i]);
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
+
+		test_conn_cnt++;
+
+		/* Save pipe's initial DSC state */
+		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
+
+		/* Force enable DSC */
+		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
+
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		/* Check if DSC is enabled */
+		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
+
+		/* Revert DSC to automatic state */
+		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
+
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+		igt_display_commit_atomic(display,DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
+
+		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+
+		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
+
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
+		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial state failed.\n");
+
+		/* Cleanup fb */
+		igt_remove_fb(data->fd, &ref_fb);
+	}
+
+	test_fini(data);
+	igt_skip_on(test_conn_cnt == 0);
+}
+
+static void test_dsc_slice_height_property(data_t *data)
+{
+	bool dsc_on, dsc_after, dsc_before;
+	int slice_height_on, slice_height_off;
+	igt_display_t *display = &data->display;
+	igt_output_t *output;
+	igt_fb_t ref_fb;
+	int i, test_conn_cnt = 0;
+
+	test_init(data);
+	igt_enable_connectors(data->fd);
+
+	for (i = 0; i < display->n_pipes; i++) {
+		/* Setup the output */
+		output = data->output[i];
+		if (!output || !igt_output_is_connected(output))
+			continue;
+
+		igt_create_pattern_fb(data->fd,
+					data->mode[i].hdisplay,
+					data->mode[i].vdisplay,
+					DRM_FORMAT_XRGB8888,
+					0,
+					&ref_fb);
+		igt_output_set_pipe(output, data->pipe_id[i]);
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
+
+		test_conn_cnt++;
+
+		/* Save pipe's initial DSC state */
+		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
+
+		/* Force enable DSC */
+		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
+
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		/* Check if DSC is enabled */
+		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
+
+		slice_height_on = igt_pipe_get_prop(display, data->pipe_id[i], IGT_CRTC_DSC_SLICE_HEIGHT);
+
+		/* Revert DSC to automatic state */
+		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
+
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
+
+		slice_height_off = igt_pipe_get_prop(display, data->pipe_id[i], IGT_CRTC_DSC_SLICE_HEIGHT);
+
+		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+
+		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
+
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
+		igt_assert_f(slice_height_on > 0, "DSC Slice property was not set properly.\n");
+		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial state failed.\n");
+		igt_assert_f(slice_height_off == 0, "DSC Slice property was not reset properly.\n");
+
+		/* Cleanup fb */
+		igt_remove_fb(data->fd, &ref_fb);
+	}
+
+	test_fini(data);
+	igt_skip_on(test_conn_cnt == 0);
+}
+
+static bool update_slice_height(data_t *data, int v_addressable,
+					  int *num_slices, igt_output_t *output, int conn_idx, igt_fb_t ref_fb)
+{
+	int i;
+	bool pass = true;
+
+	for(i = 0; i < NUM_SLICE_SLOTS; i++) {
+		int act_slice_height;
+		int slice_height = v_addressable / num_slices[i] + (v_addressable % num_slices[i]);
+
+		/* Overwrite DSC slice height */
+		igt_amd_write_dsc_param_slice_height(data->fd, output->name, slice_height);
+		igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
+		igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		igt_info("Forcing slice height: slice height %d num slices vertical %d\n", slice_height, num_slices[i]);
+
+		act_slice_height = igt_amd_read_dsc_param_slice_height(data->fd, output->name);
+
+		igt_info("Reading slice height: actual slice height %d VS assigned slice height %d\n", act_slice_height, slice_height);
+
+		pass = (slice_height == act_slice_height);
+
+		if (!pass)
+			break;
+	}
+
+	igt_amd_write_dsc_param_slice_height(data->fd, output->name, 0);
+	igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
+	igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+	return pass;
+}
+
+static bool update_slice_width(data_t *data, int h_addressable,
+					  int *num_slices, igt_output_t *output, int conn_idx, igt_fb_t ref_fb)
+{
+	int i;
+	bool pass = true;
+
+	for(i = 0; i < NUM_SLICE_SLOTS; i++) {
+		int act_slice_width;
+		int slice_width = h_addressable / num_slices[i] + (h_addressable % num_slices[i]);
+
+		/* Overwrite DSC slice width */
+		igt_amd_write_dsc_param_slice_width(data->fd, output->name, slice_width);
+		igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
+		igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		igt_info("Forcing slice width: slice width %d num slices horisontal %d\n", slice_width, num_slices[i]);
+
+		act_slice_width = igt_amd_read_dsc_param_slice_width(data->fd, output->name);
+
+		igt_info("Reading slice width: actual slice width %d VS assigned slice width %d\n", act_slice_width, slice_width);
+
+		pass = (slice_width == act_slice_width);
+
+		if (!pass)
+			break;
+	}
+
+	igt_amd_write_dsc_param_slice_width(data->fd, output->name, 0);
+	igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
+	igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+	return pass;
+}
+
+static void test_dsc_slice_dimensions_change(data_t *data)
+{
+	bool dsc_on, dsc_after, dsc_before;
+	igt_output_t *output;
+	igt_display_t *display = &data->display;
+	igt_fb_t ref_fb;
+	int num_slices [] = { 1, 2, 4, 8 };
+	int h_addressable, v_addressable;
+	bool ret_slice_height= false, ret_slice_width = false;
+	int i, test_conn_cnt = 0;
+
+	test_init(data);
+	igt_enable_connectors(data->fd);
+
+	for (i = 0; i < display->n_pipes; i++) {
+		/* Setup the output */
+		output = data->output[i];
+		if (!output || !igt_output_is_connected(output))
+			continue;
+
+		igt_create_pattern_fb(data->fd,
+					data->mode[i].hdisplay,
+					data->mode[i].vdisplay,
+					DRM_FORMAT_XRGB8888,
+					0,
+					&ref_fb);
+		igt_output_set_pipe(output, data->pipe_id[i]);
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
+
+		test_conn_cnt++;
+
+		h_addressable = data->mode->hdisplay;
+		v_addressable = data->mode->vdisplay;
+
+		igt_info("Mode info: v_ative %d  h_active %d\n", v_addressable, h_addressable);
+
+		/* Save pipe's initial DSC state */
+		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
+
+		/* Force enable DSC */
+		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
+
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		/* Check if DSC is enabled */
+		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
+
+		if (dsc_on) {
+			ret_slice_height = update_slice_height(data, v_addressable, num_slices, output, i, ref_fb);
+			ret_slice_width = update_slice_width(data, h_addressable, num_slices, output, i, ref_fb);
+		}
+
+		/* Force disable DSC */
+		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
+
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
+
+		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
+		igt_plane_set_fb(data->primary[i], &ref_fb);
+
+		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
+
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
+		igt_assert_f(ret_slice_height, "Changing slice height failed.\n");
+		igt_assert_f(ret_slice_width, "Changing slice width failed.\n");
+		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial state failed.\n");
+
+		/* Cleanup fb */
+		igt_remove_fb(data->fd, &ref_fb);
+	}
+
+	test_fini(data);
+	igt_skip_on(test_conn_cnt == 0);
+}
+
+static void test_dsc_link_settings(data_t *data)
+{
+	igt_output_t *output;
+	igt_fb_t ref_fb[MAX_PIPES];
+	igt_crc_t ref_crc[MAX_PIPES], new_crc[MAX_PIPES];
+    int lane_count[4], link_rate[4], link_spread[4];
+	igt_display_t *display = &data->display;
+	int i, lc, lr;
+    bool dsc_on;
+	const enum dc_lane_count lane_count_vals[] =
+	{
+		LANE_COUNT_TWO,
+		LANE_COUNT_FOUR
+	};
+	const enum dc_link_rate link_rate_vals[] =
+	{
+		LINK_RATE_LOW,
+		LINK_RATE_HIGH,
+		LINK_RATE_HIGH2,
+		LINK_RATE_HIGH3
+	};
+
+    test_init(data);
+
+    /* Setup all outputs */
+	for (i = 0; i < display->n_pipes; i++) {
+		output = data->output[i];
+		if (!output || !igt_output_is_connected(output))
+			continue;
+
+        igt_create_pattern_fb(data->fd,
+                    data->mode[i].hdisplay,
+                    data->mode[i].vdisplay,
+                    DRM_FORMAT_XRGB8888,
+                    0,
+                    &ref_fb[i]);
+		igt_output_set_pipe(output, data->pipe_id[i]);
+		igt_plane_set_fb(data->primary[i], &ref_fb[i]);
+	}
+	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
+
+    /* Collect reference CRCs */
+	for (i = 0; i < display->n_pipes; i++) {
+		output = data->output[i];
+		if (!output || !igt_output_is_connected(output))
+			continue;
+
+		igt_pipe_crc_collect_crc(data->pipe_crc[i], &ref_crc[i]);
+	}
+
+	for (lc = 0; lc < ARRAY_SIZE(lane_count_vals); lc++) {
+		for (lr = 0; lr < ARRAY_SIZE(link_rate_vals); lr++) {
+			/* Write new link_settings */
+			for (i = 0; i < display->n_pipes; i++) {
+				output = data->output[i];
+				if (!output || !igt_output_is_connected(output))
+					continue;
+
+				/* Write lower link settings */
+				igt_info("Applying lane count: %d, link rate 0x%02x, on default training\n",
+						lane_count_vals[lc], link_rate_vals[lr]);
+				igt_amd_write_link_settings(data->fd, output->name,
+							lane_count_vals[lc],
+							link_rate_vals[lr],
+							LINK_TRAINING_DEFAULT);
+				usleep(500 * MSEC_PER_SEC);
+			}
+
+			/* Trigger commit after writing new link settings */
+			igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+			for (i = 0; i < display->n_pipes; i++) {
+				output = data->output[i];
+				if (!output || !igt_output_is_connected(output))
+					continue;
+
+				/* Verify lower link settings */
+				igt_amd_read_link_settings(data->fd, output->name,
+							lane_count,
+							link_rate,
+							link_spread);
+
+				igt_assert_f(lane_count[0] == lane_count_vals[lc], "Lowering lane count settings failed\n");
+				igt_assert_f(link_rate[0] == link_rate_vals[lr], "Lowering link rate settings failed\n");
+
+				/* Log current mode and DSC status */
+				dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
+				igt_info("Current mode is: %dx%d @%dHz -- DSC is: %s\n",
+							data->mode[i].hdisplay,
+							data->mode[i].vdisplay,
+							data->mode[i].vrefresh,
+							dsc_on ? "ON" : "OFF");
+
+				igt_pipe_crc_collect_crc(data->pipe_crc[i], &new_crc[i]);
+				igt_assert_crc_equal(&ref_crc[i], &new_crc[i]);
+			}
+		}
+	}
+
+	/* Cleanup all fbs */
+	for (i = 0; i < display->n_pipes; i++) {
+		output = data->output[i];
+		if (!output || !igt_output_is_connected(output))
+			continue;
+		igt_remove_fb(data->fd, &ref_fb[i]);
+	}
+
+    test_fini(data);
+}
+
+/* Returns the current and maximum bpc from the connector debugfs. */
+static output_bpc_t get_output_bpc(int data_fd, char *connector_name)
+{
+	char buf[256];
+	char *start_loc;
+	int fd, res;
+	output_bpc_t info;
+
+	fd = igt_debugfs_connector_dir(data_fd, connector_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(int data_fd, char *connector_name, unsigned int bpc)
+{
+	output_bpc_t info = get_output_bpc(data_fd, connector_name);
+
+	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);
+}
+
+/* Returns the highest bpc this dispaly supports */
+static int get_max_supported_bpc(int data_fd, char *connector_name)
+{
+	output_bpc_t info = get_output_bpc(data_fd, connector_name);
+	return info.maximum;
+}
+
+static void test_dsc_bpc(data_t *data)
+{
+	igt_output_t *output;
+	igt_fb_t ref_fb[MAX_PIPES];
+	igt_crc_t test_crc;
+	igt_display_t *display = &data->display;
+	int i, bpc, max_supported_bpc[MAX_PIPES];
+    bool dsc_on;
+	const int bpc_vals[] = {12, 10, 8};
+
+    test_init(data);
+
+	/* Find max supported bpc */
+	for (i = 0; i < display->n_pipes; i++) {
+		output = data->output[i];
+		if (!output || !igt_output_is_connected(output))
+			continue;
+		igt_info("Checking bpc support of conn %s\n", output->name);
+		max_supported_bpc[i] = get_max_supported_bpc(data->fd, output->name);
+	}
+
+    /* Setup all outputs */
+	for (bpc = 0; bpc < ARRAY_SIZE(bpc_vals); bpc++) {
+		igt_info("Testing bpc = %d\n", bpc_vals[bpc]);
+
+		for (i = 0; i < display->n_pipes; i++) {
+			output = data->output[i];
+			if (!output || !igt_output_is_connected(output))
+				continue;
+
+			if (max_supported_bpc[i] < bpc_vals[bpc]) {
+				igt_info("Display doesn't support bpc of %d, max is %d. Skipping to next bpc value.\n", bpc_vals[bpc], max_supported_bpc[i]);
+				continue;
+			}
+			igt_info("Setting bpc = %d\n", bpc_vals[bpc]);
+			igt_output_set_prop_value(output, IGT_CONNECTOR_MAX_BPC, bpc_vals[bpc]);
+			igt_create_pattern_fb(data->fd,
+						data->mode[i].hdisplay,
+						data->mode[i].vdisplay,
+						DRM_FORMAT_XRGB8888,
+						0,
+						&ref_fb[i]);
+			igt_output_set_pipe(output, data->pipe_id[i]);
+			igt_plane_set_fb(data->primary[i], &ref_fb[i]);
+		}
+
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
+
+		for (i = 0; i < display->n_pipes; i++) {
+			output = data->output[i];
+			if (!output || !igt_output_is_connected(output))
+				continue;
+
+			if (max_supported_bpc[i] < bpc_vals[bpc])
+				continue;
+
+			/* Check that crc is non-zero */
+			igt_pipe_crc_collect_crc(data->pipe_crc[i], &test_crc);
+			igt_assert(test_crc.crc[0] && test_crc.crc[1] && test_crc.crc[2]);
+
+			/* Check current bpc */
+			igt_info("Verifying display %s has correct bpc\n", output->name);
+			assert_output_bpc(data->fd, output->name, bpc_vals[bpc]);
+
+			/* Log current mode and DSC status */
+			dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
+			igt_info("Current mode is: %dx%d @%dHz -- DSC is: %s\n",
+						data->mode[i].hdisplay,
+						data->mode[i].vdisplay,
+						data->mode[i].vrefresh,
+						dsc_on ? "ON" : "OFF");
+		}
+
+		/* Cleanup all fbs */
+		for (i = 0; i < display->n_pipes; i++) {
+			output = data->output[i];
+			if (!output || !igt_output_is_connected(output))
+				continue;
+
+			if (max_supported_bpc[i] < bpc_vals[bpc])
+				continue;
+
+			igt_remove_fb(data->fd, &ref_fb[i]);
+		}
+	}
+
+    test_fini(data);
+}
+
+igt_main
+{
+	data_t data = { 0 };
+
+	igt_skip_on_simulation();
+
+	igt_fixture
+	{
+		data.fd = drm_open_driver_master(DRIVER_ANY);
+
+		igt_display_require(&data.display, data.fd);
+		igt_require(data.display.is_atomic);
+		igt_display_require_output(&data.display);
+
+		igt_amd_require_dsc(&data.display, data.fd);
+		kmstest_set_vt_graphics_mode();
+	}
+
+	igt_describe("Forces DSC on/off & ensures it is reset properly");
+	igt_subtest("dsc-enable-basic")
+		    test_dsc_enable(&data);
+
+	igt_describe("Tests DSC slice height property & ensures it is reset properly on DSC enable/disable");
+	igt_subtest("dsc-slice-height-property")
+		    test_dsc_slice_height_property(&data);
+
+	igt_describe("Tests various DSC slice dimensions");
+	igt_subtest("dsc-slice-dimensions-change")
+		    test_dsc_slice_dimensions_change(&data);
+
+	igt_describe("Tests various combinations of link_rate + lane_count and logs if DSC enabled/disabled");
+	igt_subtest("dsc-link-settings")
+		    test_dsc_link_settings(&data);
+
+	igt_describe("Tests different bpc settings and logs if DSC is enabled/disabled");
+	igt_subtest("dsc-bpc")
+			test_dsc_bpc(&data);
+
+	igt_fixture
+	{
+		igt_reset_connectors();
+		igt_display_fini(&data.display);
+	}
+}
diff --git a/tests/amdgpu/meson.build b/tests/amdgpu/meson.build
index b736c456..001e37ef 100644
--- a/tests/amdgpu/meson.build
+++ b/tests/amdgpu/meson.build
@@ -16,6 +16,7 @@ if libdrm_amdgpu.found()
 			  'amd_mem_leak',
 			  'amd_link_settings',
 			  'amd_vrr_range',
+			  'amd_dp_dsc',
 			]
 	amdgpu_deps += libdrm_amdgpu
 endif
-- 
2.25.1

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

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/amdgpu: Add test for AMD DP DSC
  2021-11-19 15:00 [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC Rodrigo Siqueira
@ 2021-11-19 16:34 ` Patchwork
  2021-11-24 15:33 ` [igt-dev] [PATCH i-g-t] " Rodrigo Siqueira Jordao
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2021-11-19 16:34 UTC (permalink / raw)
  To: Rodrigo Siqueira; +Cc: igt-dev

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

== Series Details ==

Series: tests/amdgpu: Add test for AMD DP DSC
URL   : https://patchwork.freedesktop.org/series/97108/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_10907 -> IGTPW_6418
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_6418 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_6418, 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_6418/index.html

Participating hosts (44 -> 34)
------------------------------

  Missing    (10): bat-dg1-6 fi-tgl-u2 bat-dg1-5 fi-hsw-4200u fi-icl-u2 fi-bsw-cyan bat-adlp-6 fi-ctg-p8600 bat-jsl-2 bat-jsl-1 

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@i915_pm_rpm@basic-rte:
    - fi-rkl-guc:         [PASS][1] -> [CRASH][2] +2 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@i915_pm_rpm@basic-rte.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@i915_pm_rpm@basic-rte.html
    - fi-tgl-1115g4:      [PASS][3] -> [CRASH][4] +2 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@i915_pm_rpm@basic-rte.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@i915_pm_rpm@basic-rte.html

  * igt@kms_addfb_basic@framebuffer-vs-set-tiling:
    - fi-rkl-guc:         [PASS][5] -> [FAIL][6] +41 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@kms_addfb_basic@framebuffer-vs-set-tiling.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_addfb_basic@framebuffer-vs-set-tiling.html

  * igt@kms_addfb_basic@too-wide:
    - fi-tgl-1115g4:      [PASS][7] -> [FAIL][8] +42 similar issues
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@kms_addfb_basic@too-wide.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@kms_addfb_basic@too-wide.html

  * igt@kms_busy@basic:
    - fi-tgl-1115g4:      NOTRUN -> [FAIL][9]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@kms_busy@basic.html
    - fi-rkl-guc:         NOTRUN -> [FAIL][10]
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_busy@basic.html
    - fi-rkl-11600:       NOTRUN -> [FAIL][11]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_busy@basic.html

  * igt@kms_cursor_legacy@basic-flip-after-cursor-varying-size:
    - fi-rkl-11600:       [PASS][12] -> [FAIL][13] +41 similar issues
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@kms_cursor_legacy@basic-flip-after-cursor-varying-size.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_cursor_legacy@basic-flip-after-cursor-varying-size.html

  * igt@kms_force_connector_basic@force-connector-state:
    - fi-rkl-11600:       [PASS][14] -> [CRASH][15] +2 similar issues
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@kms_force_connector_basic@force-connector-state.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_force_connector_basic@force-connector-state.html

  
#### Warnings ####

  * igt@i915_pm_backlight@basic-brightness:
    - fi-tgl-1115g4:      [SKIP][16] ([i915#1155]) -> [FAIL][17]
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@i915_pm_backlight@basic-brightness.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@i915_pm_backlight@basic-brightness.html
    - fi-rkl-11600:       [SKIP][18] ([i915#3012]) -> [FAIL][19]
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@i915_pm_backlight@basic-brightness.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@i915_pm_backlight@basic-brightness.html
    - fi-rkl-guc:         [SKIP][20] ([i915#3012]) -> [FAIL][21]
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@i915_pm_backlight@basic-brightness.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@i915_pm_backlight@basic-brightness.html

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-tgl-1115g4:      [SKIP][22] ([fdo#111827]) -> [FAIL][23] +8 similar issues
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@kms_chamelium@common-hpd-after-suspend.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@kms_chamelium@common-hpd-after-suspend.html

  * igt@kms_chamelium@dp-crc-fast:
    - fi-rkl-11600:       [SKIP][24] ([fdo#111827]) -> [FAIL][25] +8 similar issues
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@kms_chamelium@dp-crc-fast.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_chamelium@dp-crc-fast.html

  * igt@kms_chamelium@dp-edid-read:
    - fi-rkl-guc:         [SKIP][26] ([fdo#111827]) -> [FAIL][27] +8 similar issues
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@kms_chamelium@dp-edid-read.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_chamelium@dp-edid-read.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - fi-rkl-11600:       [SKIP][28] ([i915#4103]) -> [FAIL][29] +1 similar issue
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
    - fi-rkl-guc:         [SKIP][30] ([i915#4103]) -> [FAIL][31] +1 similar issue
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
    - fi-tgl-1115g4:      [SKIP][32] ([i915#4103]) -> [FAIL][33] +1 similar issue
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
    - fi-rkl-11600:       [SKIP][34] ([i915#533]) -> [FAIL][35]
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
    - fi-rkl-guc:         [SKIP][36] ([i915#533]) -> [FAIL][37]
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html

  * igt@kms_psr@primary_page_flip:
    - fi-skl-6600u:       [FAIL][38] ([i915#4547]) -> [INCOMPLETE][39]
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-skl-6600u/igt@kms_psr@primary_page_flip.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-skl-6600u/igt@kms_psr@primary_page_flip.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_pm_rpm@basic-rte:
    - {fi-jsl-1}:         [PASS][40] -> [CRASH][41] +2 similar issues
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-jsl-1/igt@i915_pm_rpm@basic-rte.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@i915_pm_rpm@basic-rte.html

  * igt@kms_addfb_basic@too-high:
    - {fi-ehl-2}:         [PASS][42] -> [FAIL][43] +46 similar issues
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-ehl-2/igt@kms_addfb_basic@too-high.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@kms_addfb_basic@too-high.html

  * igt@kms_busy@basic:
    - {fi-jsl-1}:         NOTRUN -> [FAIL][44]
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@kms_busy@basic.html
    - {fi-ehl-2}:         NOTRUN -> [FAIL][45]
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@kms_busy@basic.html
    - {fi-tgl-dsi}:       NOTRUN -> [FAIL][46]
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-dsi/igt@kms_busy@basic.html

  * igt@kms_chamelium@dp-hpd-fast:
    - {fi-jsl-1}:         [SKIP][47] ([fdo#111827]) -> [FAIL][48] +8 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-jsl-1/igt@kms_chamelium@dp-hpd-fast.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@kms_chamelium@dp-hpd-fast.html

  * igt@kms_chamelium@hdmi-edid-read:
    - {fi-ehl-2}:         [SKIP][49] ([fdo#111827]) -> [FAIL][50] +8 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-ehl-2/igt@kms_chamelium@hdmi-edid-read.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@kms_chamelium@hdmi-edid-read.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - {fi-tgl-dsi}:       [SKIP][51] ([fdo#109284] / [fdo#111827]) -> [FAIL][52] +8 similar issues
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-dsi/igt@kms_chamelium@hdmi-hpd-fast.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-dsi/igt@kms_chamelium@hdmi-hpd-fast.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - {fi-jsl-1}:         [SKIP][53] ([i915#4103]) -> [FAIL][54] +1 similar issue
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-jsl-1/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
    - {fi-ehl-2}:         [SKIP][55] ([fdo#109278]) -> [FAIL][56] +1 similar issue
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-ehl-2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
    - {fi-tgl-dsi}:       [SKIP][57] ([i915#4103]) -> [FAIL][58] +1 similar issue
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-dsi/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-dsi/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-a:
    - {fi-tgl-dsi}:       [PASS][59] -> [FAIL][60] +43 similar issues
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-dsi/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-a.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-dsi/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-a.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
    - {fi-jsl-1}:         [SKIP][61] ([i915#533]) -> [FAIL][62]
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-jsl-1/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
    - {fi-ehl-2}:         [SKIP][63] ([fdo#109278] / [i915#533]) -> [FAIL][64]
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-ehl-2/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
    - {fi-jsl-1}:         [PASS][65] -> [FAIL][66] +46 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-jsl-1/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html

  * igt@prime_vgem@basic-fence-flip:
    - {fi-tgl-dsi}:       [PASS][67] -> [CRASH][68] +2 similar issues
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-dsi/igt@prime_vgem@basic-fence-flip.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-dsi/igt@prime_vgem@basic-fence-flip.html
    - {fi-ehl-2}:         [PASS][69] -> [CRASH][70] +2 similar issues
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-ehl-2/igt@prime_vgem@basic-fence-flip.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@prime_vgem@basic-fence-flip.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_basic@semaphore:
    - fi-bdw-5557u:       NOTRUN -> [SKIP][71] ([fdo#109271]) +31 similar issues
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-bdw-5557u/igt@amdgpu/amd_basic@semaphore.html

  * igt@i915_selftest@live@hangcheck:
    - fi-snb-2600:        [PASS][72] -> [INCOMPLETE][73] ([i915#3921])
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-snb-2600/igt@i915_selftest@live@hangcheck.html

  * igt@kms_chamelium@dp-crc-fast:
    - fi-bdw-5557u:       NOTRUN -> [SKIP][74] ([fdo#109271] / [fdo#111827]) +8 similar issues
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-bdw-5557u/igt@kms_chamelium@dp-crc-fast.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-cml-u2:          [PASS][75] -> [DMESG-WARN][76] ([i915#4269])
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-cml-u2/igt@kms_frontbuffer_tracking@basic.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-cml-u2/igt@kms_frontbuffer_tracking@basic.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s0:
    - fi-tgl-1115g4:      [FAIL][77] ([i915#1888]) -> [PASS][78]
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s0.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s0.html

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

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
  [i915#1759]: https://gitlab.freedesktop.org/drm/intel/issues/1759
  [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#2373]: https://gitlab.freedesktop.org/drm/intel/issues/2373
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
  [i915#3921]: https://gitlab.freedesktop.org/drm/intel/issues/3921
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4269]: https://gitlab.freedesktop.org/drm/intel/issues/4269
  [i915#4547]: https://gitlab.freedesktop.org/drm/intel/issues/4547
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#750]: https://gitlab.freedesktop.org/drm/intel/issues/750


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

  * CI: CI-20190529 -> None
  * IGT: IGT_6285 -> IGTPW_6418

  CI-20190529: 20190529
  CI_DRM_10907: e1f2e7039c95fdf680b357e4c19f7d2a3790cc1d @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_6418: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/index.html
  IGT_6285: 2e0355faad5c2e81cd6705b76e529ce526c7c9bf @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git



== Testlist changes ==

+igt@amdgpu/amd_dp_dsc@dsc-bpc
+igt@amdgpu/amd_dp_dsc@dsc-enable-basic
+igt@amdgpu/amd_dp_dsc@dsc-link-settings
+igt@amdgpu/amd_dp_dsc@dsc-slice-dimensions-change
+igt@amdgpu/amd_dp_dsc@dsc-slice-height-property

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/index.html

[-- Attachment #2: Type: text/html, Size: 19434 bytes --]

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

* Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
  2021-11-19 15:00 [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC Rodrigo Siqueira
  2021-11-19 16:34 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
@ 2021-11-24 15:33 ` Rodrigo Siqueira Jordao
  2021-11-24 19:07   ` Vudum, Lakshminarayana
  2021-11-24 23:01   ` Vudum, Lakshminarayana
  2021-11-24 16:55 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev2) Patchwork
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 17+ messages in thread
From: Rodrigo Siqueira Jordao @ 2021-11-24 15:33 UTC (permalink / raw)
  To: Vudum, Lakshminarayana; +Cc: Eryk Brol, igt-dev, Mikita Lipski

Hi Lakshmi,

I noticed a CI failure in this patch which is focused on AMD, except for 
the below change in the igt_kms.h:

diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index e9ecd21e..5c7d7481 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -125,6 +125,7 @@  enum igt_atomic_crtc_properties {
         IGT_CRTC_ACTIVE,
         IGT_CRTC_OUT_FENCE_PTR,
         IGT_CRTC_VRR_ENABLED,
+       IGT_CRTC_DSC_SLICE_HEIGHT,
         IGT_NUM_CRTC_PROPS
  };

 From the CI results, I'm not sure if this change caused the other 
failures, and since we saw some false positives in the AMD tests last 
week, is it possible to trigger the CI test for this patch again?

https://patchwork.freedesktop.org/patch/463655/?series=97108&rev=1

Thanks
Siqueira

On 2021-11-19 10:00 a.m., Rodrigo Siqueira wrote:
> From: Eryk Brol <eryk.brol@amd.com>
> 
> This commit introduces a DP DSC test that checks:
> 
> * Forces DSC on/off and ensures it is reset properly
> * Check DSC slice height property
> * Verify various DSC slice dimensions
> * Tests various combinations of link_rate + lane_count and logs if DSC
>    enabled/disabled Tests different bpc settings and logs if DSC is
>    enabled/disabled
> 
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Nicholas Choi <Nicholas.Choi@amd.com>
> Cc: Mark Yacoub <markyacoub@chromium.org>
> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
> Signed-off-by: Eryk Brol <eryk.brol@amd.com>
> ---
>   lib/igt_amd.c             | 494 +++++++++++++++++++++++++--
>   lib/igt_amd.h             |  35 ++
>   lib/igt_kms.h             |   1 +
>   tests/amdgpu/amd_dp_dsc.c | 685 ++++++++++++++++++++++++++++++++++++++
>   tests/amdgpu/meson.build  |   1 +
>   5 files changed, 1194 insertions(+), 22 deletions(-)
>   create mode 100644 tests/amdgpu/amd_dp_dsc.c
> 
> diff --git a/lib/igt_amd.c b/lib/igt_amd.c
> index f1bfb421..4bcfd594 100644
> --- a/lib/igt_amd.c
> +++ b/lib/igt_amd.c
> @@ -251,11 +251,11 @@ bool igt_amd_is_tiled(uint64_t modifier)
>   }
>   
>   /**
> - * igt_amd_output_has_hpd: check if connector has HPD debugfs entry
> + * igt_amd_output_has_dsc: check if connector has dsc debugfs entry
>    * @drm_fd: DRM file descriptor
>    * @connector_name: The connector's name, on which we're reading the status
>    */
> -static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
> +static bool igt_amd_output_has_dsc(int drm_fd, char *connector_name)
>   {
>   	int fd;
>   	int res;
> @@ -267,9 +267,9 @@ static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
>   		return false;
>   	}
>   
> -	res = fstatat(fd, DEBUGFS_HPD_TRIGGER, &stat, 0);
> +	res = fstatat(fd, DEBUGFS_DSC_CLOCK_EN , &stat, 0);
>   	if (res != 0) {
> -		igt_info("%s debugfs not supported\n", DEBUGFS_HPD_TRIGGER);
> +		igt_info("%s debugfs not supported\n", DEBUGFS_DSC_CLOCK_EN);
>   		close(fd);
>   		return false;
>   	}
> @@ -279,49 +279,499 @@ static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
>   }
>   
>   /**
> - * igt_amd_require_hpd: Checks if connectors have HPD debugfs
> + * is_dp_dsc_supported: Checks if connector is DSC capable
> + * @display: A pointer to an #igt_display_t structure
> + * @drm_fd: DRM file descriptor
> + */
> +bool is_dp_dsc_supported(int drm_fd, char *connector_name)
> +{
> +	char buf[512];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
> +
> +	return strstr(buf, "DSC_Sink_Support: yes");
> +}
> +
> +/**
> + * is_dp_fec_supported: Checks if connector is FEC capable
> + * @display: A pointer to an #igt_display_t structure
> + * @drm_fd: DRM file descriptor
> + */
> +bool is_dp_fec_supported(int drm_fd, char *connector_name)
> +{
> +	char buf[512];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
> +
> +	return strstr(buf, "FEC_Sink_Support: yes");
> +}
> +
> +/**
> + * igt_amd_require_dsc: Checks if connectors have DSC debugfs
>    * @display: A pointer to an #igt_display_t structure
>    * @drm_fd: DRM file descriptor
>    *
> - * Checks if the AMDGPU driver has support the 'trigger_hotplug'
> - * entry for HPD. Skip test if HPD is not supported.
> + * Checks if the AMDGPU driver has support of debugfs entries for
> + * DSC. Skip test if DSC is not supported.
>    */
> -void igt_amd_require_hpd(igt_display_t *display, int drm_fd)
> +void igt_amd_require_dsc(igt_display_t *display, int drm_fd)
>   {
>   	igt_output_t *output;
>   
>   	for_each_connected_output(display, output) {
> -		if (igt_amd_output_has_hpd(drm_fd, output->name))
> +		if (igt_amd_output_has_dsc(drm_fd, output->name))
>   			return;
>   	}
>   
> -	igt_skip("No HPD debugfs support.\n");
> +	igt_skip("No DSC debugfs support.\n");
>   }
>   
>   /**
> - * igt_amd_trigger_hotplut: Triggers a debugfs HPD
> + * igt_amd_read_dsc_clock_status: Read the DSC Clock Enable debugfs
>    * @drm_fd: DRM file descriptor
> - * @connector_name: The connector's name, which we trigger the hotplug on
> + * @connector_name: The connector's name, which we use to read status on
>    *
> - * igt_amd_require_hpd should be called before calling this.
>    */
> -int igt_amd_trigger_hotplug(int drm_fd, char *connector_name)
> +int igt_amd_read_dsc_clock_status(int drm_fd, char *connector_name)
> +{
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_CLOCK_EN, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_CLOCK_EN, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +
> +/**
> + * igt_amd_write_dsc_clock_en: Write the DSC Clock Enable debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status on
> + * @dsc_force: DSC force parameter, 0 - DSC automatic, 1 - DSC force on,
> + * 2 - DSC force off
> + *
> + */
> +void igt_amd_write_dsc_clock_en(int drm_fd, char *connector_name, int dsc_force)
> +{
> +	int fd, dsc_fd;
> +	char src[4];
> +	int wr_len;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	igt_assert(fd >= 0);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_CLOCK_EN, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (dsc_force == DSC_FORCE_ON)
> +		snprintf(src, sizeof(src), "%d", 1);
> +	else if (dsc_force == DSC_FORCE_OFF)
> +		snprintf(src, sizeof(src), "%d", 2);
> +	else
> +		snprintf(src, sizeof(src), "%d", 0);
> +
> +	igt_info("DSC Clock force, write %s > dsc_clock_en\n", src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	close(dsc_fd);
> +	igt_assert_eq(wr_len, strlen(src));
> +}
> +
> +/**
> + * igt_amd_write_dsc_param_slice_height: Write the DSC Slice Height debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status on
> + * @slice_height: DSC slice height parameter, accepts any positive integer,
> + * 		  if parameter is negative - it will not write to debugfs.
> + *
> + */
> +void igt_amd_write_dsc_param_slice_height(int drm_fd, char *connector_name, int slice_height)
> +{
> +	int fd, dsc_fd;
> +	char src[32];
> +	int wr_len;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	igt_assert(fd >= 0);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_SLICE_HEIGHT, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (slice_height >= 0) {
> +		snprintf(src, sizeof(src), "%#x", slice_height);
> +	} else {
> +		igt_warn("DSC SLICE HEIGHT, slice height parameter is invalid (%d)\n", slice_height);
> +		goto exit;
> +	}
> +
> +	igt_info("DSC SLICE HEIGHT, write %s > dsc_slice_height\n", src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	igt_assert_eq(wr_len, strlen(src));
> +exit:
> +	close(dsc_fd);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_slice_height: Read the DSC Slice Height debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status on
> + *
> + */
> +int igt_amd_read_dsc_param_slice_height(int drm_fd, char *connector_name)
> +{
> +	char buf[32];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_HEIGHT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_SLICE_HEIGHT, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_write_dsc_param_slice_width: Write the DSC Slice Width debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status on
> + * @slice_width: DSC slice width parameter, accepts any positive integer,
> + * 		 if parameter is negative - it will not write to debugfs.
> + *
> + */
> +void igt_amd_write_dsc_param_slice_width(int drm_fd, char *connector_name, int slice_width)
>   {
> -	int fd, hpd_fd;
> +	int fd, dsc_fd;
> +	char src[32];
>   	int wr_len;
> -	const char *enable_hpd = "1";
>   
>   	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
>   	igt_assert(fd >= 0);
> -	hpd_fd = openat(fd, DEBUGFS_HPD_TRIGGER, O_WRONLY);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_SLICE_WIDTH, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (slice_width >= 0) {
> +		snprintf(src, sizeof(src), "%#x", slice_width);
> +	} else {
> +		igt_warn("DSC SLICE WIDTH, slice width parameter is invalid (%d)\n", slice_width);
> +		goto exit;
> +	}
> +
> +	igt_info("DSC SLICE WIDTH, write %s > dsc_slice_width\n", src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	igt_assert_eq(wr_len, strlen(src));
> +exit:
> +	close(dsc_fd);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_slice_width: Read the DSC Slice Width debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status on
> + *
> + */
> +int igt_amd_read_dsc_param_slice_width(int drm_fd, char *connector_name)
> +{
> +	char buf[32];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_WIDTH, buf, sizeof(buf));
>   	close(fd);
> -	igt_assert(hpd_fd >= 0);
>   
> -	wr_len = write(hpd_fd, enable_hpd, strlen(enable_hpd));
> -	close(hpd_fd);
> -	igt_assert_eq(wr_len, strlen(enable_hpd));
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_SLICE_WIDTH, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_write_dsc_param_bpp: Write the DSC Bits Per Pixel debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status on
> + * @bpp: DSC bits per pixel parameter, accepts any positive integer,
> + * 	 if parameter is negative - it will not write to debugfs.
> + *
> + */
> +void igt_amd_write_dsc_param_bpp(int drm_fd, char *connector_name, int bpp)
> +{
> +	int fd, dsc_fd;
> +	char src[32];
> +	int wr_len;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	igt_assert(fd >= 0);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_BITS_PER_PIXEL, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (bpp >= 0) {
> +		snprintf(src, sizeof(src), "%#x", bpp);
> +	} else {
> +		igt_warn("DSC BITS PER PIXEL, bits per pixel parameter is invalid (%d)\n", bpp);
> +		goto exit;
> +	}
> +
> +	igt_info("DSC BITS PER PIXEL, write %s > dsc_bits_per_pixel\n", src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	igt_assert_eq(wr_len, strlen(src));
> +exit:
> +	close(dsc_fd);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_bpp: Read the DSC Bits Per Pixel debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status on
> + *
> + */
> +int igt_amd_read_dsc_param_bpp(int drm_fd, char *connector_name)
> +{
> +	char buf[32];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_BITS_PER_PIXEL, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_BITS_PER_PIXEL, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_pic_width: Read the DSC Picture Width debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status on
> + *
> + */
> +int igt_amd_read_dsc_param_pic_width(int drm_fd, char *connector_name)
> +{
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_PIC_WIDTH, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_PIC_WIDTH, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_pic_height: Read the DSC Picture Height debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status on
> + *
> + */
> +int igt_amd_read_dsc_param_pic_height(int drm_fd, char *connector_name)
> +{
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_PIC_HEIGHT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_PIC_HEIGHT, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_chunk_size: Read the DSC Chunk Size debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status on
> + *
> + */
> +int igt_amd_read_dsc_param_chunk_size(int drm_fd, char *connector_name)
> +{
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_CHUNK_SIZE, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_CHUNK_SIZE, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_slice_bpg: Read the DSC Slice BPG Offset debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status on
> + *
> + */
> +int igt_amd_read_dsc_param_slice_bpg(int drm_fd, char *connector_name)
> +{
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_BPG, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_SLICE_BPG, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_output_has_hpd: check if connector has HPD debugfs entry
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, on which we're reading the status
> + */
> +static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
> +{
> +        int fd;
> +        int res;
> +        struct stat stat;
> +
> +        fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +        if (fd < 0) {
> +                igt_info("output %s: debugfs not found\n", connector_name);
> +                return false;
> +        }
> +
> +        res = fstatat(fd, DEBUGFS_HPD_TRIGGER, &stat, 0);
> +        if (res != 0) {
> +                igt_info("%s debugfs not supported\n", DEBUGFS_HPD_TRIGGER);
> +                close(fd);
> +                return false;
> +        }
> +
> +        close(fd);
> +        return true;
> +}
> +
> +/**
> + * igt_amd_require_hpd: Checks if connectors have HPD debugfs
> + * @display: A pointer to an #igt_display_t structure
> + * @drm_fd: DRM file descriptor
> + *
> + * Checks if the AMDGPU driver has support the 'trigger_hotplug'
> + * entry for HPD. Skip test if HPD is not supported.
> + */
> +void igt_amd_require_hpd(igt_display_t *display, int drm_fd)
> +{
> +        igt_output_t *output;
> +
> +        for_each_connected_output(display, output) {
> +                if (igt_amd_output_has_hpd(drm_fd, output->name))
> +                        return;
> +        }
> +
> +        igt_skip("No HPD debugfs support.\n");
> +}
> +
> +/**
> + * igt_amd_trigger_hotplut: Triggers a debugfs HPD
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we trigger the hotplug on
> + *
> + * igt_amd_require_hpd should be called before calling this.
> + */
> +int igt_amd_trigger_hotplug(int drm_fd, char *connector_name)
> +{
> +        int fd, hpd_fd;
> +        int wr_len;
> +        const char *enable_hpd = "1";
> +
> +        fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +        igt_assert(fd >= 0);
> +        hpd_fd = openat(fd, DEBUGFS_HPD_TRIGGER, O_WRONLY);
> +        close(fd);
> +        igt_assert(hpd_fd >= 0);
> +
> +        wr_len = write(hpd_fd, enable_hpd, strlen(enable_hpd));
> +        close(hpd_fd);
> +        igt_assert_eq(wr_len, strlen(enable_hpd));
>   
> -	return 0;
> +        return 0;
>   }
>   
>   /*
> diff --git a/lib/igt_amd.h b/lib/igt_amd.h
> index e5bdbf33..7a91cbff 100644
> --- a/lib/igt_amd.h
> +++ b/lib/igt_amd.h
> @@ -27,9 +27,27 @@
>   #include "igt.h"
>   #include "igt_fb.h"
>   
> +/* Read & Write DSC parameters */
> +#define DEBUGFS_DSC_CLOCK_EN "dsc_clock_en"
> +#define DEBUGFS_DSC_SLICE_WIDTH "dsc_slice_width"
> +#define DEBUGFS_DSC_SLICE_HEIGHT "dsc_slice_height"
> +#define DEBUGFS_DSC_BITS_PER_PIXEL "dsc_bits_per_pixel"
> +/* Read only DSC parameters */
> +#define DEBUGFS_DSC_PIC_WIDTH "dsc_pic_width"
> +#define DEBUGFS_DSC_PIC_HEIGHT "dsc_pic_height"
> +#define DEBUGFS_DSC_CHUNK_SIZE "dsc_chunk_size"
> +#define DEBUGFS_DSC_SLICE_BPG "dsc_slice_bpg"
> +#define DEBUGFS_DSC_FEC_SUPPORT "dp_dsc_fec_support"
> +
>   #define DEBUGFS_DP_LINK_SETTINGS "link_settings"
>   #define DEBUGFS_HPD_TRIGGER "trigger_hotplug"
>   
> +enum amd_dsc_clock_force {
> +	DSC_AUTOMATIC = 0,
> +	DSC_FORCE_ON,
> +	DSC_FORCE_OFF,
> +};
> +
>   enum dc_lane_count {
>   	LANE_COUNT_UNKNOWN = 0,
>   	LANE_COUNT_ONE = 1,
> @@ -80,6 +98,23 @@ void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void *dst_buf,
>   				       struct igt_fb *src, void *src_buf);
>   bool igt_amd_is_tiled(uint64_t modifier);
>   
> +/* IGT DSC helper functions */
> +bool is_dp_dsc_supported(int drm_fd, char *connector_name);
> +bool is_dp_fec_supported(int drm_fd, char *connector_name);
> +void igt_amd_require_dsc(igt_display_t *display, int drm_fd);
> +int igt_amd_read_dsc_clock_status(int drm_fd, char *connector_name);
> +void igt_amd_write_dsc_clock_en(int drm_fd, char *connector_name, int dsc_force);
> +void igt_amd_write_dsc_param_slice_height(int drm_fd, char *connector_name, int slice_height);
> +int igt_amd_read_dsc_param_slice_height(int drm_fd, char *connector_name);
> +void igt_amd_write_dsc_param_slice_width(int drm_fd, char *connector_name, int slice_width);
> +int igt_amd_read_dsc_param_slice_width(int drm_fd, char *connector_name);
> +void igt_amd_write_dsc_param_bpp(int drm_fd, char *connector_name, int bpp);
> +int igt_amd_read_dsc_param_bpp(int drm_fd, char *connector_name);
> +int igt_amd_read_dsc_param_pic_width(int drm_fd, char *connector_name);
> +int igt_amd_read_dsc_param_pic_height(int drm_fd, char *connector_name);
> +int igt_amd_read_dsc_param_chunk_size(int drm_fd, char *connector_name);
> +int igt_amd_read_dsc_param_slice_bpg(int drm_fd, char *connector_name);
> +
>   /* IGT HPD helper functions */
>   void igt_amd_require_hpd(igt_display_t *display, int drm_fd);
>   int igt_amd_trigger_hotplug(int drm_fd, char *connector_name);
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index e9ecd21e..5c7d7481 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -125,6 +125,7 @@ enum igt_atomic_crtc_properties {
>          IGT_CRTC_ACTIVE,
>          IGT_CRTC_OUT_FENCE_PTR,
>          IGT_CRTC_VRR_ENABLED,
> +       IGT_CRTC_DSC_SLICE_HEIGHT,
>          IGT_NUM_CRTC_PROPS
>   };
>   
> diff --git a/tests/amdgpu/amd_dp_dsc.c b/tests/amdgpu/amd_dp_dsc.c
> new file mode 100644
> index 00000000..d73425e2
> --- /dev/null
> +++ b/tests/amdgpu/amd_dp_dsc.c
> @@ -0,0 +1,685 @@
> +/*
> + * Copyright 2021 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 "igt_amd.h"
> +#include "sw_sync.h"
> +#include <fcntl.h>
> +#include <signal.h>
> +
> +#define NUM_SLICE_SLOTS 4
> +
> +/* Maximumm pipes on any AMD ASIC. */
> +#define MAX_PIPES 6
> +
> +/* Common test data. */
> +typedef struct data {
> +	igt_display_t display;
> +	igt_plane_t *primary[MAX_PIPES];
> +	igt_output_t *output[MAX_PIPES];
> +	igt_pipe_t *pipe[MAX_PIPES];
> +	igt_pipe_crc_t *pipe_crc[MAX_PIPES];
> +	drmModeModeInfo mode[MAX_PIPES];
> +	enum pipe pipe_id[MAX_PIPES];
> +	int fd;
> +} data_t;
> +
> +/* BPC connector state. */
> +typedef struct output_bpc {
> +	unsigned int current;
> +	unsigned int maximum;
> +} output_bpc_t;
> +
> +/* Common test cleanup. */
> +static void test_fini(data_t *data)
> +{
> +	igt_display_t *display = &data->display;
> +	int i;
> +
> +	for (i = 0; i < display->n_pipes; ++i) {
> +		igt_pipe_crc_free(data->pipe_crc[i]);
> +	}
> +
> +	igt_display_reset(display);
> +	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> +}
> +
> +/* Common test setup. */
> +static void test_init(data_t *data)
> +{
> +	igt_display_t *display = &data->display;
> +	int i, n;
> +
> +	for (i = 0; i < display->n_pipes; ++i) {
> +		data->pipe_id[i] = PIPE_A + i;
> +		data->pipe[i] = &data->display.pipes[data->pipe_id[i]];
> +		data->primary[i] = igt_pipe_get_plane_type(
> +				data->pipe[i], DRM_PLANE_TYPE_PRIMARY);
> +		data->pipe_crc[i] =
> +				igt_pipe_crc_new(data->fd, data->pipe_id[i], "auto");
> +	}
> +
> +	for (i = 0, n = 0; i < display->n_outputs && n < display->n_pipes; ++i) {
> +		igt_output_t *output = &display->outputs[i];
> +		data->output[n] = output;
> +
> +		/* Only allow physically connected displays for the tests. */
> +		if (!igt_output_is_connected(output))
> +				continue;
> +
> +		/* Ensure that outpus are DP, DSC & FEC capable*/
> +		if (!(is_dp_fec_supported(data->fd, output->name) &&
> +			is_dp_dsc_supported(data->fd, output->name)))
> +			continue;
> +
> +		if (output->config.connector->connector_type !=
> +			DRM_MODE_CONNECTOR_DisplayPort)
> +			continue;
> +
> +		igt_assert(kmstest_get_connector_default_mode(
> +				data->fd, output->config.connector, &data->mode[n]));
> +
> +		n += 1;
> +	}
> +
> +	igt_display_reset(display);
> +}
> +
> +static void test_dsc_enable(data_t *data)
> +{
> +	bool dsc_on, dsc_after, dsc_before;
> +	igt_display_t *display = &data->display;
> +	igt_output_t *output;
> +	igt_fb_t ref_fb;
> +	int i, test_conn_cnt = 0;
> +
> +	test_init(data);
> +	igt_enable_connectors(data->fd);
> +
> +	for (i = 0; i < display->n_pipes; i++) {
> +		/* Setup the output */
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_create_pattern_fb(data->fd,
> +					data->mode[i].hdisplay,
> +					data->mode[i].vdisplay,
> +					DRM_FORMAT_XRGB8888,
> +					0,
> +					&ref_fb);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> +
> +		test_conn_cnt++;
> +
> +		/* Save pipe's initial DSC state */
> +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Force enable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		/* Check if DSC is enabled */
> +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
> +
> +		/* Revert DSC to automatic state */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display,DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial state failed.\n");
> +
> +		/* Cleanup fb */
> +		igt_remove_fb(data->fd, &ref_fb);
> +	}
> +
> +	test_fini(data);
> +	igt_skip_on(test_conn_cnt == 0);
> +}
> +
> +static void test_dsc_slice_height_property(data_t *data)
> +{
> +	bool dsc_on, dsc_after, dsc_before;
> +	int slice_height_on, slice_height_off;
> +	igt_display_t *display = &data->display;
> +	igt_output_t *output;
> +	igt_fb_t ref_fb;
> +	int i, test_conn_cnt = 0;
> +
> +	test_init(data);
> +	igt_enable_connectors(data->fd);
> +
> +	for (i = 0; i < display->n_pipes; i++) {
> +		/* Setup the output */
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_create_pattern_fb(data->fd,
> +					data->mode[i].hdisplay,
> +					data->mode[i].vdisplay,
> +					DRM_FORMAT_XRGB8888,
> +					0,
> +					&ref_fb);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> +
> +		test_conn_cnt++;
> +
> +		/* Save pipe's initial DSC state */
> +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Force enable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		/* Check if DSC is enabled */
> +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
> +
> +		slice_height_on = igt_pipe_get_prop(display, data->pipe_id[i], IGT_CRTC_DSC_SLICE_HEIGHT);
> +
> +		/* Revert DSC to automatic state */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		slice_height_off = igt_pipe_get_prop(display, data->pipe_id[i], IGT_CRTC_DSC_SLICE_HEIGHT);
> +
> +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> +		igt_assert_f(slice_height_on > 0, "DSC Slice property was not set properly.\n");
> +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial state failed.\n");
> +		igt_assert_f(slice_height_off == 0, "DSC Slice property was not reset properly.\n");
> +
> +		/* Cleanup fb */
> +		igt_remove_fb(data->fd, &ref_fb);
> +	}
> +
> +	test_fini(data);
> +	igt_skip_on(test_conn_cnt == 0);
> +}
> +
> +static bool update_slice_height(data_t *data, int v_addressable,
> +					  int *num_slices, igt_output_t *output, int conn_idx, igt_fb_t ref_fb)
> +{
> +	int i;
> +	bool pass = true;
> +
> +	for(i = 0; i < NUM_SLICE_SLOTS; i++) {
> +		int act_slice_height;
> +		int slice_height = v_addressable / num_slices[i] + (v_addressable % num_slices[i]);
> +
> +		/* Overwrite DSC slice height */
> +		igt_amd_write_dsc_param_slice_height(data->fd, output->name, slice_height);
> +		igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +		igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		igt_info("Forcing slice height: slice height %d num slices vertical %d\n", slice_height, num_slices[i]);
> +
> +		act_slice_height = igt_amd_read_dsc_param_slice_height(data->fd, output->name);
> +
> +		igt_info("Reading slice height: actual slice height %d VS assigned slice height %d\n", act_slice_height, slice_height);
> +
> +		pass = (slice_height == act_slice_height);
> +
> +		if (!pass)
> +			break;
> +	}
> +
> +	igt_amd_write_dsc_param_slice_height(data->fd, output->name, 0);
> +	igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +	igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +	return pass;
> +}
> +
> +static bool update_slice_width(data_t *data, int h_addressable,
> +					  int *num_slices, igt_output_t *output, int conn_idx, igt_fb_t ref_fb)
> +{
> +	int i;
> +	bool pass = true;
> +
> +	for(i = 0; i < NUM_SLICE_SLOTS; i++) {
> +		int act_slice_width;
> +		int slice_width = h_addressable / num_slices[i] + (h_addressable % num_slices[i]);
> +
> +		/* Overwrite DSC slice width */
> +		igt_amd_write_dsc_param_slice_width(data->fd, output->name, slice_width);
> +		igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +		igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		igt_info("Forcing slice width: slice width %d num slices horisontal %d\n", slice_width, num_slices[i]);
> +
> +		act_slice_width = igt_amd_read_dsc_param_slice_width(data->fd, output->name);
> +
> +		igt_info("Reading slice width: actual slice width %d VS assigned slice width %d\n", act_slice_width, slice_width);
> +
> +		pass = (slice_width == act_slice_width);
> +
> +		if (!pass)
> +			break;
> +	}
> +
> +	igt_amd_write_dsc_param_slice_width(data->fd, output->name, 0);
> +	igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +	igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +	return pass;
> +}
> +
> +static void test_dsc_slice_dimensions_change(data_t *data)
> +{
> +	bool dsc_on, dsc_after, dsc_before;
> +	igt_output_t *output;
> +	igt_display_t *display = &data->display;
> +	igt_fb_t ref_fb;
> +	int num_slices [] = { 1, 2, 4, 8 };
> +	int h_addressable, v_addressable;
> +	bool ret_slice_height= false, ret_slice_width = false;
> +	int i, test_conn_cnt = 0;
> +
> +	test_init(data);
> +	igt_enable_connectors(data->fd);
> +
> +	for (i = 0; i < display->n_pipes; i++) {
> +		/* Setup the output */
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_create_pattern_fb(data->fd,
> +					data->mode[i].hdisplay,
> +					data->mode[i].vdisplay,
> +					DRM_FORMAT_XRGB8888,
> +					0,
> +					&ref_fb);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> +
> +		test_conn_cnt++;
> +
> +		h_addressable = data->mode->hdisplay;
> +		v_addressable = data->mode->vdisplay;
> +
> +		igt_info("Mode info: v_ative %d  h_active %d\n", v_addressable, h_addressable);
> +
> +		/* Save pipe's initial DSC state */
> +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Force enable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		/* Check if DSC is enabled */
> +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
> +
> +		if (dsc_on) {
> +			ret_slice_height = update_slice_height(data, v_addressable, num_slices, output, i, ref_fb);
> +			ret_slice_width = update_slice_width(data, h_addressable, num_slices, output, i, ref_fb);
> +		}
> +
> +		/* Force disable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> +		igt_assert_f(ret_slice_height, "Changing slice height failed.\n");
> +		igt_assert_f(ret_slice_width, "Changing slice width failed.\n");
> +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial state failed.\n");
> +
> +		/* Cleanup fb */
> +		igt_remove_fb(data->fd, &ref_fb);
> +	}
> +
> +	test_fini(data);
> +	igt_skip_on(test_conn_cnt == 0);
> +}
> +
> +static void test_dsc_link_settings(data_t *data)
> +{
> +	igt_output_t *output;
> +	igt_fb_t ref_fb[MAX_PIPES];
> +	igt_crc_t ref_crc[MAX_PIPES], new_crc[MAX_PIPES];
> +    int lane_count[4], link_rate[4], link_spread[4];
> +	igt_display_t *display = &data->display;
> +	int i, lc, lr;
> +    bool dsc_on;
> +	const enum dc_lane_count lane_count_vals[] =
> +	{
> +		LANE_COUNT_TWO,
> +		LANE_COUNT_FOUR
> +	};
> +	const enum dc_link_rate link_rate_vals[] =
> +	{
> +		LINK_RATE_LOW,
> +		LINK_RATE_HIGH,
> +		LINK_RATE_HIGH2,
> +		LINK_RATE_HIGH3
> +	};
> +
> +    test_init(data);
> +
> +    /* Setup all outputs */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +        igt_create_pattern_fb(data->fd,
> +                    data->mode[i].hdisplay,
> +                    data->mode[i].vdisplay,
> +                    DRM_FORMAT_XRGB8888,
> +                    0,
> +                    &ref_fb[i]);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb[i]);
> +	}
> +	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> +
> +    /* Collect reference CRCs */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_pipe_crc_collect_crc(data->pipe_crc[i], &ref_crc[i]);
> +	}
> +
> +	for (lc = 0; lc < ARRAY_SIZE(lane_count_vals); lc++) {
> +		for (lr = 0; lr < ARRAY_SIZE(link_rate_vals); lr++) {
> +			/* Write new link_settings */
> +			for (i = 0; i < display->n_pipes; i++) {
> +				output = data->output[i];
> +				if (!output || !igt_output_is_connected(output))
> +					continue;
> +
> +				/* Write lower link settings */
> +				igt_info("Applying lane count: %d, link rate 0x%02x, on default training\n",
> +						lane_count_vals[lc], link_rate_vals[lr]);
> +				igt_amd_write_link_settings(data->fd, output->name,
> +							lane_count_vals[lc],
> +							link_rate_vals[lr],
> +							LINK_TRAINING_DEFAULT);
> +				usleep(500 * MSEC_PER_SEC);
> +			}
> +
> +			/* Trigger commit after writing new link settings */
> +			igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +			for (i = 0; i < display->n_pipes; i++) {
> +				output = data->output[i];
> +				if (!output || !igt_output_is_connected(output))
> +					continue;
> +
> +				/* Verify lower link settings */
> +				igt_amd_read_link_settings(data->fd, output->name,
> +							lane_count,
> +							link_rate,
> +							link_spread);
> +
> +				igt_assert_f(lane_count[0] == lane_count_vals[lc], "Lowering lane count settings failed\n");
> +				igt_assert_f(link_rate[0] == link_rate_vals[lr], "Lowering link rate settings failed\n");
> +
> +				/* Log current mode and DSC status */
> +				dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
> +				igt_info("Current mode is: %dx%d @%dHz -- DSC is: %s\n",
> +							data->mode[i].hdisplay,
> +							data->mode[i].vdisplay,
> +							data->mode[i].vrefresh,
> +							dsc_on ? "ON" : "OFF");
> +
> +				igt_pipe_crc_collect_crc(data->pipe_crc[i], &new_crc[i]);
> +				igt_assert_crc_equal(&ref_crc[i], &new_crc[i]);
> +			}
> +		}
> +	}
> +
> +	/* Cleanup all fbs */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +		igt_remove_fb(data->fd, &ref_fb[i]);
> +	}
> +
> +    test_fini(data);
> +}
> +
> +/* Returns the current and maximum bpc from the connector debugfs. */
> +static output_bpc_t get_output_bpc(int data_fd, char *connector_name)
> +{
> +	char buf[256];
> +	char *start_loc;
> +	int fd, res;
> +	output_bpc_t info;
> +
> +	fd = igt_debugfs_connector_dir(data_fd, connector_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(int data_fd, char *connector_name, unsigned int bpc)
> +{
> +	output_bpc_t info = get_output_bpc(data_fd, connector_name);
> +
> +	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);
> +}
> +
> +/* Returns the highest bpc this dispaly supports */
> +static int get_max_supported_bpc(int data_fd, char *connector_name)
> +{
> +	output_bpc_t info = get_output_bpc(data_fd, connector_name);
> +	return info.maximum;
> +}
> +
> +static void test_dsc_bpc(data_t *data)
> +{
> +	igt_output_t *output;
> +	igt_fb_t ref_fb[MAX_PIPES];
> +	igt_crc_t test_crc;
> +	igt_display_t *display = &data->display;
> +	int i, bpc, max_supported_bpc[MAX_PIPES];
> +    bool dsc_on;
> +	const int bpc_vals[] = {12, 10, 8};
> +
> +    test_init(data);
> +
> +	/* Find max supported bpc */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +		igt_info("Checking bpc support of conn %s\n", output->name);
> +		max_supported_bpc[i] = get_max_supported_bpc(data->fd, output->name);
> +	}
> +
> +    /* Setup all outputs */
> +	for (bpc = 0; bpc < ARRAY_SIZE(bpc_vals); bpc++) {
> +		igt_info("Testing bpc = %d\n", bpc_vals[bpc]);
> +
> +		for (i = 0; i < display->n_pipes; i++) {
> +			output = data->output[i];
> +			if (!output || !igt_output_is_connected(output))
> +				continue;
> +
> +			if (max_supported_bpc[i] < bpc_vals[bpc]) {
> +				igt_info("Display doesn't support bpc of %d, max is %d. Skipping to next bpc value.\n", bpc_vals[bpc], max_supported_bpc[i]);
> +				continue;
> +			}
> +			igt_info("Setting bpc = %d\n", bpc_vals[bpc]);
> +			igt_output_set_prop_value(output, IGT_CONNECTOR_MAX_BPC, bpc_vals[bpc]);
> +			igt_create_pattern_fb(data->fd,
> +						data->mode[i].hdisplay,
> +						data->mode[i].vdisplay,
> +						DRM_FORMAT_XRGB8888,
> +						0,
> +						&ref_fb[i]);
> +			igt_output_set_pipe(output, data->pipe_id[i]);
> +			igt_plane_set_fb(data->primary[i], &ref_fb[i]);
> +		}
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> +
> +		for (i = 0; i < display->n_pipes; i++) {
> +			output = data->output[i];
> +			if (!output || !igt_output_is_connected(output))
> +				continue;
> +
> +			if (max_supported_bpc[i] < bpc_vals[bpc])
> +				continue;
> +
> +			/* Check that crc is non-zero */
> +			igt_pipe_crc_collect_crc(data->pipe_crc[i], &test_crc);
> +			igt_assert(test_crc.crc[0] && test_crc.crc[1] && test_crc.crc[2]);
> +
> +			/* Check current bpc */
> +			igt_info("Verifying display %s has correct bpc\n", output->name);
> +			assert_output_bpc(data->fd, output->name, bpc_vals[bpc]);
> +
> +			/* Log current mode and DSC status */
> +			dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
> +			igt_info("Current mode is: %dx%d @%dHz -- DSC is: %s\n",
> +						data->mode[i].hdisplay,
> +						data->mode[i].vdisplay,
> +						data->mode[i].vrefresh,
> +						dsc_on ? "ON" : "OFF");
> +		}
> +
> +		/* Cleanup all fbs */
> +		for (i = 0; i < display->n_pipes; i++) {
> +			output = data->output[i];
> +			if (!output || !igt_output_is_connected(output))
> +				continue;
> +
> +			if (max_supported_bpc[i] < bpc_vals[bpc])
> +				continue;
> +
> +			igt_remove_fb(data->fd, &ref_fb[i]);
> +		}
> +	}
> +
> +    test_fini(data);
> +}
> +
> +igt_main
> +{
> +	data_t data = { 0 };
> +
> +	igt_skip_on_simulation();
> +
> +	igt_fixture
> +	{
> +		data.fd = drm_open_driver_master(DRIVER_ANY);
> +
> +		igt_display_require(&data.display, data.fd);
> +		igt_require(data.display.is_atomic);
> +		igt_display_require_output(&data.display);
> +
> +		igt_amd_require_dsc(&data.display, data.fd);
> +		kmstest_set_vt_graphics_mode();
> +	}
> +
> +	igt_describe("Forces DSC on/off & ensures it is reset properly");
> +	igt_subtest("dsc-enable-basic")
> +		    test_dsc_enable(&data);
> +
> +	igt_describe("Tests DSC slice height property & ensures it is reset properly on DSC enable/disable");
> +	igt_subtest("dsc-slice-height-property")
> +		    test_dsc_slice_height_property(&data);
> +
> +	igt_describe("Tests various DSC slice dimensions");
> +	igt_subtest("dsc-slice-dimensions-change")
> +		    test_dsc_slice_dimensions_change(&data);
> +
> +	igt_describe("Tests various combinations of link_rate + lane_count and logs if DSC enabled/disabled");
> +	igt_subtest("dsc-link-settings")
> +		    test_dsc_link_settings(&data);
> +
> +	igt_describe("Tests different bpc settings and logs if DSC is enabled/disabled");
> +	igt_subtest("dsc-bpc")
> +			test_dsc_bpc(&data);
> +
> +	igt_fixture
> +	{
> +		igt_reset_connectors();
> +		igt_display_fini(&data.display);
> +	}
> +}
> diff --git a/tests/amdgpu/meson.build b/tests/amdgpu/meson.build
> index b736c456..001e37ef 100644
> --- a/tests/amdgpu/meson.build
> +++ b/tests/amdgpu/meson.build
> @@ -16,6 +16,7 @@ if libdrm_amdgpu.found()
>   			  'amd_mem_leak',
>   			  'amd_link_settings',
>   			  'amd_vrr_range',
> +			  'amd_dp_dsc',
>   			]
>   	amdgpu_deps += libdrm_amdgpu
>   endif
> 

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

* [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev2)
  2021-11-19 15:00 [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC Rodrigo Siqueira
  2021-11-19 16:34 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  2021-11-24 15:33 ` [igt-dev] [PATCH i-g-t] " Rodrigo Siqueira Jordao
@ 2021-11-24 16:55 ` Patchwork
  2021-11-24 19:24 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev3) Patchwork
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2021-11-24 16:55 UTC (permalink / raw)
  To: Rodrigo Siqueira Jordao; +Cc: igt-dev

== Series Details ==

Series: tests/amdgpu: Add test for AMD DP DSC (rev2)
URL   : https://patchwork.freedesktop.org/series/97108/
State : failure

== Summary ==

Applying: tests/amdgpu: Add test for AMD DP DSC
Using index info to reconstruct a base tree...
Patch failed at 0001 tests/amdgpu: Add test for AMD DP DSC
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


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

* Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
  2021-11-24 15:33 ` [igt-dev] [PATCH i-g-t] " Rodrigo Siqueira Jordao
@ 2021-11-24 19:07   ` Vudum, Lakshminarayana
  2021-11-24 23:01   ` Vudum, Lakshminarayana
  1 sibling, 0 replies; 17+ messages in thread
From: Vudum, Lakshminarayana @ 2021-11-24 19:07 UTC (permalink / raw)
  To: Rodrigo Siqueira Jordao; +Cc: Eryk Brol, igt-dev, Mikita Lipski

Can you post the Ci failure link here? I can check if we have an existing bug for the failure already or not.

Lakshmi.

-----Original Message-----
From: Rodrigo Siqueira Jordao <rjordrigo@amd.com> 
Sent: Wednesday, November 24, 2021 7:34 AM
To: Vudum, Lakshminarayana <lakshminarayana.vudum@intel.com>
Cc: Mikita Lipski <mikita.lipski@amd.com>; Eryk Brol <eryk.brol@amd.com>; Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>; igt-dev@lists.freedesktop.org; harry.wentland@amd.com; Nicholas.Choi@amd.com; markyacoub@chromium.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC

Hi Lakshmi,

I noticed a CI failure in this patch which is focused on AMD, except for the below change in the igt_kms.h:

diff --git a/lib/igt_kms.h b/lib/igt_kms.h index e9ecd21e..5c7d7481 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -125,6 +125,7 @@  enum igt_atomic_crtc_properties {
         IGT_CRTC_ACTIVE,
         IGT_CRTC_OUT_FENCE_PTR,
         IGT_CRTC_VRR_ENABLED,
+       IGT_CRTC_DSC_SLICE_HEIGHT,
         IGT_NUM_CRTC_PROPS
  };

 From the CI results, I'm not sure if this change caused the other failures, and since we saw some false positives in the AMD tests last week, is it possible to trigger the CI test for this patch again?

https://patchwork.freedesktop.org/patch/463655/?series=97108&rev=1

Thanks
Siqueira

On 2021-11-19 10:00 a.m., Rodrigo Siqueira wrote:
> From: Eryk Brol <eryk.brol@amd.com>
> 
> This commit introduces a DP DSC test that checks:
> 
> * Forces DSC on/off and ensures it is reset properly
> * Check DSC slice height property
> * Verify various DSC slice dimensions
> * Tests various combinations of link_rate + lane_count and logs if DSC
>    enabled/disabled Tests different bpc settings and logs if DSC is
>    enabled/disabled
> 
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Nicholas Choi <Nicholas.Choi@amd.com>
> Cc: Mark Yacoub <markyacoub@chromium.org>
> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
> Signed-off-by: Eryk Brol <eryk.brol@amd.com>
> ---
>   lib/igt_amd.c             | 494 +++++++++++++++++++++++++--
>   lib/igt_amd.h             |  35 ++
>   lib/igt_kms.h             |   1 +
>   tests/amdgpu/amd_dp_dsc.c | 685 ++++++++++++++++++++++++++++++++++++++
>   tests/amdgpu/meson.build  |   1 +
>   5 files changed, 1194 insertions(+), 22 deletions(-)
>   create mode 100644 tests/amdgpu/amd_dp_dsc.c
> 
> diff --git a/lib/igt_amd.c b/lib/igt_amd.c index f1bfb421..4bcfd594 
> 100644
> --- a/lib/igt_amd.c
> +++ b/lib/igt_amd.c
> @@ -251,11 +251,11 @@ bool igt_amd_is_tiled(uint64_t modifier)
>   }
>   
>   /**
> - * igt_amd_output_has_hpd: check if connector has HPD debugfs entry
> + * igt_amd_output_has_dsc: check if connector has dsc debugfs entry
>    * @drm_fd: DRM file descriptor
>    * @connector_name: The connector's name, on which we're reading the status
>    */
> -static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
> +static bool igt_amd_output_has_dsc(int drm_fd, char *connector_name)
>   {
>   	int fd;
>   	int res;
> @@ -267,9 +267,9 @@ static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
>   		return false;
>   	}
>   
> -	res = fstatat(fd, DEBUGFS_HPD_TRIGGER, &stat, 0);
> +	res = fstatat(fd, DEBUGFS_DSC_CLOCK_EN , &stat, 0);
>   	if (res != 0) {
> -		igt_info("%s debugfs not supported\n", DEBUGFS_HPD_TRIGGER);
> +		igt_info("%s debugfs not supported\n", DEBUGFS_DSC_CLOCK_EN);
>   		close(fd);
>   		return false;
>   	}
> @@ -279,49 +279,499 @@ static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
>   }
>   
>   /**
> - * igt_amd_require_hpd: Checks if connectors have HPD debugfs
> + * is_dp_dsc_supported: Checks if connector is DSC capable
> + * @display: A pointer to an #igt_display_t structure
> + * @drm_fd: DRM file descriptor
> + */
> +bool is_dp_dsc_supported(int drm_fd, char *connector_name) {
> +	char buf[512];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
> +
> +	return strstr(buf, "DSC_Sink_Support: yes"); }
> +
> +/**
> + * is_dp_fec_supported: Checks if connector is FEC capable
> + * @display: A pointer to an #igt_display_t structure
> + * @drm_fd: DRM file descriptor
> + */
> +bool is_dp_fec_supported(int drm_fd, char *connector_name) {
> +	char buf[512];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
> +
> +	return strstr(buf, "FEC_Sink_Support: yes"); }
> +
> +/**
> + * igt_amd_require_dsc: Checks if connectors have DSC debugfs
>    * @display: A pointer to an #igt_display_t structure
>    * @drm_fd: DRM file descriptor
>    *
> - * Checks if the AMDGPU driver has support the 'trigger_hotplug'
> - * entry for HPD. Skip test if HPD is not supported.
> + * Checks if the AMDGPU driver has support of debugfs entries for
> + * DSC. Skip test if DSC is not supported.
>    */
> -void igt_amd_require_hpd(igt_display_t *display, int drm_fd)
> +void igt_amd_require_dsc(igt_display_t *display, int drm_fd)
>   {
>   	igt_output_t *output;
>   
>   	for_each_connected_output(display, output) {
> -		if (igt_amd_output_has_hpd(drm_fd, output->name))
> +		if (igt_amd_output_has_dsc(drm_fd, output->name))
>   			return;
>   	}
>   
> -	igt_skip("No HPD debugfs support.\n");
> +	igt_skip("No DSC debugfs support.\n");
>   }
>   
>   /**
> - * igt_amd_trigger_hotplut: Triggers a debugfs HPD
> + * igt_amd_read_dsc_clock_status: Read the DSC Clock Enable debugfs
>    * @drm_fd: DRM file descriptor
> - * @connector_name: The connector's name, which we trigger the 
> hotplug on
> + * @connector_name: The connector's name, which we use to read status 
> + on
>    *
> - * igt_amd_require_hpd should be called before calling this.
>    */
> -int igt_amd_trigger_hotplug(int drm_fd, char *connector_name)
> +int igt_amd_read_dsc_clock_status(int drm_fd, char *connector_name) {
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_CLOCK_EN, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_CLOCK_EN, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +
> +/**
> + * igt_amd_write_dsc_clock_en: Write the DSC Clock Enable debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + * @dsc_force: DSC force parameter, 0 - DSC automatic, 1 - DSC force 
> +on,
> + * 2 - DSC force off
> + *
> + */
> +void igt_amd_write_dsc_clock_en(int drm_fd, char *connector_name, int 
> +dsc_force) {
> +	int fd, dsc_fd;
> +	char src[4];
> +	int wr_len;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	igt_assert(fd >= 0);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_CLOCK_EN, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (dsc_force == DSC_FORCE_ON)
> +		snprintf(src, sizeof(src), "%d", 1);
> +	else if (dsc_force == DSC_FORCE_OFF)
> +		snprintf(src, sizeof(src), "%d", 2);
> +	else
> +		snprintf(src, sizeof(src), "%d", 0);
> +
> +	igt_info("DSC Clock force, write %s > dsc_clock_en\n", src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	close(dsc_fd);
> +	igt_assert_eq(wr_len, strlen(src));
> +}
> +
> +/**
> + * igt_amd_write_dsc_param_slice_height: Write the DSC Slice Height 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + * @slice_height: DSC slice height parameter, accepts any positive integer,
> + * 		  if parameter is negative - it will not write to debugfs.
> + *
> + */
> +void igt_amd_write_dsc_param_slice_height(int drm_fd, char 
> +*connector_name, int slice_height) {
> +	int fd, dsc_fd;
> +	char src[32];
> +	int wr_len;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	igt_assert(fd >= 0);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_SLICE_HEIGHT, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (slice_height >= 0) {
> +		snprintf(src, sizeof(src), "%#x", slice_height);
> +	} else {
> +		igt_warn("DSC SLICE HEIGHT, slice height parameter is invalid (%d)\n", slice_height);
> +		goto exit;
> +	}
> +
> +	igt_info("DSC SLICE HEIGHT, write %s > dsc_slice_height\n", src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	igt_assert_eq(wr_len, strlen(src));
> +exit:
> +	close(dsc_fd);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_slice_height: Read the DSC Slice Height 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_slice_height(int drm_fd, char 
> +*connector_name) {
> +	char buf[32];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_HEIGHT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_SLICE_HEIGHT, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_write_dsc_param_slice_width: Write the DSC Slice Width 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + * @slice_width: DSC slice width parameter, accepts any positive integer,
> + * 		 if parameter is negative - it will not write to debugfs.
> + *
> + */
> +void igt_amd_write_dsc_param_slice_width(int drm_fd, char 
> +*connector_name, int slice_width)
>   {
> -	int fd, hpd_fd;
> +	int fd, dsc_fd;
> +	char src[32];
>   	int wr_len;
> -	const char *enable_hpd = "1";
>   
>   	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
>   	igt_assert(fd >= 0);
> -	hpd_fd = openat(fd, DEBUGFS_HPD_TRIGGER, O_WRONLY);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_SLICE_WIDTH, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (slice_width >= 0) {
> +		snprintf(src, sizeof(src), "%#x", slice_width);
> +	} else {
> +		igt_warn("DSC SLICE WIDTH, slice width parameter is invalid (%d)\n", slice_width);
> +		goto exit;
> +	}
> +
> +	igt_info("DSC SLICE WIDTH, write %s > dsc_slice_width\n", src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	igt_assert_eq(wr_len, strlen(src));
> +exit:
> +	close(dsc_fd);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_slice_width: Read the DSC Slice Width 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_slice_width(int drm_fd, char 
> +*connector_name) {
> +	char buf[32];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_WIDTH, buf, 
> +sizeof(buf));
>   	close(fd);
> -	igt_assert(hpd_fd >= 0);
>   
> -	wr_len = write(hpd_fd, enable_hpd, strlen(enable_hpd));
> -	close(hpd_fd);
> -	igt_assert_eq(wr_len, strlen(enable_hpd));
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_SLICE_WIDTH, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_write_dsc_param_bpp: Write the DSC Bits Per Pixel debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + * @bpp: DSC bits per pixel parameter, accepts any positive integer,
> + * 	 if parameter is negative - it will not write to debugfs.
> + *
> + */
> +void igt_amd_write_dsc_param_bpp(int drm_fd, char *connector_name, 
> +int bpp) {
> +	int fd, dsc_fd;
> +	char src[32];
> +	int wr_len;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	igt_assert(fd >= 0);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_BITS_PER_PIXEL, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (bpp >= 0) {
> +		snprintf(src, sizeof(src), "%#x", bpp);
> +	} else {
> +		igt_warn("DSC BITS PER PIXEL, bits per pixel parameter is invalid (%d)\n", bpp);
> +		goto exit;
> +	}
> +
> +	igt_info("DSC BITS PER PIXEL, write %s > dsc_bits_per_pixel\n", 
> +src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	igt_assert_eq(wr_len, strlen(src));
> +exit:
> +	close(dsc_fd);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_bpp: Read the DSC Bits Per Pixel debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_bpp(int drm_fd, char *connector_name) {
> +	char buf[32];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_BITS_PER_PIXEL, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_BITS_PER_PIXEL, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_pic_width: Read the DSC Picture Width 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_pic_width(int drm_fd, char 
> +*connector_name) {
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_PIC_WIDTH, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_PIC_WIDTH, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_pic_height: Read the DSC Picture Height 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_pic_height(int drm_fd, char 
> +*connector_name) {
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_PIC_HEIGHT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_PIC_HEIGHT, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_chunk_size: Read the DSC Chunk Size debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_chunk_size(int drm_fd, char 
> +*connector_name) {
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_CHUNK_SIZE, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_CHUNK_SIZE, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_slice_bpg: Read the DSC Slice BPG Offset 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_slice_bpg(int drm_fd, char 
> +*connector_name) {
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_BPG, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_SLICE_BPG, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_output_has_hpd: check if connector has HPD debugfs entry
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, on which we're reading the 
> +status  */ static bool igt_amd_output_has_hpd(int drm_fd, char 
> +*connector_name) {
> +        int fd;
> +        int res;
> +        struct stat stat;
> +
> +        fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +        if (fd < 0) {
> +                igt_info("output %s: debugfs not found\n", connector_name);
> +                return false;
> +        }
> +
> +        res = fstatat(fd, DEBUGFS_HPD_TRIGGER, &stat, 0);
> +        if (res != 0) {
> +                igt_info("%s debugfs not supported\n", DEBUGFS_HPD_TRIGGER);
> +                close(fd);
> +                return false;
> +        }
> +
> +        close(fd);
> +        return true;
> +}
> +
> +/**
> + * igt_amd_require_hpd: Checks if connectors have HPD debugfs
> + * @display: A pointer to an #igt_display_t structure
> + * @drm_fd: DRM file descriptor
> + *
> + * Checks if the AMDGPU driver has support the 'trigger_hotplug'
> + * entry for HPD. Skip test if HPD is not supported.
> + */
> +void igt_amd_require_hpd(igt_display_t *display, int drm_fd) {
> +        igt_output_t *output;
> +
> +        for_each_connected_output(display, output) {
> +                if (igt_amd_output_has_hpd(drm_fd, output->name))
> +                        return;
> +        }
> +
> +        igt_skip("No HPD debugfs support.\n"); }
> +
> +/**
> + * igt_amd_trigger_hotplut: Triggers a debugfs HPD
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we trigger the 
> +hotplug on
> + *
> + * igt_amd_require_hpd should be called before calling this.
> + */
> +int igt_amd_trigger_hotplug(int drm_fd, char *connector_name) {
> +        int fd, hpd_fd;
> +        int wr_len;
> +        const char *enable_hpd = "1";
> +
> +        fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +        igt_assert(fd >= 0);
> +        hpd_fd = openat(fd, DEBUGFS_HPD_TRIGGER, O_WRONLY);
> +        close(fd);
> +        igt_assert(hpd_fd >= 0);
> +
> +        wr_len = write(hpd_fd, enable_hpd, strlen(enable_hpd));
> +        close(hpd_fd);
> +        igt_assert_eq(wr_len, strlen(enable_hpd));
>   
> -	return 0;
> +        return 0;
>   }
>   
>   /*
> diff --git a/lib/igt_amd.h b/lib/igt_amd.h index e5bdbf33..7a91cbff 
> 100644
> --- a/lib/igt_amd.h
> +++ b/lib/igt_amd.h
> @@ -27,9 +27,27 @@
>   #include "igt.h"
>   #include "igt_fb.h"
>   
> +/* Read & Write DSC parameters */
> +#define DEBUGFS_DSC_CLOCK_EN "dsc_clock_en"
> +#define DEBUGFS_DSC_SLICE_WIDTH "dsc_slice_width"
> +#define DEBUGFS_DSC_SLICE_HEIGHT "dsc_slice_height"
> +#define DEBUGFS_DSC_BITS_PER_PIXEL "dsc_bits_per_pixel"
> +/* Read only DSC parameters */
> +#define DEBUGFS_DSC_PIC_WIDTH "dsc_pic_width"
> +#define DEBUGFS_DSC_PIC_HEIGHT "dsc_pic_height"
> +#define DEBUGFS_DSC_CHUNK_SIZE "dsc_chunk_size"
> +#define DEBUGFS_DSC_SLICE_BPG "dsc_slice_bpg"
> +#define DEBUGFS_DSC_FEC_SUPPORT "dp_dsc_fec_support"
> +
>   #define DEBUGFS_DP_LINK_SETTINGS "link_settings"
>   #define DEBUGFS_HPD_TRIGGER "trigger_hotplug"
>   
> +enum amd_dsc_clock_force {
> +	DSC_AUTOMATIC = 0,
> +	DSC_FORCE_ON,
> +	DSC_FORCE_OFF,
> +};
> +
>   enum dc_lane_count {
>   	LANE_COUNT_UNKNOWN = 0,
>   	LANE_COUNT_ONE = 1,
> @@ -80,6 +98,23 @@ void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void *dst_buf,
>   				       struct igt_fb *src, void *src_buf);
>   bool igt_amd_is_tiled(uint64_t modifier);
>   
> +/* IGT DSC helper functions */
> +bool is_dp_dsc_supported(int drm_fd, char *connector_name); bool 
> +is_dp_fec_supported(int drm_fd, char *connector_name); void 
> +igt_amd_require_dsc(igt_display_t *display, int drm_fd); int 
> +igt_amd_read_dsc_clock_status(int drm_fd, char *connector_name); void 
> +igt_amd_write_dsc_clock_en(int drm_fd, char *connector_name, int 
> +dsc_force); void igt_amd_write_dsc_param_slice_height(int drm_fd, 
> +char *connector_name, int slice_height); int 
> +igt_amd_read_dsc_param_slice_height(int drm_fd, char 
> +*connector_name); void igt_amd_write_dsc_param_slice_width(int 
> +drm_fd, char *connector_name, int slice_width); int 
> +igt_amd_read_dsc_param_slice_width(int drm_fd, char *connector_name); 
> +void igt_amd_write_dsc_param_bpp(int drm_fd, char *connector_name, 
> +int bpp); int igt_amd_read_dsc_param_bpp(int drm_fd, char 
> +*connector_name); int igt_amd_read_dsc_param_pic_width(int drm_fd, 
> +char *connector_name); int igt_amd_read_dsc_param_pic_height(int 
> +drm_fd, char *connector_name); int 
> +igt_amd_read_dsc_param_chunk_size(int drm_fd, char *connector_name); 
> +int igt_amd_read_dsc_param_slice_bpg(int drm_fd, char 
> +*connector_name);
> +
>   /* IGT HPD helper functions */
>   void igt_amd_require_hpd(igt_display_t *display, int drm_fd);
>   int igt_amd_trigger_hotplug(int drm_fd, char *connector_name); diff 
> --git a/lib/igt_kms.h b/lib/igt_kms.h index e9ecd21e..5c7d7481 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -125,6 +125,7 @@ enum igt_atomic_crtc_properties {
>          IGT_CRTC_ACTIVE,
>          IGT_CRTC_OUT_FENCE_PTR,
>          IGT_CRTC_VRR_ENABLED,
> +       IGT_CRTC_DSC_SLICE_HEIGHT,
>          IGT_NUM_CRTC_PROPS
>   };
>   
> diff --git a/tests/amdgpu/amd_dp_dsc.c b/tests/amdgpu/amd_dp_dsc.c new 
> file mode 100644 index 00000000..d73425e2
> --- /dev/null
> +++ b/tests/amdgpu/amd_dp_dsc.c
> @@ -0,0 +1,685 @@
> +/*
> + * Copyright 2021 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 "igt_amd.h"
> +#include "sw_sync.h"
> +#include <fcntl.h>
> +#include <signal.h>
> +
> +#define NUM_SLICE_SLOTS 4
> +
> +/* Maximumm pipes on any AMD ASIC. */ #define MAX_PIPES 6
> +
> +/* Common test data. */
> +typedef struct data {
> +	igt_display_t display;
> +	igt_plane_t *primary[MAX_PIPES];
> +	igt_output_t *output[MAX_PIPES];
> +	igt_pipe_t *pipe[MAX_PIPES];
> +	igt_pipe_crc_t *pipe_crc[MAX_PIPES];
> +	drmModeModeInfo mode[MAX_PIPES];
> +	enum pipe pipe_id[MAX_PIPES];
> +	int fd;
> +} data_t;
> +
> +/* BPC connector state. */
> +typedef struct output_bpc {
> +	unsigned int current;
> +	unsigned int maximum;
> +} output_bpc_t;
> +
> +/* Common test cleanup. */
> +static void test_fini(data_t *data)
> +{
> +	igt_display_t *display = &data->display;
> +	int i;
> +
> +	for (i = 0; i < display->n_pipes; ++i) {
> +		igt_pipe_crc_free(data->pipe_crc[i]);
> +	}
> +
> +	igt_display_reset(display);
> +	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0); }
> +
> +/* Common test setup. */
> +static void test_init(data_t *data)
> +{
> +	igt_display_t *display = &data->display;
> +	int i, n;
> +
> +	for (i = 0; i < display->n_pipes; ++i) {
> +		data->pipe_id[i] = PIPE_A + i;
> +		data->pipe[i] = &data->display.pipes[data->pipe_id[i]];
> +		data->primary[i] = igt_pipe_get_plane_type(
> +				data->pipe[i], DRM_PLANE_TYPE_PRIMARY);
> +		data->pipe_crc[i] =
> +				igt_pipe_crc_new(data->fd, data->pipe_id[i], "auto");
> +	}
> +
> +	for (i = 0, n = 0; i < display->n_outputs && n < display->n_pipes; ++i) {
> +		igt_output_t *output = &display->outputs[i];
> +		data->output[n] = output;
> +
> +		/* Only allow physically connected displays for the tests. */
> +		if (!igt_output_is_connected(output))
> +				continue;
> +
> +		/* Ensure that outpus are DP, DSC & FEC capable*/
> +		if (!(is_dp_fec_supported(data->fd, output->name) &&
> +			is_dp_dsc_supported(data->fd, output->name)))
> +			continue;
> +
> +		if (output->config.connector->connector_type !=
> +			DRM_MODE_CONNECTOR_DisplayPort)
> +			continue;
> +
> +		igt_assert(kmstest_get_connector_default_mode(
> +				data->fd, output->config.connector, &data->mode[n]));
> +
> +		n += 1;
> +	}
> +
> +	igt_display_reset(display);
> +}
> +
> +static void test_dsc_enable(data_t *data) {
> +	bool dsc_on, dsc_after, dsc_before;
> +	igt_display_t *display = &data->display;
> +	igt_output_t *output;
> +	igt_fb_t ref_fb;
> +	int i, test_conn_cnt = 0;
> +
> +	test_init(data);
> +	igt_enable_connectors(data->fd);
> +
> +	for (i = 0; i < display->n_pipes; i++) {
> +		/* Setup the output */
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_create_pattern_fb(data->fd,
> +					data->mode[i].hdisplay,
> +					data->mode[i].vdisplay,
> +					DRM_FORMAT_XRGB8888,
> +					0,
> +					&ref_fb);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0);
> +
> +		test_conn_cnt++;
> +
> +		/* Save pipe's initial DSC state */
> +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Force enable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		/* Check if DSC is enabled */
> +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 
> +1;
> +
> +		/* Revert DSC to automatic state */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display,DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial 
> +state failed.\n");
> +
> +		/* Cleanup fb */
> +		igt_remove_fb(data->fd, &ref_fb);
> +	}
> +
> +	test_fini(data);
> +	igt_skip_on(test_conn_cnt == 0);
> +}
> +
> +static void test_dsc_slice_height_property(data_t *data) {
> +	bool dsc_on, dsc_after, dsc_before;
> +	int slice_height_on, slice_height_off;
> +	igt_display_t *display = &data->display;
> +	igt_output_t *output;
> +	igt_fb_t ref_fb;
> +	int i, test_conn_cnt = 0;
> +
> +	test_init(data);
> +	igt_enable_connectors(data->fd);
> +
> +	for (i = 0; i < display->n_pipes; i++) {
> +		/* Setup the output */
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_create_pattern_fb(data->fd,
> +					data->mode[i].hdisplay,
> +					data->mode[i].vdisplay,
> +					DRM_FORMAT_XRGB8888,
> +					0,
> +					&ref_fb);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0);
> +
> +		test_conn_cnt++;
> +
> +		/* Save pipe's initial DSC state */
> +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Force enable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		/* Check if DSC is enabled */
> +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 
> +1;
> +
> +		slice_height_on = igt_pipe_get_prop(display, data->pipe_id[i], 
> +IGT_CRTC_DSC_SLICE_HEIGHT);
> +
> +		/* Revert DSC to automatic state */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		slice_height_off = igt_pipe_get_prop(display, data->pipe_id[i], 
> +IGT_CRTC_DSC_SLICE_HEIGHT);
> +
> +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> +		igt_assert_f(slice_height_on > 0, "DSC Slice property was not set properly.\n");
> +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial state failed.\n");
> +		igt_assert_f(slice_height_off == 0, "DSC Slice property was not 
> +reset properly.\n");
> +
> +		/* Cleanup fb */
> +		igt_remove_fb(data->fd, &ref_fb);
> +	}
> +
> +	test_fini(data);
> +	igt_skip_on(test_conn_cnt == 0);
> +}
> +
> +static bool update_slice_height(data_t *data, int v_addressable,
> +					  int *num_slices, igt_output_t *output, int conn_idx, igt_fb_t 
> +ref_fb) {
> +	int i;
> +	bool pass = true;
> +
> +	for(i = 0; i < NUM_SLICE_SLOTS; i++) {
> +		int act_slice_height;
> +		int slice_height = v_addressable / num_slices[i] + (v_addressable % 
> +num_slices[i]);
> +
> +		/* Overwrite DSC slice height */
> +		igt_amd_write_dsc_param_slice_height(data->fd, output->name, slice_height);
> +		igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +		igt_display_commit_atomic(&data->display, 
> +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		igt_info("Forcing slice height: slice height %d num slices vertical 
> +%d\n", slice_height, num_slices[i]);
> +
> +		act_slice_height = igt_amd_read_dsc_param_slice_height(data->fd, 
> +output->name);
> +
> +		igt_info("Reading slice height: actual slice height %d VS assigned 
> +slice height %d\n", act_slice_height, slice_height);
> +
> +		pass = (slice_height == act_slice_height);
> +
> +		if (!pass)
> +			break;
> +	}
> +
> +	igt_amd_write_dsc_param_slice_height(data->fd, output->name, 0);
> +	igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +	igt_display_commit_atomic(&data->display, 
> +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +	return pass;
> +}
> +
> +static bool update_slice_width(data_t *data, int h_addressable,
> +					  int *num_slices, igt_output_t *output, int conn_idx, igt_fb_t 
> +ref_fb) {
> +	int i;
> +	bool pass = true;
> +
> +	for(i = 0; i < NUM_SLICE_SLOTS; i++) {
> +		int act_slice_width;
> +		int slice_width = h_addressable / num_slices[i] + (h_addressable % 
> +num_slices[i]);
> +
> +		/* Overwrite DSC slice width */
> +		igt_amd_write_dsc_param_slice_width(data->fd, output->name, slice_width);
> +		igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +		igt_display_commit_atomic(&data->display, 
> +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		igt_info("Forcing slice width: slice width %d num slices horisontal 
> +%d\n", slice_width, num_slices[i]);
> +
> +		act_slice_width = igt_amd_read_dsc_param_slice_width(data->fd, 
> +output->name);
> +
> +		igt_info("Reading slice width: actual slice width %d VS assigned 
> +slice width %d\n", act_slice_width, slice_width);
> +
> +		pass = (slice_width == act_slice_width);
> +
> +		if (!pass)
> +			break;
> +	}
> +
> +	igt_amd_write_dsc_param_slice_width(data->fd, output->name, 0);
> +	igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +	igt_display_commit_atomic(&data->display, 
> +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +	return pass;
> +}
> +
> +static void test_dsc_slice_dimensions_change(data_t *data) {
> +	bool dsc_on, dsc_after, dsc_before;
> +	igt_output_t *output;
> +	igt_display_t *display = &data->display;
> +	igt_fb_t ref_fb;
> +	int num_slices [] = { 1, 2, 4, 8 };
> +	int h_addressable, v_addressable;
> +	bool ret_slice_height= false, ret_slice_width = false;
> +	int i, test_conn_cnt = 0;
> +
> +	test_init(data);
> +	igt_enable_connectors(data->fd);
> +
> +	for (i = 0; i < display->n_pipes; i++) {
> +		/* Setup the output */
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_create_pattern_fb(data->fd,
> +					data->mode[i].hdisplay,
> +					data->mode[i].vdisplay,
> +					DRM_FORMAT_XRGB8888,
> +					0,
> +					&ref_fb);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0);
> +
> +		test_conn_cnt++;
> +
> +		h_addressable = data->mode->hdisplay;
> +		v_addressable = data->mode->vdisplay;
> +
> +		igt_info("Mode info: v_ative %d  h_active %d\n", v_addressable, 
> +h_addressable);
> +
> +		/* Save pipe's initial DSC state */
> +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Force enable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		/* Check if DSC is enabled */
> +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 
> +1;
> +
> +		if (dsc_on) {
> +			ret_slice_height = update_slice_height(data, v_addressable, num_slices, output, i, ref_fb);
> +			ret_slice_width = update_slice_width(data, h_addressable, num_slices, output, i, ref_fb);
> +		}
> +
> +		/* Force disable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> +		igt_assert_f(ret_slice_height, "Changing slice height failed.\n");
> +		igt_assert_f(ret_slice_width, "Changing slice width failed.\n");
> +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial 
> +state failed.\n");
> +
> +		/* Cleanup fb */
> +		igt_remove_fb(data->fd, &ref_fb);
> +	}
> +
> +	test_fini(data);
> +	igt_skip_on(test_conn_cnt == 0);
> +}
> +
> +static void test_dsc_link_settings(data_t *data) {
> +	igt_output_t *output;
> +	igt_fb_t ref_fb[MAX_PIPES];
> +	igt_crc_t ref_crc[MAX_PIPES], new_crc[MAX_PIPES];
> +    int lane_count[4], link_rate[4], link_spread[4];
> +	igt_display_t *display = &data->display;
> +	int i, lc, lr;
> +    bool dsc_on;
> +	const enum dc_lane_count lane_count_vals[] =
> +	{
> +		LANE_COUNT_TWO,
> +		LANE_COUNT_FOUR
> +	};
> +	const enum dc_link_rate link_rate_vals[] =
> +	{
> +		LINK_RATE_LOW,
> +		LINK_RATE_HIGH,
> +		LINK_RATE_HIGH2,
> +		LINK_RATE_HIGH3
> +	};
> +
> +    test_init(data);
> +
> +    /* Setup all outputs */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +        igt_create_pattern_fb(data->fd,
> +                    data->mode[i].hdisplay,
> +                    data->mode[i].vdisplay,
> +                    DRM_FORMAT_XRGB8888,
> +                    0,
> +                    &ref_fb[i]);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb[i]);
> +	}
> +	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0);
> +
> +    /* Collect reference CRCs */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_pipe_crc_collect_crc(data->pipe_crc[i], &ref_crc[i]);
> +	}
> +
> +	for (lc = 0; lc < ARRAY_SIZE(lane_count_vals); lc++) {
> +		for (lr = 0; lr < ARRAY_SIZE(link_rate_vals); lr++) {
> +			/* Write new link_settings */
> +			for (i = 0; i < display->n_pipes; i++) {
> +				output = data->output[i];
> +				if (!output || !igt_output_is_connected(output))
> +					continue;
> +
> +				/* Write lower link settings */
> +				igt_info("Applying lane count: %d, link rate 0x%02x, on default training\n",
> +						lane_count_vals[lc], link_rate_vals[lr]);
> +				igt_amd_write_link_settings(data->fd, output->name,
> +							lane_count_vals[lc],
> +							link_rate_vals[lr],
> +							LINK_TRAINING_DEFAULT);
> +				usleep(500 * MSEC_PER_SEC);
> +			}
> +
> +			/* Trigger commit after writing new link settings */
> +			igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +			for (i = 0; i < display->n_pipes; i++) {
> +				output = data->output[i];
> +				if (!output || !igt_output_is_connected(output))
> +					continue;
> +
> +				/* Verify lower link settings */
> +				igt_amd_read_link_settings(data->fd, output->name,
> +							lane_count,
> +							link_rate,
> +							link_spread);
> +
> +				igt_assert_f(lane_count[0] == lane_count_vals[lc], "Lowering lane count settings failed\n");
> +				igt_assert_f(link_rate[0] == link_rate_vals[lr], "Lowering link 
> +rate settings failed\n");
> +
> +				/* Log current mode and DSC status */
> +				dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
> +				igt_info("Current mode is: %dx%d @%dHz -- DSC is: %s\n",
> +							data->mode[i].hdisplay,
> +							data->mode[i].vdisplay,
> +							data->mode[i].vrefresh,
> +							dsc_on ? "ON" : "OFF");
> +
> +				igt_pipe_crc_collect_crc(data->pipe_crc[i], &new_crc[i]);
> +				igt_assert_crc_equal(&ref_crc[i], &new_crc[i]);
> +			}
> +		}
> +	}
> +
> +	/* Cleanup all fbs */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +		igt_remove_fb(data->fd, &ref_fb[i]);
> +	}
> +
> +    test_fini(data);
> +}
> +
> +/* Returns the current and maximum bpc from the connector debugfs. */ 
> +static output_bpc_t get_output_bpc(int data_fd, char *connector_name) 
> +{
> +	char buf[256];
> +	char *start_loc;
> +	int fd, res;
> +	output_bpc_t info;
> +
> +	fd = igt_debugfs_connector_dir(data_fd, connector_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(int data_fd, char *connector_name, unsigned int 
> +bpc) {
> +	output_bpc_t info = get_output_bpc(data_fd, connector_name);
> +
> +	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);
> +}
> +
> +/* Returns the highest bpc this dispaly supports */ static int 
> +get_max_supported_bpc(int data_fd, char *connector_name) {
> +	output_bpc_t info = get_output_bpc(data_fd, connector_name);
> +	return info.maximum;
> +}
> +
> +static void test_dsc_bpc(data_t *data) {
> +	igt_output_t *output;
> +	igt_fb_t ref_fb[MAX_PIPES];
> +	igt_crc_t test_crc;
> +	igt_display_t *display = &data->display;
> +	int i, bpc, max_supported_bpc[MAX_PIPES];
> +    bool dsc_on;
> +	const int bpc_vals[] = {12, 10, 8};
> +
> +    test_init(data);
> +
> +	/* Find max supported bpc */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +		igt_info("Checking bpc support of conn %s\n", output->name);
> +		max_supported_bpc[i] = get_max_supported_bpc(data->fd, output->name);
> +	}
> +
> +    /* Setup all outputs */
> +	for (bpc = 0; bpc < ARRAY_SIZE(bpc_vals); bpc++) {
> +		igt_info("Testing bpc = %d\n", bpc_vals[bpc]);
> +
> +		for (i = 0; i < display->n_pipes; i++) {
> +			output = data->output[i];
> +			if (!output || !igt_output_is_connected(output))
> +				continue;
> +
> +			if (max_supported_bpc[i] < bpc_vals[bpc]) {
> +				igt_info("Display doesn't support bpc of %d, max is %d. Skipping to next bpc value.\n", bpc_vals[bpc], max_supported_bpc[i]);
> +				continue;
> +			}
> +			igt_info("Setting bpc = %d\n", bpc_vals[bpc]);
> +			igt_output_set_prop_value(output, IGT_CONNECTOR_MAX_BPC, bpc_vals[bpc]);
> +			igt_create_pattern_fb(data->fd,
> +						data->mode[i].hdisplay,
> +						data->mode[i].vdisplay,
> +						DRM_FORMAT_XRGB8888,
> +						0,
> +						&ref_fb[i]);
> +			igt_output_set_pipe(output, data->pipe_id[i]);
> +			igt_plane_set_fb(data->primary[i], &ref_fb[i]);
> +		}
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0);
> +
> +		for (i = 0; i < display->n_pipes; i++) {
> +			output = data->output[i];
> +			if (!output || !igt_output_is_connected(output))
> +				continue;
> +
> +			if (max_supported_bpc[i] < bpc_vals[bpc])
> +				continue;
> +
> +			/* Check that crc is non-zero */
> +			igt_pipe_crc_collect_crc(data->pipe_crc[i], &test_crc);
> +			igt_assert(test_crc.crc[0] && test_crc.crc[1] && test_crc.crc[2]);
> +
> +			/* Check current bpc */
> +			igt_info("Verifying display %s has correct bpc\n", output->name);
> +			assert_output_bpc(data->fd, output->name, bpc_vals[bpc]);
> +
> +			/* Log current mode and DSC status */
> +			dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
> +			igt_info("Current mode is: %dx%d @%dHz -- DSC is: %s\n",
> +						data->mode[i].hdisplay,
> +						data->mode[i].vdisplay,
> +						data->mode[i].vrefresh,
> +						dsc_on ? "ON" : "OFF");
> +		}
> +
> +		/* Cleanup all fbs */
> +		for (i = 0; i < display->n_pipes; i++) {
> +			output = data->output[i];
> +			if (!output || !igt_output_is_connected(output))
> +				continue;
> +
> +			if (max_supported_bpc[i] < bpc_vals[bpc])
> +				continue;
> +
> +			igt_remove_fb(data->fd, &ref_fb[i]);
> +		}
> +	}
> +
> +    test_fini(data);
> +}
> +
> +igt_main
> +{
> +	data_t data = { 0 };
> +
> +	igt_skip_on_simulation();
> +
> +	igt_fixture
> +	{
> +		data.fd = drm_open_driver_master(DRIVER_ANY);
> +
> +		igt_display_require(&data.display, data.fd);
> +		igt_require(data.display.is_atomic);
> +		igt_display_require_output(&data.display);
> +
> +		igt_amd_require_dsc(&data.display, data.fd);
> +		kmstest_set_vt_graphics_mode();
> +	}
> +
> +	igt_describe("Forces DSC on/off & ensures it is reset properly");
> +	igt_subtest("dsc-enable-basic")
> +		    test_dsc_enable(&data);
> +
> +	igt_describe("Tests DSC slice height property & ensures it is reset properly on DSC enable/disable");
> +	igt_subtest("dsc-slice-height-property")
> +		    test_dsc_slice_height_property(&data);
> +
> +	igt_describe("Tests various DSC slice dimensions");
> +	igt_subtest("dsc-slice-dimensions-change")
> +		    test_dsc_slice_dimensions_change(&data);
> +
> +	igt_describe("Tests various combinations of link_rate + lane_count and logs if DSC enabled/disabled");
> +	igt_subtest("dsc-link-settings")
> +		    test_dsc_link_settings(&data);
> +
> +	igt_describe("Tests different bpc settings and logs if DSC is enabled/disabled");
> +	igt_subtest("dsc-bpc")
> +			test_dsc_bpc(&data);
> +
> +	igt_fixture
> +	{
> +		igt_reset_connectors();
> +		igt_display_fini(&data.display);
> +	}
> +}
> diff --git a/tests/amdgpu/meson.build b/tests/amdgpu/meson.build index 
> b736c456..001e37ef 100644
> --- a/tests/amdgpu/meson.build
> +++ b/tests/amdgpu/meson.build
> @@ -16,6 +16,7 @@ if libdrm_amdgpu.found()
>   			  'amd_mem_leak',
>   			  'amd_link_settings',
>   			  'amd_vrr_range',
> +			  'amd_dp_dsc',
>   			]
>   	amdgpu_deps += libdrm_amdgpu
>   endif
> 


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

* [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev3)
  2021-11-19 15:00 [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC Rodrigo Siqueira
                   ` (2 preceding siblings ...)
  2021-11-24 16:55 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev2) Patchwork
@ 2021-11-24 19:24 ` Patchwork
  2021-11-24 22:55 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/amdgpu: Add test for AMD DP DSC Patchwork
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2021-11-24 19:24 UTC (permalink / raw)
  To: Vudum, Lakshminarayana; +Cc: igt-dev

== Series Details ==

Series: tests/amdgpu: Add test for AMD DP DSC (rev3)
URL   : https://patchwork.freedesktop.org/series/97108/
State : failure

== Summary ==

Applying: tests/amdgpu: Add test for AMD DP DSC
Patch failed at 0001 tests/amdgpu: Add test for AMD DP DSC
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


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

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/amdgpu: Add test for AMD DP DSC
  2021-11-19 15:00 [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC Rodrigo Siqueira
                   ` (3 preceding siblings ...)
  2021-11-24 19:24 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev3) Patchwork
@ 2021-11-24 22:55 ` Patchwork
  2021-11-24 23:18 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev4) Patchwork
  2021-11-25  7:10 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev5) Patchwork
  6 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2021-11-24 22:55 UTC (permalink / raw)
  To: Vudum, Lakshminarayana; +Cc: igt-dev

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

== Series Details ==

Series: tests/amdgpu: Add test for AMD DP DSC
URL   : https://patchwork.freedesktop.org/series/97108/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_10907 -> IGTPW_6418
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_6418 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_6418, 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_6418/index.html

Participating hosts (44 -> 34)
------------------------------

  Missing    (10): bat-dg1-6 fi-tgl-u2 bat-dg1-5 fi-hsw-4200u fi-icl-u2 fi-bsw-cyan bat-adlp-6 fi-ctg-p8600 bat-jsl-2 bat-jsl-1 

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@kms_addfb_basic@addfb25-bad-modifier:
    - fi-rkl-11600:       [PASS][1] -> [FAIL][2] +36 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@kms_addfb_basic@addfb25-bad-modifier.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_addfb_basic@addfb25-bad-modifier.html

  * igt@kms_addfb_basic@basic-x-tiled-legacy:
    - fi-rkl-guc:         [PASS][3] -> [FAIL][4] +36 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@kms_addfb_basic@basic-x-tiled-legacy.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_addfb_basic@basic-x-tiled-legacy.html

  * igt@prime_vgem@basic-fence-flip:
    - fi-rkl-11600:       [PASS][5] -> [CRASH][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@prime_vgem@basic-fence-flip.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@prime_vgem@basic-fence-flip.html
    - fi-rkl-guc:         [PASS][7] -> [CRASH][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@prime_vgem@basic-fence-flip.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@prime_vgem@basic-fence-flip.html

  
#### Warnings ####

  * igt@i915_pm_backlight@basic-brightness:
    - fi-rkl-11600:       [SKIP][9] ([i915#3012]) -> [FAIL][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@i915_pm_backlight@basic-brightness.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@i915_pm_backlight@basic-brightness.html
    - fi-rkl-guc:         [SKIP][11] ([i915#3012]) -> [FAIL][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@i915_pm_backlight@basic-brightness.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@i915_pm_backlight@basic-brightness.html

  * igt@kms_chamelium@dp-crc-fast:
    - fi-rkl-11600:       [SKIP][13] ([fdo#111827]) -> [FAIL][14] +8 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@kms_chamelium@dp-crc-fast.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_chamelium@dp-crc-fast.html

  * igt@kms_chamelium@dp-edid-read:
    - fi-rkl-guc:         [SKIP][15] ([fdo#111827]) -> [FAIL][16] +8 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@kms_chamelium@dp-edid-read.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_chamelium@dp-edid-read.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - fi-rkl-11600:       [SKIP][17] ([i915#4103]) -> [FAIL][18] +1 similar issue
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
    - fi-rkl-guc:         [SKIP][19] ([i915#4103]) -> [FAIL][20] +1 similar issue
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
    - fi-rkl-11600:       [SKIP][21] ([i915#533]) -> [FAIL][22]
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
    - fi-rkl-guc:         [SKIP][23] ([i915#533]) -> [FAIL][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_pm_rpm@basic-rte:
    - {fi-jsl-1}:         [PASS][25] -> [CRASH][26] +2 similar issues
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-jsl-1/igt@i915_pm_rpm@basic-rte.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@i915_pm_rpm@basic-rte.html

  * igt@kms_addfb_basic@too-high:
    - {fi-ehl-2}:         [PASS][27] -> [FAIL][28] +46 similar issues
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-ehl-2/igt@kms_addfb_basic@too-high.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@kms_addfb_basic@too-high.html

  * igt@kms_busy@basic:
    - {fi-jsl-1}:         NOTRUN -> [FAIL][29]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@kms_busy@basic.html
    - {fi-ehl-2}:         NOTRUN -> [FAIL][30]
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@kms_busy@basic.html

  * igt@kms_chamelium@dp-hpd-fast:
    - {fi-jsl-1}:         [SKIP][31] ([fdo#111827]) -> [FAIL][32] +8 similar issues
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-jsl-1/igt@kms_chamelium@dp-hpd-fast.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@kms_chamelium@dp-hpd-fast.html

  * igt@kms_chamelium@hdmi-edid-read:
    - {fi-ehl-2}:         [SKIP][33] ([fdo#111827]) -> [FAIL][34] +8 similar issues
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-ehl-2/igt@kms_chamelium@hdmi-edid-read.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@kms_chamelium@hdmi-edid-read.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - {fi-jsl-1}:         [SKIP][35] ([i915#4103]) -> [FAIL][36] +1 similar issue
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-jsl-1/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
    - {fi-ehl-2}:         [SKIP][37] ([fdo#109278]) -> [FAIL][38] +1 similar issue
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-ehl-2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
    - {fi-jsl-1}:         [SKIP][39] ([i915#533]) -> [FAIL][40]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-jsl-1/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
    - {fi-ehl-2}:         [SKIP][41] ([fdo#109278] / [i915#533]) -> [FAIL][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-ehl-2/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
    - {fi-jsl-1}:         [PASS][43] -> [FAIL][44] +46 similar issues
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-jsl-1/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-jsl-1/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html

  * igt@prime_vgem@basic-fence-flip:
    - {fi-ehl-2}:         [PASS][45] -> [CRASH][46] +2 similar issues
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-ehl-2/igt@prime_vgem@basic-fence-flip.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-ehl-2/igt@prime_vgem@basic-fence-flip.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_basic@semaphore:
    - fi-bdw-5557u:       NOTRUN -> [SKIP][47] ([fdo#109271]) +31 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-bdw-5557u/igt@amdgpu/amd_basic@semaphore.html

  * igt@i915_pm_rpm@basic-rte:
    - fi-rkl-guc:         [PASS][48] -> [CRASH][49] ([i915#4598])
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@i915_pm_rpm@basic-rte.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@i915_pm_rpm@basic-rte.html
    - fi-tgl-1115g4:      [PASS][50] -> [CRASH][51] ([i915#4598]) +2 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@i915_pm_rpm@basic-rte.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@i915_pm_rpm@basic-rte.html
    - fi-rkl-11600:       [PASS][52] -> [CRASH][53] ([i915#4598])
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@i915_pm_rpm@basic-rte.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@i915_pm_rpm@basic-rte.html

  * igt@i915_pm_rpm@module-reload:
    - fi-rkl-11600:       [PASS][54] -> [FAIL][55] ([i915#4598]) +1 similar issue
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@i915_pm_rpm@module-reload.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@i915_pm_rpm@module-reload.html
    - fi-rkl-guc:         [PASS][56] -> [FAIL][57] ([i915#4598]) +1 similar issue
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@i915_pm_rpm@module-reload.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@i915_pm_rpm@module-reload.html

  * igt@i915_selftest@live@hangcheck:
    - fi-snb-2600:        [PASS][58] -> [INCOMPLETE][59] ([i915#3921])
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-snb-2600/igt@i915_selftest@live@hangcheck.html

  * igt@kms_addfb_basic@framebuffer-vs-set-tiling:
    - fi-rkl-guc:         [PASS][60] -> [FAIL][61] ([i915#4638]) +2 similar issues
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@kms_addfb_basic@framebuffer-vs-set-tiling.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_addfb_basic@framebuffer-vs-set-tiling.html

  * igt@kms_addfb_basic@too-wide:
    - fi-tgl-1115g4:      [PASS][62] -> [FAIL][63] ([i915#4598]) +42 similar issues
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@kms_addfb_basic@too-wide.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@kms_addfb_basic@too-wide.html

  * igt@kms_busy@basic:
    - fi-tgl-1115g4:      NOTRUN -> [FAIL][64] ([i915#4598])
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@kms_busy@basic.html
    - fi-rkl-guc:         NOTRUN -> [FAIL][65] ([i915#4638])
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_busy@basic.html
    - fi-rkl-11600:       NOTRUN -> [FAIL][66] ([i915#4638])
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_busy@basic.html

  * igt@kms_chamelium@dp-crc-fast:
    - fi-bdw-5557u:       NOTRUN -> [SKIP][67] ([fdo#109271] / [fdo#111827]) +8 similar issues
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-bdw-5557u/igt@kms_chamelium@dp-crc-fast.html

  * igt@kms_cursor_legacy@basic-flip-after-cursor-varying-size:
    - fi-rkl-11600:       [PASS][68] -> [FAIL][69] ([i915#4638]) +2 similar issues
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@kms_cursor_legacy@basic-flip-after-cursor-varying-size.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_cursor_legacy@basic-flip-after-cursor-varying-size.html

  * igt@kms_force_connector_basic@force-connector-state:
    - fi-rkl-11600:       [PASS][70] -> [CRASH][71] ([i915#4638])
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-11600/igt@kms_force_connector_basic@force-connector-state.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-11600/igt@kms_force_connector_basic@force-connector-state.html
    - fi-rkl-guc:         [PASS][72] -> [CRASH][73] ([i915#4638])
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-rkl-guc/igt@kms_force_connector_basic@force-connector-state.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-rkl-guc/igt@kms_force_connector_basic@force-connector-state.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-cml-u2:          [PASS][74] -> [DMESG-WARN][75] ([i915#4269])
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-cml-u2/igt@kms_frontbuffer_tracking@basic.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-cml-u2/igt@kms_frontbuffer_tracking@basic.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s0:
    - fi-tgl-1115g4:      [FAIL][76] ([i915#1888]) -> [PASS][77]
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s0.html
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s0.html

  
#### Warnings ####

  * igt@i915_pm_backlight@basic-brightness:
    - fi-tgl-1115g4:      [SKIP][78] ([i915#1155]) -> [FAIL][79] ([i915#4598])
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@i915_pm_backlight@basic-brightness.html
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@i915_pm_backlight@basic-brightness.html

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-tgl-1115g4:      [SKIP][80] ([fdo#111827]) -> [FAIL][81] ([i915#4598]) +8 similar issues
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@kms_chamelium@common-hpd-after-suspend.html
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@kms_chamelium@common-hpd-after-suspend.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - fi-tgl-1115g4:      [SKIP][82] ([i915#4103]) -> [FAIL][83] ([i915#4598]) +1 similar issue
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-tgl-1115g4/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-tgl-1115g4/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_psr@primary_page_flip:
    - fi-skl-6600u:       [FAIL][84] ([i915#4547]) -> [INCOMPLETE][85] ([i915#4564])
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10907/fi-skl-6600u/igt@kms_psr@primary_page_flip.html
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/fi-skl-6600u/igt@kms_psr@primary_page_flip.html

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

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
  [i915#1759]: https://gitlab.freedesktop.org/drm/intel/issues/1759
  [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#2373]: https://gitlab.freedesktop.org/drm/intel/issues/2373
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
  [i915#3921]: https://gitlab.freedesktop.org/drm/intel/issues/3921
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4269]: https://gitlab.freedesktop.org/drm/intel/issues/4269
  [i915#4547]: https://gitlab.freedesktop.org/drm/intel/issues/4547
  [i915#4564]: https://gitlab.freedesktop.org/drm/intel/issues/4564
  [i915#4598]: https://gitlab.freedesktop.org/drm/intel/issues/4598
  [i915#4638]: https://gitlab.freedesktop.org/drm/intel/issues/4638
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#750]: https://gitlab.freedesktop.org/drm/intel/issues/750


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

  * CI: CI-20190529 -> None
  * IGT: IGT_6285 -> IGTPW_6418

  CI-20190529: 20190529
  CI_DRM_10907: e1f2e7039c95fdf680b357e4c19f7d2a3790cc1d @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_6418: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/index.html
  IGT_6285: 2e0355faad5c2e81cd6705b76e529ce526c7c9bf @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git



== Testlist changes ==

+igt@amdgpu/amd_dp_dsc@dsc-bpc
+igt@amdgpu/amd_dp_dsc@dsc-enable-basic
+igt@amdgpu/amd_dp_dsc@dsc-link-settings
+igt@amdgpu/amd_dp_dsc@dsc-slice-dimensions-change
+igt@amdgpu/amd_dp_dsc@dsc-slice-height-property

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6418/index.html

[-- Attachment #2: Type: text/html, Size: 21665 bytes --]

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

* Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
  2021-11-24 15:33 ` [igt-dev] [PATCH i-g-t] " Rodrigo Siqueira Jordao
  2021-11-24 19:07   ` Vudum, Lakshminarayana
@ 2021-11-24 23:01   ` Vudum, Lakshminarayana
  2021-11-25  7:11     ` Petri Latvala
  1 sibling, 1 reply; 17+ messages in thread
From: Vudum, Lakshminarayana @ 2021-11-24 23:01 UTC (permalink / raw)
  To: Rodrigo Siqueira Jordao, Rodrigo Siqueira, Latvala, Petri
  Cc: Eryk Brol, igt-dev, Mikita Lipski

@Rodrigo Siqueira I don't have the possibility to re-run the series. @Latvala, Petri Can you help here?

Lakshmi.

-----Original Message-----
From: Rodrigo Siqueira Jordao <rjordrigo@amd.com> 
Sent: Wednesday, November 24, 2021 7:34 AM
To: Vudum, Lakshminarayana <lakshminarayana.vudum@intel.com>
Cc: Mikita Lipski <mikita.lipski@amd.com>; Eryk Brol <eryk.brol@amd.com>; Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>; igt-dev@lists.freedesktop.org; harry.wentland@amd.com; Nicholas.Choi@amd.com; markyacoub@chromium.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC

Hi Lakshmi,

I noticed a CI failure in this patch which is focused on AMD, except for the below change in the igt_kms.h:

diff --git a/lib/igt_kms.h b/lib/igt_kms.h index e9ecd21e..5c7d7481 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -125,6 +125,7 @@  enum igt_atomic_crtc_properties {
         IGT_CRTC_ACTIVE,
         IGT_CRTC_OUT_FENCE_PTR,
         IGT_CRTC_VRR_ENABLED,
+       IGT_CRTC_DSC_SLICE_HEIGHT,
         IGT_NUM_CRTC_PROPS
  };

 From the CI results, I'm not sure if this change caused the other failures, and since we saw some false positives in the AMD tests last week, is it possible to trigger the CI test for this patch again?

https://patchwork.freedesktop.org/patch/463655/?series=97108&rev=1

Thanks
Siqueira

On 2021-11-19 10:00 a.m., Rodrigo Siqueira wrote:
> From: Eryk Brol <eryk.brol@amd.com>
> 
> This commit introduces a DP DSC test that checks:
> 
> * Forces DSC on/off and ensures it is reset properly
> * Check DSC slice height property
> * Verify various DSC slice dimensions
> * Tests various combinations of link_rate + lane_count and logs if DSC
>    enabled/disabled Tests different bpc settings and logs if DSC is
>    enabled/disabled
> 
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Nicholas Choi <Nicholas.Choi@amd.com>
> Cc: Mark Yacoub <markyacoub@chromium.org>
> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
> Signed-off-by: Eryk Brol <eryk.brol@amd.com>
> ---
>   lib/igt_amd.c             | 494 +++++++++++++++++++++++++--
>   lib/igt_amd.h             |  35 ++
>   lib/igt_kms.h             |   1 +
>   tests/amdgpu/amd_dp_dsc.c | 685 ++++++++++++++++++++++++++++++++++++++
>   tests/amdgpu/meson.build  |   1 +
>   5 files changed, 1194 insertions(+), 22 deletions(-)
>   create mode 100644 tests/amdgpu/amd_dp_dsc.c
> 
> diff --git a/lib/igt_amd.c b/lib/igt_amd.c index f1bfb421..4bcfd594 
> 100644
> --- a/lib/igt_amd.c
> +++ b/lib/igt_amd.c
> @@ -251,11 +251,11 @@ bool igt_amd_is_tiled(uint64_t modifier)
>   }
>   
>   /**
> - * igt_amd_output_has_hpd: check if connector has HPD debugfs entry
> + * igt_amd_output_has_dsc: check if connector has dsc debugfs entry
>    * @drm_fd: DRM file descriptor
>    * @connector_name: The connector's name, on which we're reading the status
>    */
> -static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
> +static bool igt_amd_output_has_dsc(int drm_fd, char *connector_name)
>   {
>   	int fd;
>   	int res;
> @@ -267,9 +267,9 @@ static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
>   		return false;
>   	}
>   
> -	res = fstatat(fd, DEBUGFS_HPD_TRIGGER, &stat, 0);
> +	res = fstatat(fd, DEBUGFS_DSC_CLOCK_EN , &stat, 0);
>   	if (res != 0) {
> -		igt_info("%s debugfs not supported\n", DEBUGFS_HPD_TRIGGER);
> +		igt_info("%s debugfs not supported\n", DEBUGFS_DSC_CLOCK_EN);
>   		close(fd);
>   		return false;
>   	}
> @@ -279,49 +279,499 @@ static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
>   }
>   
>   /**
> - * igt_amd_require_hpd: Checks if connectors have HPD debugfs
> + * is_dp_dsc_supported: Checks if connector is DSC capable
> + * @display: A pointer to an #igt_display_t structure
> + * @drm_fd: DRM file descriptor
> + */
> +bool is_dp_dsc_supported(int drm_fd, char *connector_name) {
> +	char buf[512];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
> +
> +	return strstr(buf, "DSC_Sink_Support: yes"); }
> +
> +/**
> + * is_dp_fec_supported: Checks if connector is FEC capable
> + * @display: A pointer to an #igt_display_t structure
> + * @drm_fd: DRM file descriptor
> + */
> +bool is_dp_fec_supported(int drm_fd, char *connector_name) {
> +	char buf[512];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
> +
> +	return strstr(buf, "FEC_Sink_Support: yes"); }
> +
> +/**
> + * igt_amd_require_dsc: Checks if connectors have DSC debugfs
>    * @display: A pointer to an #igt_display_t structure
>    * @drm_fd: DRM file descriptor
>    *
> - * Checks if the AMDGPU driver has support the 'trigger_hotplug'
> - * entry for HPD. Skip test if HPD is not supported.
> + * Checks if the AMDGPU driver has support of debugfs entries for
> + * DSC. Skip test if DSC is not supported.
>    */
> -void igt_amd_require_hpd(igt_display_t *display, int drm_fd)
> +void igt_amd_require_dsc(igt_display_t *display, int drm_fd)
>   {
>   	igt_output_t *output;
>   
>   	for_each_connected_output(display, output) {
> -		if (igt_amd_output_has_hpd(drm_fd, output->name))
> +		if (igt_amd_output_has_dsc(drm_fd, output->name))
>   			return;
>   	}
>   
> -	igt_skip("No HPD debugfs support.\n");
> +	igt_skip("No DSC debugfs support.\n");
>   }
>   
>   /**
> - * igt_amd_trigger_hotplut: Triggers a debugfs HPD
> + * igt_amd_read_dsc_clock_status: Read the DSC Clock Enable debugfs
>    * @drm_fd: DRM file descriptor
> - * @connector_name: The connector's name, which we trigger the 
> hotplug on
> + * @connector_name: The connector's name, which we use to read status 
> + on
>    *
> - * igt_amd_require_hpd should be called before calling this.
>    */
> -int igt_amd_trigger_hotplug(int drm_fd, char *connector_name)
> +int igt_amd_read_dsc_clock_status(int drm_fd, char *connector_name) {
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_CLOCK_EN, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_CLOCK_EN, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +
> +/**
> + * igt_amd_write_dsc_clock_en: Write the DSC Clock Enable debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + * @dsc_force: DSC force parameter, 0 - DSC automatic, 1 - DSC force 
> +on,
> + * 2 - DSC force off
> + *
> + */
> +void igt_amd_write_dsc_clock_en(int drm_fd, char *connector_name, int 
> +dsc_force) {
> +	int fd, dsc_fd;
> +	char src[4];
> +	int wr_len;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	igt_assert(fd >= 0);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_CLOCK_EN, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (dsc_force == DSC_FORCE_ON)
> +		snprintf(src, sizeof(src), "%d", 1);
> +	else if (dsc_force == DSC_FORCE_OFF)
> +		snprintf(src, sizeof(src), "%d", 2);
> +	else
> +		snprintf(src, sizeof(src), "%d", 0);
> +
> +	igt_info("DSC Clock force, write %s > dsc_clock_en\n", src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	close(dsc_fd);
> +	igt_assert_eq(wr_len, strlen(src));
> +}
> +
> +/**
> + * igt_amd_write_dsc_param_slice_height: Write the DSC Slice Height 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + * @slice_height: DSC slice height parameter, accepts any positive integer,
> + * 		  if parameter is negative - it will not write to debugfs.
> + *
> + */
> +void igt_amd_write_dsc_param_slice_height(int drm_fd, char 
> +*connector_name, int slice_height) {
> +	int fd, dsc_fd;
> +	char src[32];
> +	int wr_len;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	igt_assert(fd >= 0);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_SLICE_HEIGHT, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (slice_height >= 0) {
> +		snprintf(src, sizeof(src), "%#x", slice_height);
> +	} else {
> +		igt_warn("DSC SLICE HEIGHT, slice height parameter is invalid (%d)\n", slice_height);
> +		goto exit;
> +	}
> +
> +	igt_info("DSC SLICE HEIGHT, write %s > dsc_slice_height\n", src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	igt_assert_eq(wr_len, strlen(src));
> +exit:
> +	close(dsc_fd);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_slice_height: Read the DSC Slice Height 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_slice_height(int drm_fd, char 
> +*connector_name) {
> +	char buf[32];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_HEIGHT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_SLICE_HEIGHT, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_write_dsc_param_slice_width: Write the DSC Slice Width 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + * @slice_width: DSC slice width parameter, accepts any positive integer,
> + * 		 if parameter is negative - it will not write to debugfs.
> + *
> + */
> +void igt_amd_write_dsc_param_slice_width(int drm_fd, char 
> +*connector_name, int slice_width)
>   {
> -	int fd, hpd_fd;
> +	int fd, dsc_fd;
> +	char src[32];
>   	int wr_len;
> -	const char *enable_hpd = "1";
>   
>   	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
>   	igt_assert(fd >= 0);
> -	hpd_fd = openat(fd, DEBUGFS_HPD_TRIGGER, O_WRONLY);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_SLICE_WIDTH, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (slice_width >= 0) {
> +		snprintf(src, sizeof(src), "%#x", slice_width);
> +	} else {
> +		igt_warn("DSC SLICE WIDTH, slice width parameter is invalid (%d)\n", slice_width);
> +		goto exit;
> +	}
> +
> +	igt_info("DSC SLICE WIDTH, write %s > dsc_slice_width\n", src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	igt_assert_eq(wr_len, strlen(src));
> +exit:
> +	close(dsc_fd);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_slice_width: Read the DSC Slice Width 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_slice_width(int drm_fd, char 
> +*connector_name) {
> +	char buf[32];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_WIDTH, buf, 
> +sizeof(buf));
>   	close(fd);
> -	igt_assert(hpd_fd >= 0);
>   
> -	wr_len = write(hpd_fd, enable_hpd, strlen(enable_hpd));
> -	close(hpd_fd);
> -	igt_assert_eq(wr_len, strlen(enable_hpd));
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_SLICE_WIDTH, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_write_dsc_param_bpp: Write the DSC Bits Per Pixel debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + * @bpp: DSC bits per pixel parameter, accepts any positive integer,
> + * 	 if parameter is negative - it will not write to debugfs.
> + *
> + */
> +void igt_amd_write_dsc_param_bpp(int drm_fd, char *connector_name, 
> +int bpp) {
> +	int fd, dsc_fd;
> +	char src[32];
> +	int wr_len;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	igt_assert(fd >= 0);
> +	dsc_fd = openat(fd, DEBUGFS_DSC_BITS_PER_PIXEL, O_WRONLY);
> +	close(fd);
> +	igt_assert(dsc_fd >= 0);
> +
> +	if (bpp >= 0) {
> +		snprintf(src, sizeof(src), "%#x", bpp);
> +	} else {
> +		igt_warn("DSC BITS PER PIXEL, bits per pixel parameter is invalid (%d)\n", bpp);
> +		goto exit;
> +	}
> +
> +	igt_info("DSC BITS PER PIXEL, write %s > dsc_bits_per_pixel\n", 
> +src);
> +
> +	wr_len = write(dsc_fd, src, strlen(src));
> +	igt_assert_eq(wr_len, strlen(src));
> +exit:
> +	close(dsc_fd);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_bpp: Read the DSC Bits Per Pixel debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_bpp(int drm_fd, char *connector_name) {
> +	char buf[32];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_BITS_PER_PIXEL, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_BITS_PER_PIXEL, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_pic_width: Read the DSC Picture Width 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_pic_width(int drm_fd, char 
> +*connector_name) {
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_PIC_WIDTH, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_PIC_WIDTH, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_pic_height: Read the DSC Picture Height 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_pic_height(int drm_fd, char 
> +*connector_name) {
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_PIC_HEIGHT, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_PIC_HEIGHT, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_chunk_size: Read the DSC Chunk Size debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_chunk_size(int drm_fd, char 
> +*connector_name) {
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_CHUNK_SIZE, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_CHUNK_SIZE, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_read_dsc_param_slice_bpg: Read the DSC Slice BPG Offset 
> +debugfs
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we use to read status 
> +on
> + *
> + */
> +int igt_amd_read_dsc_param_slice_bpg(int drm_fd, char 
> +*connector_name) {
> +	char buf[4];
> +	int fd, ret;
> +
> +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Couldn't open connector %s debugfs directory\n",
> +			 connector_name);
> +		return false;
> +	}
> +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_BPG, buf, sizeof(buf));
> +	close(fd);
> +
> +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> +		     DEBUGFS_DSC_SLICE_BPG, connector_name);
> +
> +	return strtol(buf, NULL, 0);
> +}
> +
> +/**
> + * igt_amd_output_has_hpd: check if connector has HPD debugfs entry
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, on which we're reading the 
> +status  */ static bool igt_amd_output_has_hpd(int drm_fd, char 
> +*connector_name) {
> +        int fd;
> +        int res;
> +        struct stat stat;
> +
> +        fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +        if (fd < 0) {
> +                igt_info("output %s: debugfs not found\n", connector_name);
> +                return false;
> +        }
> +
> +        res = fstatat(fd, DEBUGFS_HPD_TRIGGER, &stat, 0);
> +        if (res != 0) {
> +                igt_info("%s debugfs not supported\n", DEBUGFS_HPD_TRIGGER);
> +                close(fd);
> +                return false;
> +        }
> +
> +        close(fd);
> +        return true;
> +}
> +
> +/**
> + * igt_amd_require_hpd: Checks if connectors have HPD debugfs
> + * @display: A pointer to an #igt_display_t structure
> + * @drm_fd: DRM file descriptor
> + *
> + * Checks if the AMDGPU driver has support the 'trigger_hotplug'
> + * entry for HPD. Skip test if HPD is not supported.
> + */
> +void igt_amd_require_hpd(igt_display_t *display, int drm_fd) {
> +        igt_output_t *output;
> +
> +        for_each_connected_output(display, output) {
> +                if (igt_amd_output_has_hpd(drm_fd, output->name))
> +                        return;
> +        }
> +
> +        igt_skip("No HPD debugfs support.\n"); }
> +
> +/**
> + * igt_amd_trigger_hotplut: Triggers a debugfs HPD
> + * @drm_fd: DRM file descriptor
> + * @connector_name: The connector's name, which we trigger the 
> +hotplug on
> + *
> + * igt_amd_require_hpd should be called before calling this.
> + */
> +int igt_amd_trigger_hotplug(int drm_fd, char *connector_name) {
> +        int fd, hpd_fd;
> +        int wr_len;
> +        const char *enable_hpd = "1";
> +
> +        fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> +        igt_assert(fd >= 0);
> +        hpd_fd = openat(fd, DEBUGFS_HPD_TRIGGER, O_WRONLY);
> +        close(fd);
> +        igt_assert(hpd_fd >= 0);
> +
> +        wr_len = write(hpd_fd, enable_hpd, strlen(enable_hpd));
> +        close(hpd_fd);
> +        igt_assert_eq(wr_len, strlen(enable_hpd));
>   
> -	return 0;
> +        return 0;
>   }
>   
>   /*
> diff --git a/lib/igt_amd.h b/lib/igt_amd.h index e5bdbf33..7a91cbff 
> 100644
> --- a/lib/igt_amd.h
> +++ b/lib/igt_amd.h
> @@ -27,9 +27,27 @@
>   #include "igt.h"
>   #include "igt_fb.h"
>   
> +/* Read & Write DSC parameters */
> +#define DEBUGFS_DSC_CLOCK_EN "dsc_clock_en"
> +#define DEBUGFS_DSC_SLICE_WIDTH "dsc_slice_width"
> +#define DEBUGFS_DSC_SLICE_HEIGHT "dsc_slice_height"
> +#define DEBUGFS_DSC_BITS_PER_PIXEL "dsc_bits_per_pixel"
> +/* Read only DSC parameters */
> +#define DEBUGFS_DSC_PIC_WIDTH "dsc_pic_width"
> +#define DEBUGFS_DSC_PIC_HEIGHT "dsc_pic_height"
> +#define DEBUGFS_DSC_CHUNK_SIZE "dsc_chunk_size"
> +#define DEBUGFS_DSC_SLICE_BPG "dsc_slice_bpg"
> +#define DEBUGFS_DSC_FEC_SUPPORT "dp_dsc_fec_support"
> +
>   #define DEBUGFS_DP_LINK_SETTINGS "link_settings"
>   #define DEBUGFS_HPD_TRIGGER "trigger_hotplug"
>   
> +enum amd_dsc_clock_force {
> +	DSC_AUTOMATIC = 0,
> +	DSC_FORCE_ON,
> +	DSC_FORCE_OFF,
> +};
> +
>   enum dc_lane_count {
>   	LANE_COUNT_UNKNOWN = 0,
>   	LANE_COUNT_ONE = 1,
> @@ -80,6 +98,23 @@ void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void *dst_buf,
>   				       struct igt_fb *src, void *src_buf);
>   bool igt_amd_is_tiled(uint64_t modifier);
>   
> +/* IGT DSC helper functions */
> +bool is_dp_dsc_supported(int drm_fd, char *connector_name); bool 
> +is_dp_fec_supported(int drm_fd, char *connector_name); void 
> +igt_amd_require_dsc(igt_display_t *display, int drm_fd); int 
> +igt_amd_read_dsc_clock_status(int drm_fd, char *connector_name); void 
> +igt_amd_write_dsc_clock_en(int drm_fd, char *connector_name, int 
> +dsc_force); void igt_amd_write_dsc_param_slice_height(int drm_fd, 
> +char *connector_name, int slice_height); int 
> +igt_amd_read_dsc_param_slice_height(int drm_fd, char 
> +*connector_name); void igt_amd_write_dsc_param_slice_width(int 
> +drm_fd, char *connector_name, int slice_width); int 
> +igt_amd_read_dsc_param_slice_width(int drm_fd, char *connector_name); 
> +void igt_amd_write_dsc_param_bpp(int drm_fd, char *connector_name, 
> +int bpp); int igt_amd_read_dsc_param_bpp(int drm_fd, char 
> +*connector_name); int igt_amd_read_dsc_param_pic_width(int drm_fd, 
> +char *connector_name); int igt_amd_read_dsc_param_pic_height(int 
> +drm_fd, char *connector_name); int 
> +igt_amd_read_dsc_param_chunk_size(int drm_fd, char *connector_name); 
> +int igt_amd_read_dsc_param_slice_bpg(int drm_fd, char 
> +*connector_name);
> +
>   /* IGT HPD helper functions */
>   void igt_amd_require_hpd(igt_display_t *display, int drm_fd);
>   int igt_amd_trigger_hotplug(int drm_fd, char *connector_name); diff 
> --git a/lib/igt_kms.h b/lib/igt_kms.h index e9ecd21e..5c7d7481 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -125,6 +125,7 @@ enum igt_atomic_crtc_properties {
>          IGT_CRTC_ACTIVE,
>          IGT_CRTC_OUT_FENCE_PTR,
>          IGT_CRTC_VRR_ENABLED,
> +       IGT_CRTC_DSC_SLICE_HEIGHT,
>          IGT_NUM_CRTC_PROPS
>   };
>   
> diff --git a/tests/amdgpu/amd_dp_dsc.c b/tests/amdgpu/amd_dp_dsc.c new 
> file mode 100644 index 00000000..d73425e2
> --- /dev/null
> +++ b/tests/amdgpu/amd_dp_dsc.c
> @@ -0,0 +1,685 @@
> +/*
> + * Copyright 2021 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 "igt_amd.h"
> +#include "sw_sync.h"
> +#include <fcntl.h>
> +#include <signal.h>
> +
> +#define NUM_SLICE_SLOTS 4
> +
> +/* Maximumm pipes on any AMD ASIC. */ #define MAX_PIPES 6
> +
> +/* Common test data. */
> +typedef struct data {
> +	igt_display_t display;
> +	igt_plane_t *primary[MAX_PIPES];
> +	igt_output_t *output[MAX_PIPES];
> +	igt_pipe_t *pipe[MAX_PIPES];
> +	igt_pipe_crc_t *pipe_crc[MAX_PIPES];
> +	drmModeModeInfo mode[MAX_PIPES];
> +	enum pipe pipe_id[MAX_PIPES];
> +	int fd;
> +} data_t;
> +
> +/* BPC connector state. */
> +typedef struct output_bpc {
> +	unsigned int current;
> +	unsigned int maximum;
> +} output_bpc_t;
> +
> +/* Common test cleanup. */
> +static void test_fini(data_t *data)
> +{
> +	igt_display_t *display = &data->display;
> +	int i;
> +
> +	for (i = 0; i < display->n_pipes; ++i) {
> +		igt_pipe_crc_free(data->pipe_crc[i]);
> +	}
> +
> +	igt_display_reset(display);
> +	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0); }
> +
> +/* Common test setup. */
> +static void test_init(data_t *data)
> +{
> +	igt_display_t *display = &data->display;
> +	int i, n;
> +
> +	for (i = 0; i < display->n_pipes; ++i) {
> +		data->pipe_id[i] = PIPE_A + i;
> +		data->pipe[i] = &data->display.pipes[data->pipe_id[i]];
> +		data->primary[i] = igt_pipe_get_plane_type(
> +				data->pipe[i], DRM_PLANE_TYPE_PRIMARY);
> +		data->pipe_crc[i] =
> +				igt_pipe_crc_new(data->fd, data->pipe_id[i], "auto");
> +	}
> +
> +	for (i = 0, n = 0; i < display->n_outputs && n < display->n_pipes; ++i) {
> +		igt_output_t *output = &display->outputs[i];
> +		data->output[n] = output;
> +
> +		/* Only allow physically connected displays for the tests. */
> +		if (!igt_output_is_connected(output))
> +				continue;
> +
> +		/* Ensure that outpus are DP, DSC & FEC capable*/
> +		if (!(is_dp_fec_supported(data->fd, output->name) &&
> +			is_dp_dsc_supported(data->fd, output->name)))
> +			continue;
> +
> +		if (output->config.connector->connector_type !=
> +			DRM_MODE_CONNECTOR_DisplayPort)
> +			continue;
> +
> +		igt_assert(kmstest_get_connector_default_mode(
> +				data->fd, output->config.connector, &data->mode[n]));
> +
> +		n += 1;
> +	}
> +
> +	igt_display_reset(display);
> +}
> +
> +static void test_dsc_enable(data_t *data) {
> +	bool dsc_on, dsc_after, dsc_before;
> +	igt_display_t *display = &data->display;
> +	igt_output_t *output;
> +	igt_fb_t ref_fb;
> +	int i, test_conn_cnt = 0;
> +
> +	test_init(data);
> +	igt_enable_connectors(data->fd);
> +
> +	for (i = 0; i < display->n_pipes; i++) {
> +		/* Setup the output */
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_create_pattern_fb(data->fd,
> +					data->mode[i].hdisplay,
> +					data->mode[i].vdisplay,
> +					DRM_FORMAT_XRGB8888,
> +					0,
> +					&ref_fb);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0);
> +
> +		test_conn_cnt++;
> +
> +		/* Save pipe's initial DSC state */
> +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Force enable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		/* Check if DSC is enabled */
> +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 
> +1;
> +
> +		/* Revert DSC to automatic state */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display,DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial 
> +state failed.\n");
> +
> +		/* Cleanup fb */
> +		igt_remove_fb(data->fd, &ref_fb);
> +	}
> +
> +	test_fini(data);
> +	igt_skip_on(test_conn_cnt == 0);
> +}
> +
> +static void test_dsc_slice_height_property(data_t *data) {
> +	bool dsc_on, dsc_after, dsc_before;
> +	int slice_height_on, slice_height_off;
> +	igt_display_t *display = &data->display;
> +	igt_output_t *output;
> +	igt_fb_t ref_fb;
> +	int i, test_conn_cnt = 0;
> +
> +	test_init(data);
> +	igt_enable_connectors(data->fd);
> +
> +	for (i = 0; i < display->n_pipes; i++) {
> +		/* Setup the output */
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_create_pattern_fb(data->fd,
> +					data->mode[i].hdisplay,
> +					data->mode[i].vdisplay,
> +					DRM_FORMAT_XRGB8888,
> +					0,
> +					&ref_fb);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0);
> +
> +		test_conn_cnt++;
> +
> +		/* Save pipe's initial DSC state */
> +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Force enable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		/* Check if DSC is enabled */
> +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 
> +1;
> +
> +		slice_height_on = igt_pipe_get_prop(display, data->pipe_id[i], 
> +IGT_CRTC_DSC_SLICE_HEIGHT);
> +
> +		/* Revert DSC to automatic state */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		slice_height_off = igt_pipe_get_prop(display, data->pipe_id[i], 
> +IGT_CRTC_DSC_SLICE_HEIGHT);
> +
> +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> +		igt_assert_f(slice_height_on > 0, "DSC Slice property was not set properly.\n");
> +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial state failed.\n");
> +		igt_assert_f(slice_height_off == 0, "DSC Slice property was not 
> +reset properly.\n");
> +
> +		/* Cleanup fb */
> +		igt_remove_fb(data->fd, &ref_fb);
> +	}
> +
> +	test_fini(data);
> +	igt_skip_on(test_conn_cnt == 0);
> +}
> +
> +static bool update_slice_height(data_t *data, int v_addressable,
> +					  int *num_slices, igt_output_t *output, int conn_idx, igt_fb_t 
> +ref_fb) {
> +	int i;
> +	bool pass = true;
> +
> +	for(i = 0; i < NUM_SLICE_SLOTS; i++) {
> +		int act_slice_height;
> +		int slice_height = v_addressable / num_slices[i] + (v_addressable % 
> +num_slices[i]);
> +
> +		/* Overwrite DSC slice height */
> +		igt_amd_write_dsc_param_slice_height(data->fd, output->name, slice_height);
> +		igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +		igt_display_commit_atomic(&data->display, 
> +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		igt_info("Forcing slice height: slice height %d num slices vertical 
> +%d\n", slice_height, num_slices[i]);
> +
> +		act_slice_height = igt_amd_read_dsc_param_slice_height(data->fd, 
> +output->name);
> +
> +		igt_info("Reading slice height: actual slice height %d VS assigned 
> +slice height %d\n", act_slice_height, slice_height);
> +
> +		pass = (slice_height == act_slice_height);
> +
> +		if (!pass)
> +			break;
> +	}
> +
> +	igt_amd_write_dsc_param_slice_height(data->fd, output->name, 0);
> +	igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +	igt_display_commit_atomic(&data->display, 
> +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +	return pass;
> +}
> +
> +static bool update_slice_width(data_t *data, int h_addressable,
> +					  int *num_slices, igt_output_t *output, int conn_idx, igt_fb_t 
> +ref_fb) {
> +	int i;
> +	bool pass = true;
> +
> +	for(i = 0; i < NUM_SLICE_SLOTS; i++) {
> +		int act_slice_width;
> +		int slice_width = h_addressable / num_slices[i] + (h_addressable % 
> +num_slices[i]);
> +
> +		/* Overwrite DSC slice width */
> +		igt_amd_write_dsc_param_slice_width(data->fd, output->name, slice_width);
> +		igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +		igt_display_commit_atomic(&data->display, 
> +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		igt_info("Forcing slice width: slice width %d num slices horisontal 
> +%d\n", slice_width, num_slices[i]);
> +
> +		act_slice_width = igt_amd_read_dsc_param_slice_width(data->fd, 
> +output->name);
> +
> +		igt_info("Reading slice width: actual slice width %d VS assigned 
> +slice width %d\n", act_slice_width, slice_width);
> +
> +		pass = (slice_width == act_slice_width);
> +
> +		if (!pass)
> +			break;
> +	}
> +
> +	igt_amd_write_dsc_param_slice_width(data->fd, output->name, 0);
> +	igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> +	igt_display_commit_atomic(&data->display, 
> +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +	return pass;
> +}
> +
> +static void test_dsc_slice_dimensions_change(data_t *data) {
> +	bool dsc_on, dsc_after, dsc_before;
> +	igt_output_t *output;
> +	igt_display_t *display = &data->display;
> +	igt_fb_t ref_fb;
> +	int num_slices [] = { 1, 2, 4, 8 };
> +	int h_addressable, v_addressable;
> +	bool ret_slice_height= false, ret_slice_width = false;
> +	int i, test_conn_cnt = 0;
> +
> +	test_init(data);
> +	igt_enable_connectors(data->fd);
> +
> +	for (i = 0; i < display->n_pipes; i++) {
> +		/* Setup the output */
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_create_pattern_fb(data->fd,
> +					data->mode[i].hdisplay,
> +					data->mode[i].vdisplay,
> +					DRM_FORMAT_XRGB8888,
> +					0,
> +					&ref_fb);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0);
> +
> +		test_conn_cnt++;
> +
> +		h_addressable = data->mode->hdisplay;
> +		v_addressable = data->mode->vdisplay;
> +
> +		igt_info("Mode info: v_ative %d  h_active %d\n", v_addressable, 
> +h_addressable);
> +
> +		/* Save pipe's initial DSC state */
> +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Force enable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		/* Check if DSC is enabled */
> +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 
> +1;
> +
> +		if (dsc_on) {
> +			ret_slice_height = update_slice_height(data, v_addressable, num_slices, output, i, ref_fb);
> +			ret_slice_width = update_slice_width(data, h_addressable, num_slices, output, i, ref_fb);
> +		}
> +
> +		/* Force disable DSC */
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> +
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> +
> +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> +		igt_plane_set_fb(data->primary[i], &ref_fb);
> +
> +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> +		igt_assert_f(ret_slice_height, "Changing slice height failed.\n");
> +		igt_assert_f(ret_slice_width, "Changing slice width failed.\n");
> +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial 
> +state failed.\n");
> +
> +		/* Cleanup fb */
> +		igt_remove_fb(data->fd, &ref_fb);
> +	}
> +
> +	test_fini(data);
> +	igt_skip_on(test_conn_cnt == 0);
> +}
> +
> +static void test_dsc_link_settings(data_t *data) {
> +	igt_output_t *output;
> +	igt_fb_t ref_fb[MAX_PIPES];
> +	igt_crc_t ref_crc[MAX_PIPES], new_crc[MAX_PIPES];
> +    int lane_count[4], link_rate[4], link_spread[4];
> +	igt_display_t *display = &data->display;
> +	int i, lc, lr;
> +    bool dsc_on;
> +	const enum dc_lane_count lane_count_vals[] =
> +	{
> +		LANE_COUNT_TWO,
> +		LANE_COUNT_FOUR
> +	};
> +	const enum dc_link_rate link_rate_vals[] =
> +	{
> +		LINK_RATE_LOW,
> +		LINK_RATE_HIGH,
> +		LINK_RATE_HIGH2,
> +		LINK_RATE_HIGH3
> +	};
> +
> +    test_init(data);
> +
> +    /* Setup all outputs */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +        igt_create_pattern_fb(data->fd,
> +                    data->mode[i].hdisplay,
> +                    data->mode[i].vdisplay,
> +                    DRM_FORMAT_XRGB8888,
> +                    0,
> +                    &ref_fb[i]);
> +		igt_output_set_pipe(output, data->pipe_id[i]);
> +		igt_plane_set_fb(data->primary[i], &ref_fb[i]);
> +	}
> +	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0);
> +
> +    /* Collect reference CRCs */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +
> +		igt_pipe_crc_collect_crc(data->pipe_crc[i], &ref_crc[i]);
> +	}
> +
> +	for (lc = 0; lc < ARRAY_SIZE(lane_count_vals); lc++) {
> +		for (lr = 0; lr < ARRAY_SIZE(link_rate_vals); lr++) {
> +			/* Write new link_settings */
> +			for (i = 0; i < display->n_pipes; i++) {
> +				output = data->output[i];
> +				if (!output || !igt_output_is_connected(output))
> +					continue;
> +
> +				/* Write lower link settings */
> +				igt_info("Applying lane count: %d, link rate 0x%02x, on default training\n",
> +						lane_count_vals[lc], link_rate_vals[lr]);
> +				igt_amd_write_link_settings(data->fd, output->name,
> +							lane_count_vals[lc],
> +							link_rate_vals[lr],
> +							LINK_TRAINING_DEFAULT);
> +				usleep(500 * MSEC_PER_SEC);
> +			}
> +
> +			/* Trigger commit after writing new link settings */
> +			igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +NULL);
> +
> +			for (i = 0; i < display->n_pipes; i++) {
> +				output = data->output[i];
> +				if (!output || !igt_output_is_connected(output))
> +					continue;
> +
> +				/* Verify lower link settings */
> +				igt_amd_read_link_settings(data->fd, output->name,
> +							lane_count,
> +							link_rate,
> +							link_spread);
> +
> +				igt_assert_f(lane_count[0] == lane_count_vals[lc], "Lowering lane count settings failed\n");
> +				igt_assert_f(link_rate[0] == link_rate_vals[lr], "Lowering link 
> +rate settings failed\n");
> +
> +				/* Log current mode and DSC status */
> +				dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
> +				igt_info("Current mode is: %dx%d @%dHz -- DSC is: %s\n",
> +							data->mode[i].hdisplay,
> +							data->mode[i].vdisplay,
> +							data->mode[i].vrefresh,
> +							dsc_on ? "ON" : "OFF");
> +
> +				igt_pipe_crc_collect_crc(data->pipe_crc[i], &new_crc[i]);
> +				igt_assert_crc_equal(&ref_crc[i], &new_crc[i]);
> +			}
> +		}
> +	}
> +
> +	/* Cleanup all fbs */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +		igt_remove_fb(data->fd, &ref_fb[i]);
> +	}
> +
> +    test_fini(data);
> +}
> +
> +/* Returns the current and maximum bpc from the connector debugfs. */ 
> +static output_bpc_t get_output_bpc(int data_fd, char *connector_name) 
> +{
> +	char buf[256];
> +	char *start_loc;
> +	int fd, res;
> +	output_bpc_t info;
> +
> +	fd = igt_debugfs_connector_dir(data_fd, connector_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(int data_fd, char *connector_name, unsigned int 
> +bpc) {
> +	output_bpc_t info = get_output_bpc(data_fd, connector_name);
> +
> +	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);
> +}
> +
> +/* Returns the highest bpc this dispaly supports */ static int 
> +get_max_supported_bpc(int data_fd, char *connector_name) {
> +	output_bpc_t info = get_output_bpc(data_fd, connector_name);
> +	return info.maximum;
> +}
> +
> +static void test_dsc_bpc(data_t *data) {
> +	igt_output_t *output;
> +	igt_fb_t ref_fb[MAX_PIPES];
> +	igt_crc_t test_crc;
> +	igt_display_t *display = &data->display;
> +	int i, bpc, max_supported_bpc[MAX_PIPES];
> +    bool dsc_on;
> +	const int bpc_vals[] = {12, 10, 8};
> +
> +    test_init(data);
> +
> +	/* Find max supported bpc */
> +	for (i = 0; i < display->n_pipes; i++) {
> +		output = data->output[i];
> +		if (!output || !igt_output_is_connected(output))
> +			continue;
> +		igt_info("Checking bpc support of conn %s\n", output->name);
> +		max_supported_bpc[i] = get_max_supported_bpc(data->fd, output->name);
> +	}
> +
> +    /* Setup all outputs */
> +	for (bpc = 0; bpc < ARRAY_SIZE(bpc_vals); bpc++) {
> +		igt_info("Testing bpc = %d\n", bpc_vals[bpc]);
> +
> +		for (i = 0; i < display->n_pipes; i++) {
> +			output = data->output[i];
> +			if (!output || !igt_output_is_connected(output))
> +				continue;
> +
> +			if (max_supported_bpc[i] < bpc_vals[bpc]) {
> +				igt_info("Display doesn't support bpc of %d, max is %d. Skipping to next bpc value.\n", bpc_vals[bpc], max_supported_bpc[i]);
> +				continue;
> +			}
> +			igt_info("Setting bpc = %d\n", bpc_vals[bpc]);
> +			igt_output_set_prop_value(output, IGT_CONNECTOR_MAX_BPC, bpc_vals[bpc]);
> +			igt_create_pattern_fb(data->fd,
> +						data->mode[i].hdisplay,
> +						data->mode[i].vdisplay,
> +						DRM_FORMAT_XRGB8888,
> +						0,
> +						&ref_fb[i]);
> +			igt_output_set_pipe(output, data->pipe_id[i]);
> +			igt_plane_set_fb(data->primary[i], &ref_fb[i]);
> +		}
> +
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> +0);
> +
> +		for (i = 0; i < display->n_pipes; i++) {
> +			output = data->output[i];
> +			if (!output || !igt_output_is_connected(output))
> +				continue;
> +
> +			if (max_supported_bpc[i] < bpc_vals[bpc])
> +				continue;
> +
> +			/* Check that crc is non-zero */
> +			igt_pipe_crc_collect_crc(data->pipe_crc[i], &test_crc);
> +			igt_assert(test_crc.crc[0] && test_crc.crc[1] && test_crc.crc[2]);
> +
> +			/* Check current bpc */
> +			igt_info("Verifying display %s has correct bpc\n", output->name);
> +			assert_output_bpc(data->fd, output->name, bpc_vals[bpc]);
> +
> +			/* Log current mode and DSC status */
> +			dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
> +			igt_info("Current mode is: %dx%d @%dHz -- DSC is: %s\n",
> +						data->mode[i].hdisplay,
> +						data->mode[i].vdisplay,
> +						data->mode[i].vrefresh,
> +						dsc_on ? "ON" : "OFF");
> +		}
> +
> +		/* Cleanup all fbs */
> +		for (i = 0; i < display->n_pipes; i++) {
> +			output = data->output[i];
> +			if (!output || !igt_output_is_connected(output))
> +				continue;
> +
> +			if (max_supported_bpc[i] < bpc_vals[bpc])
> +				continue;
> +
> +			igt_remove_fb(data->fd, &ref_fb[i]);
> +		}
> +	}
> +
> +    test_fini(data);
> +}
> +
> +igt_main
> +{
> +	data_t data = { 0 };
> +
> +	igt_skip_on_simulation();
> +
> +	igt_fixture
> +	{
> +		data.fd = drm_open_driver_master(DRIVER_ANY);
> +
> +		igt_display_require(&data.display, data.fd);
> +		igt_require(data.display.is_atomic);
> +		igt_display_require_output(&data.display);
> +
> +		igt_amd_require_dsc(&data.display, data.fd);
> +		kmstest_set_vt_graphics_mode();
> +	}
> +
> +	igt_describe("Forces DSC on/off & ensures it is reset properly");
> +	igt_subtest("dsc-enable-basic")
> +		    test_dsc_enable(&data);
> +
> +	igt_describe("Tests DSC slice height property & ensures it is reset properly on DSC enable/disable");
> +	igt_subtest("dsc-slice-height-property")
> +		    test_dsc_slice_height_property(&data);
> +
> +	igt_describe("Tests various DSC slice dimensions");
> +	igt_subtest("dsc-slice-dimensions-change")
> +		    test_dsc_slice_dimensions_change(&data);
> +
> +	igt_describe("Tests various combinations of link_rate + lane_count and logs if DSC enabled/disabled");
> +	igt_subtest("dsc-link-settings")
> +		    test_dsc_link_settings(&data);
> +
> +	igt_describe("Tests different bpc settings and logs if DSC is enabled/disabled");
> +	igt_subtest("dsc-bpc")
> +			test_dsc_bpc(&data);
> +
> +	igt_fixture
> +	{
> +		igt_reset_connectors();
> +		igt_display_fini(&data.display);
> +	}
> +}
> diff --git a/tests/amdgpu/meson.build b/tests/amdgpu/meson.build index 
> b736c456..001e37ef 100644
> --- a/tests/amdgpu/meson.build
> +++ b/tests/amdgpu/meson.build
> @@ -16,6 +16,7 @@ if libdrm_amdgpu.found()
>   			  'amd_mem_leak',
>   			  'amd_link_settings',
>   			  'amd_vrr_range',
> +			  'amd_dp_dsc',
>   			]
>   	amdgpu_deps += libdrm_amdgpu
>   endif
> 


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

* [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev4)
  2021-11-19 15:00 [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC Rodrigo Siqueira
                   ` (4 preceding siblings ...)
  2021-11-24 22:55 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/amdgpu: Add test for AMD DP DSC Patchwork
@ 2021-11-24 23:18 ` Patchwork
  2021-11-25  7:10 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev5) Patchwork
  6 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2021-11-24 23:18 UTC (permalink / raw)
  To: Vudum, Lakshminarayana; +Cc: igt-dev

== Series Details ==

Series: tests/amdgpu: Add test for AMD DP DSC (rev4)
URL   : https://patchwork.freedesktop.org/series/97108/
State : failure

== Summary ==

Applying: tests/amdgpu: Add test for AMD DP DSC
Patch failed at 0001 tests/amdgpu: Add test for AMD DP DSC
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


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

* [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev5)
  2021-11-19 15:00 [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC Rodrigo Siqueira
                   ` (5 preceding siblings ...)
  2021-11-24 23:18 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev4) Patchwork
@ 2021-11-25  7:10 ` Patchwork
  6 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2021-11-25  7:10 UTC (permalink / raw)
  To: Vudum, Lakshminarayana; +Cc: igt-dev

== Series Details ==

Series: tests/amdgpu: Add test for AMD DP DSC (rev5)
URL   : https://patchwork.freedesktop.org/series/97108/
State : failure

== Summary ==

Applying: tests/amdgpu: Add test for AMD DP DSC
Patch failed at 0001 tests/amdgpu: Add test for AMD DP DSC
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


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

* Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
  2021-11-24 23:01   ` Vudum, Lakshminarayana
@ 2021-11-25  7:11     ` Petri Latvala
  2021-11-25 15:57       ` Rodrigo Siqueira Jordao
  0 siblings, 1 reply; 17+ messages in thread
From: Petri Latvala @ 2021-11-25  7:11 UTC (permalink / raw)
  To: Vudum, Lakshminarayana
  Cc: Eryk Brol, igt-dev, Rodrigo Siqueira Jordao, Mikita Lipski

On Thu, Nov 25, 2021 at 01:01:04AM +0200, Vudum, Lakshminarayana wrote:
> @Rodrigo Siqueira I don't have the possibility to re-run the series. @Latvala, Petri Can you help here?
> 
> Lakshmi.

Unfortunately patchwork got confused by your emails and thinks you've
sent a patch, so the re-run button just reattempts the incorrect
patch.

Rodrigo, please re-send this patch.

-- 
Petri Latvala


> 
> -----Original Message-----
> From: Rodrigo Siqueira Jordao <rjordrigo@amd.com> 
> Sent: Wednesday, November 24, 2021 7:34 AM
> To: Vudum, Lakshminarayana <lakshminarayana.vudum@intel.com>
> Cc: Mikita Lipski <mikita.lipski@amd.com>; Eryk Brol <eryk.brol@amd.com>; Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>; igt-dev@lists.freedesktop.org; harry.wentland@amd.com; Nicholas.Choi@amd.com; markyacoub@chromium.org
> Subject: Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
> 
> Hi Lakshmi,
> 
> I noticed a CI failure in this patch which is focused on AMD, except for the below change in the igt_kms.h:
> 
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h index e9ecd21e..5c7d7481 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -125,6 +125,7 @@  enum igt_atomic_crtc_properties {
>          IGT_CRTC_ACTIVE,
>          IGT_CRTC_OUT_FENCE_PTR,
>          IGT_CRTC_VRR_ENABLED,
> +       IGT_CRTC_DSC_SLICE_HEIGHT,
>          IGT_NUM_CRTC_PROPS
>   };
> 
>  From the CI results, I'm not sure if this change caused the other failures, and since we saw some false positives in the AMD tests last week, is it possible to trigger the CI test for this patch again?
> 
> https://patchwork.freedesktop.org/patch/463655/?series=97108&rev=1
> 
> Thanks
> Siqueira
> 
> On 2021-11-19 10:00 a.m., Rodrigo Siqueira wrote:
> > From: Eryk Brol <eryk.brol@amd.com>
> > 
> > This commit introduces a DP DSC test that checks:
> > 
> > * Forces DSC on/off and ensures it is reset properly
> > * Check DSC slice height property
> > * Verify various DSC slice dimensions
> > * Tests various combinations of link_rate + lane_count and logs if DSC
> >    enabled/disabled Tests different bpc settings and logs if DSC is
> >    enabled/disabled
> > 
> > Cc: Harry Wentland <harry.wentland@amd.com>
> > Cc: Nicholas Choi <Nicholas.Choi@amd.com>
> > Cc: Mark Yacoub <markyacoub@chromium.org>
> > Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
> > Signed-off-by: Eryk Brol <eryk.brol@amd.com>
> > ---
> >   lib/igt_amd.c             | 494 +++++++++++++++++++++++++--
> >   lib/igt_amd.h             |  35 ++
> >   lib/igt_kms.h             |   1 +
> >   tests/amdgpu/amd_dp_dsc.c | 685 ++++++++++++++++++++++++++++++++++++++
> >   tests/amdgpu/meson.build  |   1 +
> >   5 files changed, 1194 insertions(+), 22 deletions(-)
> >   create mode 100644 tests/amdgpu/amd_dp_dsc.c
> > 
> > diff --git a/lib/igt_amd.c b/lib/igt_amd.c index f1bfb421..4bcfd594 
> > 100644
> > --- a/lib/igt_amd.c
> > +++ b/lib/igt_amd.c
> > @@ -251,11 +251,11 @@ bool igt_amd_is_tiled(uint64_t modifier)
> >   }
> >   
> >   /**
> > - * igt_amd_output_has_hpd: check if connector has HPD debugfs entry
> > + * igt_amd_output_has_dsc: check if connector has dsc debugfs entry
> >    * @drm_fd: DRM file descriptor
> >    * @connector_name: The connector's name, on which we're reading the status
> >    */
> > -static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
> > +static bool igt_amd_output_has_dsc(int drm_fd, char *connector_name)
> >   {
> >   	int fd;
> >   	int res;
> > @@ -267,9 +267,9 @@ static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
> >   		return false;
> >   	}
> >   
> > -	res = fstatat(fd, DEBUGFS_HPD_TRIGGER, &stat, 0);
> > +	res = fstatat(fd, DEBUGFS_DSC_CLOCK_EN , &stat, 0);
> >   	if (res != 0) {
> > -		igt_info("%s debugfs not supported\n", DEBUGFS_HPD_TRIGGER);
> > +		igt_info("%s debugfs not supported\n", DEBUGFS_DSC_CLOCK_EN);
> >   		close(fd);
> >   		return false;
> >   	}
> > @@ -279,49 +279,499 @@ static bool igt_amd_output_has_hpd(int drm_fd, char *connector_name)
> >   }
> >   
> >   /**
> > - * igt_amd_require_hpd: Checks if connectors have HPD debugfs
> > + * is_dp_dsc_supported: Checks if connector is DSC capable
> > + * @display: A pointer to an #igt_display_t structure
> > + * @drm_fd: DRM file descriptor
> > + */
> > +bool is_dp_dsc_supported(int drm_fd, char *connector_name) {
> > +	char buf[512];
> > +	int fd, ret;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +
> > +	if (fd < 0) {
> > +		igt_info("Couldn't open connector %s debugfs directory\n",
> > +			 connector_name);
> > +		return false;
> > +	}
> > +
> > +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
> > +	close(fd);
> > +
> > +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> > +		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
> > +
> > +	return strstr(buf, "DSC_Sink_Support: yes"); }
> > +
> > +/**
> > + * is_dp_fec_supported: Checks if connector is FEC capable
> > + * @display: A pointer to an #igt_display_t structure
> > + * @drm_fd: DRM file descriptor
> > + */
> > +bool is_dp_fec_supported(int drm_fd, char *connector_name) {
> > +	char buf[512];
> > +	int fd, ret;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +
> > +	if (fd < 0) {
> > +		igt_info("Couldn't open connector %s debugfs directory\n",
> > +			 connector_name);
> > +		return false;
> > +	}
> > +
> > +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
> > +	close(fd);
> > +
> > +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> > +		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
> > +
> > +	return strstr(buf, "FEC_Sink_Support: yes"); }
> > +
> > +/**
> > + * igt_amd_require_dsc: Checks if connectors have DSC debugfs
> >    * @display: A pointer to an #igt_display_t structure
> >    * @drm_fd: DRM file descriptor
> >    *
> > - * Checks if the AMDGPU driver has support the 'trigger_hotplug'
> > - * entry for HPD. Skip test if HPD is not supported.
> > + * Checks if the AMDGPU driver has support of debugfs entries for
> > + * DSC. Skip test if DSC is not supported.
> >    */
> > -void igt_amd_require_hpd(igt_display_t *display, int drm_fd)
> > +void igt_amd_require_dsc(igt_display_t *display, int drm_fd)
> >   {
> >   	igt_output_t *output;
> >   
> >   	for_each_connected_output(display, output) {
> > -		if (igt_amd_output_has_hpd(drm_fd, output->name))
> > +		if (igt_amd_output_has_dsc(drm_fd, output->name))
> >   			return;
> >   	}
> >   
> > -	igt_skip("No HPD debugfs support.\n");
> > +	igt_skip("No DSC debugfs support.\n");
> >   }
> >   
> >   /**
> > - * igt_amd_trigger_hotplut: Triggers a debugfs HPD
> > + * igt_amd_read_dsc_clock_status: Read the DSC Clock Enable debugfs
> >    * @drm_fd: DRM file descriptor
> > - * @connector_name: The connector's name, which we trigger the 
> > hotplug on
> > + * @connector_name: The connector's name, which we use to read status 
> > + on
> >    *
> > - * igt_amd_require_hpd should be called before calling this.
> >    */
> > -int igt_amd_trigger_hotplug(int drm_fd, char *connector_name)
> > +int igt_amd_read_dsc_clock_status(int drm_fd, char *connector_name) {
> > +	char buf[4];
> > +	int fd, ret;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +	if (fd < 0) {
> > +		igt_info("Couldn't open connector %s debugfs directory\n",
> > +			 connector_name);
> > +		return false;
> > +	}
> > +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_CLOCK_EN, buf, sizeof(buf));
> > +	close(fd);
> > +
> > +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> > +		     DEBUGFS_DSC_CLOCK_EN, connector_name);
> > +
> > +	return strtol(buf, NULL, 0);
> > +}
> > +
> > +
> > +/**
> > + * igt_amd_write_dsc_clock_en: Write the DSC Clock Enable debugfs
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we use to read status 
> > +on
> > + * @dsc_force: DSC force parameter, 0 - DSC automatic, 1 - DSC force 
> > +on,
> > + * 2 - DSC force off
> > + *
> > + */
> > +void igt_amd_write_dsc_clock_en(int drm_fd, char *connector_name, int 
> > +dsc_force) {
> > +	int fd, dsc_fd;
> > +	char src[4];
> > +	int wr_len;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +	igt_assert(fd >= 0);
> > +	dsc_fd = openat(fd, DEBUGFS_DSC_CLOCK_EN, O_WRONLY);
> > +	close(fd);
> > +	igt_assert(dsc_fd >= 0);
> > +
> > +	if (dsc_force == DSC_FORCE_ON)
> > +		snprintf(src, sizeof(src), "%d", 1);
> > +	else if (dsc_force == DSC_FORCE_OFF)
> > +		snprintf(src, sizeof(src), "%d", 2);
> > +	else
> > +		snprintf(src, sizeof(src), "%d", 0);
> > +
> > +	igt_info("DSC Clock force, write %s > dsc_clock_en\n", src);
> > +
> > +	wr_len = write(dsc_fd, src, strlen(src));
> > +	close(dsc_fd);
> > +	igt_assert_eq(wr_len, strlen(src));
> > +}
> > +
> > +/**
> > + * igt_amd_write_dsc_param_slice_height: Write the DSC Slice Height 
> > +debugfs
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we use to read status 
> > +on
> > + * @slice_height: DSC slice height parameter, accepts any positive integer,
> > + * 		  if parameter is negative - it will not write to debugfs.
> > + *
> > + */
> > +void igt_amd_write_dsc_param_slice_height(int drm_fd, char 
> > +*connector_name, int slice_height) {
> > +	int fd, dsc_fd;
> > +	char src[32];
> > +	int wr_len;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +	igt_assert(fd >= 0);
> > +	dsc_fd = openat(fd, DEBUGFS_DSC_SLICE_HEIGHT, O_WRONLY);
> > +	close(fd);
> > +	igt_assert(dsc_fd >= 0);
> > +
> > +	if (slice_height >= 0) {
> > +		snprintf(src, sizeof(src), "%#x", slice_height);
> > +	} else {
> > +		igt_warn("DSC SLICE HEIGHT, slice height parameter is invalid (%d)\n", slice_height);
> > +		goto exit;
> > +	}
> > +
> > +	igt_info("DSC SLICE HEIGHT, write %s > dsc_slice_height\n", src);
> > +
> > +	wr_len = write(dsc_fd, src, strlen(src));
> > +	igt_assert_eq(wr_len, strlen(src));
> > +exit:
> > +	close(dsc_fd);
> > +}
> > +
> > +/**
> > + * igt_amd_read_dsc_param_slice_height: Read the DSC Slice Height 
> > +debugfs
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we use to read status 
> > +on
> > + *
> > + */
> > +int igt_amd_read_dsc_param_slice_height(int drm_fd, char 
> > +*connector_name) {
> > +	char buf[32];
> > +	int fd, ret;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +	if (fd < 0) {
> > +		igt_info("Couldn't open connector %s debugfs directory\n",
> > +			 connector_name);
> > +		return false;
> > +	}
> > +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_HEIGHT, buf, sizeof(buf));
> > +	close(fd);
> > +
> > +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> > +		     DEBUGFS_DSC_SLICE_HEIGHT, connector_name);
> > +
> > +	return strtol(buf, NULL, 0);
> > +}
> > +
> > +/**
> > + * igt_amd_write_dsc_param_slice_width: Write the DSC Slice Width 
> > +debugfs
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we use to read status 
> > +on
> > + * @slice_width: DSC slice width parameter, accepts any positive integer,
> > + * 		 if parameter is negative - it will not write to debugfs.
> > + *
> > + */
> > +void igt_amd_write_dsc_param_slice_width(int drm_fd, char 
> > +*connector_name, int slice_width)
> >   {
> > -	int fd, hpd_fd;
> > +	int fd, dsc_fd;
> > +	char src[32];
> >   	int wr_len;
> > -	const char *enable_hpd = "1";
> >   
> >   	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> >   	igt_assert(fd >= 0);
> > -	hpd_fd = openat(fd, DEBUGFS_HPD_TRIGGER, O_WRONLY);
> > +	dsc_fd = openat(fd, DEBUGFS_DSC_SLICE_WIDTH, O_WRONLY);
> > +	close(fd);
> > +	igt_assert(dsc_fd >= 0);
> > +
> > +	if (slice_width >= 0) {
> > +		snprintf(src, sizeof(src), "%#x", slice_width);
> > +	} else {
> > +		igt_warn("DSC SLICE WIDTH, slice width parameter is invalid (%d)\n", slice_width);
> > +		goto exit;
> > +	}
> > +
> > +	igt_info("DSC SLICE WIDTH, write %s > dsc_slice_width\n", src);
> > +
> > +	wr_len = write(dsc_fd, src, strlen(src));
> > +	igt_assert_eq(wr_len, strlen(src));
> > +exit:
> > +	close(dsc_fd);
> > +}
> > +
> > +/**
> > + * igt_amd_read_dsc_param_slice_width: Read the DSC Slice Width 
> > +debugfs
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we use to read status 
> > +on
> > + *
> > + */
> > +int igt_amd_read_dsc_param_slice_width(int drm_fd, char 
> > +*connector_name) {
> > +	char buf[32];
> > +	int fd, ret;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +	if (fd < 0) {
> > +		igt_info("Couldn't open connector %s debugfs directory\n",
> > +			 connector_name);
> > +		return false;
> > +	}
> > +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_WIDTH, buf, 
> > +sizeof(buf));
> >   	close(fd);
> > -	igt_assert(hpd_fd >= 0);
> >   
> > -	wr_len = write(hpd_fd, enable_hpd, strlen(enable_hpd));
> > -	close(hpd_fd);
> > -	igt_assert_eq(wr_len, strlen(enable_hpd));
> > +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> > +		     DEBUGFS_DSC_SLICE_WIDTH, connector_name);
> > +
> > +	return strtol(buf, NULL, 0);
> > +}
> > +
> > +/**
> > + * igt_amd_write_dsc_param_bpp: Write the DSC Bits Per Pixel debugfs
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we use to read status 
> > +on
> > + * @bpp: DSC bits per pixel parameter, accepts any positive integer,
> > + * 	 if parameter is negative - it will not write to debugfs.
> > + *
> > + */
> > +void igt_amd_write_dsc_param_bpp(int drm_fd, char *connector_name, 
> > +int bpp) {
> > +	int fd, dsc_fd;
> > +	char src[32];
> > +	int wr_len;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +	igt_assert(fd >= 0);
> > +	dsc_fd = openat(fd, DEBUGFS_DSC_BITS_PER_PIXEL, O_WRONLY);
> > +	close(fd);
> > +	igt_assert(dsc_fd >= 0);
> > +
> > +	if (bpp >= 0) {
> > +		snprintf(src, sizeof(src), "%#x", bpp);
> > +	} else {
> > +		igt_warn("DSC BITS PER PIXEL, bits per pixel parameter is invalid (%d)\n", bpp);
> > +		goto exit;
> > +	}
> > +
> > +	igt_info("DSC BITS PER PIXEL, write %s > dsc_bits_per_pixel\n", 
> > +src);
> > +
> > +	wr_len = write(dsc_fd, src, strlen(src));
> > +	igt_assert_eq(wr_len, strlen(src));
> > +exit:
> > +	close(dsc_fd);
> > +}
> > +
> > +/**
> > + * igt_amd_read_dsc_param_bpp: Read the DSC Bits Per Pixel debugfs
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we use to read status 
> > +on
> > + *
> > + */
> > +int igt_amd_read_dsc_param_bpp(int drm_fd, char *connector_name) {
> > +	char buf[32];
> > +	int fd, ret;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +	if (fd < 0) {
> > +		igt_info("Couldn't open connector %s debugfs directory\n",
> > +			 connector_name);
> > +		return false;
> > +	}
> > +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_BITS_PER_PIXEL, buf, sizeof(buf));
> > +	close(fd);
> > +
> > +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> > +		     DEBUGFS_DSC_BITS_PER_PIXEL, connector_name);
> > +
> > +	return strtol(buf, NULL, 0);
> > +}
> > +
> > +/**
> > + * igt_amd_read_dsc_param_pic_width: Read the DSC Picture Width 
> > +debugfs
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we use to read status 
> > +on
> > + *
> > + */
> > +int igt_amd_read_dsc_param_pic_width(int drm_fd, char 
> > +*connector_name) {
> > +	char buf[4];
> > +	int fd, ret;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +	if (fd < 0) {
> > +		igt_info("Couldn't open connector %s debugfs directory\n",
> > +			 connector_name);
> > +		return false;
> > +	}
> > +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_PIC_WIDTH, buf, sizeof(buf));
> > +	close(fd);
> > +
> > +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> > +		     DEBUGFS_DSC_PIC_WIDTH, connector_name);
> > +
> > +	return strtol(buf, NULL, 0);
> > +}
> > +
> > +/**
> > + * igt_amd_read_dsc_param_pic_height: Read the DSC Picture Height 
> > +debugfs
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we use to read status 
> > +on
> > + *
> > + */
> > +int igt_amd_read_dsc_param_pic_height(int drm_fd, char 
> > +*connector_name) {
> > +	char buf[4];
> > +	int fd, ret;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +	if (fd < 0) {
> > +		igt_info("Couldn't open connector %s debugfs directory\n",
> > +			 connector_name);
> > +		return false;
> > +	}
> > +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_PIC_HEIGHT, buf, sizeof(buf));
> > +	close(fd);
> > +
> > +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> > +		     DEBUGFS_DSC_PIC_HEIGHT, connector_name);
> > +
> > +	return strtol(buf, NULL, 0);
> > +}
> > +
> > +/**
> > + * igt_amd_read_dsc_param_chunk_size: Read the DSC Chunk Size debugfs
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we use to read status 
> > +on
> > + *
> > + */
> > +int igt_amd_read_dsc_param_chunk_size(int drm_fd, char 
> > +*connector_name) {
> > +	char buf[4];
> > +	int fd, ret;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +	if (fd < 0) {
> > +		igt_info("Couldn't open connector %s debugfs directory\n",
> > +			 connector_name);
> > +		return false;
> > +	}
> > +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_CHUNK_SIZE, buf, sizeof(buf));
> > +	close(fd);
> > +
> > +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> > +		     DEBUGFS_DSC_CHUNK_SIZE, connector_name);
> > +
> > +	return strtol(buf, NULL, 0);
> > +}
> > +
> > +/**
> > + * igt_amd_read_dsc_param_slice_bpg: Read the DSC Slice BPG Offset 
> > +debugfs
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we use to read status 
> > +on
> > + *
> > + */
> > +int igt_amd_read_dsc_param_slice_bpg(int drm_fd, char 
> > +*connector_name) {
> > +	char buf[4];
> > +	int fd, ret;
> > +
> > +	fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +	if (fd < 0) {
> > +		igt_info("Couldn't open connector %s debugfs directory\n",
> > +			 connector_name);
> > +		return false;
> > +	}
> > +	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_SLICE_BPG, buf, sizeof(buf));
> > +	close(fd);
> > +
> > +	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
> > +		     DEBUGFS_DSC_SLICE_BPG, connector_name);
> > +
> > +	return strtol(buf, NULL, 0);
> > +}
> > +
> > +/**
> > + * igt_amd_output_has_hpd: check if connector has HPD debugfs entry
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, on which we're reading the 
> > +status  */ static bool igt_amd_output_has_hpd(int drm_fd, char 
> > +*connector_name) {
> > +        int fd;
> > +        int res;
> > +        struct stat stat;
> > +
> > +        fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +        if (fd < 0) {
> > +                igt_info("output %s: debugfs not found\n", connector_name);
> > +                return false;
> > +        }
> > +
> > +        res = fstatat(fd, DEBUGFS_HPD_TRIGGER, &stat, 0);
> > +        if (res != 0) {
> > +                igt_info("%s debugfs not supported\n", DEBUGFS_HPD_TRIGGER);
> > +                close(fd);
> > +                return false;
> > +        }
> > +
> > +        close(fd);
> > +        return true;
> > +}
> > +
> > +/**
> > + * igt_amd_require_hpd: Checks if connectors have HPD debugfs
> > + * @display: A pointer to an #igt_display_t structure
> > + * @drm_fd: DRM file descriptor
> > + *
> > + * Checks if the AMDGPU driver has support the 'trigger_hotplug'
> > + * entry for HPD. Skip test if HPD is not supported.
> > + */
> > +void igt_amd_require_hpd(igt_display_t *display, int drm_fd) {
> > +        igt_output_t *output;
> > +
> > +        for_each_connected_output(display, output) {
> > +                if (igt_amd_output_has_hpd(drm_fd, output->name))
> > +                        return;
> > +        }
> > +
> > +        igt_skip("No HPD debugfs support.\n"); }
> > +
> > +/**
> > + * igt_amd_trigger_hotplut: Triggers a debugfs HPD
> > + * @drm_fd: DRM file descriptor
> > + * @connector_name: The connector's name, which we trigger the 
> > +hotplug on
> > + *
> > + * igt_amd_require_hpd should be called before calling this.
> > + */
> > +int igt_amd_trigger_hotplug(int drm_fd, char *connector_name) {
> > +        int fd, hpd_fd;
> > +        int wr_len;
> > +        const char *enable_hpd = "1";
> > +
> > +        fd = igt_debugfs_connector_dir(drm_fd, connector_name, O_RDONLY);
> > +        igt_assert(fd >= 0);
> > +        hpd_fd = openat(fd, DEBUGFS_HPD_TRIGGER, O_WRONLY);
> > +        close(fd);
> > +        igt_assert(hpd_fd >= 0);
> > +
> > +        wr_len = write(hpd_fd, enable_hpd, strlen(enable_hpd));
> > +        close(hpd_fd);
> > +        igt_assert_eq(wr_len, strlen(enable_hpd));
> >   
> > -	return 0;
> > +        return 0;
> >   }
> >   
> >   /*
> > diff --git a/lib/igt_amd.h b/lib/igt_amd.h index e5bdbf33..7a91cbff 
> > 100644
> > --- a/lib/igt_amd.h
> > +++ b/lib/igt_amd.h
> > @@ -27,9 +27,27 @@
> >   #include "igt.h"
> >   #include "igt_fb.h"
> >   
> > +/* Read & Write DSC parameters */
> > +#define DEBUGFS_DSC_CLOCK_EN "dsc_clock_en"
> > +#define DEBUGFS_DSC_SLICE_WIDTH "dsc_slice_width"
> > +#define DEBUGFS_DSC_SLICE_HEIGHT "dsc_slice_height"
> > +#define DEBUGFS_DSC_BITS_PER_PIXEL "dsc_bits_per_pixel"
> > +/* Read only DSC parameters */
> > +#define DEBUGFS_DSC_PIC_WIDTH "dsc_pic_width"
> > +#define DEBUGFS_DSC_PIC_HEIGHT "dsc_pic_height"
> > +#define DEBUGFS_DSC_CHUNK_SIZE "dsc_chunk_size"
> > +#define DEBUGFS_DSC_SLICE_BPG "dsc_slice_bpg"
> > +#define DEBUGFS_DSC_FEC_SUPPORT "dp_dsc_fec_support"
> > +
> >   #define DEBUGFS_DP_LINK_SETTINGS "link_settings"
> >   #define DEBUGFS_HPD_TRIGGER "trigger_hotplug"
> >   
> > +enum amd_dsc_clock_force {
> > +	DSC_AUTOMATIC = 0,
> > +	DSC_FORCE_ON,
> > +	DSC_FORCE_OFF,
> > +};
> > +
> >   enum dc_lane_count {
> >   	LANE_COUNT_UNKNOWN = 0,
> >   	LANE_COUNT_ONE = 1,
> > @@ -80,6 +98,23 @@ void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void *dst_buf,
> >   				       struct igt_fb *src, void *src_buf);
> >   bool igt_amd_is_tiled(uint64_t modifier);
> >   
> > +/* IGT DSC helper functions */
> > +bool is_dp_dsc_supported(int drm_fd, char *connector_name); bool 
> > +is_dp_fec_supported(int drm_fd, char *connector_name); void 
> > +igt_amd_require_dsc(igt_display_t *display, int drm_fd); int 
> > +igt_amd_read_dsc_clock_status(int drm_fd, char *connector_name); void 
> > +igt_amd_write_dsc_clock_en(int drm_fd, char *connector_name, int 
> > +dsc_force); void igt_amd_write_dsc_param_slice_height(int drm_fd, 
> > +char *connector_name, int slice_height); int 
> > +igt_amd_read_dsc_param_slice_height(int drm_fd, char 
> > +*connector_name); void igt_amd_write_dsc_param_slice_width(int 
> > +drm_fd, char *connector_name, int slice_width); int 
> > +igt_amd_read_dsc_param_slice_width(int drm_fd, char *connector_name); 
> > +void igt_amd_write_dsc_param_bpp(int drm_fd, char *connector_name, 
> > +int bpp); int igt_amd_read_dsc_param_bpp(int drm_fd, char 
> > +*connector_name); int igt_amd_read_dsc_param_pic_width(int drm_fd, 
> > +char *connector_name); int igt_amd_read_dsc_param_pic_height(int 
> > +drm_fd, char *connector_name); int 
> > +igt_amd_read_dsc_param_chunk_size(int drm_fd, char *connector_name); 
> > +int igt_amd_read_dsc_param_slice_bpg(int drm_fd, char 
> > +*connector_name);
> > +
> >   /* IGT HPD helper functions */
> >   void igt_amd_require_hpd(igt_display_t *display, int drm_fd);
> >   int igt_amd_trigger_hotplug(int drm_fd, char *connector_name); diff 
> > --git a/lib/igt_kms.h b/lib/igt_kms.h index e9ecd21e..5c7d7481 100644
> > --- a/lib/igt_kms.h
> > +++ b/lib/igt_kms.h
> > @@ -125,6 +125,7 @@ enum igt_atomic_crtc_properties {
> >          IGT_CRTC_ACTIVE,
> >          IGT_CRTC_OUT_FENCE_PTR,
> >          IGT_CRTC_VRR_ENABLED,
> > +       IGT_CRTC_DSC_SLICE_HEIGHT,
> >          IGT_NUM_CRTC_PROPS
> >   };
> >   
> > diff --git a/tests/amdgpu/amd_dp_dsc.c b/tests/amdgpu/amd_dp_dsc.c new 
> > file mode 100644 index 00000000..d73425e2
> > --- /dev/null
> > +++ b/tests/amdgpu/amd_dp_dsc.c
> > @@ -0,0 +1,685 @@
> > +/*
> > + * Copyright 2021 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 "igt_amd.h"
> > +#include "sw_sync.h"
> > +#include <fcntl.h>
> > +#include <signal.h>
> > +
> > +#define NUM_SLICE_SLOTS 4
> > +
> > +/* Maximumm pipes on any AMD ASIC. */ #define MAX_PIPES 6
> > +
> > +/* Common test data. */
> > +typedef struct data {
> > +	igt_display_t display;
> > +	igt_plane_t *primary[MAX_PIPES];
> > +	igt_output_t *output[MAX_PIPES];
> > +	igt_pipe_t *pipe[MAX_PIPES];
> > +	igt_pipe_crc_t *pipe_crc[MAX_PIPES];
> > +	drmModeModeInfo mode[MAX_PIPES];
> > +	enum pipe pipe_id[MAX_PIPES];
> > +	int fd;
> > +} data_t;
> > +
> > +/* BPC connector state. */
> > +typedef struct output_bpc {
> > +	unsigned int current;
> > +	unsigned int maximum;
> > +} output_bpc_t;
> > +
> > +/* Common test cleanup. */
> > +static void test_fini(data_t *data)
> > +{
> > +	igt_display_t *display = &data->display;
> > +	int i;
> > +
> > +	for (i = 0; i < display->n_pipes; ++i) {
> > +		igt_pipe_crc_free(data->pipe_crc[i]);
> > +	}
> > +
> > +	igt_display_reset(display);
> > +	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +0); }
> > +
> > +/* Common test setup. */
> > +static void test_init(data_t *data)
> > +{
> > +	igt_display_t *display = &data->display;
> > +	int i, n;
> > +
> > +	for (i = 0; i < display->n_pipes; ++i) {
> > +		data->pipe_id[i] = PIPE_A + i;
> > +		data->pipe[i] = &data->display.pipes[data->pipe_id[i]];
> > +		data->primary[i] = igt_pipe_get_plane_type(
> > +				data->pipe[i], DRM_PLANE_TYPE_PRIMARY);
> > +		data->pipe_crc[i] =
> > +				igt_pipe_crc_new(data->fd, data->pipe_id[i], "auto");
> > +	}
> > +
> > +	for (i = 0, n = 0; i < display->n_outputs && n < display->n_pipes; ++i) {
> > +		igt_output_t *output = &display->outputs[i];
> > +		data->output[n] = output;
> > +
> > +		/* Only allow physically connected displays for the tests. */
> > +		if (!igt_output_is_connected(output))
> > +				continue;
> > +
> > +		/* Ensure that outpus are DP, DSC & FEC capable*/
> > +		if (!(is_dp_fec_supported(data->fd, output->name) &&
> > +			is_dp_dsc_supported(data->fd, output->name)))
> > +			continue;
> > +
> > +		if (output->config.connector->connector_type !=
> > +			DRM_MODE_CONNECTOR_DisplayPort)
> > +			continue;
> > +
> > +		igt_assert(kmstest_get_connector_default_mode(
> > +				data->fd, output->config.connector, &data->mode[n]));
> > +
> > +		n += 1;
> > +	}
> > +
> > +	igt_display_reset(display);
> > +}
> > +
> > +static void test_dsc_enable(data_t *data) {
> > +	bool dsc_on, dsc_after, dsc_before;
> > +	igt_display_t *display = &data->display;
> > +	igt_output_t *output;
> > +	igt_fb_t ref_fb;
> > +	int i, test_conn_cnt = 0;
> > +
> > +	test_init(data);
> > +	igt_enable_connectors(data->fd);
> > +
> > +	for (i = 0; i < display->n_pipes; i++) {
> > +		/* Setup the output */
> > +		output = data->output[i];
> > +		if (!output || !igt_output_is_connected(output))
> > +			continue;
> > +
> > +		igt_create_pattern_fb(data->fd,
> > +					data->mode[i].hdisplay,
> > +					data->mode[i].vdisplay,
> > +					DRM_FORMAT_XRGB8888,
> > +					0,
> > +					&ref_fb);
> > +		igt_output_set_pipe(output, data->pipe_id[i]);
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +0);
> > +
> > +		test_conn_cnt++;
> > +
> > +		/* Save pipe's initial DSC state */
> > +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> > +
> > +		/* Force enable DSC */
> > +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> > +
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +NULL);
> > +
> > +		/* Check if DSC is enabled */
> > +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 
> > +1;
> > +
> > +		/* Revert DSC to automatic state */
> > +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> > +
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +		igt_display_commit_atomic(display,DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +NULL);
> > +
> > +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> > +
> > +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +
> > +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> > +
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +NULL);
> > +
> > +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> > +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial 
> > +state failed.\n");
> > +
> > +		/* Cleanup fb */
> > +		igt_remove_fb(data->fd, &ref_fb);
> > +	}
> > +
> > +	test_fini(data);
> > +	igt_skip_on(test_conn_cnt == 0);
> > +}
> > +
> > +static void test_dsc_slice_height_property(data_t *data) {
> > +	bool dsc_on, dsc_after, dsc_before;
> > +	int slice_height_on, slice_height_off;
> > +	igt_display_t *display = &data->display;
> > +	igt_output_t *output;
> > +	igt_fb_t ref_fb;
> > +	int i, test_conn_cnt = 0;
> > +
> > +	test_init(data);
> > +	igt_enable_connectors(data->fd);
> > +
> > +	for (i = 0; i < display->n_pipes; i++) {
> > +		/* Setup the output */
> > +		output = data->output[i];
> > +		if (!output || !igt_output_is_connected(output))
> > +			continue;
> > +
> > +		igt_create_pattern_fb(data->fd,
> > +					data->mode[i].hdisplay,
> > +					data->mode[i].vdisplay,
> > +					DRM_FORMAT_XRGB8888,
> > +					0,
> > +					&ref_fb);
> > +		igt_output_set_pipe(output, data->pipe_id[i]);
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +0);
> > +
> > +		test_conn_cnt++;
> > +
> > +		/* Save pipe's initial DSC state */
> > +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> > +
> > +		/* Force enable DSC */
> > +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> > +
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +NULL);
> > +
> > +		/* Check if DSC is enabled */
> > +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 
> > +1;
> > +
> > +		slice_height_on = igt_pipe_get_prop(display, data->pipe_id[i], 
> > +IGT_CRTC_DSC_SLICE_HEIGHT);
> > +
> > +		/* Revert DSC to automatic state */
> > +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> > +
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +NULL);
> > +
> > +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> > +
> > +		slice_height_off = igt_pipe_get_prop(display, data->pipe_id[i], 
> > +IGT_CRTC_DSC_SLICE_HEIGHT);
> > +
> > +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +
> > +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> > +
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +NULL);
> > +
> > +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> > +		igt_assert_f(slice_height_on > 0, "DSC Slice property was not set properly.\n");
> > +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial state failed.\n");
> > +		igt_assert_f(slice_height_off == 0, "DSC Slice property was not 
> > +reset properly.\n");
> > +
> > +		/* Cleanup fb */
> > +		igt_remove_fb(data->fd, &ref_fb);
> > +	}
> > +
> > +	test_fini(data);
> > +	igt_skip_on(test_conn_cnt == 0);
> > +}
> > +
> > +static bool update_slice_height(data_t *data, int v_addressable,
> > +					  int *num_slices, igt_output_t *output, int conn_idx, igt_fb_t 
> > +ref_fb) {
> > +	int i;
> > +	bool pass = true;
> > +
> > +	for(i = 0; i < NUM_SLICE_SLOTS; i++) {
> > +		int act_slice_height;
> > +		int slice_height = v_addressable / num_slices[i] + (v_addressable % 
> > +num_slices[i]);
> > +
> > +		/* Overwrite DSC slice height */
> > +		igt_amd_write_dsc_param_slice_height(data->fd, output->name, slice_height);
> > +		igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> > +		igt_display_commit_atomic(&data->display, 
> > +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> > +
> > +		igt_info("Forcing slice height: slice height %d num slices vertical 
> > +%d\n", slice_height, num_slices[i]);
> > +
> > +		act_slice_height = igt_amd_read_dsc_param_slice_height(data->fd, 
> > +output->name);
> > +
> > +		igt_info("Reading slice height: actual slice height %d VS assigned 
> > +slice height %d\n", act_slice_height, slice_height);
> > +
> > +		pass = (slice_height == act_slice_height);
> > +
> > +		if (!pass)
> > +			break;
> > +	}
> > +
> > +	igt_amd_write_dsc_param_slice_height(data->fd, output->name, 0);
> > +	igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> > +	igt_display_commit_atomic(&data->display, 
> > +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> > +
> > +	return pass;
> > +}
> > +
> > +static bool update_slice_width(data_t *data, int h_addressable,
> > +					  int *num_slices, igt_output_t *output, int conn_idx, igt_fb_t 
> > +ref_fb) {
> > +	int i;
> > +	bool pass = true;
> > +
> > +	for(i = 0; i < NUM_SLICE_SLOTS; i++) {
> > +		int act_slice_width;
> > +		int slice_width = h_addressable / num_slices[i] + (h_addressable % 
> > +num_slices[i]);
> > +
> > +		/* Overwrite DSC slice width */
> > +		igt_amd_write_dsc_param_slice_width(data->fd, output->name, slice_width);
> > +		igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> > +		igt_display_commit_atomic(&data->display, 
> > +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> > +
> > +		igt_info("Forcing slice width: slice width %d num slices horisontal 
> > +%d\n", slice_width, num_slices[i]);
> > +
> > +		act_slice_width = igt_amd_read_dsc_param_slice_width(data->fd, 
> > +output->name);
> > +
> > +		igt_info("Reading slice width: actual slice width %d VS assigned 
> > +slice width %d\n", act_slice_width, slice_width);
> > +
> > +		pass = (slice_width == act_slice_width);
> > +
> > +		if (!pass)
> > +			break;
> > +	}
> > +
> > +	igt_amd_write_dsc_param_slice_width(data->fd, output->name, 0);
> > +	igt_plane_set_fb(data->primary[conn_idx], &ref_fb);
> > +	igt_display_commit_atomic(&data->display, 
> > +DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> > +
> > +	return pass;
> > +}
> > +
> > +static void test_dsc_slice_dimensions_change(data_t *data) {
> > +	bool dsc_on, dsc_after, dsc_before;
> > +	igt_output_t *output;
> > +	igt_display_t *display = &data->display;
> > +	igt_fb_t ref_fb;
> > +	int num_slices [] = { 1, 2, 4, 8 };
> > +	int h_addressable, v_addressable;
> > +	bool ret_slice_height= false, ret_slice_width = false;
> > +	int i, test_conn_cnt = 0;
> > +
> > +	test_init(data);
> > +	igt_enable_connectors(data->fd);
> > +
> > +	for (i = 0; i < display->n_pipes; i++) {
> > +		/* Setup the output */
> > +		output = data->output[i];
> > +		if (!output || !igt_output_is_connected(output))
> > +			continue;
> > +
> > +		igt_create_pattern_fb(data->fd,
> > +					data->mode[i].hdisplay,
> > +					data->mode[i].vdisplay,
> > +					DRM_FORMAT_XRGB8888,
> > +					0,
> > +					&ref_fb);
> > +		igt_output_set_pipe(output, data->pipe_id[i]);
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +0);
> > +
> > +		test_conn_cnt++;
> > +
> > +		h_addressable = data->mode->hdisplay;
> > +		v_addressable = data->mode->vdisplay;
> > +
> > +		igt_info("Mode info: v_ative %d  h_active %d\n", v_addressable, 
> > +h_addressable);
> > +
> > +		/* Save pipe's initial DSC state */
> > +		dsc_before = igt_amd_read_dsc_clock_status(data->fd, output->name);
> > +
> > +		/* Force enable DSC */
> > +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_ON);
> > +
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +NULL);
> > +
> > +		/* Check if DSC is enabled */
> > +		dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 
> > +1;
> > +
> > +		if (dsc_on) {
> > +			ret_slice_height = update_slice_height(data, v_addressable, num_slices, output, i, ref_fb);
> > +			ret_slice_width = update_slice_width(data, h_addressable, num_slices, output, i, ref_fb);
> > +		}
> > +
> > +		/* Force disable DSC */
> > +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_FORCE_OFF);
> > +
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +NULL);
> > +
> > +		dsc_after = igt_amd_read_dsc_clock_status(data->fd, output->name);
> > +
> > +		/* Revert DSC back to automatic mechanism by disabling state overwrites*/
> > +		igt_plane_set_fb(data->primary[i], &ref_fb);
> > +
> > +		igt_amd_write_dsc_clock_en(data->fd, output->name, DSC_AUTOMATIC);
> > +
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +NULL);
> > +
> > +		igt_assert_f(dsc_on, "Enabling DSC on pipe failed.\n");
> > +		igt_assert_f(ret_slice_height, "Changing slice height failed.\n");
> > +		igt_assert_f(ret_slice_width, "Changing slice width failed.\n");
> > +		igt_assert_f(dsc_after == dsc_before, "Reverting DSC to initial 
> > +state failed.\n");
> > +
> > +		/* Cleanup fb */
> > +		igt_remove_fb(data->fd, &ref_fb);
> > +	}
> > +
> > +	test_fini(data);
> > +	igt_skip_on(test_conn_cnt == 0);
> > +}
> > +
> > +static void test_dsc_link_settings(data_t *data) {
> > +	igt_output_t *output;
> > +	igt_fb_t ref_fb[MAX_PIPES];
> > +	igt_crc_t ref_crc[MAX_PIPES], new_crc[MAX_PIPES];
> > +    int lane_count[4], link_rate[4], link_spread[4];
> > +	igt_display_t *display = &data->display;
> > +	int i, lc, lr;
> > +    bool dsc_on;
> > +	const enum dc_lane_count lane_count_vals[] =
> > +	{
> > +		LANE_COUNT_TWO,
> > +		LANE_COUNT_FOUR
> > +	};
> > +	const enum dc_link_rate link_rate_vals[] =
> > +	{
> > +		LINK_RATE_LOW,
> > +		LINK_RATE_HIGH,
> > +		LINK_RATE_HIGH2,
> > +		LINK_RATE_HIGH3
> > +	};
> > +
> > +    test_init(data);
> > +
> > +    /* Setup all outputs */
> > +	for (i = 0; i < display->n_pipes; i++) {
> > +		output = data->output[i];
> > +		if (!output || !igt_output_is_connected(output))
> > +			continue;
> > +
> > +        igt_create_pattern_fb(data->fd,
> > +                    data->mode[i].hdisplay,
> > +                    data->mode[i].vdisplay,
> > +                    DRM_FORMAT_XRGB8888,
> > +                    0,
> > +                    &ref_fb[i]);
> > +		igt_output_set_pipe(output, data->pipe_id[i]);
> > +		igt_plane_set_fb(data->primary[i], &ref_fb[i]);
> > +	}
> > +	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +0);
> > +
> > +    /* Collect reference CRCs */
> > +	for (i = 0; i < display->n_pipes; i++) {
> > +		output = data->output[i];
> > +		if (!output || !igt_output_is_connected(output))
> > +			continue;
> > +
> > +		igt_pipe_crc_collect_crc(data->pipe_crc[i], &ref_crc[i]);
> > +	}
> > +
> > +	for (lc = 0; lc < ARRAY_SIZE(lane_count_vals); lc++) {
> > +		for (lr = 0; lr < ARRAY_SIZE(link_rate_vals); lr++) {
> > +			/* Write new link_settings */
> > +			for (i = 0; i < display->n_pipes; i++) {
> > +				output = data->output[i];
> > +				if (!output || !igt_output_is_connected(output))
> > +					continue;
> > +
> > +				/* Write lower link settings */
> > +				igt_info("Applying lane count: %d, link rate 0x%02x, on default training\n",
> > +						lane_count_vals[lc], link_rate_vals[lr]);
> > +				igt_amd_write_link_settings(data->fd, output->name,
> > +							lane_count_vals[lc],
> > +							link_rate_vals[lr],
> > +							LINK_TRAINING_DEFAULT);
> > +				usleep(500 * MSEC_PER_SEC);
> > +			}
> > +
> > +			/* Trigger commit after writing new link settings */
> > +			igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +NULL);
> > +
> > +			for (i = 0; i < display->n_pipes; i++) {
> > +				output = data->output[i];
> > +				if (!output || !igt_output_is_connected(output))
> > +					continue;
> > +
> > +				/* Verify lower link settings */
> > +				igt_amd_read_link_settings(data->fd, output->name,
> > +							lane_count,
> > +							link_rate,
> > +							link_spread);
> > +
> > +				igt_assert_f(lane_count[0] == lane_count_vals[lc], "Lowering lane count settings failed\n");
> > +				igt_assert_f(link_rate[0] == link_rate_vals[lr], "Lowering link 
> > +rate settings failed\n");
> > +
> > +				/* Log current mode and DSC status */
> > +				dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
> > +				igt_info("Current mode is: %dx%d @%dHz -- DSC is: %s\n",
> > +							data->mode[i].hdisplay,
> > +							data->mode[i].vdisplay,
> > +							data->mode[i].vrefresh,
> > +							dsc_on ? "ON" : "OFF");
> > +
> > +				igt_pipe_crc_collect_crc(data->pipe_crc[i], &new_crc[i]);
> > +				igt_assert_crc_equal(&ref_crc[i], &new_crc[i]);
> > +			}
> > +		}
> > +	}
> > +
> > +	/* Cleanup all fbs */
> > +	for (i = 0; i < display->n_pipes; i++) {
> > +		output = data->output[i];
> > +		if (!output || !igt_output_is_connected(output))
> > +			continue;
> > +		igt_remove_fb(data->fd, &ref_fb[i]);
> > +	}
> > +
> > +    test_fini(data);
> > +}
> > +
> > +/* Returns the current and maximum bpc from the connector debugfs. */ 
> > +static output_bpc_t get_output_bpc(int data_fd, char *connector_name) 
> > +{
> > +	char buf[256];
> > +	char *start_loc;
> > +	int fd, res;
> > +	output_bpc_t info;
> > +
> > +	fd = igt_debugfs_connector_dir(data_fd, connector_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(int data_fd, char *connector_name, unsigned int 
> > +bpc) {
> > +	output_bpc_t info = get_output_bpc(data_fd, connector_name);
> > +
> > +	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);
> > +}
> > +
> > +/* Returns the highest bpc this dispaly supports */ static int 
> > +get_max_supported_bpc(int data_fd, char *connector_name) {
> > +	output_bpc_t info = get_output_bpc(data_fd, connector_name);
> > +	return info.maximum;
> > +}
> > +
> > +static void test_dsc_bpc(data_t *data) {
> > +	igt_output_t *output;
> > +	igt_fb_t ref_fb[MAX_PIPES];
> > +	igt_crc_t test_crc;
> > +	igt_display_t *display = &data->display;
> > +	int i, bpc, max_supported_bpc[MAX_PIPES];
> > +    bool dsc_on;
> > +	const int bpc_vals[] = {12, 10, 8};
> > +
> > +    test_init(data);
> > +
> > +	/* Find max supported bpc */
> > +	for (i = 0; i < display->n_pipes; i++) {
> > +		output = data->output[i];
> > +		if (!output || !igt_output_is_connected(output))
> > +			continue;
> > +		igt_info("Checking bpc support of conn %s\n", output->name);
> > +		max_supported_bpc[i] = get_max_supported_bpc(data->fd, output->name);
> > +	}
> > +
> > +    /* Setup all outputs */
> > +	for (bpc = 0; bpc < ARRAY_SIZE(bpc_vals); bpc++) {
> > +		igt_info("Testing bpc = %d\n", bpc_vals[bpc]);
> > +
> > +		for (i = 0; i < display->n_pipes; i++) {
> > +			output = data->output[i];
> > +			if (!output || !igt_output_is_connected(output))
> > +				continue;
> > +
> > +			if (max_supported_bpc[i] < bpc_vals[bpc]) {
> > +				igt_info("Display doesn't support bpc of %d, max is %d. Skipping to next bpc value.\n", bpc_vals[bpc], max_supported_bpc[i]);
> > +				continue;
> > +			}
> > +			igt_info("Setting bpc = %d\n", bpc_vals[bpc]);
> > +			igt_output_set_prop_value(output, IGT_CONNECTOR_MAX_BPC, bpc_vals[bpc]);
> > +			igt_create_pattern_fb(data->fd,
> > +						data->mode[i].hdisplay,
> > +						data->mode[i].vdisplay,
> > +						DRM_FORMAT_XRGB8888,
> > +						0,
> > +						&ref_fb[i]);
> > +			igt_output_set_pipe(output, data->pipe_id[i]);
> > +			igt_plane_set_fb(data->primary[i], &ref_fb[i]);
> > +		}
> > +
> > +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 
> > +0);
> > +
> > +		for (i = 0; i < display->n_pipes; i++) {
> > +			output = data->output[i];
> > +			if (!output || !igt_output_is_connected(output))
> > +				continue;
> > +
> > +			if (max_supported_bpc[i] < bpc_vals[bpc])
> > +				continue;
> > +
> > +			/* Check that crc is non-zero */
> > +			igt_pipe_crc_collect_crc(data->pipe_crc[i], &test_crc);
> > +			igt_assert(test_crc.crc[0] && test_crc.crc[1] && test_crc.crc[2]);
> > +
> > +			/* Check current bpc */
> > +			igt_info("Verifying display %s has correct bpc\n", output->name);
> > +			assert_output_bpc(data->fd, output->name, bpc_vals[bpc]);
> > +
> > +			/* Log current mode and DSC status */
> > +			dsc_on = igt_amd_read_dsc_clock_status(data->fd, output->name) == 1;
> > +			igt_info("Current mode is: %dx%d @%dHz -- DSC is: %s\n",
> > +						data->mode[i].hdisplay,
> > +						data->mode[i].vdisplay,
> > +						data->mode[i].vrefresh,
> > +						dsc_on ? "ON" : "OFF");
> > +		}
> > +
> > +		/* Cleanup all fbs */
> > +		for (i = 0; i < display->n_pipes; i++) {
> > +			output = data->output[i];
> > +			if (!output || !igt_output_is_connected(output))
> > +				continue;
> > +
> > +			if (max_supported_bpc[i] < bpc_vals[bpc])
> > +				continue;
> > +
> > +			igt_remove_fb(data->fd, &ref_fb[i]);
> > +		}
> > +	}
> > +
> > +    test_fini(data);
> > +}
> > +
> > +igt_main
> > +{
> > +	data_t data = { 0 };
> > +
> > +	igt_skip_on_simulation();
> > +
> > +	igt_fixture
> > +	{
> > +		data.fd = drm_open_driver_master(DRIVER_ANY);
> > +
> > +		igt_display_require(&data.display, data.fd);
> > +		igt_require(data.display.is_atomic);
> > +		igt_display_require_output(&data.display);
> > +
> > +		igt_amd_require_dsc(&data.display, data.fd);
> > +		kmstest_set_vt_graphics_mode();
> > +	}
> > +
> > +	igt_describe("Forces DSC on/off & ensures it is reset properly");
> > +	igt_subtest("dsc-enable-basic")
> > +		    test_dsc_enable(&data);
> > +
> > +	igt_describe("Tests DSC slice height property & ensures it is reset properly on DSC enable/disable");
> > +	igt_subtest("dsc-slice-height-property")
> > +		    test_dsc_slice_height_property(&data);
> > +
> > +	igt_describe("Tests various DSC slice dimensions");
> > +	igt_subtest("dsc-slice-dimensions-change")
> > +		    test_dsc_slice_dimensions_change(&data);
> > +
> > +	igt_describe("Tests various combinations of link_rate + lane_count and logs if DSC enabled/disabled");
> > +	igt_subtest("dsc-link-settings")
> > +		    test_dsc_link_settings(&data);
> > +
> > +	igt_describe("Tests different bpc settings and logs if DSC is enabled/disabled");
> > +	igt_subtest("dsc-bpc")
> > +			test_dsc_bpc(&data);
> > +
> > +	igt_fixture
> > +	{
> > +		igt_reset_connectors();
> > +		igt_display_fini(&data.display);
> > +	}
> > +}
> > diff --git a/tests/amdgpu/meson.build b/tests/amdgpu/meson.build index 
> > b736c456..001e37ef 100644
> > --- a/tests/amdgpu/meson.build
> > +++ b/tests/amdgpu/meson.build
> > @@ -16,6 +16,7 @@ if libdrm_amdgpu.found()
> >   			  'amd_mem_leak',
> >   			  'amd_link_settings',
> >   			  'amd_vrr_range',
> > +			  'amd_dp_dsc',
> >   			]
> >   	amdgpu_deps += libdrm_amdgpu
> >   endif
> > 
> 

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

* Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
  2021-11-25  7:11     ` Petri Latvala
@ 2021-11-25 15:57       ` Rodrigo Siqueira Jordao
  2021-11-25 18:58         ` Rodrigo Siqueira Jordao
  0 siblings, 1 reply; 17+ messages in thread
From: Rodrigo Siqueira Jordao @ 2021-11-25 15:57 UTC (permalink / raw)
  To: Petri Latvala, Vudum, Lakshminarayana; +Cc: Eryk Brol, igt-dev, Mikita Lipski



On 2021-11-25 2:11 a.m., Petri Latvala wrote:
> On Thu, Nov 25, 2021 at 01:01:04AM +0200, Vudum, Lakshminarayana wrote:
>> @Rodrigo Siqueira I don't have the possibility to re-run the series. @Latvala, Petri Can you help here?
>>
>> Lakshmi.
> 
> Unfortunately patchwork got confused by your emails and thinks you've
> sent a patch, so the re-run button just reattempts the incorrect
> patch.
> 
> Rodrigo, please re-send this patch.
> 


Hi Petri/Lakshmi,

Thanks a lot for your help.

I submitted a V2:
https://patchwork.freedesktop.org/series/97108/

Thanks.

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

* Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
  2021-11-25 15:57       ` Rodrigo Siqueira Jordao
@ 2021-11-25 18:58         ` Rodrigo Siqueira Jordao
  2021-11-26  0:31           ` Vudum, Lakshminarayana
  2021-11-26  9:43           ` Petri Latvala
  0 siblings, 2 replies; 17+ messages in thread
From: Rodrigo Siqueira Jordao @ 2021-11-25 18:58 UTC (permalink / raw)
  To: Petri Latvala, Vudum, Lakshminarayana; +Cc: Eryk Brol, igt-dev, Mikita Lipski



On 2021-11-25 10:57 a.m., Rodrigo Siqueira Jordao wrote:
> 
> 
> On 2021-11-25 2:11 a.m., Petri Latvala wrote:
>> On Thu, Nov 25, 2021 at 01:01:04AM +0200, Vudum, Lakshminarayana wrote:
>>> @Rodrigo Siqueira I don't have the possibility to re-run the series. 
>>> @Latvala, Petri Can you help here?
>>>
>>> Lakshmi.
>>
>> Unfortunately patchwork got confused by your emails and thinks you've
>> sent a patch, so the re-run button just reattempts the incorrect
>> patch.
>>
>> Rodrigo, please re-send this patch.
>>
> 
> 
> Hi Petri/Lakshmi,
> 
> Thanks a lot for your help.
> 
> I submitted a V2:
> https://patchwork.freedesktop.org/series/97108/
> 
> Thanks.

Lakshmi/Petri,

For some reason, it looks like that the new version is still assigned to 
Lakshmi in the patchwork, and it has some weird failures (see below). 
Any idea? Do I need to resubmit the patch with a different subject?

Thanks

Gitlab.Pipeline:

Pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/453561 
for the overview.

containers:igt has failed 
(https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/16168063):
   STEP 2: COPY installdir/opt/igt /opt/igt
   1895d20f5469210af8281acac7769fa51efbde5ca3931bd457af2c2834e1f7ee
   STEP 3: COPY .gitlab-ci/docker-help.sh /usr/local/bin/docker-help.sh
   b743d155d30d20100edf9b2df89664275b2ea33d402f9df69cf5a1824a781b01
   STEP 4: ENV PATH="/opt/igt/bin:${PATH}"
   5eb0330fdfca164d1ef769d62f1d3c1a539a09a81da3ca01273c4e7afe2ee974
   STEP 5: ENV 
LD_LIBRARY_PATH="/opt/igt/lib:/opt/igt/lib64:${LD_LIBRARY_PATH}"
   b4ea9d4538270ad267ff798de51f4b7bed3e1ae27f9d3df8cea163e78acc9d3e
   STEP 6: ENV IGT_TEST_ROOT="/opt/igt/libexec/igt-gpu-tools"
   ae060122c9eeab50d82bbafa097e8cd72bccdc8e8cb00b42de1b38531854d099
   STEP 7: CMD docker-help.sh
   STEP 8: COMMIT 
registry.freedesktop.org/gfx-ci/igt-ci-tags/igt:commit-dcfa579ba0a38131881dfd441d558b54d4cd3183
   fcc29304314f515e7c8612f480ef56419de32ac5b5917000b434768cf94b6793
   Getting image source signatures
   Copying blob 
sha256:508381dd82aeb851da958db0528f2893285a9392bd0787020d3569a61fcdd513
   Copying blob 
sha256:3504a8337d3b7eaabfd338d6a971d02441d28ebef8bd81f730d87f936ed58079
   Copying blob 
sha256:f3f4119da36f8525b923a310c4b1f15579ca311a753c9973ef966cdb2a71a4e8
   section_end:1637863318:step_script
   ERROR: Job failed: execution took longer than 1h0m0s seconds

CI.BAT

IGT changes
Possible regressions
igt@kms_addfb_basic@addfb25-bad-modifier:

fi-rkl-11600: PASS -> FAIL +36 similar issues
igt@kms_addfb_basic@basic-x-tiled-legacy:

fi-rkl-guc: PASS -> FAIL +36 similar issues
igt@kms_addfb_basic@bo-too-small:

fi-tgl-1115g4: PASS -> FAIL +37 similar issues
igt@kms_addfb_basic@bo-too-small-due-to-tiling:

fi-icl-u2: PASS -> FAIL +46 similar issues
igt@kms_busy@basic:

fi-icl-u2: NOTRUN -> FAIL
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:

fi-tgl-u2: NOTRUN -> FAIL +53 similar issues
igt@prime_vgem@basic-fence-flip:

fi-icl-u2: PASS -> CRASH +2 similar issues

fi-tgl-u2: NOTRUN -> CRASH

fi-rkl-11600: PASS -> CRASH

fi-rkl-guc: PASS -> CRASH

fi-tgl-1115g4: PASS -> CRASH

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

* Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
  2021-11-25 18:58         ` Rodrigo Siqueira Jordao
@ 2021-11-26  0:31           ` Vudum, Lakshminarayana
  2021-11-26  9:43           ` Petri Latvala
  1 sibling, 0 replies; 17+ messages in thread
From: Vudum, Lakshminarayana @ 2021-11-26  0:31 UTC (permalink / raw)
  To: Rodrigo Siqueira Jordao, Latvala, Petri; +Cc: Eryk Brol, igt-dev, Mikita Lipski

@Rodrigo Siqueira Jordao I see those failures are keep coming. I haven't seen those from CI or from other pre-merge testing. 
Is review done for this patch?

Lakshmi.

-----Original Message-----
From: Rodrigo Siqueira Jordao <rjordrigo@amd.com> 
Sent: Thursday, November 25, 2021 10:58 AM
To: Latvala, Petri <petri.latvala@intel.com>; Vudum, Lakshminarayana <lakshminarayana.vudum@intel.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>; Mikita Lipski <mikita.lipski@amd.com>; Eryk Brol <eryk.brol@amd.com>; igt-dev@lists.freedesktop.org; harry.wentland@amd.com; Nicholas.Choi@amd.com; markyacoub@chromium.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC



On 2021-11-25 10:57 a.m., Rodrigo Siqueira Jordao wrote:
> 
> 
> On 2021-11-25 2:11 a.m., Petri Latvala wrote:
>> On Thu, Nov 25, 2021 at 01:01:04AM +0200, Vudum, Lakshminarayana wrote:
>>> @Rodrigo Siqueira I don't have the possibility to re-run the series. 
>>> @Latvala, Petri Can you help here?
>>>
>>> Lakshmi.
>>
>> Unfortunately patchwork got confused by your emails and thinks you've 
>> sent a patch, so the re-run button just reattempts the incorrect 
>> patch.
>>
>> Rodrigo, please re-send this patch.
>>
> 
> 
> Hi Petri/Lakshmi,
> 
> Thanks a lot for your help.
> 
> I submitted a V2:
> https://patchwork.freedesktop.org/series/97108/
> 
> Thanks.

Lakshmi/Petri,

For some reason, it looks like that the new version is still assigned to Lakshmi in the patchwork, and it has some weird failures (see below). 
Any idea? Do I need to resubmit the patch with a different subject?

Thanks

Gitlab.Pipeline:

Pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/453561
for the overview.

containers:igt has failed
(https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/16168063):
   STEP 2: COPY installdir/opt/igt /opt/igt
   1895d20f5469210af8281acac7769fa51efbde5ca3931bd457af2c2834e1f7ee
   STEP 3: COPY .gitlab-ci/docker-help.sh /usr/local/bin/docker-help.sh
   b743d155d30d20100edf9b2df89664275b2ea33d402f9df69cf5a1824a781b01
   STEP 4: ENV PATH="/opt/igt/bin:${PATH}"
   5eb0330fdfca164d1ef769d62f1d3c1a539a09a81da3ca01273c4e7afe2ee974
   STEP 5: ENV
LD_LIBRARY_PATH="/opt/igt/lib:/opt/igt/lib64:${LD_LIBRARY_PATH}"
   b4ea9d4538270ad267ff798de51f4b7bed3e1ae27f9d3df8cea163e78acc9d3e
   STEP 6: ENV IGT_TEST_ROOT="/opt/igt/libexec/igt-gpu-tools"
   ae060122c9eeab50d82bbafa097e8cd72bccdc8e8cb00b42de1b38531854d099
   STEP 7: CMD docker-help.sh
   STEP 8: COMMIT
registry.freedesktop.org/gfx-ci/igt-ci-tags/igt:commit-dcfa579ba0a38131881dfd441d558b54d4cd3183
   fcc29304314f515e7c8612f480ef56419de32ac5b5917000b434768cf94b6793
   Getting image source signatures
   Copying blob
sha256:508381dd82aeb851da958db0528f2893285a9392bd0787020d3569a61fcdd513
   Copying blob
sha256:3504a8337d3b7eaabfd338d6a971d02441d28ebef8bd81f730d87f936ed58079
   Copying blob
sha256:f3f4119da36f8525b923a310c4b1f15579ca311a753c9973ef966cdb2a71a4e8
   section_end:1637863318:step_script
   ERROR: Job failed: execution took longer than 1h0m0s seconds

CI.BAT

IGT changes
Possible regressions
igt@kms_addfb_basic@addfb25-bad-modifier:

fi-rkl-11600: PASS -> FAIL +36 similar issues
igt@kms_addfb_basic@basic-x-tiled-legacy:

fi-rkl-guc: PASS -> FAIL +36 similar issues
igt@kms_addfb_basic@bo-too-small:

fi-tgl-1115g4: PASS -> FAIL +37 similar issues
igt@kms_addfb_basic@bo-too-small-due-to-tiling:

fi-icl-u2: PASS -> FAIL +46 similar issues
igt@kms_busy@basic:

fi-icl-u2: NOTRUN -> FAIL
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:

fi-tgl-u2: NOTRUN -> FAIL +53 similar issues
igt@prime_vgem@basic-fence-flip:

fi-icl-u2: PASS -> CRASH +2 similar issues

fi-tgl-u2: NOTRUN -> CRASH

fi-rkl-11600: PASS -> CRASH

fi-rkl-guc: PASS -> CRASH

fi-tgl-1115g4: PASS -> CRASH


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

* Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
  2021-11-25 18:58         ` Rodrigo Siqueira Jordao
  2021-11-26  0:31           ` Vudum, Lakshminarayana
@ 2021-11-26  9:43           ` Petri Latvala
  2021-11-26 10:07             ` Petri Latvala
  1 sibling, 1 reply; 17+ messages in thread
From: Petri Latvala @ 2021-11-26  9:43 UTC (permalink / raw)
  To: Rodrigo Siqueira Jordao
  Cc: Eryk Brol, Vudum, Lakshminarayana, igt-dev, Mikita Lipski

On Thu, Nov 25, 2021 at 01:58:14PM -0500, Rodrigo Siqueira Jordao wrote:
> 
> 
> On 2021-11-25 10:57 a.m., Rodrigo Siqueira Jordao wrote:
> > 
> > 
> > On 2021-11-25 2:11 a.m., Petri Latvala wrote:
> > > On Thu, Nov 25, 2021 at 01:01:04AM +0200, Vudum, Lakshminarayana wrote:
> > > > @Rodrigo Siqueira I don't have the possibility to re-run the
> > > > series. @Latvala, Petri Can you help here?
> > > > 
> > > > Lakshmi.
> > > 
> > > Unfortunately patchwork got confused by your emails and thinks you've
> > > sent a patch, so the re-run button just reattempts the incorrect
> > > patch.
> > > 
> > > Rodrigo, please re-send this patch.
> > > 
> > 
> > 
> > Hi Petri/Lakshmi,
> > 
> > Thanks a lot for your help.
> > 
> > I submitted a V2:
> > https://patchwork.freedesktop.org/series/97108/
> > 
> > Thanks.
> 
> Lakshmi/Petri,
> 
> For some reason, it looks like that the new version is still assigned to
> Lakshmi in the patchwork

Is the patch data itself correct?

> , and it has some weird failures (see below). Any
> idea? Do I need to resubmit the patch with a different subject?
> 
> Thanks
> 
> Gitlab.Pipeline:
> 
> Pipeline status: FAILED.
> 
> see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/453561 for
> the overview.
> 
> containers:igt has failed
> (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/16168063):
>   STEP 2: COPY installdir/opt/igt /opt/igt
>   1895d20f5469210af8281acac7769fa51efbde5ca3931bd457af2c2834e1f7ee
>   STEP 3: COPY .gitlab-ci/docker-help.sh /usr/local/bin/docker-help.sh
>   b743d155d30d20100edf9b2df89664275b2ea33d402f9df69cf5a1824a781b01
>   STEP 4: ENV PATH="/opt/igt/bin:${PATH}"
>   5eb0330fdfca164d1ef769d62f1d3c1a539a09a81da3ca01273c4e7afe2ee974
>   STEP 5: ENV
> LD_LIBRARY_PATH="/opt/igt/lib:/opt/igt/lib64:${LD_LIBRARY_PATH}"
>   b4ea9d4538270ad267ff798de51f4b7bed3e1ae27f9d3df8cea163e78acc9d3e
>   STEP 6: ENV IGT_TEST_ROOT="/opt/igt/libexec/igt-gpu-tools"
>   ae060122c9eeab50d82bbafa097e8cd72bccdc8e8cb00b42de1b38531854d099
>   STEP 7: CMD docker-help.sh
>   STEP 8: COMMIT registry.freedesktop.org/gfx-ci/igt-ci-tags/igt:commit-dcfa579ba0a38131881dfd441d558b54d4cd3183
>   fcc29304314f515e7c8612f480ef56419de32ac5b5917000b434768cf94b6793
>   Getting image source signatures
>   Copying blob
> sha256:508381dd82aeb851da958db0528f2893285a9392bd0787020d3569a61fcdd513
>   Copying blob
> sha256:3504a8337d3b7eaabfd338d6a971d02441d28ebef8bd81f730d87f936ed58079
>   Copying blob
> sha256:f3f4119da36f8525b923a310c4b1f15579ca311a753c9973ef966cdb2a71a4e8
>   section_end:1637863318:step_script
>   ERROR: Job failed: execution took longer than 1h0m0s seconds

You can ignore this error. gitlab had issues talking to its docker
registry.


-- 
Petri Latvala




> 
> CI.BAT
> 
> IGT changes
> Possible regressions
> igt@kms_addfb_basic@addfb25-bad-modifier:
> 
> fi-rkl-11600: PASS -> FAIL +36 similar issues
> igt@kms_addfb_basic@basic-x-tiled-legacy:
> 
> fi-rkl-guc: PASS -> FAIL +36 similar issues
> igt@kms_addfb_basic@bo-too-small:
> 
> fi-tgl-1115g4: PASS -> FAIL +37 similar issues
> igt@kms_addfb_basic@bo-too-small-due-to-tiling:
> 
> fi-icl-u2: PASS -> FAIL +46 similar issues
> igt@kms_busy@basic:
> 
> fi-icl-u2: NOTRUN -> FAIL
> igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
> 
> fi-tgl-u2: NOTRUN -> FAIL +53 similar issues
> igt@prime_vgem@basic-fence-flip:
> 
> fi-icl-u2: PASS -> CRASH +2 similar issues
> 
> fi-tgl-u2: NOTRUN -> CRASH
> 
> fi-rkl-11600: PASS -> CRASH
> 
> fi-rkl-guc: PASS -> CRASH
> 
> fi-tgl-1115g4: PASS -> CRASH
> 

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

* Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
  2021-11-26  9:43           ` Petri Latvala
@ 2021-11-26 10:07             ` Petri Latvala
  2021-11-26 14:15               ` Rodrigo Siqueira Jordao
  0 siblings, 1 reply; 17+ messages in thread
From: Petri Latvala @ 2021-11-26 10:07 UTC (permalink / raw)
  To: Rodrigo Siqueira Jordao
  Cc: igt-dev, Mikita Lipski, Vudum, Lakshminarayana, Eryk Brol

On Fri, Nov 26, 2021 at 11:43:52AM +0200, Petri Latvala wrote:
> On Thu, Nov 25, 2021 at 01:58:14PM -0500, Rodrigo Siqueira Jordao wrote:
> > 
> > 
> > On 2021-11-25 10:57 a.m., Rodrigo Siqueira Jordao wrote:
> > > 
> > > 
> > > On 2021-11-25 2:11 a.m., Petri Latvala wrote:
> > > > On Thu, Nov 25, 2021 at 01:01:04AM +0200, Vudum, Lakshminarayana wrote:
> > > > > @Rodrigo Siqueira I don't have the possibility to re-run the
> > > > > series. @Latvala, Petri Can you help here?
> > > > > 
> > > > > Lakshmi.
> > > > 
> > > > Unfortunately patchwork got confused by your emails and thinks you've
> > > > sent a patch, so the re-run button just reattempts the incorrect
> > > > patch.
> > > > 
> > > > Rodrigo, please re-send this patch.
> > > > 
> > > 
> > > 
> > > Hi Petri/Lakshmi,
> > > 
> > > Thanks a lot for your help.
> > > 
> > > I submitted a V2:
> > > https://patchwork.freedesktop.org/series/97108/
> > > 
> > > Thanks.
> > 
> > Lakshmi/Petri,
> > 
> > For some reason, it looks like that the new version is still assigned to
> > Lakshmi in the patchwork
> 
> Is the patch data itself correct?
> 
> > , and it has some weird failures (see below). Any
> > idea? Do I need to resubmit the patch with a different subject?
> > 
> > Thanks
> > 
> > Gitlab.Pipeline:
> > 
> > Pipeline status: FAILED.
> > 
> > see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/453561 for
> > the overview.
> > 
> > containers:igt has failed
> > (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/16168063):
> >   STEP 2: COPY installdir/opt/igt /opt/igt
> >   1895d20f5469210af8281acac7769fa51efbde5ca3931bd457af2c2834e1f7ee
> >   STEP 3: COPY .gitlab-ci/docker-help.sh /usr/local/bin/docker-help.sh
> >   b743d155d30d20100edf9b2df89664275b2ea33d402f9df69cf5a1824a781b01
> >   STEP 4: ENV PATH="/opt/igt/bin:${PATH}"
> >   5eb0330fdfca164d1ef769d62f1d3c1a539a09a81da3ca01273c4e7afe2ee974
> >   STEP 5: ENV
> > LD_LIBRARY_PATH="/opt/igt/lib:/opt/igt/lib64:${LD_LIBRARY_PATH}"
> >   b4ea9d4538270ad267ff798de51f4b7bed3e1ae27f9d3df8cea163e78acc9d3e
> >   STEP 6: ENV IGT_TEST_ROOT="/opt/igt/libexec/igt-gpu-tools"
> >   ae060122c9eeab50d82bbafa097e8cd72bccdc8e8cb00b42de1b38531854d099
> >   STEP 7: CMD docker-help.sh
> >   STEP 8: COMMIT registry.freedesktop.org/gfx-ci/igt-ci-tags/igt:commit-dcfa579ba0a38131881dfd441d558b54d4cd3183
> >   fcc29304314f515e7c8612f480ef56419de32ac5b5917000b434768cf94b6793
> >   Getting image source signatures
> >   Copying blob
> > sha256:508381dd82aeb851da958db0528f2893285a9392bd0787020d3569a61fcdd513
> >   Copying blob
> > sha256:3504a8337d3b7eaabfd338d6a971d02441d28ebef8bd81f730d87f936ed58079
> >   Copying blob
> > sha256:f3f4119da36f8525b923a310c4b1f15579ca311a753c9973ef966cdb2a71a4e8
> >   section_end:1637863318:step_script
> >   ERROR: Job failed: execution took longer than 1h0m0s seconds
> 
> You can ignore this error. gitlab had issues talking to its docker
> registry.
> 
> 
> -- 
> Petri Latvala
> 
> 
> 
> 
> > 
> > CI.BAT
> > 
> > IGT changes
> > Possible regressions
> > igt@kms_addfb_basic@addfb25-bad-modifier:
> > 
> > fi-rkl-11600: PASS -> FAIL +36 similar issues
> > igt@kms_addfb_basic@basic-x-tiled-legacy:
> > 
> > fi-rkl-guc: PASS -> FAIL +36 similar issues
> > igt@kms_addfb_basic@bo-too-small:
> > 
> > fi-tgl-1115g4: PASS -> FAIL +37 similar issues
> > igt@kms_addfb_basic@bo-too-small-due-to-tiling:
> > 
> > fi-icl-u2: PASS -> FAIL +46 similar issues
> > igt@kms_busy@basic:
> > 
> > fi-icl-u2: NOTRUN -> FAIL
> > igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
> > 
> > fi-tgl-u2: NOTRUN -> FAIL +53 similar issues
> > igt@prime_vgem@basic-fence-flip:
> > 
> > fi-icl-u2: PASS -> CRASH +2 similar issues
> > 
> > fi-tgl-u2: NOTRUN -> CRASH
> > 
> > fi-rkl-11600: PASS -> CRASH
> > 
> > fi-rkl-guc: PASS -> CRASH
> > 
> > fi-tgl-1115g4: PASS -> CRASH
> > 


As for these failures, they are caused by the change to
igt_atomic_properties array in igt_kms.h. You added a prop there but
didn't change any code that loops through the whole array. Look for
IGT_NUM_CRTC_PROPS.


-- 
Petri Latvala

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

* Re: [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC
  2021-11-26 10:07             ` Petri Latvala
@ 2021-11-26 14:15               ` Rodrigo Siqueira Jordao
  0 siblings, 0 replies; 17+ messages in thread
From: Rodrigo Siqueira Jordao @ 2021-11-26 14:15 UTC (permalink / raw)
  To: Petri Latvala; +Cc: igt-dev, Mikita Lipski, Vudum, Lakshminarayana, Eryk Brol



On 2021-11-26 5:07 a.m., Petri Latvala wrote:
> On Fri, Nov 26, 2021 at 11:43:52AM +0200, Petri Latvala wrote:
>> On Thu, Nov 25, 2021 at 01:58:14PM -0500, Rodrigo Siqueira Jordao wrote:
>>>
>>>
>>> On 2021-11-25 10:57 a.m., Rodrigo Siqueira Jordao wrote:
>>>>
>>>>
>>>> On 2021-11-25 2:11 a.m., Petri Latvala wrote:
>>>>> On Thu, Nov 25, 2021 at 01:01:04AM +0200, Vudum, Lakshminarayana wrote:
>>>>>> @Rodrigo Siqueira I don't have the possibility to re-run the
>>>>>> series. @Latvala, Petri Can you help here?
>>>>>>
>>>>>> Lakshmi.
>>>>>
>>>>> Unfortunately patchwork got confused by your emails and thinks you've
>>>>> sent a patch, so the re-run button just reattempts the incorrect
>>>>> patch.
>>>>>
>>>>> Rodrigo, please re-send this patch.
>>>>>
>>>>
>>>>
>>>> Hi Petri/Lakshmi,
>>>>
>>>> Thanks a lot for your help.
>>>>
>>>> I submitted a V2:
>>>> https://patchwork.freedesktop.org/series/97108/>>>>>
>>>> Thanks.
>>>
>>> Lakshmi/Petri,
>>>
>>> For some reason, it looks like that the new version is still assigned to
>>> Lakshmi in the patchwork
>>
>> Is the patch data itself correct?
>>
>>> , and it has some weird failures (see below). Any
>>> idea? Do I need to resubmit the patch with a different subject?
>>>
>>> Thanks
>>>
>>> Gitlab.Pipeline:
>>>
>>> Pipeline status: FAILED.
>>>
>>> see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/453561 for
>>> the overview.
>>>
>>> containers:igt has failed
>>> (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/16168063>>>>    STEP 2: COPY installdir/opt/igt /opt/igt
>>>    1895d20f5469210af8281acac7769fa51efbde5ca3931bd457af2c2834e1f7ee
>>>    STEP 3: COPY .gitlab-ci/docker-help.sh /usr/local/bin/docker-help.sh
>>>    b743d155d30d20100edf9b2df89664275b2ea33d402f9df69cf5a1824a781b01
>>>    STEP 4: ENV PATH="/opt/igt/bin:${PATH}"
>>>    5eb0330fdfca164d1ef769d62f1d3c1a539a09a81da3ca01273c4e7afe2ee974
>>>    STEP 5: ENV
>>> LD_LIBRARY_PATH="/opt/igt/lib:/opt/igt/lib64:${LD_LIBRARY_PATH}"
>>>    b4ea9d4538270ad267ff798de51f4b7bed3e1ae27f9d3df8cea163e78acc9d3e
>>>    STEP 6: ENV IGT_TEST_ROOT="/opt/igt/libexec/igt-gpu-tools"
>>>    ae060122c9eeab50d82bbafa097e8cd72bccdc8e8cb00b42de1b38531854d099
>>>    STEP 7: CMD docker-help.sh
>>>    STEP 8: COMMIT registry.freedesktop.org/gfx-ci/igt-ci-tags/igt:commit-dcfa579ba0a38131881dfd441d558b54d4cd3183
>>>    fcc29304314f515e7c8612f480ef56419de32ac5b5917000b434768cf94b6793
>>>    Getting image source signatures
>>>    Copying blob
>>> sha256:508381dd82aeb851da958db0528f2893285a9392bd0787020d3569a61fcdd513
>>>    Copying blob
>>> sha256:3504a8337d3b7eaabfd338d6a971d02441d28ebef8bd81f730d87f936ed58079
>>>    Copying blob
>>> sha256:f3f4119da36f8525b923a310c4b1f15579ca311a753c9973ef966cdb2a71a4e8
>>>    section_end:1637863318:step_script
>>>    ERROR: Job failed: execution took longer than 1h0m0s seconds
>>
>> You can ignore this error. gitlab had issues talking to its docker
>> registry.
>>
>>
>> -- 
>> Petri Latvala
>>
>>
>>
>>
>>>
>>> CI.BAT
>>>
>>> IGT changes
>>> Possible regressions
>>> igt@kms_addfb_basic@addfb25-bad-modifier:
>>>
>>> fi-rkl-11600: PASS -> FAIL +36 similar issues
>>> igt@kms_addfb_basic@basic-x-tiled-legacy:
>>>
>>> fi-rkl-guc: PASS -> FAIL +36 similar issues
>>> igt@kms_addfb_basic@bo-too-small:
>>>
>>> fi-tgl-1115g4: PASS -> FAIL +37 similar issues
>>> igt@kms_addfb_basic@bo-too-small-due-to-tiling:
>>>
>>> fi-icl-u2: PASS -> FAIL +46 similar issues
>>> igt@kms_busy@basic:
>>>
>>> fi-icl-u2: NOTRUN -> FAIL
>>> igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
>>>
>>> fi-tgl-u2: NOTRUN -> FAIL +53 similar issues
>>> igt@prime_vgem@basic-fence-flip:
>>>
>>> fi-icl-u2: PASS -> CRASH +2 similar issues
>>>
>>> fi-tgl-u2: NOTRUN -> CRASH
>>>
>>> fi-rkl-11600: PASS -> CRASH
>>>
>>> fi-rkl-guc: PASS -> CRASH
>>>
>>> fi-tgl-1115g4: PASS -> CRASH
>>>
> 
> 
> As for these failures, they are caused by the change to
> igt_atomic_properties array in igt_kms.h. You added a prop there but
> didn't change any code that loops through the whole array. Look for
> IGT_NUM_CRTC_PROPS.
> 
> 

Idk what's going on with this patch. For this reason, I changed the 
commit subject, rebased it in the latest version of IGT, and resubmitted 
the patch. Here is the new version:

https://patchwork.freedesktop.org/series/97325/

Thanks.

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

end of thread, other threads:[~2021-11-26 14:15 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19 15:00 [igt-dev] [PATCH i-g-t] tests/amdgpu: Add test for AMD DP DSC Rodrigo Siqueira
2021-11-19 16:34 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2021-11-24 15:33 ` [igt-dev] [PATCH i-g-t] " Rodrigo Siqueira Jordao
2021-11-24 19:07   ` Vudum, Lakshminarayana
2021-11-24 23:01   ` Vudum, Lakshminarayana
2021-11-25  7:11     ` Petri Latvala
2021-11-25 15:57       ` Rodrigo Siqueira Jordao
2021-11-25 18:58         ` Rodrigo Siqueira Jordao
2021-11-26  0:31           ` Vudum, Lakshminarayana
2021-11-26  9:43           ` Petri Latvala
2021-11-26 10:07             ` Petri Latvala
2021-11-26 14:15               ` Rodrigo Siqueira Jordao
2021-11-24 16:55 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev2) Patchwork
2021-11-24 19:24 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev3) Patchwork
2021-11-24 22:55 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/amdgpu: Add test for AMD DP DSC Patchwork
2021-11-24 23:18 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev4) Patchwork
2021-11-25  7:10 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu: Add test for AMD DP DSC (rev5) Patchwork

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.