Skip to contentSkip to conversation

DSC Fractional BPP Val Support

PATCH Superseded Swati Sharma 2 participants 12 messages Jul 28, 2023 Library code

v4 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

v4 cover DSC Fractional BPP Val Support

Existing i-g-t is extended to enable validation for dsc fractional bpp.
This series is split from
https://patchwork.freedesktop.org/series/111342/

v2: addressed review comments from Ankit
v3: addressed review comments from Ankit
v4: fixed if() (Ankit)

Swati Sharma (10):
tests/i915/kms_dsc: add new test flag
tests/i915/kms_dsc: use uint32_t test flag tests/i915/kms_dsc: use #define for default bpc tests/i915/kms_dsc: update if condition tests/i915/kms_dsc: use igt_get_pipe_current_bpc() tests/i915/kms_dsc: add test validating output formats with input bpc lib/dsc: add helpers for vdsc fractional bpp debugfs entry tests/i915/kms_dsc: enable validation for vdsc fractional bpp tests/i915/kms_dsc: add test to validate fractional bpp with input bpc tests/i915/kms_dsc: add test summary

 lib/igt_dsc.c               |  84 ++++++++++++++++++++++
 lib/igt_dsc.h               |   5 ++
 tests/i915/kms_dsc.c        | 137 +++++++++++++++++++++++++++++-------
 tests/i915/kms_dsc_helper.c |  71 +++++++++++++++++++
 tests/i915/kms_dsc_helper.h |   4 ++
 5 files changed, 274 insertions(+), 27 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v4 1/10 tests/i915/kms_dsc: add new test flag

Add new test flag TEST_DSC_FORMAT. This flag is added to differentiate the basic dsc test and the tests where we want to change different plane pixel formats.

v2: -update commit message (Ankit)

---
 tests/i915/kms_dsc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/i915/kms_dsc.c +2 -1
index 0a3e29924..23ccbca00 100644
@@ -37,6 +37,7 @@ IGT_TEST_DESCRIPTION("Test to validate display stream compression");
 enum dsc_test_type {
 	TEST_DSC_BASIC,
 	TEST_DSC_BPC,
+	TEST_DSC_FORMAT,
 	TEST_DSC_OUTPUT_FORMAT,
 };
 
@@ -302,7 +303,7 @@ igt_main_args("l", NULL, help_str, opt_handler, &data)
 		     "with default parameters and creating fb with diff formats");
 	igt_subtest_with_dynamic("dsc-with-formats") {
 		for (int k = 0; k < ARRAY_SIZE(format_list); k++)
-			test_dsc(&data, TEST_DSC_BASIC, 0,
+			test_dsc(&data, TEST_DSC_FORMAT, 0,
 				 format_list[k], DSC_FORMAT_RGB);
 	}
 
Signature · 1 line
2.25.1
#2 lore raw

PATCH v4 2/10 tests/i915/kms_dsc: use uint32_t test flag

In reply to Swati Sharma

Instead of using enum, use uinit32_t test flag. It is helpful, if we need to implement feature combination tests.

v2: -use #define (Ankit)
-use 2D char array (Ankit)

---
 tests/i915/kms_dsc.c | 50 +++++++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 22 deletions(-)
tests/i915/kms_dsc.c +28 -22
index 23ccbca00..99d35a7ff 100644
@@ -34,12 +34,12 @@
 
 IGT_TEST_DESCRIPTION("Test to validate display stream compression");
 
-enum dsc_test_type {
-	TEST_DSC_BASIC,
-	TEST_DSC_BPC,
-	TEST_DSC_FORMAT,
-	TEST_DSC_OUTPUT_FORMAT,
-};
+#define LEN		20
+
+#define TEST_DSC_BASIC		(0<<0)
+#define TEST_DSC_BPC		(1<<0)
+#define TEST_DSC_FORMAT		(1<<1)
+#define TEST_DSC_OUTPUT_FORMAT	(1<<2)
 
 typedef struct {
 	int drm_fd;
@@ -111,7 +111,7 @@ static void test_cleanup(data_t *data)
 }
 
 /* re-probe connectors and do a modeset with DSC */
-static void update_display(data_t *data, enum dsc_test_type test_type)
+static void update_display(data_t *data, uint32_t test_type)
 {
 	int ret;
 	bool enabled;
@@ -130,12 +130,12 @@ static void update_display(data_t *data, enum dsc_test_type test_type)
 	save_force_dsc_en(data->drm_fd, data->output);
 	force_dsc_enable(data->drm_fd, data->output);
 
-	if (test_type == TEST_DSC_BPC) {
+	if (test_type & TEST_DSC_BPC) {
 		igt_debug("Trying to set input BPC to %d\n", data->input_bpc);
 		force_dsc_enable_bpc(data->drm_fd, data->output, data->input_bpc);
 	}
 
-	if (test_type == TEST_DSC_OUTPUT_FORMAT) {
+	if (test_type & TEST_DSC_OUTPUT_FORMAT) {
 		igt_debug("Trying to set DSC %s output format\n",
 			   kmstest_dsc_output_format_str(data->output_format));
 		force_dsc_output_format(data->drm_fd, data->output, data->output_format);
@@ -214,13 +214,18 @@ reset:
 	igt_assert_eq(ret, 0);
 }
 
-static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
-		     unsigned int plane_format, enum dsc_output_format output_format)
+static void test_dsc(data_t *data, uint32_t test_type, int bpc,
+		     unsigned int plane_format,
+		     enum dsc_output_format output_format)
 {
 	igt_display_t *display = &data->display;
 	igt_output_t *output;
-	char name[20];
 	enum pipe pipe;
+	char name[3][LEN] = {
+				{0},
+				{0},
+				{0},
+			    };
 
 	for_each_pipe_with_valid_output(display, pipe, output) {
 		data->output_format = output_format;
@@ -242,15 +247,15 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
 		if (!check_gen11_bpc_constraint(data->drm_fd, data->output, data->input_bpc))
 			continue;
 
-		if (test_type == TEST_DSC_BPC)
-			snprintf(name, sizeof(name), "-%dbpc-%s", data->input_bpc, igt_format_str(data->plane_format));
-		else if (test_type == TEST_DSC_OUTPUT_FORMAT)
-			snprintf(name, sizeof(name), "-%s-%s", kmstest_dsc_output_format_str(data->output_format),
-							       igt_format_str(data->plane_format));
-		else
-			snprintf(name, sizeof(name), "-%s", igt_format_str(data->plane_format));
+		if (test_type & TEST_DSC_OUTPUT_FORMAT)
+			snprintf(&name[0][0], LEN, "-%s", kmstest_dsc_output_format_str(data->output_format));
+		if (test_type & TEST_DSC_FORMAT)
+			snprintf(&name[1][0], LEN, "-%s", igt_format_str(data->plane_format));
+		if (test_type & TEST_DSC_BPC)
+			snprintf(&name[2][0], LEN, "-%dbpc", data->input_bpc);
 
-		igt_dynamic_f("pipe-%s-%s%s",  kmstest_pipe_name(data->pipe), data->output->name, name)
+		igt_dynamic_f("pipe-%s-%s%s%s%s",  kmstest_pipe_name(data->pipe), data->output->name,
+			      &name[0][0], &name[1][0], &name[2][0])
 			update_display(data, test_type);
 
 		if (data->limited)
@@ -322,8 +327,9 @@ igt_main_args("l", NULL, help_str, opt_handler, &data)
 	igt_subtest_with_dynamic("dsc-with-bpc-formats") {
 		for (int j = 0; j < ARRAY_SIZE(bpc_list); j++) {
 			for (int k = 0; k < ARRAY_SIZE(format_list); k++) {
-				test_dsc(&data, TEST_DSC_BPC, bpc_list[j],
-				format_list[k], DSC_FORMAT_RGB);
+				test_dsc(&data, TEST_DSC_BPC | TEST_DSC_FORMAT,
+				bpc_list[j], format_list[k],
+				DSC_FORMAT_RGB);
 			}
 		}
 	}
Signature · 1 line
2.25.1
#3 lore raw

PATCH v4 3/10 tests/i915/kms_dsc: use #define for default bpc

In reply to Swati Sharma

For default bpc, use #define. By setting bpc as 0, means driver will set its own value and we are not enforcing input bpc.

---
 tests/i915/kms_dsc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
tests/i915/kms_dsc.c +5 -3
index 99d35a7ff..7b9bae91a 100644
@@ -35,6 +35,7 @@
 IGT_TEST_DESCRIPTION("Test to validate display stream compression");
 
 #define LEN		20
+#define DEFAULT_BPC	0
 
 #define TEST_DSC_BASIC		(0<<0)
 #define TEST_DSC_BPC		(1<<0)
@@ -300,7 +301,7 @@ igt_main_args("l", NULL, help_str, opt_handler, &data)
 		     "by a connector by forcing DSC on all connectors that support it "
 		     "with default parameters");
 	igt_subtest_with_dynamic("dsc-basic")
-			test_dsc(&data, TEST_DSC_BASIC, 0,
+			test_dsc(&data, TEST_DSC_BASIC, DEFAULT_BPC,
 				 DRM_FORMAT_XRGB8888, DSC_FORMAT_RGB);
 
 	igt_describe("Tests basic display stream compression functionality if supported "
@@ -308,7 +309,7 @@ igt_main_args("l", NULL, help_str, opt_handler, &data)
 		     "with default parameters and creating fb with diff formats");
 	igt_subtest_with_dynamic("dsc-with-formats") {
 		for (int k = 0; k < ARRAY_SIZE(format_list); k++)
-			test_dsc(&data, TEST_DSC_FORMAT, 0,
+			test_dsc(&data, TEST_DSC_FORMAT, DEFAULT_BPC,
 				 format_list[k], DSC_FORMAT_RGB);
 	}
 
@@ -339,7 +340,8 @@ igt_main_args("l", NULL, help_str, opt_handler, &data)
 		     "that support it");
 	igt_subtest_with_dynamic("dsc-with-output-formats") {
 		for (int k = 0; k < ARRAY_SIZE(output_format_list); k++)
-			test_dsc(&data, TEST_DSC_OUTPUT_FORMAT, 0, DRM_FORMAT_XRGB8888,
+			test_dsc(&data, TEST_DSC_OUTPUT_FORMAT, DEFAULT_BPC,
+				 DRM_FORMAT_XRGB8888,
 				 output_format_list[k]);
 	}
 
Signature · 1 line
2.25.1
#4 lore raw

PATCH v4 4/10 tests/i915/kms_dsc: update if condition

In reply to Swati Sharma

Check is_dsc_output_format_supported() iff test flag is set to OUTPUT_FORMAT.

---
 tests/i915/kms_dsc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tests/i915/kms_dsc.c +3 -2
index 7b9bae91a..266918f74 100644
@@ -238,8 +238,9 @@ static void test_dsc(data_t *data, uint32_t test_type, int bpc,
 		if (!is_dsc_supported_by_sink(data->drm_fd, data->output))
 			continue;
 
-		if (!is_dsc_output_format_supported(data->drm_fd, data->disp_ver,
-						    data->output, data->output_format))
+		if ((test_type & TEST_DSC_OUTPUT_FORMAT) &&
+		    (!is_dsc_output_format_supported(data->drm_fd, data->disp_ver,
+						     data->output, data->output_format)))
 			continue;
 
 		if (!check_gen11_dp_constraint(data->drm_fd, data->output, data->pipe))
Signature · 1 line
2.25.1
#5 lore raw

Re: [igt-dev] [v4 04/10] tests/i915/kms_dsc: update if condition

Quoted 13 lines · Swati Sharma

Check is_dsc_output_format_supported() iff test flag is set to OUTPUT_FORMAT.

---
  tests/i915/kms_dsc.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
tests/i915/kms_dsc.c +0 -0
index 7b9bae91a..266918f74 100644

tests/i915/kms_dsc.c static void test_dsc(data_t *data, uint32_t test_type, int bpc, · line 244

Quoted 9 lines
tests/i915/kms_dsc.c +3 -2
@@ -238,8 +238,9 @@ static void test_dsc(data_t *data, uint32_t test_type, int bpc,
  		if (!is_dsc_supported_by_sink(data->drm_fd, data->output))
  			continue;
 
-		if (!is_dsc_output_format_supported(data->drm_fd, data->disp_ver,
-						    data->output, data->output_format))
+		if ((test_type & TEST_DSC_OUTPUT_FORMAT) &&
+		    (!is_dsc_output_format_supported(data->drm_fd, data->disp_ver,
+						     data->output, data->output_format)))
  			continue;

The change look good.

Makes sense to check for output format constraint, only when we are forcing the output format.

tests/i915/kms_dsc.c static void test_dsc(data_t *data, uint32_t test_type, int bpc, · line 246

Quoted 2 lines
tests/i915/kms_dsc.c +0 -0
  		if (!check_gen11_dp_constraint(data->drm_fd, data->output, data->pipe))

Perhaps this check and the first check: is_dsc_output_format_supported can be together.

Also realized that check_gen11_bpc_constraint which come later should not be in the loop, as it does not depend on either pipe or output.

So lets move that outside the loop.

Regards,

Ankit

#6 lore raw

PATCH v4 5/10 tests/i915/kms_dsc: use igt_get_pipe_current_bpc()

In reply to Swati Sharma

Use igt_get_pipe_current_bpc() to get current bpc when TEST_DSC_BPC test flag is used. If input bpc is not equal to current bpc, skip test.

v2: -use helper directly (Ankit)

---
 tests/i915/kms_dsc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
tests/i915/kms_dsc.c +8 -1
index 266918f74..00e2ed1a8 100644
@@ -117,6 +117,7 @@ static void update_display(data_t *data, uint32_t test_type)
 	int ret;
 	bool enabled;
 	int index = 0;
+	int current_bpc = 0;
 	igt_plane_t *primary;
 	drmModeModeInfo *mode;
 	igt_output_t *output = data->output;
@@ -202,11 +203,17 @@ static void update_display(data_t *data, uint32_t test_type)
 
 	restore_force_dsc_en();
 
+	if (test_type & TEST_DSC_BPC) {
+		current_bpc = igt_get_pipe_current_bpc(data->drm_fd, data->pipe);
+		igt_skip_on_f(data->input_bpc != current_bpc,
+			      "Input bpc = %d is not equal to current bpc = %d\n",
+			      data->input_bpc, current_bpc);
+	}
+
 	igt_assert_f(enabled,
 		     "Default DSC enable failed on connector: %s pipe: %s\n",
 		     output->name,
 		     kmstest_pipe_name(data->pipe));
-
 reset:
 	test_reset(data);
 
Signature · 1 line
2.25.1
#7 lore raw

PATCH v4 6/10 tests/i915/kms_dsc: add test validating output formats with input bpc

In reply to Swati Sharma

New subtest is added validating output format with different input bpc.

v2: -update subject (Ankit)

---
 tests/i915/kms_dsc.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
tests/i915/kms_dsc.c +13 -0
index 00e2ed1a8..cf99e6faa 100644
@@ -353,6 +353,19 @@ igt_main_args("l", NULL, help_str, opt_handler, &data)
 				 output_format_list[k]);
 	}
 
+	igt_describe("Tests basic display stream compression functionality if supported "
+		     "by a connector by forcing DSC and output format on all connectors "
+		     "that support it with certain input BPC for the connector");
+	igt_subtest_with_dynamic("dsc-with-output-formats-with-bpc") {
+		for (int k = 0; k < ARRAY_SIZE(output_format_list); k++) {
+			for (int j = 0; j < ARRAY_SIZE(bpc_list); j++) {
+				test_dsc(&data, TEST_DSC_OUTPUT_FORMAT | TEST_DSC_BPC,
+					 bpc_list[j], DRM_FORMAT_XRGB8888,
+					 output_format_list[k]);
+			}
+		}
+	}
+
 	igt_fixture {
 		igt_display_fini(&data.display);
 		drm_close_driver(data.drm_fd);
Signature · 1 line
2.25.1
#8 lore raw

PATCH v4 7/10 lib/dsc: add helpers for vdsc fractional bpp debugfs entry

In reply to Swati Sharma

Helper functions are added for getting/setting VDSC Fractional BPP debugfs entry.

v2: -improved func description (Ankit)
-increased buff size (Ankit)
-asserted bpp_prec (Ankit)
v3: -return 0 on success instead of 1 (Jouni)
v4: -rebase
v5: -alignment fixes (Ankit)

---
 lib/igt_dsc.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/igt_dsc.h |  5 +++
 2 files changed, 89 insertions(+)
lib/igt_dsc.c +84 -0
index 76a420c10..6c3b70421 100644
@@ -205,3 +205,87 @@ int igt_force_dsc_output_format(int drmfd, char *connector_name,
 
 	return write_dsc_debugfs(drmfd, connector_name, "i915_dsc_output_format", buf);
 }
+
+static
+bool check_dsc_fractional_bpp_debugfs(int drmfd, char *connector_name,
+				      const char *check_str)
+{
+	char file_name[128] = {0};
+	char buf[512];
+
+	sprintf(file_name, "%s/i915_dsc_fractional_bpp", connector_name);
+
+	igt_debugfs_read(drmfd, file_name, buf);
+
+	return strstr(buf, check_str);
+}
+
+/*
+ * igt_get_dsc_fractional_bpp_supported:
+ * @drmfd: A drm file descriptor
+ * @connector_name: Name of the libdrm connector we're going to use
+ *
+ * Returns: DSC BPP precision supported by the sink.
+ * 	    Precision value of
+ * 		16 => 1/16
+ * 		8  => 1/8
+ * 		1  => fractional bpp not supported
+ */
+int igt_get_dsc_fractional_bpp_supported(int drmfd, char *connector_name)
+{
+	char file_name[128] = {0};
+	char buf[512];
+	char *start_loc;
+	int bpp_prec;
+
+	sprintf(file_name, "%s/i915_dsc_fec_support", connector_name);
+	igt_debugfs_read(drmfd, file_name, buf);
+
+	igt_assert(start_loc = strstr(buf, "DSC_Sink_BPP_Precision: "));
+	igt_assert_eq(sscanf(start_loc, "DSC_Sink_BPP_Precision: %d", &bpp_prec), 1);
+	igt_assert(bpp_prec > 0);
+
+	return bpp_prec;
+}
+
+/*
+ * igt_is_force_dsc_fractional_bpp_enabled:
+ * @drmfd: A drm file descriptor
+ * @connector_name: Name of the libdrm connector we're going to use
+ *
+ * Returns: True if DSC Fractional BPP is force enabled (via debugfs) for the given connector,
+ * false otherwise.
+ */
+bool igt_is_force_dsc_fractional_bpp_enabled(int drmfd, char *connector_name)
+{
+	return check_dsc_fractional_bpp_debugfs(drmfd, connector_name, "Force_DSC_Fractional_BPP_Enable: yes");
+}
+
+/*
+ * igt_force_dsc_fractional_bpp_enable:
+ * @drmfd: A drm file descriptor
+ * @connector_name: Name of the libdrm connector we're going to use
+ *
+ * Returns: 0 on success or negative error code, in case of failure.
+ */
+int igt_force_dsc_fractional_bpp_enable(int drmfd, char *connector_name)
+{
+	return write_dsc_debugfs(drmfd, connector_name, "i915_dsc_fractional_bpp", "1");
+}
+
+/*
+ * igt_get_dsc_fractional_bpp_debugfs_fd:
+ * @drmfd: A drm file descriptor
+ * @connector_name: Name of the libdrm connector we're going to use
+ *
+ * Returns: fd of the DSC Fractional BPP debugfs for the given connector,
+ * else returns -1.
+ */
+int igt_get_dsc_fractional_bpp_debugfs_fd(int drmfd, char *connector_name)
+{
+	char file_name[128] = {0};
+
+	sprintf(file_name, "%s/i915_dsc_fractional_bpp", connector_name);
+
+	return openat(igt_debugfs_dir(drmfd), file_name, O_WRONLY);
+}
lib/igt_dsc.h +5 -0
index b58743b5f..5d918ea7a 100644
@@ -8,6 +8,7 @@
 
 #include "igt_fb.h"
 #include "igt_kms.h"
+#include "igt_core.h"
 
 bool igt_is_dsc_supported_by_source(int drmfd);
 bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
@@ -21,5 +22,9 @@ bool igt_is_dsc_output_format_supported_by_sink(int drmfd, char *connector_name,
 						enum dsc_output_format output_format);
 int igt_force_dsc_output_format(int drmfd, char *connector_name,
 				enum dsc_output_format output_format);
+int igt_get_dsc_fractional_bpp_supported(int drmfd, char *connector_name);
+bool igt_is_force_dsc_fractional_bpp_enabled(int drmfd, char *connector_name);
+int igt_force_dsc_fractional_bpp_enable(int drmfd, char *connector_name);
+int igt_get_dsc_fractional_bpp_debugfs_fd(int drmfd, char *connector_name);
 
 #endif
Signature · 1 line
2.25.1
#9 lore raw

PATCH v4 8/10 tests/i915/kms_dsc: enable validation for vdsc fractional bpp

In reply to Swati Sharma

Intel hardware supports fractional bpp from display_ver >= 14. To test fractional bpp, debugfs entry (force_dsc_fractional_bpp) is introduced. From the IGT; we are setting this debugfs entry. However, before setting this debugfs entry, we are checking capability i.e. fractional bpp is supported by platform and sink both. In driver, if force_dsc_fractional_bpp is set then while iterating over output bpp with fractional step size we will continue if output_bpp is computed as integer and allow DSC iff compressed bpp is fractional.

v2: -change in igt_describe (Ankit)
v3: -rebase
v4: -add wrapper for source support of fractional bpp (Ankit)

---
 tests/i915/kms_dsc.c        | 23 ++++++++++++
 tests/i915/kms_dsc_helper.c | 71 +++++++++++++++++++++++++++++++++++++
 tests/i915/kms_dsc_helper.h |  4 +++
 3 files changed, 98 insertions(+)
tests/i915/kms_dsc.c +23 -0
index cf99e6faa..8733f13d1 100644
@@ -41,6 +41,7 @@ IGT_TEST_DESCRIPTION("Test to validate display stream compression");
 #define TEST_DSC_BPC		(1<<0)
 #define TEST_DSC_FORMAT		(1<<1)
 #define TEST_DSC_OUTPUT_FORMAT	(1<<2)
+#define TEST_DSC_FRACTIONAL_BPP (1<<3)
 
 typedef struct {
 	int drm_fd;
@@ -143,6 +144,12 @@ static void update_display(data_t *data, uint32_t test_type)
 		force_dsc_output_format(data->drm_fd, data->output, data->output_format);
 	}
 
+	if (test_type & TEST_DSC_FRACTIONAL_BPP) {
+		igt_debug("DSC fractional bpp is supported on %s\n", data->output->name);
+		save_force_dsc_fractional_bpp_en(data->drm_fd, data->output);
+		force_dsc_fractional_bpp_enable(data->drm_fd, data->output);
+	}
+
 	igt_output_set_pipe(output, data->pipe);
 	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 
@@ -202,6 +209,7 @@ static void update_display(data_t *data, uint32_t test_type)
 				enabled ? "ON" : "OFF");
 
 	restore_force_dsc_en();
+	restore_force_dsc_fractional_bpp_en();
 
 	if (test_type & TEST_DSC_BPC) {
 		current_bpc = igt_get_pipe_current_bpc(data->drm_fd, data->pipe);
@@ -250,6 +258,11 @@ static void test_dsc(data_t *data, uint32_t test_type, int bpc,
 						     data->output, data->output_format)))
 			continue;
 
+		if ((test_type & TEST_DSC_FRACTIONAL_BPP) &&
+		    (!is_dsc_fractional_bpp_supported(data->disp_ver,
+						      data->drm_fd, data->output)))
+			continue;
+
 		if (!check_gen11_dp_constraint(data->drm_fd, data->output, data->pipe))
 			continue;
 
@@ -366,6 +379,16 @@ igt_main_args("l", NULL, help_str, opt_handler, &data)
 		}
 	}
 
+	igt_describe("Tests fractional compressed bpp functionality if supported "
+		     "by a connector by forcing fractional_bpp on all connectors that support it "
+		     "with default parameter. While finding the optimum compressed bpp, driver will "
+		     "skip over the compressed bpps with integer values. It will go ahead with DSC, "
+		     "iff compressed bpp is fractional, failing in which, it will fail the commit.");
+	igt_subtest_with_dynamic("dsc-fractional-bpp")
+			test_dsc(&data, TEST_DSC_FRACTIONAL_BPP,
+				 DEFAULT_BPC, DRM_FORMAT_XRGB8888,
+				 DSC_FORMAT_RGB);
+
 	igt_fixture {
 		igt_display_fini(&data.display);
 		drm_close_driver(data.drm_fd);
tests/i915/kms_dsc_helper.c +71 -0

87 lines not on this page · raw message

tests/i915/kms_dsc_helper.h +4 -0
index 2109bd767..9af609e12 100644
@@ -34,5 +34,9 @@ void force_dsc_output_format(int drmfd, igt_output_t *output,
 			     enum dsc_output_format output_format);
 bool is_dsc_output_format_supported(int disp_ver, int drmfd, igt_output_t *output,
 				    enum dsc_output_format output_format);
+void force_dsc_fractional_bpp_enable(int drmfd, igt_output_t *output);
+void save_force_dsc_fractional_bpp_en(int drmfd, igt_output_t *output);
+void restore_force_dsc_fractional_bpp_en(void);
+bool is_dsc_fractional_bpp_supported(int disp_ver, int drmfd, igt_output_t *output);
 
 #endif
Signature · 1 line
2.25.1
#10 lore raw

PATCH v4 9/10 tests/i915/kms_dsc: add test to validate fractional bpp with input bpc

In reply to Swati Sharma

New subtest is added to validate fractional bpp with different input bpc.

---
 tests/i915/kms_dsc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
tests/i915/kms_dsc.c +10 -0
index 8733f13d1..bb6ea2133 100644
@@ -389,6 +389,16 @@ igt_main_args("l", NULL, help_str, opt_handler, &data)
 				 DEFAULT_BPC, DRM_FORMAT_XRGB8888,
 				 DSC_FORMAT_RGB);
 
+	igt_describe("Tests fractional compressed bpp functionality if supported "
+		     "by a connector by forcing fractional_bpp on all connectors that support it "
+		     "with certain input BPC for the connector.");
+	igt_subtest_with_dynamic("dsc-fractional-bpp-with-bpc") {
+		for (int j = 0; j < ARRAY_SIZE(bpc_list); j++)
+			test_dsc(&data, TEST_DSC_FRACTIONAL_BPP | TEST_DSC_BPC,
+				 bpc_list[j], DRM_FORMAT_XRGB8888,
+				 DSC_FORMAT_RGB);
+	}
+
 	igt_fixture {
 		igt_display_fini(&data.display);
 		drm_close_driver(data.drm_fd);
Signature · 1 line
2.25.1
#11 lore raw

PATCH v4 10/10 tests/i915/kms_dsc: add test summary

In reply to Swati Sharma

Add test summary giving overall summary of subtests.

v2: -drop DSC1.2 reference (Ankit)

---
 tests/i915/kms_dsc.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
tests/i915/kms_dsc.c +20 -0
index bb6ea2133..089420cc5 100644
@@ -43,6 +43,26 @@ IGT_TEST_DESCRIPTION("Test to validate display stream compression");
 #define TEST_DSC_OUTPUT_FORMAT	(1<<2)
 #define TEST_DSC_FRACTIONAL_BPP (1<<3)
 
+/*
+ * Starting from gen11, intel driver supports DSC1.1. For validating
+ * DSC, the first step is to verify if the sink supports DSC.
+ * If the sink does support DSC, we will validate the following
+ * scenarios. In all the scenarios, we are forcing dsc.
+ * (i) basic modeset (ii) input bpc (iii) pixel formats
+ * (iv) output formats (v) fractional bpp
+ * In the basic subtest, we perform modeset with default parameters.
+ * Input bpc and pixel formats subtests, we perform modeset
+ * with different input bpc (12/10/8) and pixel formats (YUV/RGB),
+ * respectively. From MTL+, we can verify fractional bpp and
+ * DSC YCBCR420 output format. The tests are executed with the
+ * RGB444 output format by default. However, in the output-format
+ * subtest, we verify output formats (RGB/YCBCR444/YCBCR420).
+ * Fractional bpp is tested with default parameter. In this,
+ * driver will ignore integer compressed bpp value and will do
+ * modeset with fractional bpp only. Also, tests are added to
+ * validate output format and fractional bpp with different input bpc.
+ */
+
 typedef struct {
 	int drm_fd;
 	uint32_t devid;
Signature · 1 line
2.25.1