* [igt-dev] [PATCH i-g-t 0/5] Enable VDSC output formats validation
@ 2023-01-24 6:51 Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 1/5] lib/dsc: Fix return value Swati Sharma
` (5 more replies)
0 siblings, 6 replies; 11+ messages in thread
From: Swati Sharma @ 2023-01-24 6:51 UTC (permalink / raw)
To: igt-dev
This series is split from
https://patchwork.freedesktop.org/series/111342/
Initial dsc lib related changes got merged. Received review
comments on driver debugfs YCBCR420 changes, to make debugfs
entry generic so that all supported output formats can be
validated.
In this series, review comments from above PW are addressed.
Along, with that changes are done to make test generic to
validate all supported dsc formats.
Swati Sharma (5):
lib/dsc: Fix return value
tests/i915/kms_dsc: Add plane_format as struct data_t member
tests/i915/kms_dsc: Remove pointless struct
lib/dsc: Add helpers for VDSC output format debugfs entry
tests/i915/kms_dsc: Enable validation for VDSC output formats
lib/igt_dsc.c | 61 ++++++++++++++++-
lib/igt_dsc.h | 5 ++
lib/igt_kms.c | 20 ++++++
lib/igt_kms.h | 9 +++
tests/i915/kms_dsc.c | 126 ++++++++++++++++++++++++++----------
tests/i915/kms_dsc_helper.c | 40 +++++++++++-
tests/i915/kms_dsc_helper.h | 4 ++
7 files changed, 226 insertions(+), 39 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t 1/5] lib/dsc: Fix return value
2023-01-24 6:51 [igt-dev] [PATCH i-g-t 0/5] Enable VDSC output formats validation Swati Sharma
@ 2023-01-24 6:51 ` Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 2/5] tests/i915/kms_dsc: Add plane_format as struct data_t member Swati Sharma
` (4 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Swati Sharma @ 2023-01-24 6:51 UTC (permalink / raw)
To: igt-dev
0 is usually success, < 0 is error. Fix this.
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
lib/igt_dsc.c | 7 +++++--
tests/i915/kms_dsc_helper.c | 4 ++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
index 25dcb5840..64dd6b29a 100644
--- a/lib/igt_dsc.c
+++ b/lib/igt_dsc.c
@@ -35,6 +35,9 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
close(debugfs_fd);
+ if (ret > 0)
+ return 0;
+
return ret;
}
@@ -92,7 +95,7 @@ bool igt_is_force_dsc_enabled(int drmfd, char *connector_name)
* @drmfd: A drm file descriptor
* @connector_name: Name of the libdrm connector we're going to use
*
- * Returns: 1 on success or negative error code, in case of failure.
+ * Returns: 0 on success or negative error code, in case of failure.
*/
int igt_force_dsc_enable(int drmfd, char *connector_name)
{
@@ -105,7 +108,7 @@ int igt_force_dsc_enable(int drmfd, char *connector_name)
* @connector_name: Name of the libdrm connector we're going to use
* @bpc: Input BPC
*
- * Returns: No. of bytes written or negative error code, in case of failure.
+ * Returns: 0 on success or negative error code, in case of failure.
*/
int igt_force_dsc_enable_bpc(int drmfd, char *connector_name, int bpc)
{
diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
index a80f3d787..e2c278c7a 100644
--- a/tests/i915/kms_dsc_helper.c
+++ b/tests/i915/kms_dsc_helper.c
@@ -14,7 +14,7 @@ void force_dsc_enable(int drmfd, igt_output_t *output)
igt_debug("Forcing DSC enable on %s\n", output->name);
ret = igt_force_dsc_enable(drmfd, output->name);
- igt_assert_f(ret > 0, "forcing dsc enable debugfs_write failed\n");
+ igt_assert_f(ret == 0, "forcing dsc enable debugfs_write failed\n");
}
void force_dsc_enable_bpc(int drmfd, igt_output_t *output, int input_bpc)
@@ -24,7 +24,7 @@ void force_dsc_enable_bpc(int drmfd, igt_output_t *output, int input_bpc)
igt_debug("Forcing input DSC BPC to %d on %s\n",
input_bpc, output->name);
ret = igt_force_dsc_enable_bpc(drmfd, output->name, input_bpc);
- igt_assert_f(ret > 0, "forcing input dsc bpc debugfs_write failed\n");
+ igt_assert_f(ret == 0, "forcing input dsc bpc debugfs_write failed\n");
}
void save_force_dsc_en(int drmfd, igt_output_t *output)
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t 2/5] tests/i915/kms_dsc: Add plane_format as struct data_t member
2023-01-24 6:51 [igt-dev] [PATCH i-g-t 0/5] Enable VDSC output formats validation Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 1/5] lib/dsc: Fix return value Swati Sharma
@ 2023-01-24 6:51 ` Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 3/5] tests/i915/kms_dsc: Remove pointless struct Swati Sharma
` (3 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Swati Sharma @ 2023-01-24 6:51 UTC (permalink / raw)
To: igt-dev
plane_format is added as struct data_t member. Also, corresponding
changes are done to accommodate this change.
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
tests/i915/kms_dsc.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
index 8f32ae950..af9466518 100644
--- a/tests/i915/kms_dsc.c
+++ b/tests/i915/kms_dsc.c
@@ -44,6 +44,7 @@ typedef struct {
uint32_t devid;
igt_display_t display;
struct igt_fb fb_test_pattern;
+ unsigned int plane_format;
igt_output_t *output;
int input_bpc;
int n_pipes;
@@ -108,7 +109,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, unsigned int plane_format)
+static void update_display(data_t *data, enum dsc_test_type test_type)
{
bool enabled;
igt_plane_t *primary;
@@ -137,13 +138,13 @@ static void update_display(data_t *data, enum dsc_test_type test_type, unsigned
primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
- igt_skip_on(!igt_plane_has_format_mod(primary, plane_format,
+ igt_skip_on(!igt_plane_has_format_mod(primary, data->plane_format,
DRM_FORMAT_MOD_LINEAR));
igt_create_pattern_fb(data->drm_fd,
mode->hdisplay,
mode->vdisplay,
- plane_format,
+ data->plane_format,
DRM_FORMAT_MOD_LINEAR,
&data->fb_test_pattern);
@@ -184,6 +185,7 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
enum pipe pipe;
for_each_pipe_with_valid_output(display, pipe, output) {
+ data->plane_format = plane_format;
data->input_bpc = bpc;
data->output = output;
data->pipe = pipe;
@@ -201,12 +203,12 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
continue;
if (test_type == TEST_DSC_BPC)
- snprintf(name, sizeof(name), "-%dbpc-%s", data->input_bpc, igt_format_str(plane_format));
+ snprintf(name, sizeof(name), "-%dbpc-%s", data->input_bpc, igt_format_str(data->plane_format));
else
- snprintf(name, sizeof(name), "-%s", igt_format_str(plane_format));
+ snprintf(name, sizeof(name), "-%s", igt_format_str(data->plane_format));
igt_dynamic_f("pipe-%s-%s%s", kmstest_pipe_name(data->pipe), data->output->name, name)
- update_display(data, test_type, plane_format);
+ update_display(data, test_type);
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t 3/5] tests/i915/kms_dsc: Remove pointless struct
2023-01-24 6:51 [igt-dev] [PATCH i-g-t 0/5] Enable VDSC output formats validation Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 1/5] lib/dsc: Fix return value Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 2/5] tests/i915/kms_dsc: Add plane_format as struct data_t member Swati Sharma
@ 2023-01-24 6:51 ` Swati Sharma
2023-01-24 10:47 ` Hogander, Jouni
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 4/5] lib/dsc: Add helpers for VDSC output format debugfs entry Swati Sharma
` (2 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Swati Sharma @ 2023-01-24 6:51 UTC (permalink / raw)
To: igt-dev
Array can be used for plane_format. Use that and remove
struct.
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
tests/i915/kms_dsc.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
index af9466518..62df87636 100644
--- a/tests/i915/kms_dsc.c
+++ b/tests/i915/kms_dsc.c
@@ -52,16 +52,7 @@ typedef struct {
enum pipe pipe;
} data_t;
-const struct {
- const int format;
- const char format_str[20];
-} format_list[] = {
- {DRM_FORMAT_XYUV8888, "XYUV8888"},
- {DRM_FORMAT_XRGB2101010, "XRGB2101010"},
- {DRM_FORMAT_XRGB16161616F, "XRGB16161616F"},
- {DRM_FORMAT_YUYV, "YUYV"},
-};
-
+int format_list[] = {DRM_FORMAT_XYUV8888, DRM_FORMAT_XRGB2101010, DRM_FORMAT_XRGB16161616F, DRM_FORMAT_YUYV};
uint32_t bpc_list[] = {12, 10, 8};
static inline void manual(const char *expected)
@@ -242,7 +233,7 @@ igt_main
"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, format_list[k].format);
+ test_dsc(&data, TEST_DSC_BASIC, 0, format_list[k]);
}
igt_describe("Tests basic display stream compression functionality if supported "
@@ -259,7 +250,7 @@ igt_main
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].format);
+ test_dsc(&data, TEST_DSC_BPC, bpc_list[j], format_list[k]);
}
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t 4/5] lib/dsc: Add helpers for VDSC output format debugfs entry
2023-01-24 6:51 [igt-dev] [PATCH i-g-t 0/5] Enable VDSC output formats validation Swati Sharma
` (2 preceding siblings ...)
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 3/5] tests/i915/kms_dsc: Remove pointless struct Swati Sharma
@ 2023-01-24 6:51 ` Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 5/5] tests/i915/kms_dsc: Enable validation for VDSC output formats Swati Sharma
2023-01-24 7:36 ` [igt-dev] ✗ Fi.CI.BAT: failure for Enable VDSC output formats validation Patchwork
5 siblings, 0 replies; 11+ messages in thread
From: Swati Sharma @ 2023-01-24 6:51 UTC (permalink / raw)
To: igt-dev
Helper functions are added for VDSC output format debugfs entry.
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
lib/igt_dsc.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
lib/igt_dsc.h | 5 +++++
lib/igt_kms.h | 8 ++++++++
3 files changed, 67 insertions(+)
diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
index 64dd6b29a..6c4ffae26 100644
--- a/lib/igt_dsc.c
+++ b/lib/igt_dsc.c
@@ -134,3 +134,57 @@ int igt_get_dsc_debugfs_fd(int drmfd, char *connector_name)
return openat(igt_debugfs_dir(drmfd), file_name, O_WRONLY);
}
+
+/*
+ * igt_is_dsc_output_format_supported_by_sink:
+ * @drmfd: A drm file descriptor
+ * @connector_name: Name of the libdrm connector we're going to use
+ * @output_format: Output format
+ *
+ * Returns: True if DSC output format is supported for the given connector,
+ * false otherwise.
+ */
+bool igt_is_dsc_output_format_supported_by_sink(int drmfd, char *connector_name,
+ enum dsc_output_format output_format)
+{
+ const char *check_str = "OUTPUTFORMATNOTFOUND";
+
+ switch(output_format) {
+ case DSC_FORMAT_DEFAULT:
+ return true;
+ case DSC_FORMAT_RGB:
+ check_str = "RGB: yes";
+ break;
+ case DSC_FORMAT_YCBCR420:
+ check_str = "YCBCR420: yes";
+ break;
+ case DSC_FORMAT_YCBCR422:
+ check_str = "YCBCR422: yes";
+ break;
+ case DSC_FORMAT_YCBCR444:
+ check_str = "YCBCR444: yes";
+ break;
+ default:
+ break;
+ }
+
+ return check_dsc_debugfs(drmfd, connector_name, check_str);
+}
+
+/*
+ * igt_force_dsc_output_format:
+ * @drmfd: A drm file descriptor
+ * @connector_name: Name of the libdrm connector we're going to use
+ * @output_format: Output format
+ *
+ * Returns: 0 on success or negative error code, in case of failure.
+ */
+int igt_force_dsc_output_format(int drmfd, char *connector_name,
+ enum dsc_output_format output_format)
+{
+ char buf[20] = {0};
+
+ sprintf(buf, "%d", output_format);
+
+ return write_dsc_debugfs(drmfd, connector_name, "i915_dsc_output_format", buf);
+}
diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
index 291c2cdea..9608aad44 100644
--- a/lib/igt_dsc.h
+++ b/lib/igt_dsc.h
@@ -7,6 +7,7 @@
#define IGT_DSC_H
#include "igt_fb.h"
+#include "igt_kms.h"
bool igt_is_dsc_supported(int drmfd, char *connector_name);
bool igt_is_fec_supported(int drmfd, char *connector_name);
@@ -15,5 +16,9 @@ bool igt_is_force_dsc_enabled(int drmfd, char *connector_name);
int igt_force_dsc_enable(int drmfd, char *connector_name);
int igt_force_dsc_enable_bpc(int drmfd, char *connector_name, int bpc);
int igt_get_dsc_debugfs_fd(int drmfd, char *connector_name);
+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);
#endif
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index be5482e08..d677d39f9 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -106,6 +106,14 @@ enum igt_custom_edid_type {
*/
#define kmstest_port_name(port) ((port) + 'A')
+enum dsc_output_format {
+ DSC_FORMAT_DEFAULT,
+ DSC_FORMAT_RGB,
+ DSC_FORMAT_YCBCR420,
+ DSC_FORMAT_YCBCR422,
+ DSC_FORMAT_YCBCR444
+};
+
const char *kmstest_encoder_type_str(int type);
const char *kmstest_connector_status_str(int status);
const char *kmstest_connector_type_str(int type);
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] [PATCH i-g-t 5/5] tests/i915/kms_dsc: Enable validation for VDSC output formats
2023-01-24 6:51 [igt-dev] [PATCH i-g-t 0/5] Enable VDSC output formats validation Swati Sharma
` (3 preceding siblings ...)
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 4/5] lib/dsc: Add helpers for VDSC output format debugfs entry Swati Sharma
@ 2023-01-24 6:51 ` Swati Sharma
2023-01-24 10:53 ` Hogander, Jouni
2023-01-24 7:36 ` [igt-dev] ✗ Fi.CI.BAT: failure for Enable VDSC output formats validation Patchwork
5 siblings, 1 reply; 11+ messages in thread
From: Swati Sharma @ 2023-01-24 6:51 UTC (permalink / raw)
To: igt-dev
Existing i-g-t is extended to enable validation for VDSC output formats. Output
format is selected as per driver policy. For ex: If a mode is supported
in both RGB and YCbCr420 output formats by the sink, i915 driver policy is
to try RGB first and fall back to YCbCr420, if mode cannot be shown using RGB.
To test DSC output format, a debugfs entry is created to force this output format.
However, before setting debugfs entry, we have checked capability i.e. output
format is supported by both platform and sink.
Also, each mode doesn't support all output formats; so if both sink and platform
support an output format, we will do a try commit with each mode till we get a
successful commit.
v2: -used is_dsc_ycbcr420_supported() (Ankit)
-handled try-commit correctly (Ankit)
-instead of flag use enum for output formats (Ankit)
v3: -instead of global count, pass count as para (Ankit)
-print output format (Ankit)
v4: -optimized while loop (Jouni)
-used only try commit (Jouni)
-fixed get_next_mode() (Jouni)
v5: -made generic test to validate all output formats (Jani N)
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
lib/igt_kms.c | 20 +++++++
lib/igt_kms.h | 1 +
tests/i915/kms_dsc.c | 103 +++++++++++++++++++++++++++++-------
tests/i915/kms_dsc_helper.c | 36 +++++++++++++
tests/i915/kms_dsc_helper.h | 4 ++
5 files changed, 144 insertions(+), 20 deletions(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 31e6dfda0..bbdcf97f1 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -966,6 +966,26 @@ const char *kmstest_scaling_filter_str(int filter)
return find_type_name(scaling_filter_names, filter);
}
+static const struct type_name dsc_output_format_names[] = {
+ { DSC_FORMAT_DEFAULT, "DEFAULT" },
+ { DSC_FORMAT_RGB, "RGB" },
+ { DSC_FORMAT_YCBCR420, "YCBCR420" },
+ { DSC_FORMAT_YCBCR422, "YCBCR422" },
+ { DSC_FORMAT_YCBCR444, "YCBCR444" },
+ {}
+};
+
+/**
+ * kmstest_dsc_output_format_str:
+ * @output_format: DSC_FORMAT_* output format value
+ *
+ * Returns: A string representing the output format @output format.
+ */
+const char *kmstest_dsc_output_format_str(int output_format)
+{
+ return find_type_name(dsc_output_format_names, output_format);
+}
+
static const struct type_name connector_type_names[] = {
{ DRM_MODE_CONNECTOR_Unknown, "Unknown" },
{ DRM_MODE_CONNECTOR_VGA, "VGA" },
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index d677d39f9..5b48409f4 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -118,6 +118,7 @@ const char *kmstest_encoder_type_str(int type);
const char *kmstest_connector_status_str(int status);
const char *kmstest_connector_type_str(int type);
const char *kmstest_scaling_filter_str(int filter);
+const char *kmstest_dsc_output_format_str(int output_format);
void kmstest_dump_mode(drmModeModeInfo *mode);
#define MAX_HDISPLAY_PER_PIPE 5120
diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
index 62df87636..99aeb7ddc 100644
--- a/tests/i915/kms_dsc.c
+++ b/tests/i915/kms_dsc.c
@@ -36,7 +36,8 @@ IGT_TEST_DESCRIPTION("Test to validate display stream compression");
enum dsc_test_type {
TEST_DSC_BASIC,
- TEST_DSC_BPC
+ TEST_DSC_BPC,
+ TEST_DSC_OUTPUT_FORMAT
};
typedef struct {
@@ -44,6 +45,7 @@ typedef struct {
uint32_t devid;
igt_display_t display;
struct igt_fb fb_test_pattern;
+ enum dsc_output_format output_format;
unsigned int plane_format;
igt_output_t *output;
int input_bpc;
@@ -52,6 +54,7 @@ typedef struct {
enum pipe pipe;
} data_t;
+int output_format_list[] = {DSC_FORMAT_DEFAULT, DSC_FORMAT_RGB, DSC_FORMAT_YCBCR420, DSC_FORMAT_YCBCR444};
int format_list[] = {DRM_FORMAT_XYUV8888, DRM_FORMAT_XRGB2101010, DRM_FORMAT_XRGB16161616F, DRM_FORMAT_YUYV};
uint32_t bpc_list[] = {12, 10, 8};
@@ -72,6 +75,17 @@ static drmModeModeInfo *get_highres_mode(igt_output_t *output)
return highest_mode;
}
+static drmModeModeInfo *get_next_mode(igt_output_t *output, int index)
+{
+ drmModeConnector *connector = output->config.connector;
+ drmModeModeInfo *next_mode = NULL;
+
+ if (index < connector->count_modes)
+ next_mode = &connector->modes[index];
+
+ return next_mode;
+}
+
static bool check_big_joiner_pipe_constraint(data_t *data)
{
igt_output_t *output = data->output;
@@ -102,7 +116,9 @@ 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)
{
+ int ret;
bool enabled;
+ int index = 0;
igt_plane_t *primary;
drmModeModeInfo *mode;
igt_output_t *output = data->output;
@@ -121,26 +137,47 @@ static void update_display(data_t *data, enum dsc_test_type test_type)
force_dsc_enable_bpc(data->drm_fd, data->output, data->input_bpc);
}
- igt_output_set_pipe(output, data->pipe);
-
- mode = get_highres_mode(output);
- igt_require(mode != NULL);
- igt_output_override_mode(output, mode);
+ 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);
+ }
+ igt_output_set_pipe(output, data->pipe);
primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
igt_skip_on(!igt_plane_has_format_mod(primary, data->plane_format,
DRM_FORMAT_MOD_LINEAR));
- igt_create_pattern_fb(data->drm_fd,
- mode->hdisplay,
- mode->vdisplay,
- data->plane_format,
- DRM_FORMAT_MOD_LINEAR,
- &data->fb_test_pattern);
+ do {
+ if (data->output_format == DSC_FORMAT_DEFAULT) {
+ mode = get_highres_mode(output);
+ } else {
+ mode = get_next_mode(output, index);
+ index++;
+ }
- igt_plane_set_fb(primary, &data->fb_test_pattern);
- igt_display_commit(display);
+ igt_require(mode != NULL);
+ igt_output_override_mode(output, mode);
+
+ igt_create_pattern_fb(data->drm_fd,
+ mode->hdisplay,
+ mode->vdisplay,
+ data->plane_format,
+ DRM_FORMAT_MOD_LINEAR,
+ &data->fb_test_pattern);
+ igt_plane_set_fb(primary, &data->fb_test_pattern);
+
+ ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+ if (data->output_format != DSC_FORMAT_DEFAULT && ret != 0) {
+ igt_remove_fb(data->drm_fd, &data->fb_test_pattern);
+ continue;
+ } else {
+ break;
+ }
+ } while(1);
+
+ igt_assert_eq(ret, 0);
/* until we have CRC check support, manually check if RGB test
* pattern has no corruption.
@@ -155,10 +192,15 @@ static void update_display(data_t *data, enum dsc_test_type test_type)
enabled ? "ON" : "OFF");
restore_force_dsc_en();
- igt_debug("Reset compression BPC\n");
+
+ igt_debug("Reset input BPC\n");
data->input_bpc = 0;
force_dsc_enable_bpc(data->drm_fd, data->output, data->input_bpc);
+ igt_debug("Reset DSC output format\n");
+ data->output_format = DSC_FORMAT_DEFAULT;
+ force_dsc_output_format(data->drm_fd, data->output, data->output_format);
+
igt_assert_f(enabled,
"Default DSC enable failed on connector: %s pipe: %s\n",
output->name,
@@ -168,7 +210,7 @@ static void update_display(data_t *data, enum dsc_test_type test_type)
}
static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
- unsigned int plane_format)
+ unsigned int plane_format, enum dsc_output_format output_format)
{
igt_display_t *display = &data->display;
igt_output_t *output;
@@ -176,6 +218,7 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
enum pipe pipe;
for_each_pipe_with_valid_output(display, pipe, output) {
+ data->output_format = output_format;
data->plane_format = plane_format;
data->input_bpc = bpc;
data->output = output;
@@ -184,6 +227,10 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
if (!check_dsc_on_connector(data->drm_fd, data->output))
continue;
+ if (!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))
continue;
@@ -195,6 +242,9 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
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));
@@ -226,14 +276,16 @@ igt_main
"by a connector by forcing DSC on all connectors that support it "
"with default parameters");
igt_subtest_with_dynamic("basic-dsc")
- test_dsc(&data, TEST_DSC_BASIC, 0, DRM_FORMAT_XRGB8888);
+ test_dsc(&data, TEST_DSC_BASIC, 0,
+ DRM_FORMAT_XRGB8888, DSC_FORMAT_DEFAULT);
igt_describe("Tests basic display stream compression functionality if supported "
"by a connector by forcing DSC on all connectors that support it "
"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, format_list[k]);
+ test_dsc(&data, TEST_DSC_BASIC, 0,
+ format_list[k], DSC_FORMAT_DEFAULT);
}
igt_describe("Tests basic display stream compression functionality if supported "
@@ -241,7 +293,8 @@ igt_main
"with certain input BPC for the connector");
igt_subtest_with_dynamic("dsc-with-bpc") {
for (int j = 0; j < ARRAY_SIZE(bpc_list); j++)
- test_dsc(&data, TEST_DSC_BPC, bpc_list[j], DRM_FORMAT_XRGB8888);
+ test_dsc(&data, TEST_DSC_BPC, bpc_list[j],
+ DRM_FORMAT_XRGB8888, DSC_FORMAT_DEFAULT);
}
igt_describe("Tests basic display stream compression functionality if supported "
@@ -250,11 +303,21 @@ igt_main
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]);
+ test_dsc(&data, TEST_DSC_BPC, bpc_list[j],
+ format_list[k], DSC_FORMAT_DEFAULT);
}
}
}
+ 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");
+ 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,
+ output_format_list[k]);
+ }
+
igt_fixture {
igt_display_fini(&data.display);
close(data.drm_fd);
diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
index e2c278c7a..c70b7aae8 100644
--- a/tests/i915/kms_dsc_helper.c
+++ b/tests/i915/kms_dsc_helper.c
@@ -97,3 +97,39 @@ bool check_gen11_bpc_constraint(int drmfd, igt_output_t *output, int input_bpc)
return true;
}
+
+void force_dsc_output_format(int drmfd, igt_output_t *output,
+ enum dsc_output_format output_format)
+{
+ int ret;
+
+ igt_debug("Forcing DSC %s output format on %s\n",
+ kmstest_dsc_output_format_str(output_format), output->name);
+ ret = igt_force_dsc_output_format(drmfd, output->name, output_format);
+ igt_assert_f(ret > 0, "forcing dsc output format debugfs_write failed\n");
+}
+
+/* YCbCr420 DSC is supported on display version 14+ with DSC1.2a */
+static bool is_dsc_output_format_supported_by_platform(int disp_ver, enum dsc_output_format output_format)
+{
+ if (disp_ver < 14 && output_format == DSC_FORMAT_YCBCR420) {
+ igt_debug("Ouput format DSC YCBCR420 supported on D14+ platforms\n");
+ return false;
+ }
+
+ return true;
+}
+
+bool is_dsc_output_format_supported(int disp_ver, int drmfd, igt_output_t *output,
+ enum dsc_output_format output_format)
+{
+ if (!(igt_is_dsc_output_format_supported_by_sink(drmfd, output->name, output_format)) &&
+ (is_dsc_output_format_supported_by_platform(disp_ver, output_format))) {
+ igt_debug("DSC %s output format not supported on connector %s\n",
+ kmstest_dsc_output_format_str(output_format),
+ output->name);
+ return false;
+ }
+
+ return true;
+}
diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
index fe479dac4..244293cd0 100644
--- a/tests/i915/kms_dsc_helper.h
+++ b/tests/i915/kms_dsc_helper.h
@@ -31,5 +31,9 @@ void kms_dsc_exit_handler(int sig);
bool check_dsc_on_connector(int drmfd, igt_output_t *output);
bool check_gen11_dp_constraint(int drmfd, igt_output_t *output, enum pipe pipe);
bool check_gen11_bpc_constraint(int drmfd, igt_output_t *output, int input_bpc);
+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);
#endif
--
2.25.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for Enable VDSC output formats validation
2023-01-24 6:51 [igt-dev] [PATCH i-g-t 0/5] Enable VDSC output formats validation Swati Sharma
` (4 preceding siblings ...)
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 5/5] tests/i915/kms_dsc: Enable validation for VDSC output formats Swati Sharma
@ 2023-01-24 7:36 ` Patchwork
5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2023-01-24 7:36 UTC (permalink / raw)
To: Swati Sharma; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 7871 bytes --]
== Series Details ==
Series: Enable VDSC output formats validation
URL : https://patchwork.freedesktop.org/series/113253/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_12625 -> IGTPW_8396
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_8396 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_8396, 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_8396/index.html
Participating hosts (39 -> 38)
------------------------------
Additional (1): fi-kbl-soraka
Missing (2): fi-bsw-kefka fi-snb-2520m
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_8396:
### IGT changes ###
#### Possible regressions ####
* igt@kms_cursor_legacy@basic-flip-after-cursor@atomic-transitions-varying-size:
- fi-kbl-soraka: NOTRUN -> [FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/fi-kbl-soraka/igt@kms_cursor_legacy@basic-flip-after-cursor@atomic-transitions-varying-size.html
Known issues
------------
Here are the changes found in IGTPW_8396 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_gttfill@basic:
- fi-pnv-d510: [PASS][2] -> [FAIL][3] ([i915#7229])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12625/fi-pnv-d510/igt@gem_exec_gttfill@basic.html
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/fi-pnv-d510/igt@gem_exec_gttfill@basic.html
* igt@gem_huc_copy@huc-copy:
- fi-kbl-soraka: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#2190])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/fi-kbl-soraka/igt@gem_huc_copy@huc-copy.html
* igt@gem_lmem_swapping@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][5] ([fdo#109271] / [i915#4613]) +3 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/fi-kbl-soraka/igt@gem_lmem_swapping@basic.html
* igt@i915_module_load@load:
- fi-ctg-p8600: [PASS][6] -> [DMESG-WARN][7] ([i915#6020])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12625/fi-ctg-p8600/igt@i915_module_load@load.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/fi-ctg-p8600/igt@i915_module_load@load.html
* igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][8] ([i915#1886])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html
* igt@i915_selftest@live@slpc:
- fi-kbl-soraka: NOTRUN -> [INCOMPLETE][9] ([i915#7913])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/fi-kbl-soraka/igt@i915_selftest@live@slpc.html
* igt@kms_chamelium_frames@hdmi-crc-fast:
- fi-kbl-soraka: NOTRUN -> [SKIP][10] ([fdo#109271]) +15 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/fi-kbl-soraka/igt@kms_chamelium_frames@hdmi-crc-fast.html
* igt@kms_chamelium_hpd@common-hpd-after-suspend:
- fi-rkl-guc: NOTRUN -> [SKIP][11] ([i915#7828])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/fi-rkl-guc/igt@kms_chamelium_hpd@common-hpd-after-suspend.html
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s0@smem:
- {bat-rpls-1}: [DMESG-WARN][12] ([i915#7359] / [i915#7625]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12625/bat-rpls-1/igt@gem_exec_suspend@basic-s0@smem.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/bat-rpls-1/igt@gem_exec_suspend@basic-s0@smem.html
* igt@i915_selftest@live@gt_lrc:
- fi-rkl-guc: [INCOMPLETE][14] ([i915#4983]) -> [PASS][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12625/fi-rkl-guc/igt@i915_selftest@live@gt_lrc.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/fi-rkl-guc/igt@i915_selftest@live@gt_lrc.html
* igt@i915_selftest@live@gt_mocs:
- {bat-rpls-2}: [DMESG-FAIL][16] ([i915#7059]) -> [PASS][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12625/bat-rpls-2/igt@i915_selftest@live@gt_mocs.html
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/bat-rpls-2/igt@i915_selftest@live@gt_mocs.html
* igt@i915_selftest@live@migrate:
- {bat-dg2-11}: [DMESG-WARN][18] ([i915#2867]) -> [PASS][19] +4 similar issues
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12625/bat-dg2-11/igt@i915_selftest@live@migrate.html
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/bat-dg2-11/igt@i915_selftest@live@migrate.html
* igt@i915_selftest@live@requests:
- {bat-rplp-1}: [INCOMPLETE][20] ([i915#7609]) -> [PASS][21]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12625/bat-rplp-1/igt@i915_selftest@live@requests.html
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/bat-rplp-1/igt@i915_selftest@live@requests.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#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#6020]: https://gitlab.freedesktop.org/drm/intel/issues/6020
[i915#6257]: https://gitlab.freedesktop.org/drm/intel/issues/6257
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
[i915#7059]: https://gitlab.freedesktop.org/drm/intel/issues/7059
[i915#7229]: https://gitlab.freedesktop.org/drm/intel/issues/7229
[i915#7359]: https://gitlab.freedesktop.org/drm/intel/issues/7359
[i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
[i915#7609]: https://gitlab.freedesktop.org/drm/intel/issues/7609
[i915#7625]: https://gitlab.freedesktop.org/drm/intel/issues/7625
[i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7134 -> IGTPW_8396
CI-20190529: 20190529
CI_DRM_12625: 6a023df4443d313724dc96d1fff15193bb7ec5b8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8396: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/index.html
IGT_7134: 61b8c0a0c8a9611c47749c0b1a262843892cccd7 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Testlist changes
----------------
+igt@kms_dsc@dsc-with-output-formats
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8396/index.html
[-- Attachment #2: Type: text/html, Size: 7878 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 3/5] tests/i915/kms_dsc: Remove pointless struct
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 3/5] tests/i915/kms_dsc: Remove pointless struct Swati Sharma
@ 2023-01-24 10:47 ` Hogander, Jouni
2023-01-24 10:51 ` Swati Sharma
0 siblings, 1 reply; 11+ messages in thread
From: Hogander, Jouni @ 2023-01-24 10:47 UTC (permalink / raw)
To: igt-dev@lists.freedesktop.org, Sharma, Swati2
On Tue, 2023-01-24 at 12:21 +0530, Swati Sharma wrote:
> Array can be used for plane_format. Use that and remove
> struct.
>
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
> tests/i915/kms_dsc.c | 15 +++------------
> 1 file changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
> index af9466518..62df87636 100644
> --- a/tests/i915/kms_dsc.c
> +++ b/tests/i915/kms_dsc.c
> @@ -52,16 +52,7 @@ typedef struct {
> enum pipe pipe;
> } data_t;
>
> -const struct {
> - const int format;
> - const char format_str[20];
> -} format_list[] = {
> - {DRM_FORMAT_XYUV8888, "XYUV8888"},
> - {DRM_FORMAT_XRGB2101010, "XRGB2101010"},
> - {DRM_FORMAT_XRGB16161616F, "XRGB16161616F"},
> - {DRM_FORMAT_YUYV, "YUYV"},
> -};
> -
> +int format_list[] = {DRM_FORMAT_XYUV8888, DRM_FORMAT_XRGB2101010,
> DRM_FORMAT_XRGB16161616F, DRM_FORMAT_YUYV};
> uint32_t bpc_list[] = {12, 10, 8};
I think format_list should be static. Not matter of this patch, but
maybe you could change bpc_list as a static too.
>
> static inline void manual(const char *expected)
> @@ -242,7 +233,7 @@ igt_main
> "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,
> format_list[k].format);
> + test_dsc(&data, TEST_DSC_BASIC, 0,
> format_list[k]);
> }
>
> igt_describe("Tests basic display stream compression
> functionality if supported "
> @@ -259,7 +250,7 @@ igt_main
> 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].format);
> + test_dsc(&data, TEST_DSC_BPC,
> bpc_list[j], format_list[k]);
> }
> }
> }
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 3/5] tests/i915/kms_dsc: Remove pointless struct
2023-01-24 10:47 ` Hogander, Jouni
@ 2023-01-24 10:51 ` Swati Sharma
0 siblings, 0 replies; 11+ messages in thread
From: Swati Sharma @ 2023-01-24 10:51 UTC (permalink / raw)
To: Hogander, Jouni, igt-dev@lists.freedesktop.org
On 24-Jan-23 4:17 PM, Hogander, Jouni wrote:
> On Tue, 2023-01-24 at 12:21 +0530, Swati Sharma wrote:
>> Array can be used for plane_format. Use that and remove
>> struct.
>>
>> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>> ---
>> tests/i915/kms_dsc.c | 15 +++------------
>> 1 file changed, 3 insertions(+), 12 deletions(-)
>>
>> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
>> index af9466518..62df87636 100644
>> --- a/tests/i915/kms_dsc.c
>> +++ b/tests/i915/kms_dsc.c
>> @@ -52,16 +52,7 @@ typedef struct {
>> enum pipe pipe;
>> } data_t;
>>
>> -const struct {
>> - const int format;
>> - const char format_str[20];
>> -} format_list[] = {
>> - {DRM_FORMAT_XYUV8888, "XYUV8888"},
>> - {DRM_FORMAT_XRGB2101010, "XRGB2101010"},
>> - {DRM_FORMAT_XRGB16161616F, "XRGB16161616F"},
>> - {DRM_FORMAT_YUYV, "YUYV"},
>> -};
>> -
>> +int format_list[] = {DRM_FORMAT_XYUV8888, DRM_FORMAT_XRGB2101010,
>> DRM_FORMAT_XRGB16161616F, DRM_FORMAT_YUYV};
>> uint32_t bpc_list[] = {12, 10, 8};
>
> I think format_list should be static. Not matter of this patch, but
> maybe you could change bpc_list as a static too.
>
Right, will make that change.
>>
>> static inline void manual(const char *expected)
>> @@ -242,7 +233,7 @@ igt_main
>> "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,
>> format_list[k].format);
>> + test_dsc(&data, TEST_DSC_BASIC, 0,
>> format_list[k]);
>> }
>>
>> igt_describe("Tests basic display stream compression
>> functionality if supported "
>> @@ -259,7 +250,7 @@ igt_main
>> 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].format);
>> + test_dsc(&data, TEST_DSC_BPC,
>> bpc_list[j], format_list[k]);
>> }
>> }
>> }
>
--
~Swati Sharma
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 5/5] tests/i915/kms_dsc: Enable validation for VDSC output formats
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 5/5] tests/i915/kms_dsc: Enable validation for VDSC output formats Swati Sharma
@ 2023-01-24 10:53 ` Hogander, Jouni
2023-01-24 11:32 ` Swati Sharma
0 siblings, 1 reply; 11+ messages in thread
From: Hogander, Jouni @ 2023-01-24 10:53 UTC (permalink / raw)
To: igt-dev@lists.freedesktop.org, Sharma, Swati2
On Tue, 2023-01-24 at 12:21 +0530, Swati Sharma wrote:
> Existing i-g-t is extended to enable validation for VDSC output
> formats. Output
> format is selected as per driver policy. For ex: If a mode is
> supported
> in both RGB and YCbCr420 output formats by the sink, i915 driver
> policy is
> to try RGB first and fall back to YCbCr420, if mode cannot be shown
> using RGB.
>
> To test DSC output format, a debugfs entry is created to force this
> output format.
> However, before setting debugfs entry, we have checked capability
> i.e. output
> format is supported by both platform and sink.
>
> Also, each mode doesn't support all output formats; so if both sink
> and platform
> support an output format, we will do a try commit with each mode till
> we get a
> successful commit.
>
> v2: -used is_dsc_ycbcr420_supported() (Ankit)
> -handled try-commit correctly (Ankit)
> -instead of flag use enum for output formats (Ankit)
> v3: -instead of global count, pass count as para (Ankit)
> -print output format (Ankit)
> v4: -optimized while loop (Jouni)
> -used only try commit (Jouni)
> -fixed get_next_mode() (Jouni)
> v5: -made generic test to validate all output formats (Jani N)
>
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
> lib/igt_kms.c | 20 +++++++
> lib/igt_kms.h | 1 +
> tests/i915/kms_dsc.c | 103 +++++++++++++++++++++++++++++-----
> --
> tests/i915/kms_dsc_helper.c | 36 +++++++++++++
> tests/i915/kms_dsc_helper.h | 4 ++
> 5 files changed, 144 insertions(+), 20 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 31e6dfda0..bbdcf97f1 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -966,6 +966,26 @@ const char *kmstest_scaling_filter_str(int
> filter)
> return find_type_name(scaling_filter_names, filter);
> }
>
> +static const struct type_name dsc_output_format_names[] = {
> + { DSC_FORMAT_DEFAULT, "DEFAULT" },
> + { DSC_FORMAT_RGB, "RGB" },
> + { DSC_FORMAT_YCBCR420, "YCBCR420" },
> + { DSC_FORMAT_YCBCR422, "YCBCR422" },
> + { DSC_FORMAT_YCBCR444, "YCBCR444" },
> + {}
> +};
> +
> +/**
> + * kmstest_dsc_output_format_str:
> + * @output_format: DSC_FORMAT_* output format value
> + *
> + * Returns: A string representing the output format @output format.
> + */
> +const char *kmstest_dsc_output_format_str(int output_format)
> +{
> + return find_type_name(dsc_output_format_names,
> output_format);
> +}
> +
> static const struct type_name connector_type_names[] = {
> { DRM_MODE_CONNECTOR_Unknown, "Unknown" },
> { DRM_MODE_CONNECTOR_VGA, "VGA" },
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index d677d39f9..5b48409f4 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -118,6 +118,7 @@ const char *kmstest_encoder_type_str(int type);
> const char *kmstest_connector_status_str(int status);
> const char *kmstest_connector_type_str(int type);
> const char *kmstest_scaling_filter_str(int filter);
> +const char *kmstest_dsc_output_format_str(int output_format);
>
> void kmstest_dump_mode(drmModeModeInfo *mode);
> #define MAX_HDISPLAY_PER_PIPE 5120
> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
> index 62df87636..99aeb7ddc 100644
> --- a/tests/i915/kms_dsc.c
> +++ b/tests/i915/kms_dsc.c
> @@ -36,7 +36,8 @@ IGT_TEST_DESCRIPTION("Test to validate display
> stream compression");
>
> enum dsc_test_type {
> TEST_DSC_BASIC,
> - TEST_DSC_BPC
> + TEST_DSC_BPC,
> + TEST_DSC_OUTPUT_FORMAT
> };
>
> typedef struct {
> @@ -44,6 +45,7 @@ typedef struct {
> uint32_t devid;
> igt_display_t display;
> struct igt_fb fb_test_pattern;
> + enum dsc_output_format output_format;
> unsigned int plane_format;
> igt_output_t *output;
> int input_bpc;
> @@ -52,6 +54,7 @@ typedef struct {
> enum pipe pipe;
> } data_t;
>
> +int output_format_list[] = {DSC_FORMAT_DEFAULT, DSC_FORMAT_RGB,
> DSC_FORMAT_YCBCR420, DSC_FORMAT_YCBCR444};
static
> int format_list[] = {DRM_FORMAT_XYUV8888, DRM_FORMAT_XRGB2101010,
> DRM_FORMAT_XRGB16161616F, DRM_FORMAT_YUYV};
> uint32_t bpc_list[] = {12, 10, 8};
>
> @@ -72,6 +75,17 @@ static drmModeModeInfo
> *get_highres_mode(igt_output_t *output)
> return highest_mode;
> }
>
> +static drmModeModeInfo *get_next_mode(igt_output_t *output, int
> index)
> +{
> + drmModeConnector *connector = output->config.connector;
> + drmModeModeInfo *next_mode = NULL;
> +
> + if (index < connector->count_modes)
> + next_mode = &connector->modes[index];
> +
> + return next_mode;
> +}
> +
> static bool check_big_joiner_pipe_constraint(data_t *data)
> {
> igt_output_t *output = data->output;
> @@ -102,7 +116,9 @@ 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)
> {
> + int ret;
> bool enabled;
> + int index = 0;
> igt_plane_t *primary;
> drmModeModeInfo *mode;
> igt_output_t *output = data->output;
> @@ -121,26 +137,47 @@ static void update_display(data_t *data, enum
> dsc_test_type test_type)
> force_dsc_enable_bpc(data->drm_fd, data->output,
> data->input_bpc);
> }
>
> - igt_output_set_pipe(output, data->pipe);
> -
> - mode = get_highres_mode(output);
> - igt_require(mode != NULL);
> - igt_output_override_mode(output, mode);
> + 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);
> + }
>
> + igt_output_set_pipe(output, data->pipe);
> primary = igt_output_get_plane_type(output,
> DRM_PLANE_TYPE_PRIMARY);
>
> igt_skip_on(!igt_plane_has_format_mod(primary, data-
> >plane_format,
> DRM_FORMAT_MOD_LINEAR));
>
> - igt_create_pattern_fb(data->drm_fd,
> - mode->hdisplay,
> - mode->vdisplay,
> - data->plane_format,
> - DRM_FORMAT_MOD_LINEAR,
> - &data->fb_test_pattern);
> + do {
> + if (data->output_format == DSC_FORMAT_DEFAULT) {
> + mode = get_highres_mode(output);
> + } else {
> + mode = get_next_mode(output, index);
> + index++;
> + }
>
> - igt_plane_set_fb(primary, &data->fb_test_pattern);
> - igt_display_commit(display);
> + igt_require(mode != NULL);
> + igt_output_override_mode(output, mode);
> +
> + igt_create_pattern_fb(data->drm_fd,
> + mode->hdisplay,
> + mode->vdisplay,
> + data->plane_format,
> + DRM_FORMAT_MOD_LINEAR,
> + &data->fb_test_pattern);
> + igt_plane_set_fb(primary, &data->fb_test_pattern);
> +
> + ret = igt_display_try_commit_atomic(display,
> DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> + if (data->output_format != DSC_FORMAT_DEFAULT && ret
> != 0) {
> + igt_remove_fb(data->drm_fd, &data-
> >fb_test_pattern);
> + continue;
> + } else {
> + break;
> + }
> + } while(1);
> +
> + igt_assert_eq(ret, 0);
>
> /* until we have CRC check support, manually check if RGB
> test
> * pattern has no corruption.
> @@ -155,10 +192,15 @@ static void update_display(data_t *data, enum
> dsc_test_type test_type)
> enabled ? "ON" : "OFF");
>
> restore_force_dsc_en();
> - igt_debug("Reset compression BPC\n");
> +
> + igt_debug("Reset input BPC\n");
> data->input_bpc = 0;
> force_dsc_enable_bpc(data->drm_fd, data->output, data-
> >input_bpc);
>
> + igt_debug("Reset DSC output format\n");
> + data->output_format = DSC_FORMAT_DEFAULT;
> + force_dsc_output_format(data->drm_fd, data->output, data-
> >output_format);
> +
> igt_assert_f(enabled,
> "Default DSC enable failed on connector: %s
> pipe: %s\n",
> output->name,
> @@ -168,7 +210,7 @@ static void update_display(data_t *data, enum
> dsc_test_type test_type)
> }
>
> static void test_dsc(data_t *data, enum dsc_test_type test_type, int
> bpc,
> - unsigned int plane_format)
> + unsigned int plane_format, enum
> dsc_output_format output_format)
> {
> igt_display_t *display = &data->display;
> igt_output_t *output;
> @@ -176,6 +218,7 @@ static void test_dsc(data_t *data, enum
> dsc_test_type test_type, int bpc,
> enum pipe pipe;
>
> for_each_pipe_with_valid_output(display, pipe, output) {
> + data->output_format = output_format;
> data->plane_format = plane_format;
> data->input_bpc = bpc;
> data->output = output;
> @@ -184,6 +227,10 @@ static void test_dsc(data_t *data, enum
> dsc_test_type test_type, int bpc,
> if (!check_dsc_on_connector(data->drm_fd, data-
> >output))
> continue;
>
> + if (!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))
> continue;
>
> @@ -195,6 +242,9 @@ static void test_dsc(data_t *data, enum
> dsc_test_type test_type, int bpc,
>
> 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));
>
> @@ -226,14 +276,16 @@ igt_main
> "by a connector by forcing DSC on all connectors
> that support it "
> "with default parameters");
> igt_subtest_with_dynamic("basic-dsc")
> - test_dsc(&data, TEST_DSC_BASIC, 0,
> DRM_FORMAT_XRGB8888);
> + test_dsc(&data, TEST_DSC_BASIC, 0,
> + DRM_FORMAT_XRGB8888,
> DSC_FORMAT_DEFAULT);
>
> igt_describe("Tests basic display stream compression
> functionality if supported "
> "by a connector by forcing DSC on all connectors
> that support it "
> "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,
> format_list[k]);
> + test_dsc(&data, TEST_DSC_BASIC, 0,
> + format_list[k], DSC_FORMAT_DEFAULT);
> }
>
> igt_describe("Tests basic display stream compression
> functionality if supported "
> @@ -241,7 +293,8 @@ igt_main
> "with certain input BPC for the connector");
> igt_subtest_with_dynamic("dsc-with-bpc") {
> for (int j = 0; j < ARRAY_SIZE(bpc_list); j++)
> - test_dsc(&data, TEST_DSC_BPC, bpc_list[j],
> DRM_FORMAT_XRGB8888);
> + test_dsc(&data, TEST_DSC_BPC, bpc_list[j],
> + DRM_FORMAT_XRGB8888,
> DSC_FORMAT_DEFAULT);
> }
>
> igt_describe("Tests basic display stream compression
> functionality if supported "
> @@ -250,11 +303,21 @@ igt_main
> 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]);
> + test_dsc(&data, TEST_DSC_BPC,
> bpc_list[j],
> + format_list[k], DSC_FORMAT_DEFAULT);
> }
> }
> }
>
> + 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");
> + 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,
> + output_format_list[k]);
> + }
> +
> igt_fixture {
> igt_display_fini(&data.display);
> close(data.drm_fd);
> diff --git a/tests/i915/kms_dsc_helper.c
> b/tests/i915/kms_dsc_helper.c
> index e2c278c7a..c70b7aae8 100644
> --- a/tests/i915/kms_dsc_helper.c
> +++ b/tests/i915/kms_dsc_helper.c
> @@ -97,3 +97,39 @@ bool check_gen11_bpc_constraint(int drmfd,
> igt_output_t *output, int input_bpc)
>
> return true;
> }
> +
> +void force_dsc_output_format(int drmfd, igt_output_t *output,
> + enum dsc_output_format output_format)
> +{
> + int ret;
> +
> + igt_debug("Forcing DSC %s output format on %s\n",
> + kmstest_dsc_output_format_str(output_format),
> output->name);
> + ret = igt_force_dsc_output_format(drmfd, output->name,
> output_format);
> + igt_assert_f(ret > 0, "forcing dsc output format
> debugfs_write failed\n");
Isn't it !ret or ret == 0 as you did earlier?
> +}
> +
> +/* YCbCr420 DSC is supported on display version 14+ with DSC1.2a */
> +static bool is_dsc_output_format_supported_by_platform(int disp_ver,
> enum dsc_output_format output_format)
> +{
> + if (disp_ver < 14 && output_format == DSC_FORMAT_YCBCR420) {
> + igt_debug("Ouput format DSC YCBCR420 supported on
> D14+ platforms\n");
> + return false;
> + }
> +
> + return true;
> +}
> +
> +bool is_dsc_output_format_supported(int disp_ver, int drmfd,
> igt_output_t *output,
> + enum dsc_output_format
> output_format)
> +{
> + if (!(igt_is_dsc_output_format_supported_by_sink(drmfd,
> output->name, output_format)) &&
> + (is_dsc_output_format_supported_by_platform(disp_ver,
> output_format))) {
> + igt_debug("DSC %s output format not supported on
> connector %s\n",
> +
> kmstest_dsc_output_format_str(output_format),
> + output->name);
> + return false;
> + }
> +
> + return true;
> +}
> diff --git a/tests/i915/kms_dsc_helper.h
> b/tests/i915/kms_dsc_helper.h
> index fe479dac4..244293cd0 100644
> --- a/tests/i915/kms_dsc_helper.h
> +++ b/tests/i915/kms_dsc_helper.h
> @@ -31,5 +31,9 @@ void kms_dsc_exit_handler(int sig);
> bool check_dsc_on_connector(int drmfd, igt_output_t *output);
> bool check_gen11_dp_constraint(int drmfd, igt_output_t *output, enum
> pipe pipe);
> bool check_gen11_bpc_constraint(int drmfd, igt_output_t *output, int
> input_bpc);
> +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);
>
> #endif
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 5/5] tests/i915/kms_dsc: Enable validation for VDSC output formats
2023-01-24 10:53 ` Hogander, Jouni
@ 2023-01-24 11:32 ` Swati Sharma
0 siblings, 0 replies; 11+ messages in thread
From: Swati Sharma @ 2023-01-24 11:32 UTC (permalink / raw)
To: Hogander, Jouni, igt-dev@lists.freedesktop.org
On 24-Jan-23 4:23 PM, Hogander, Jouni wrote:
> On Tue, 2023-01-24 at 12:21 +0530, Swati Sharma wrote:
>> Existing i-g-t is extended to enable validation for VDSC output
>> formats. Output
>> format is selected as per driver policy. For ex: If a mode is
>> supported
>> in both RGB and YCbCr420 output formats by the sink, i915 driver
>> policy is
>> to try RGB first and fall back to YCbCr420, if mode cannot be shown
>> using RGB.
>>
>> To test DSC output format, a debugfs entry is created to force this
>> output format.
>> However, before setting debugfs entry, we have checked capability
>> i.e. output
>> format is supported by both platform and sink.
>>
>> Also, each mode doesn't support all output formats; so if both sink
>> and platform
>> support an output format, we will do a try commit with each mode till
>> we get a
>> successful commit.
>>
>> v2: -used is_dsc_ycbcr420_supported() (Ankit)
>> -handled try-commit correctly (Ankit)
>> -instead of flag use enum for output formats (Ankit)
>> v3: -instead of global count, pass count as para (Ankit)
>> -print output format (Ankit)
>> v4: -optimized while loop (Jouni)
>> -used only try commit (Jouni)
>> -fixed get_next_mode() (Jouni)
>> v5: -made generic test to validate all output formats (Jani N)
>>
>> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>> ---
>> lib/igt_kms.c | 20 +++++++
>> lib/igt_kms.h | 1 +
>> tests/i915/kms_dsc.c | 103 +++++++++++++++++++++++++++++-----
>> --
>> tests/i915/kms_dsc_helper.c | 36 +++++++++++++
>> tests/i915/kms_dsc_helper.h | 4 ++
>> 5 files changed, 144 insertions(+), 20 deletions(-)
>>
>> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
>> index 31e6dfda0..bbdcf97f1 100644
>> --- a/lib/igt_kms.c
>> +++ b/lib/igt_kms.c
>> @@ -966,6 +966,26 @@ const char *kmstest_scaling_filter_str(int
>> filter)
>> return find_type_name(scaling_filter_names, filter);
>> }
>>
>> +static const struct type_name dsc_output_format_names[] = {
>> + { DSC_FORMAT_DEFAULT, "DEFAULT" },
>> + { DSC_FORMAT_RGB, "RGB" },
>> + { DSC_FORMAT_YCBCR420, "YCBCR420" },
>> + { DSC_FORMAT_YCBCR422, "YCBCR422" },
>> + { DSC_FORMAT_YCBCR444, "YCBCR444" },
>> + {}
>> +};
>> +
>> +/**
>> + * kmstest_dsc_output_format_str:
>> + * @output_format: DSC_FORMAT_* output format value
>> + *
>> + * Returns: A string representing the output format @output format.
>> + */
>> +const char *kmstest_dsc_output_format_str(int output_format)
>> +{
>> + return find_type_name(dsc_output_format_names,
>> output_format);
>> +}
>> +
>> static const struct type_name connector_type_names[] = {
>> { DRM_MODE_CONNECTOR_Unknown, "Unknown" },
>> { DRM_MODE_CONNECTOR_VGA, "VGA" },
>> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
>> index d677d39f9..5b48409f4 100644
>> --- a/lib/igt_kms.h
>> +++ b/lib/igt_kms.h
>> @@ -118,6 +118,7 @@ const char *kmstest_encoder_type_str(int type);
>> const char *kmstest_connector_status_str(int status);
>> const char *kmstest_connector_type_str(int type);
>> const char *kmstest_scaling_filter_str(int filter);
>> +const char *kmstest_dsc_output_format_str(int output_format);
>>
>> void kmstest_dump_mode(drmModeModeInfo *mode);
>> #define MAX_HDISPLAY_PER_PIPE 5120
>> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
>> index 62df87636..99aeb7ddc 100644
>> --- a/tests/i915/kms_dsc.c
>> +++ b/tests/i915/kms_dsc.c
>> @@ -36,7 +36,8 @@ IGT_TEST_DESCRIPTION("Test to validate display
>> stream compression");
>>
>> enum dsc_test_type {
>> TEST_DSC_BASIC,
>> - TEST_DSC_BPC
>> + TEST_DSC_BPC,
>> + TEST_DSC_OUTPUT_FORMAT
>> };
>>
>> typedef struct {
>> @@ -44,6 +45,7 @@ typedef struct {
>> uint32_t devid;
>> igt_display_t display;
>> struct igt_fb fb_test_pattern;
>> + enum dsc_output_format output_format;
>> unsigned int plane_format;
>> igt_output_t *output;
>> int input_bpc;
>> @@ -52,6 +54,7 @@ typedef struct {
>> enum pipe pipe;
>> } data_t;
>>
>> +int output_format_list[] = {DSC_FORMAT_DEFAULT, DSC_FORMAT_RGB,
>> DSC_FORMAT_YCBCR420, DSC_FORMAT_YCBCR444};
>
> static
>
>> int format_list[] = {DRM_FORMAT_XYUV8888, DRM_FORMAT_XRGB2101010,
>> DRM_FORMAT_XRGB16161616F, DRM_FORMAT_YUYV};
>> uint32_t bpc_list[] = {12, 10, 8};
>>
>> @@ -72,6 +75,17 @@ static drmModeModeInfo
>> *get_highres_mode(igt_output_t *output)
>> return highest_mode;
>> }
>>
>> +static drmModeModeInfo *get_next_mode(igt_output_t *output, int
>> index)
>> +{
>> + drmModeConnector *connector = output->config.connector;
>> + drmModeModeInfo *next_mode = NULL;
>> +
>> + if (index < connector->count_modes)
>> + next_mode = &connector->modes[index];
>> +
>> + return next_mode;
>> +}
>> +
>> static bool check_big_joiner_pipe_constraint(data_t *data)
>> {
>> igt_output_t *output = data->output;
>> @@ -102,7 +116,9 @@ 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)
>> {
>> + int ret;
>> bool enabled;
>> + int index = 0;
>> igt_plane_t *primary;
>> drmModeModeInfo *mode;
>> igt_output_t *output = data->output;
>> @@ -121,26 +137,47 @@ static void update_display(data_t *data, enum
>> dsc_test_type test_type)
>> force_dsc_enable_bpc(data->drm_fd, data->output,
>> data->input_bpc);
>> }
>>
>> - igt_output_set_pipe(output, data->pipe);
>> -
>> - mode = get_highres_mode(output);
>> - igt_require(mode != NULL);
>> - igt_output_override_mode(output, mode);
>> + 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);
>> + }
>>
>> + igt_output_set_pipe(output, data->pipe);
>> primary = igt_output_get_plane_type(output,
>> DRM_PLANE_TYPE_PRIMARY);
>>
>> igt_skip_on(!igt_plane_has_format_mod(primary, data-
>>> plane_format,
>> DRM_FORMAT_MOD_LINEAR));
>>
>> - igt_create_pattern_fb(data->drm_fd,
>> - mode->hdisplay,
>> - mode->vdisplay,
>> - data->plane_format,
>> - DRM_FORMAT_MOD_LINEAR,
>> - &data->fb_test_pattern);
>> + do {
>> + if (data->output_format == DSC_FORMAT_DEFAULT) {
>> + mode = get_highres_mode(output);
>> + } else {
>> + mode = get_next_mode(output, index);
>> + index++;
>> + }
>>
>> - igt_plane_set_fb(primary, &data->fb_test_pattern);
>> - igt_display_commit(display);
>> + igt_require(mode != NULL);
>> + igt_output_override_mode(output, mode);
>> +
>> + igt_create_pattern_fb(data->drm_fd,
>> + mode->hdisplay,
>> + mode->vdisplay,
>> + data->plane_format,
>> + DRM_FORMAT_MOD_LINEAR,
>> + &data->fb_test_pattern);
>> + igt_plane_set_fb(primary, &data->fb_test_pattern);
>> +
>> + ret = igt_display_try_commit_atomic(display,
>> DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>> + if (data->output_format != DSC_FORMAT_DEFAULT && ret
>> != 0) {
>> + igt_remove_fb(data->drm_fd, &data-
>>> fb_test_pattern);
>> + continue;
>> + } else {
>> + break;
>> + }
>> + } while(1);
>> +
>> + igt_assert_eq(ret, 0);
>>
>> /* until we have CRC check support, manually check if RGB
>> test
>> * pattern has no corruption.
>> @@ -155,10 +192,15 @@ static void update_display(data_t *data, enum
>> dsc_test_type test_type)
>> enabled ? "ON" : "OFF");
>>
>> restore_force_dsc_en();
>> - igt_debug("Reset compression BPC\n");
>> +
>> + igt_debug("Reset input BPC\n");
>> data->input_bpc = 0;
>> force_dsc_enable_bpc(data->drm_fd, data->output, data-
>>> input_bpc);
>>
>> + igt_debug("Reset DSC output format\n");
>> + data->output_format = DSC_FORMAT_DEFAULT;
>> + force_dsc_output_format(data->drm_fd, data->output, data-
>>> output_format);
>> +
>> igt_assert_f(enabled,
>> "Default DSC enable failed on connector: %s
>> pipe: %s\n",
>> output->name,
>> @@ -168,7 +210,7 @@ static void update_display(data_t *data, enum
>> dsc_test_type test_type)
>> }
>>
>> static void test_dsc(data_t *data, enum dsc_test_type test_type, int
>> bpc,
>> - unsigned int plane_format)
>> + unsigned int plane_format, enum
>> dsc_output_format output_format)
>> {
>> igt_display_t *display = &data->display;
>> igt_output_t *output;
>> @@ -176,6 +218,7 @@ static void test_dsc(data_t *data, enum
>> dsc_test_type test_type, int bpc,
>> enum pipe pipe;
>>
>> for_each_pipe_with_valid_output(display, pipe, output) {
>> + data->output_format = output_format;
>> data->plane_format = plane_format;
>> data->input_bpc = bpc;
>> data->output = output;
>> @@ -184,6 +227,10 @@ static void test_dsc(data_t *data, enum
>> dsc_test_type test_type, int bpc,
>> if (!check_dsc_on_connector(data->drm_fd, data-
>>> output))
>> continue;
>>
>> + if (!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))
>> continue;
>>
>> @@ -195,6 +242,9 @@ static void test_dsc(data_t *data, enum
>> dsc_test_type test_type, int bpc,
>>
>> 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));
>>
>> @@ -226,14 +276,16 @@ igt_main
>> "by a connector by forcing DSC on all connectors
>> that support it "
>> "with default parameters");
>> igt_subtest_with_dynamic("basic-dsc")
>> - test_dsc(&data, TEST_DSC_BASIC, 0,
>> DRM_FORMAT_XRGB8888);
>> + test_dsc(&data, TEST_DSC_BASIC, 0,
>> + DRM_FORMAT_XRGB8888,
>> DSC_FORMAT_DEFAULT);
>>
>> igt_describe("Tests basic display stream compression
>> functionality if supported "
>> "by a connector by forcing DSC on all connectors
>> that support it "
>> "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,
>> format_list[k]);
>> + test_dsc(&data, TEST_DSC_BASIC, 0,
>> + format_list[k], DSC_FORMAT_DEFAULT);
>> }
>>
>> igt_describe("Tests basic display stream compression
>> functionality if supported "
>> @@ -241,7 +293,8 @@ igt_main
>> "with certain input BPC for the connector");
>> igt_subtest_with_dynamic("dsc-with-bpc") {
>> for (int j = 0; j < ARRAY_SIZE(bpc_list); j++)
>> - test_dsc(&data, TEST_DSC_BPC, bpc_list[j],
>> DRM_FORMAT_XRGB8888);
>> + test_dsc(&data, TEST_DSC_BPC, bpc_list[j],
>> + DRM_FORMAT_XRGB8888,
>> DSC_FORMAT_DEFAULT);
>> }
>>
>> igt_describe("Tests basic display stream compression
>> functionality if supported "
>> @@ -250,11 +303,21 @@ igt_main
>> 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]);
>> + test_dsc(&data, TEST_DSC_BPC,
>> bpc_list[j],
>> + format_list[k], DSC_FORMAT_DEFAULT);
>> }
>> }
>> }
>>
>> + 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");
>> + 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,
>> + output_format_list[k]);
>> + }
>> +
>> igt_fixture {
>> igt_display_fini(&data.display);
>> close(data.drm_fd);
>> diff --git a/tests/i915/kms_dsc_helper.c
>> b/tests/i915/kms_dsc_helper.c
>> index e2c278c7a..c70b7aae8 100644
>> --- a/tests/i915/kms_dsc_helper.c
>> +++ b/tests/i915/kms_dsc_helper.c
>> @@ -97,3 +97,39 @@ bool check_gen11_bpc_constraint(int drmfd,
>> igt_output_t *output, int input_bpc)
>>
>> return true;
>> }
>> +
>> +void force_dsc_output_format(int drmfd, igt_output_t *output,
>> + enum dsc_output_format output_format)
>> +{
>> + int ret;
>> +
>> + igt_debug("Forcing DSC %s output format on %s\n",
>> + kmstest_dsc_output_format_str(output_format),
>> output->name);
>> + ret = igt_force_dsc_output_format(drmfd, output->name,
>> output_format);
>> + igt_assert_f(ret > 0, "forcing dsc output format
>> debugfs_write failed\n");
>
> Isn't it !ret or ret == 0 as you did earlier?
Yes, it should be changed. Missed by mistake.
>
>> +}
>> +
>> +/* YCbCr420 DSC is supported on display version 14+ with DSC1.2a */
>> +static bool is_dsc_output_format_supported_by_platform(int disp_ver,
>> enum dsc_output_format output_format)
>> +{
>> + if (disp_ver < 14 && output_format == DSC_FORMAT_YCBCR420) {
>> + igt_debug("Ouput format DSC YCBCR420 supported on
>> D14+ platforms\n");
>> + return false;
>> + }
>> +
>> + return true;
>> +}
>> +
>> +bool is_dsc_output_format_supported(int disp_ver, int drmfd,
>> igt_output_t *output,
>> + enum dsc_output_format
>> output_format)
>> +{
>> + if (!(igt_is_dsc_output_format_supported_by_sink(drmfd,
>> output->name, output_format)) &&
>> + (is_dsc_output_format_supported_by_platform(disp_ver,
>> output_format))) {
>> + igt_debug("DSC %s output format not supported on
>> connector %s\n",
>> +
>> kmstest_dsc_output_format_str(output_format),
>> + output->name);
>> + return false;
>> + }
>> +
>> + return true;
>> +}
>> diff --git a/tests/i915/kms_dsc_helper.h
>> b/tests/i915/kms_dsc_helper.h
>> index fe479dac4..244293cd0 100644
>> --- a/tests/i915/kms_dsc_helper.h
>> +++ b/tests/i915/kms_dsc_helper.h
>> @@ -31,5 +31,9 @@ void kms_dsc_exit_handler(int sig);
>> bool check_dsc_on_connector(int drmfd, igt_output_t *output);
>> bool check_gen11_dp_constraint(int drmfd, igt_output_t *output, enum
>> pipe pipe);
>> bool check_gen11_bpc_constraint(int drmfd, igt_output_t *output, int
>> input_bpc);
>> +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);
>>
>> #endif
>
--
~Swati Sharma
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-01-24 11:32 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-24 6:51 [igt-dev] [PATCH i-g-t 0/5] Enable VDSC output formats validation Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 1/5] lib/dsc: Fix return value Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 2/5] tests/i915/kms_dsc: Add plane_format as struct data_t member Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 3/5] tests/i915/kms_dsc: Remove pointless struct Swati Sharma
2023-01-24 10:47 ` Hogander, Jouni
2023-01-24 10:51 ` Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 4/5] lib/dsc: Add helpers for VDSC output format debugfs entry Swati Sharma
2023-01-24 6:51 ` [igt-dev] [PATCH i-g-t 5/5] tests/i915/kms_dsc: Enable validation for VDSC output formats Swati Sharma
2023-01-24 10:53 ` Hogander, Jouni
2023-01-24 11:32 ` Swati Sharma
2023-01-24 7:36 ` [igt-dev] ✗ Fi.CI.BAT: failure for Enable VDSC output formats validation Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox