All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v3] tests/i915/kms_dsc: IGT cleanup
@ 2022-05-17 11:16 Swati Sharma
  2022-05-17 12:15 ` [igt-dev] ✗ GitLab.Pipeline: warning for tests/i915/kms_dsc: IGT cleanup (rev3) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Swati Sharma @ 2022-05-17 11:16 UTC (permalink / raw)
  To: igt-dev

Remove redundant code and before starting the subtest,
clean up the states to default by igt_display_reset().
Few minor fixes in indentation. Added subtests description.

v2: -minor mistake in subtest name
    -commit was missing after reset, added
v3: -fixed styling error
    -replaced drm calls with igt wrappers

Signed-off-by: Patnana Venkata Sai <venkata.sai.patnana@intel.com>
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 lib/igt_kms.c        |   1 -
 tests/i915/kms_dsc.c | 153 ++++++++++++++++++++-----------------------
 2 files changed, 72 insertions(+), 82 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 7838ff28..50a965ad 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -5304,7 +5304,6 @@ bool igt_is_dsc_supported(int drmfd, drmModeConnector *connector)
  */
 bool igt_is_fec_supported(int drmfd, drmModeConnector *connector)
 {
-
 	return check_dsc_debugfs(drmfd, connector, "FEC_Sink_Support: yes");
 }
 
diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
index 22d2216e..31f28dcf 100644
--- a/tests/i915/kms_dsc.c
+++ b/tests/i915/kms_dsc.c
@@ -44,13 +44,16 @@
 #include <fcntl.h>
 #include <termios.h>
 
-/* currently dsc compression is verifying on 8bpc frame only */
+IGT_TEST_DESCRIPTION("Test to validate display stream compression");
+
+#define HDISPLAY_5K	5120
+
+/* currently dsc is verifed on 8bpc frame only */
 #define XRGB8888_DRM_FORMAT_MIN_BPP 8
 
-enum dsc_test_type
-{
-	test_basic_dsc_enable,
-	test_dsc_compression_bpp
+enum dsc_test_type {
+	TEST_BASIC_DSC_ENABLE,
+	TEST_DSC_COMPRESSION_BPP
 };
 
 typedef struct {
@@ -60,8 +63,6 @@ typedef struct {
 	struct igt_fb fb_test_pattern;
 	igt_output_t *output;
 	int mode_valid;
-	drmModeEncoder *encoder;
-	int crtc;
 	int compression_bpp;
 	int n_pipes;
 	enum pipe pipe;
@@ -82,7 +83,7 @@ static void force_dsc_enable(data_t *data)
 
 	igt_debug ("Forcing DSC enable on %s\n", data->conn_name);
 	ret = igt_force_dsc_enable(data->drm_fd,
-				      data->output->config.connector);
+				   data->output->config.connector);
 	igt_assert_f(ret > 0, "debugfs_write failed");
 }
 
@@ -93,8 +94,8 @@ static void force_dsc_enable_bpp(data_t *data)
 	igt_debug("Forcing DSC BPP to %d on %s\n",
 		  data->compression_bpp, data->conn_name);
 	ret = igt_force_dsc_enable_bpp(data->drm_fd,
-					  data->output->config.connector,
-					  data->compression_bpp);
+				       data->output->config.connector,
+				       data->compression_bpp);
 	igt_assert_f(ret > 0, "debugfs_write failed");
 }
 
@@ -121,19 +122,6 @@ static void restore_force_dsc_en(void)
 	force_dsc_restore_fd = -1;
 }
 
-static void test_cleanup(data_t *data)
-{
-	igt_plane_t *primary;
-
-	if (data->output) {
-		primary = igt_output_get_plane_type(data->output,
-						    DRM_PLANE_TYPE_PRIMARY);
-		igt_plane_set_fb(primary, NULL);
-		igt_output_set_pipe(data->output, PIPE_NONE);
-		igt_display_commit(&data->display);
-	}
-}
-
 static void kms_dsc_exit_handler(int sig)
 {
 	restore_force_dsc_en();
@@ -159,28 +147,24 @@ static int sort_drm_modes(const void *a, const void *b)
 	return (mode1->clock < mode2->clock) - (mode2->clock < mode1->clock);
 }
 
-static bool check_dsc_on_connector(data_t *data, uint32_t drmConnector)
+static bool check_dsc_on_connector(data_t *data, igt_output_t *output)
 {
-	drmModeConnector *connector;
-	igt_output_t *output;
+	drmModeConnector *connector = output->config.connector;
 
-	connector = drmModeGetConnectorCurrent(data->drm_fd,
-					       drmConnector);
 	if (connector->connection != DRM_MODE_CONNECTED)
 		return false;
 
-	output = igt_output_from_connector(&data->display, connector);
-
 	/*
-	 * As dsc supports >= 5k modes, we need to suppress lower
+	 * dsc supports >= 5k modes, we need to suppress lower
 	 * resolutions.
 	 */
-	qsort(output->config.connector->modes,
-	      output->config.connector->count_modes,
+	qsort(connector->modes,
+	      connector->count_modes,
 	      sizeof(drmModeModeInfo),
 	      sort_drm_modes);
-	if (output->config.connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
-	    output->config.connector->modes[0].hdisplay < 5120)
+
+	if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
+	    connector->modes[0].hdisplay < HDISPLAY_5K)
 		return NULL;
 
 	sprintf(data->conn_name, "%s-%d",
@@ -192,81 +176,86 @@ static bool check_dsc_on_connector(data_t *data, uint32_t drmConnector)
 			  data->conn_name);
 		return false;
 	}
+
 	if (is_external_panel(connector) &&
 	    !igt_is_fec_supported(data->drm_fd, connector)) {
 		igt_debug("DSC cannot be enabled without FEC on %s\n",
 			  data->conn_name);
 		return false;
 	}
+
 	data->output = output;
 	return true;
 }
 
-/*
- * Re-probe connectors and do a modeset with DSC
- *
- */
+/* re-probe connectors and do a modeset with DSC */
 static void update_display(data_t *data, enum dsc_test_type test_type)
 {
 	bool enabled;
 	igt_plane_t *primary;
+	drmModeConnector *connector = data->output->config.connector;
 
-	/* Disable the output first */
-	igt_output_set_pipe(data->output, PIPE_NONE);
+	/* sanitize the state before starting the subtest. */
+	igt_display_reset(&data->display);
 	igt_display_commit(&data->display);
 
 	igt_debug("DSC is supported on %s\n", data->conn_name);
 	save_force_dsc_en(data);
 	force_dsc_enable(data);
-	if (test_type == test_dsc_compression_bpp) {
+
+	if (test_type == TEST_DSC_COMPRESSION_BPP) {
 		igt_debug("Trying to set BPP to %d\n", data->compression_bpp);
 		force_dsc_enable_bpp(data);
 	}
 
 	igt_output_set_pipe(data->output, data->pipe);
-	qsort(data->output->config.connector->modes,
-			data->output->config.connector->count_modes,
-			sizeof(drmModeModeInfo),
-			sort_drm_modes);
-	igt_output_override_mode(data->output, &data->output->config.connector->modes[0]);
+	qsort(connector->modes,
+	      connector->count_modes,
+	      sizeof(drmModeModeInfo),
+	      sort_drm_modes);
+
+	igt_output_override_mode(data->output, &connector->modes[0]);
 	primary = igt_output_get_plane_type(data->output,
 					    DRM_PLANE_TYPE_PRIMARY);
 
-	/* Now set the output to the desired mode */
+	/* now set the output to the desired mode */
 	igt_plane_set_fb(primary, &data->fb_test_pattern);
 	igt_display_commit(&data->display);
 
 	/*
-	 * Until we have CRC check support, manually check if RGB test
+	 * until we have CRC check support, manually check if RGB test
 	 * pattern has no corruption.
 	 */
 	manual("RGB test pattern without corruption");
 
-	enabled = igt_is_dsc_enabled(data->drm_fd,
-					data->output->config.connector);
+	enabled = igt_is_dsc_enabled(data->drm_fd, connector);
 	restore_force_dsc_en();
 	igt_debug("Reset compression BPP\n");
 	data->compression_bpp = 0;
 	force_dsc_enable_bpp(data);
 
 	igt_assert_f(enabled,
-		     "Default DSC enable failed on Connector: %s Pipe: %s\n",
+		     "Default DSC enable failed on connector: %s pipe: %s\n",
 		     data->conn_name,
 		     kmstest_pipe_name(data->pipe));
+
+	igt_plane_set_fb(primary, NULL);
+	igt_output_set_pipe(data->output, PIPE_NONE);
 }
 
 static void run_test(data_t *data, enum dsc_test_type test_type)
 {
 	enum pipe pipe;
 	char test_name[10];
+	drmModeConnector *connector = data->output->config.connector;
 
-	igt_skip_on_f(test_type == test_dsc_compression_bpp &&
-		      data->output->config.connector->modes[0].hdisplay >= 5120,
+	igt_skip_on_f(test_type == TEST_DSC_COMPRESSION_BPP &&
+		      connector->modes[0].hdisplay >= HDISPLAY_5K,
 		      "bigjoiner does not support force bpp\n");
 
 	igt_create_pattern_fb(data->drm_fd,
-			      data->output->config.connector->modes[0].hdisplay,
-			      data->output->config.connector->modes[0].vdisplay,
+			      connector->modes[0].hdisplay,
+			      connector->modes[0].vdisplay,
 			      DRM_FORMAT_XRGB8888,
 			      DRM_FORMAT_MOD_LINEAR,
 			      &data->fb_test_pattern);
@@ -274,9 +263,9 @@ static void run_test(data_t *data, enum dsc_test_type test_type)
 	for_each_pipe(&data->display, pipe) {
 		uint32_t devid = intel_get_drm_devid(data->drm_fd);
 
-		if (data->output->config.connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
+		if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
 		    pipe == PIPE_A && IS_GEN11(devid)) {
-			igt_debug("DSC not supported on Pipe A on external DP in Gen11 platforms\n");
+			igt_debug("DSC not supported on pipe A on external DP in gen11 platforms\n");
 			continue;
 		}
 
@@ -284,19 +273,18 @@ static void run_test(data_t *data, enum dsc_test_type test_type)
 		if (!igt_pipe_connector_valid(pipe, data->output))
 			continue;
 
-		igt_dynamic_f("%s-pipe-%s%s", data->output->name,
-			      kmstest_pipe_name(pipe),
-			      (test_type == test_dsc_compression_bpp) ?
+		igt_dynamic_f("pipe-%s-%s%s",  kmstest_pipe_name(pipe), data->output->name,
+			     (test_type == TEST_DSC_COMPRESSION_BPP) ?
 			      test_name : "") {
 			data->pipe = pipe;
-			igt_skip_on_f((data->output->config.connector->modes[0].hdisplay >= 5120) &&
+			igt_skip_on_f((connector->modes[0].hdisplay >= HDISPLAY_5K) &&
 				      (pipe  == (data->n_pipes - 1)),
 				      "pipe-%s not supported due to bigjoiner limitation\n",
 				      kmstest_pipe_name(pipe));
 			update_display(data, test_type);
-
 		}
-		if (test_type == test_dsc_compression_bpp)
+
+		if (test_type == TEST_DSC_COMPRESSION_BPP)
 			break;
 	}
 
@@ -306,54 +294,57 @@ static void run_test(data_t *data, enum dsc_test_type test_type)
 igt_main
 {
 	data_t data = {};
-	drmModeRes *res;
-	drmModeConnector *connector = NULL;
-	int i, j;
+	igt_output_t *output;
+	int i;
+
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 		data.devid = intel_get_drm_devid(data.drm_fd);
 		kmstest_set_vt_graphics_mode();
 		igt_install_exit_handler(kms_dsc_exit_handler);
 		igt_display_require(&data.display, data.drm_fd);
-		igt_require(res = drmModeGetResources(data.drm_fd));
 		data.n_pipes = 0;
 		for_each_pipe(&data.display, i)
 			data.n_pipes++;
 	}
+
+	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");
 	igt_subtest_with_dynamic("basic-dsc-enable") {
-		for (j = 0; j < res->count_connectors; j++) {
-			if (!check_dsc_on_connector(&data, res->connectors[j]))
+		for_each_connected_output(&data.display, output) {
+			if (!check_dsc_on_connector(&data, output))
 				continue;
-			run_test(&data, test_basic_dsc_enable);
+			run_test(&data, TEST_BASIC_DSC_ENABLE);
 		}
 	}
+
 	/* currently we are validating compression bpp on XRGB8888 format only */
+	igt_describe("Tests basic display stream compression functionality if supported "
+		     "by a connector by forcing DSC on all connectors that support it "
+		     "with certain BPP as the output BPP for the connector");
 	igt_subtest_with_dynamic("XRGB8888-dsc-compression") {
 		uint32_t bpp_list[] = {
 			XRGB8888_DRM_FORMAT_MIN_BPP,
 			(XRGB8888_DRM_FORMAT_MIN_BPP  +
-			 (XRGB8888_DRM_FORMAT_MIN_BPP * 3) - 1) / 2,
+			(XRGB8888_DRM_FORMAT_MIN_BPP * 3) - 1) / 2,
 			(XRGB8888_DRM_FORMAT_MIN_BPP * 3) - 1
 		};
 
 		igt_require(intel_display_ver(data.devid) >= 13);
 
-		for (j = 0; j < res->count_connectors; j++) {
-			if (!check_dsc_on_connector(&data, res->connectors[j]))
+		for_each_connected_output(&data.display, output) {
+			if (!check_dsc_on_connector(&data, output))
 				continue;
 
-			for (i = 0; i < ARRAY_SIZE(bpp_list); i++) {
-				data.compression_bpp = bpp_list[i];
-				run_test(&data, test_dsc_compression_bpp);
+			for (int j = 0; j < ARRAY_SIZE(bpp_list); j++) {
+				data.compression_bpp = bpp_list[j];
+				run_test(&data, TEST_DSC_COMPRESSION_BPP);
 			}
 		}
 	}
 
 	igt_fixture {
-		if (connector)
-			drmModeFreeConnector(connector);
-		test_cleanup(&data);
-		drmModeFreeResources(res);
 		igt_display_fini(&data.display);
 		close(data.drm_fd);
 	}
-- 
2.25.1

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

* [igt-dev] ✗ GitLab.Pipeline: warning for tests/i915/kms_dsc: IGT cleanup (rev3)
  2022-05-17 11:16 [igt-dev] [PATCH i-g-t v3] tests/i915/kms_dsc: IGT cleanup Swati Sharma
@ 2022-05-17 12:15 ` Patchwork
  2022-05-17 12:39 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
  2022-05-17 13:12 ` [igt-dev] [PATCH i-g-t v3] tests/i915/kms_dsc: IGT cleanup Modem, Bhanuprakash
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2022-05-17 12:15 UTC (permalink / raw)
  To: Swati Sharma; +Cc: igt-dev

== Series Details ==

Series: tests/i915/kms_dsc: IGT cleanup (rev3)
URL   : https://patchwork.freedesktop.org/series/103935/
State : warning

== Summary ==

Pipeline status: FAILED.

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

test:ninja-test-mips has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/22794200):
  Ok:                   22
  Expected Fail:         3
  Fail:                289
  Unexpected Pass:       0
  Skipped:               0
  Timeout:               0
  
  Full log written to /builds/gfx-ci/igt-ci-tags/build/meson-logs/testlog.txt
  section_end:1652789482:step_script
  section_start:1652789482:upload_artifacts_on_failure
  Uploading artifacts for failed job
  Uploading artifacts...
  build: found 1725 matching files and directories   
  Uploading artifacts as "archive" to coordinator... 201 Created  id=22794200 responseStatus=201 Created token=9jnyFE7F
  section_end:1652789493:upload_artifacts_on_failure
  section_start:1652789493:cleanup_file_variables
  Cleaning up project directory and file based variables
  section_end:1652789494:cleanup_file_variables
  ERROR: Job failed: exit code 1

== Logs ==

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

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

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/kms_dsc: IGT cleanup (rev3)
  2022-05-17 11:16 [igt-dev] [PATCH i-g-t v3] tests/i915/kms_dsc: IGT cleanup Swati Sharma
  2022-05-17 12:15 ` [igt-dev] ✗ GitLab.Pipeline: warning for tests/i915/kms_dsc: IGT cleanup (rev3) Patchwork
@ 2022-05-17 12:39 ` Patchwork
  2022-05-17 13:12 ` [igt-dev] [PATCH i-g-t v3] tests/i915/kms_dsc: IGT cleanup Modem, Bhanuprakash
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2022-05-17 12:39 UTC (permalink / raw)
  To: Swati Sharma; +Cc: igt-dev

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

== Series Details ==

Series: tests/i915/kms_dsc: IGT cleanup (rev3)
URL   : https://patchwork.freedesktop.org/series/103935/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_11664 -> IGTPW_7118
====================================================

Summary
-------

  **FAILURE**

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

Participating hosts (41 -> 40)
------------------------------

  Additional (1): bat-dg2-8 
  Missing    (2): fi-hsw-4770 bat-dg2-9 

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@kms_flip@basic-flip-vs-wf_vblank@a-vga1:
    - fi-bwr-2160:        [PASS][1] -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11664/fi-bwr-2160/igt@kms_flip@basic-flip-vs-wf_vblank@a-vga1.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7118/fi-bwr-2160/igt@kms_flip@basic-flip-vs-wf_vblank@a-vga1.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@gt_engines:
    - bat-dg1-6:          [PASS][3] -> [INCOMPLETE][4] ([i915#4418])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11664/bat-dg1-6/igt@i915_selftest@live@gt_engines.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7118/bat-dg1-6/igt@i915_selftest@live@gt_engines.html

  * igt@i915_selftest@live@hangcheck:
    - bat-dg1-5:          NOTRUN -> [DMESG-FAIL][5] ([i915#4494] / [i915#4957])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7118/bat-dg1-5/igt@i915_selftest@live@hangcheck.html

  * igt@i915_suspend@basic-s2idle-without-i915:
    - bat-dg1-5:          NOTRUN -> [INCOMPLETE][6] ([i915#6011])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7118/bat-dg1-5/igt@i915_suspend@basic-s2idle-without-i915.html

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-rkl-guc:         NOTRUN -> [SKIP][7] ([fdo#111827])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7118/fi-rkl-guc/igt@kms_chamelium@common-hpd-after-suspend.html
    - fi-snb-2600:        NOTRUN -> [SKIP][8] ([fdo#109271] / [fdo#111827])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7118/fi-snb-2600/igt@kms_chamelium@common-hpd-after-suspend.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s0@smem:
    - {fi-ehl-2}:         [DMESG-WARN][9] ([i915#5122]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11664/fi-ehl-2/igt@gem_exec_suspend@basic-s0@smem.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7118/fi-ehl-2/igt@gem_exec_suspend@basic-s0@smem.html

  * igt@i915_selftest@live@gt_engines:
    - bat-dg1-5:          [INCOMPLETE][11] ([i915#4418]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11664/bat-dg1-5/igt@i915_selftest@live@gt_engines.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7118/bat-dg1-5/igt@i915_selftest@live@gt_engines.html

  * igt@i915_selftest@live@gt_lrc:
    - fi-rkl-guc:         [INCOMPLETE][13] ([i915#4983]) -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11664/fi-rkl-guc/igt@i915_selftest@live@gt_lrc.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7118/fi-rkl-guc/igt@i915_selftest@live@gt_lrc.html

  * igt@i915_selftest@live@hangcheck:
    - fi-snb-2600:        [INCOMPLETE][15] ([i915#3921]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11664/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7118/fi-snb-2600/igt@i915_selftest@live@hangcheck.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#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
  [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3547]: https://gitlab.freedesktop.org/drm/intel/issues/3547
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3576]: https://gitlab.freedesktop.org/drm/intel/issues/3576
  [i915#3595]: https://gitlab.freedesktop.org/drm/intel/issues/3595
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3921]: https://gitlab.freedesktop.org/drm/intel/issues/3921
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
  [i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
  [i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
  [i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
  [i915#4418]: https://gitlab.freedesktop.org/drm/intel/issues/4418
  [i915#4494]: https://gitlab.freedesktop.org/drm/intel/issues/4494
  [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
  [i915#4873]: https://gitlab.freedesktop.org/drm/intel/issues/4873
  [i915#4957]: https://gitlab.freedesktop.org/drm/intel/issues/4957
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#5122]: https://gitlab.freedesktop.org/drm/intel/issues/5122
  [i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
  [i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
  [i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
  [i915#5763]: https://gitlab.freedesktop.org/drm/intel/issues/5763
  [i915#5885]: https://gitlab.freedesktop.org/drm/intel/issues/5885
  [i915#5903]: https://gitlab.freedesktop.org/drm/intel/issues/5903
  [i915#5950]: https://gitlab.freedesktop.org/drm/intel/issues/5950
  [i915#6011]: https://gitlab.freedesktop.org/drm/intel/issues/6011


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

  * CI: CI-20190529 -> None
  * IGT: IGT_6476 -> IGTPW_7118

  CI-20190529: 20190529
  CI_DRM_11664: ff658f5f8e7e427556a8e6f1adc0e4519527ca95 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_7118: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7118/index.html
  IGT_6476: 08aa9296163b94cf4c529fc890ae3e90e21c3cdb @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

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

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

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

* Re: [igt-dev] [PATCH i-g-t v3] tests/i915/kms_dsc: IGT cleanup
  2022-05-17 11:16 [igt-dev] [PATCH i-g-t v3] tests/i915/kms_dsc: IGT cleanup Swati Sharma
  2022-05-17 12:15 ` [igt-dev] ✗ GitLab.Pipeline: warning for tests/i915/kms_dsc: IGT cleanup (rev3) Patchwork
  2022-05-17 12:39 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
@ 2022-05-17 13:12 ` Modem, Bhanuprakash
  2 siblings, 0 replies; 4+ messages in thread
From: Modem, Bhanuprakash @ 2022-05-17 13:12 UTC (permalink / raw)
  To: Swati Sharma, igt-dev

On Tue-17-05-2022 04:46 pm, Swati Sharma wrote:
> Remove redundant code and before starting the subtest,
> clean up the states to default by igt_display_reset().
> Few minor fixes in indentation. Added subtests description.
> 
> v2: -minor mistake in subtest name
>      -commit was missing after reset, added
> v3: -fixed styling error
>      -replaced drm calls with igt wrappers
> 
> Signed-off-by: Patnana Venkata Sai <venkata.sai.patnana@intel.com>
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>   lib/igt_kms.c        |   1 -
>   tests/i915/kms_dsc.c | 153 ++++++++++++++++++++-----------------------
>   2 files changed, 72 insertions(+), 82 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 7838ff28..50a965ad 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -5304,7 +5304,6 @@ bool igt_is_dsc_supported(int drmfd, drmModeConnector *connector)
>    */
>   bool igt_is_fec_supported(int drmfd, drmModeConnector *connector)
>   {
> -
>   	return check_dsc_debugfs(drmfd, connector, "FEC_Sink_Support: yes");
>   }
>   
> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
> index 22d2216e..31f28dcf 100644
> --- a/tests/i915/kms_dsc.c
> +++ b/tests/i915/kms_dsc.c
> @@ -44,13 +44,16 @@
>   #include <fcntl.h>
>   #include <termios.h>
>   
> -/* currently dsc compression is verifying on 8bpc frame only */
> +IGT_TEST_DESCRIPTION("Test to validate display stream compression");
> +
> +#define HDISPLAY_5K	5120
> +
> +/* currently dsc is verifed on 8bpc frame only */
>   #define XRGB8888_DRM_FORMAT_MIN_BPP 8
>   
> -enum dsc_test_type
> -{
> -	test_basic_dsc_enable,
> -	test_dsc_compression_bpp
> +enum dsc_test_type {
> +	TEST_BASIC_DSC_ENABLE,
> +	TEST_DSC_COMPRESSION_BPP
>   };
>   
>   typedef struct {
> @@ -60,8 +63,6 @@ typedef struct {
>   	struct igt_fb fb_test_pattern;
>   	igt_output_t *output;
>   	int mode_valid;
> -	drmModeEncoder *encoder;
> -	int crtc;
>   	int compression_bpp;
>   	int n_pipes;
>   	enum pipe pipe;
> @@ -82,7 +83,7 @@ static void force_dsc_enable(data_t *data)
>   
>   	igt_debug ("Forcing DSC enable on %s\n", data->conn_name);
>   	ret = igt_force_dsc_enable(data->drm_fd,
> -				      data->output->config.connector);
> +				   data->output->config.connector);
>   	igt_assert_f(ret > 0, "debugfs_write failed");
>   }
>   
> @@ -93,8 +94,8 @@ static void force_dsc_enable_bpp(data_t *data)
>   	igt_debug("Forcing DSC BPP to %d on %s\n",
>   		  data->compression_bpp, data->conn_name);
>   	ret = igt_force_dsc_enable_bpp(data->drm_fd,
> -					  data->output->config.connector,
> -					  data->compression_bpp);
> +				       data->output->config.connector,
> +				       data->compression_bpp);
>   	igt_assert_f(ret > 0, "debugfs_write failed");
>   }
>   
> @@ -121,19 +122,6 @@ static void restore_force_dsc_en(void)
>   	force_dsc_restore_fd = -1;
>   }
>   
> -static void test_cleanup(data_t *data)
> -{
> -	igt_plane_t *primary;
> -
> -	if (data->output) {
> -		primary = igt_output_get_plane_type(data->output,
> -						    DRM_PLANE_TYPE_PRIMARY);
> -		igt_plane_set_fb(primary, NULL);
> -		igt_output_set_pipe(data->output, PIPE_NONE);
> -		igt_display_commit(&data->display);
> -	}
> -}
> -
>   static void kms_dsc_exit_handler(int sig)
>   {
>   	restore_force_dsc_en();
> @@ -159,28 +147,24 @@ static int sort_drm_modes(const void *a, const void *b)
>   	return (mode1->clock < mode2->clock) - (mode2->clock < mode1->clock);
>   }
>   
> -static bool check_dsc_on_connector(data_t *data, uint32_t drmConnector)
> +static bool check_dsc_on_connector(data_t *data, igt_output_t *output)
>   {
> -	drmModeConnector *connector;
> -	igt_output_t *output;
> +	drmModeConnector *connector = output->config.connector;
>   
> -	connector = drmModeGetConnectorCurrent(data->drm_fd,
> -					       drmConnector);
>   	if (connector->connection != DRM_MODE_CONNECTED)
>   		return false;
>   
> -	output = igt_output_from_connector(&data->display, connector);
> -
>   	/*
> -	 * As dsc supports >= 5k modes, we need to suppress lower
> +	 * dsc supports >= 5k modes, we need to suppress lower
>   	 * resolutions.
>   	 */
> -	qsort(output->config.connector->modes,
> -	      output->config.connector->count_modes,
> +	qsort(connector->modes,
> +	      connector->count_modes,
>   	      sizeof(drmModeModeInfo),
>   	      sort_drm_modes);
> -	if (output->config.connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
> -	    output->config.connector->modes[0].hdisplay < 5120)
> +
> +	if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
> +	    connector->modes[0].hdisplay < HDISPLAY_5K)
>   		return NULL;
>   
>   	sprintf(data->conn_name, "%s-%d",

data->conn_name = output->name;

I think we need to use output->name wherever data->conn_name is using.
It seems, we need this cleanup in lib/igt_kms.c too.

> @@ -192,81 +176,86 @@ static bool check_dsc_on_connector(data_t *data, uint32_t drmConnector)
>   			  data->conn_name);
>   		return false;
>   	}
> +
>   	if (is_external_panel(connector) &&
>   	    !igt_is_fec_supported(data->drm_fd, connector)) {
>   		igt_debug("DSC cannot be enabled without FEC on %s\n",
>   			  data->conn_name);
>   		return false;
>   	}
> +
>   	data->output = output;
>   	return true;
>   }
>   
> -/*
> - * Re-probe connectors and do a modeset with DSC
> - *
> - */
> +/* re-probe connectors and do a modeset with DSC */
>   static void update_display(data_t *data, enum dsc_test_type test_type)
>   {
>   	bool enabled;
>   	igt_plane_t *primary;
> +	drmModeConnector *connector = data->output->config.connector;
>   
> -	/* Disable the output first */
> -	igt_output_set_pipe(data->output, PIPE_NONE);
> +	/* sanitize the state before starting the subtest. */
> +	igt_display_reset(&data->display);
>   	igt_display_commit(&data->display);
>   
>   	igt_debug("DSC is supported on %s\n", data->conn_name);
>   	save_force_dsc_en(data);
>   	force_dsc_enable(data);
> -	if (test_type == test_dsc_compression_bpp) {
> +
> +	if (test_type == TEST_DSC_COMPRESSION_BPP) {
>   		igt_debug("Trying to set BPP to %d\n", data->compression_bpp);
>   		force_dsc_enable_bpp(data);
>   	}
>   
>   	igt_output_set_pipe(data->output, data->pipe);
> -	qsort(data->output->config.connector->modes,
> -			data->output->config.connector->count_modes,
> -			sizeof(drmModeModeInfo),
> -			sort_drm_modes);
> -	igt_output_override_mode(data->output, &data->output->config.connector->modes[0]);
> +	qsort(connector->modes,
> +	      connector->count_modes,
> +	      sizeof(drmModeModeInfo),
> +	      sort_drm_modes);
> +
> +	igt_output_override_mode(data->output, &connector->modes[0]);
>   	primary = igt_output_get_plane_type(data->output,
>   					    DRM_PLANE_TYPE_PRIMARY);
>   
> -	/* Now set the output to the desired mode */
> +	/* now set the output to the desired mode */
>   	igt_plane_set_fb(primary, &data->fb_test_pattern);
>   	igt_display_commit(&data->display);
>   
>   	/*
> -	 * Until we have CRC check support, manually check if RGB test
> +	 * until we have CRC check support, manually check if RGB test
>   	 * pattern has no corruption.
>   	 */
>   	manual("RGB test pattern without corruption");
>   
> -	enabled = igt_is_dsc_enabled(data->drm_fd,
> -					data->output->config.connector);
> +	enabled = igt_is_dsc_enabled(data->drm_fd, connector);
>   	restore_force_dsc_en();
>   	igt_debug("Reset compression BPP\n");
>   	data->compression_bpp = 0;
>   	force_dsc_enable_bpp(data);
>   
>   	igt_assert_f(enabled,
> -		     "Default DSC enable failed on Connector: %s Pipe: %s\n",
> +		     "Default DSC enable failed on connector: %s pipe: %s\n",
>   		     data->conn_name,
>   		     kmstest_pipe_name(data->pipe));
> +
> +	igt_plane_set_fb(primary, NULL);
> +	igt_output_set_pipe(data->output, PIPE_NONE);

commit?

>   }
>   
>   static void run_test(data_t *data, enum dsc_test_type test_type)
>   {
>   	enum pipe pipe;
>   	char test_name[10];
> +	drmModeConnector *connector = data->output->config.connector;
>   
> -	igt_skip_on_f(test_type == test_dsc_compression_bpp &&
> -		      data->output->config.connector->modes[0].hdisplay >= 5120,
> +	igt_skip_on_f(test_type == TEST_DSC_COMPRESSION_BPP &&
> +		      connector->modes[0].hdisplay >= HDISPLAY_5K,
>   		      "bigjoiner does not support force bpp\n");
>   
>   	igt_create_pattern_fb(data->drm_fd,
> -			      data->output->config.connector->modes[0].hdisplay,
> -			      data->output->config.connector->modes[0].vdisplay,
> +			      connector->modes[0].hdisplay,
> +			      connector->modes[0].vdisplay,
>   			      DRM_FORMAT_XRGB8888,
>   			      DRM_FORMAT_MOD_LINEAR,
>   			      &data->fb_test_pattern);
> @@ -274,9 +263,9 @@ static void run_test(data_t *data, enum dsc_test_type test_type)
>   	for_each_pipe(&data->display, pipe) {
>   		uint32_t devid = intel_get_drm_devid(data->drm_fd);
>   
> -		if (data->output->config.connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
> +		if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
>   		    pipe == PIPE_A && IS_GEN11(devid)) {
> -			igt_debug("DSC not supported on Pipe A on external DP in Gen11 platforms\n");
> +			igt_debug("DSC not supported on pipe A on external DP in gen11 platforms\n");
>   			continue;
>   		}
>   
> @@ -284,19 +273,18 @@ static void run_test(data_t *data, enum dsc_test_type test_type)
>   		if (!igt_pipe_connector_valid(pipe, data->output))
>   			continue;
>   
> -		igt_dynamic_f("%s-pipe-%s%s", data->output->name,
> -			      kmstest_pipe_name(pipe),
> -			      (test_type == test_dsc_compression_bpp) ?
> +		igt_dynamic_f("pipe-%s-%s%s",  kmstest_pipe_name(pipe), data->output->name,
> +			     (test_type == TEST_DSC_COMPRESSION_BPP) ?
>   			      test_name : "") {
>   			data->pipe = pipe;
> -			igt_skip_on_f((data->output->config.connector->modes[0].hdisplay >= 5120) &&
> +			igt_skip_on_f((connector->modes[0].hdisplay >= HDISPLAY_5K) &&

Skips are not recommended in dynamic subtests, instead just don't 
trigger the test.

>   				      (pipe  == (data->n_pipes - 1)),
>   				      "pipe-%s not supported due to bigjoiner limitation\n",
>   				      kmstest_pipe_name(pipe));
>   			update_display(data, test_type);
> -
>   		}
> -		if (test_type == test_dsc_compression_bpp)
> +
> +		if (test_type == TEST_DSC_COMPRESSION_BPP)
>   			break;
>   	}
>   
> @@ -306,54 +294,57 @@ static void run_test(data_t *data, enum dsc_test_type test_type)
>   igt_main
>   {
>   	data_t data = {};
> -	drmModeRes *res;
> -	drmModeConnector *connector = NULL;
> -	int i, j;
> +	igt_output_t *output;
> +	int i;
> +
>   	igt_fixture {
>   		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
>   		data.devid = intel_get_drm_devid(data.drm_fd);
>   		kmstest_set_vt_graphics_mode();
>   		igt_install_exit_handler(kms_dsc_exit_handler);
>   		igt_display_require(&data.display, data.drm_fd);
> -		igt_require(res = drmModeGetResources(data.drm_fd));

Please add igt_display_require_output() in igt_fixture

- Bhanu

>   		data.n_pipes = 0;
>   		for_each_pipe(&data.display, i)
>   			data.n_pipes++;
>   	}
> +
> +	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");
>   	igt_subtest_with_dynamic("basic-dsc-enable") {
> -		for (j = 0; j < res->count_connectors; j++) {
> -			if (!check_dsc_on_connector(&data, res->connectors[j]))
> +		for_each_connected_output(&data.display, output) {
> +			if (!check_dsc_on_connector(&data, output))
>   				continue;
> -			run_test(&data, test_basic_dsc_enable);
> +			run_test(&data, TEST_BASIC_DSC_ENABLE);
>   		}
>   	}
> +
>   	/* currently we are validating compression bpp on XRGB8888 format only */
> +	igt_describe("Tests basic display stream compression functionality if supported "
> +		     "by a connector by forcing DSC on all connectors that support it "
> +		     "with certain BPP as the output BPP for the connector");
>   	igt_subtest_with_dynamic("XRGB8888-dsc-compression") {
>   		uint32_t bpp_list[] = {
>   			XRGB8888_DRM_FORMAT_MIN_BPP,
>   			(XRGB8888_DRM_FORMAT_MIN_BPP  +
> -			 (XRGB8888_DRM_FORMAT_MIN_BPP * 3) - 1) / 2,
> +			(XRGB8888_DRM_FORMAT_MIN_BPP * 3) - 1) / 2,
>   			(XRGB8888_DRM_FORMAT_MIN_BPP * 3) - 1
>   		};
>   
>   		igt_require(intel_display_ver(data.devid) >= 13);
>   
> -		for (j = 0; j < res->count_connectors; j++) {
> -			if (!check_dsc_on_connector(&data, res->connectors[j]))
> +		for_each_connected_output(&data.display, output) {
> +			if (!check_dsc_on_connector(&data, output))
>   				continue;
>   
> -			for (i = 0; i < ARRAY_SIZE(bpp_list); i++) {
> -				data.compression_bpp = bpp_list[i];
> -				run_test(&data, test_dsc_compression_bpp);
> +			for (int j = 0; j < ARRAY_SIZE(bpp_list); j++) {
> +				data.compression_bpp = bpp_list[j];
> +				run_test(&data, TEST_DSC_COMPRESSION_BPP);
>   			}
>   		}
>   	}
>   
>   	igt_fixture {
> -		if (connector)
> -			drmModeFreeConnector(connector);
> -		test_cleanup(&data);
> -		drmModeFreeResources(res);
>   		igt_display_fini(&data.display);
>   		close(data.drm_fd);
>   	}

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

end of thread, other threads:[~2022-05-17 13:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 11:16 [igt-dev] [PATCH i-g-t v3] tests/i915/kms_dsc: IGT cleanup Swati Sharma
2022-05-17 12:15 ` [igt-dev] ✗ GitLab.Pipeline: warning for tests/i915/kms_dsc: IGT cleanup (rev3) Patchwork
2022-05-17 12:39 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2022-05-17 13:12 ` [igt-dev] [PATCH i-g-t v3] tests/i915/kms_dsc: IGT cleanup Modem, Bhanuprakash

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.