Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability
@ 2023-05-31  6:54 Swati Sharma
  2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t 1/3] tests: s/igt_is_dsc_supported/igt_is_dsc_supported_by_sink Swati Sharma
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Swati Sharma @ 2023-05-31  6:54 UTC (permalink / raw)
  To: igt-dev

Instead of assuming dsc is supported gen11+, lets use has_dsc
flag in i915_capability to check h/w support.

Swati Sharma (3):
  tests: s/igt_is_dsc_supported/igt_is_dsc_supported_by_sink
  tests: s/check_dsc_on_connector/is_dsc_supported_by_sink
  tests: add igt_is_dsc_supported_by_source()

 lib/igt_dsc.c               | 28 +++++++++++++++++++++++++---
 lib/igt_dsc.h               |  3 ++-
 tests/i915/kms_dsc.c        |  4 ++--
 tests/i915/kms_dsc_helper.c | 14 ++++++++++++--
 tests/i915/kms_dsc_helper.h |  3 ++-
 tests/i915/kms_psr2_sf.c    |  2 +-
 tests/kms_invalid_mode.c    |  5 ++---
 7 files changed, 46 insertions(+), 13 deletions(-)

-- 
2.25.1

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

* [igt-dev] [PATCH i-g-t 1/3] tests: s/igt_is_dsc_supported/igt_is_dsc_supported_by_sink
  2023-05-31  6:54 [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability Swati Sharma
@ 2023-05-31  6:54 ` Swati Sharma
  2023-06-01 13:48   ` Kamil Konieczny
  2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t 2/3] tests: s/check_dsc_on_connector/is_dsc_supported_by_sink Swati Sharma
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Swati Sharma @ 2023-05-31  6:54 UTC (permalink / raw)
  To: igt-dev

Rename helper.

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 lib/igt_dsc.c               | 6 +++---
 lib/igt_dsc.h               | 2 +-
 tests/i915/kms_dsc_helper.c | 2 +-
 tests/kms_invalid_mode.c    | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
index 9e1ab9b1..6cbd8bae 100644
--- a/lib/igt_dsc.c
+++ b/lib/igt_dsc.c
@@ -42,13 +42,13 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
 }
 
 /*
- * igt_is_dsc_supported:
+ * igt_is_dsc_supported_by_sink:
  * @drmfd: A drm file descriptor
  * @connector_name: Name of the libdrm connector we're going to use
  *
- * Returns: True if DSC is supported for the given connector, false otherwise.
+ * Returns: True if DSC is supported for the given connector/sink, false otherwise.
  */
-bool igt_is_dsc_supported(int drmfd, char *connector_name)
+bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name)
 {
 	return check_dsc_debugfs(drmfd, connector_name, "DSC_Sink_Support: yes");
 }
diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
index 9608aad4..241fc0ac 100644
--- a/lib/igt_dsc.h
+++ b/lib/igt_dsc.h
@@ -9,7 +9,7 @@
 #include "igt_fb.h"
 #include "igt_kms.h"
 
-bool igt_is_dsc_supported(int drmfd, char *connector_name);
+bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
 bool igt_is_fec_supported(int drmfd, char *connector_name);
 bool igt_is_dsc_enabled(int drmfd, char *connector_name);
 bool igt_is_force_dsc_enabled(int drmfd, char *connector_name);
diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
index 02d1a484..1adf920b 100644
--- a/tests/i915/kms_dsc_helper.c
+++ b/tests/i915/kms_dsc_helper.c
@@ -55,7 +55,7 @@ void kms_dsc_exit_handler(int sig)
 
 bool check_dsc_on_connector(int drmfd, igt_output_t *output)
 {
-	if (!igt_is_dsc_supported(drmfd, output->name)) {
+	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
 		igt_debug("DSC not supported on connector %s\n",
 			  output->name);
 		return false;
diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
index ec048305..63da3a1c 100644
--- a/tests/kms_invalid_mode.c
+++ b/tests/kms_invalid_mode.c
@@ -61,7 +61,7 @@ can_bigjoiner(data_t *data)
 		igt_debug("Platform supports uncompressed bigjoiner\n");
 		return true;
 	} else if (intel_display_ver(devid) >= 11) {
-		return igt_is_dsc_supported(data->drm_fd, data->output->name);
+		return igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
 	}
 
 	return false;
-- 
2.25.1

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

* [igt-dev] [PATCH i-g-t 2/3] tests: s/check_dsc_on_connector/is_dsc_supported_by_sink
  2023-05-31  6:54 [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability Swati Sharma
  2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t 1/3] tests: s/igt_is_dsc_supported/igt_is_dsc_supported_by_sink Swati Sharma
@ 2023-05-31  6:54 ` Swati Sharma
  2023-06-01 13:49   ` Kamil Konieczny
  2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source() Swati Sharma
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Swati Sharma @ 2023-05-31  6:54 UTC (permalink / raw)
  To: igt-dev

Rename function.

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/i915/kms_dsc.c        | 2 +-
 tests/i915/kms_dsc_helper.c | 2 +-
 tests/i915/kms_dsc_helper.h | 2 +-
 tests/i915/kms_psr2_sf.c    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
index 3ce28f84..d142fae2 100644
--- a/tests/i915/kms_dsc.c
+++ b/tests/i915/kms_dsc.c
@@ -227,7 +227,7 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
 		data->output = output;
 		data->pipe = pipe;
 
-		if (!check_dsc_on_connector(data->drm_fd, data->output))
+		if (!is_dsc_supported_by_sink(data->drm_fd, data->output))
 			continue;
 
 		if (!is_dsc_output_format_supported(data->drm_fd, data->disp_ver,
diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
index 1adf920b..c90d833d 100644
--- a/tests/i915/kms_dsc_helper.c
+++ b/tests/i915/kms_dsc_helper.c
@@ -53,7 +53,7 @@ void kms_dsc_exit_handler(int sig)
 	restore_force_dsc_en();
 }
 
-bool check_dsc_on_connector(int drmfd, igt_output_t *output)
+bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output)
 {
 	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
 		igt_debug("DSC not supported on connector %s\n",
diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
index 198f5afa..f66191c7 100644
--- a/tests/i915/kms_dsc_helper.h
+++ b/tests/i915/kms_dsc_helper.h
@@ -26,7 +26,7 @@ void force_dsc_enable_bpc(int drmfd, igt_output_t *output, int input_bpc);
 void save_force_dsc_en(int drmfd, igt_output_t *output);
 void restore_force_dsc_en(void);
 void kms_dsc_exit_handler(int sig);
-bool check_dsc_on_connector(int drmfd, igt_output_t *output);
+bool is_dsc_supported_by_sink(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,
diff --git a/tests/i915/kms_psr2_sf.c b/tests/i915/kms_psr2_sf.c
index 4cf98644..ffc41f98 100644
--- a/tests/i915/kms_psr2_sf.c
+++ b/tests/i915/kms_psr2_sf.c
@@ -934,7 +934,7 @@ igt_main
 				pipes[n_pipes] = data.pipe;
 				outputs[n_pipes] = data.output;
 
-				if (check_dsc_on_connector(data.drm_fd, data.output))
+				if (is_dsc_supported_by_sink(data.drm_fd, data.output))
 					coexist_features[n_pipes] |= FEATURE_DSC;
 
 				n_pipes++;
-- 
2.25.1

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

* [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source()
  2023-05-31  6:54 [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability Swati Sharma
  2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t 1/3] tests: s/igt_is_dsc_supported/igt_is_dsc_supported_by_sink Swati Sharma
  2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t 2/3] tests: s/check_dsc_on_connector/is_dsc_supported_by_sink Swati Sharma
@ 2023-05-31  6:54 ` Swati Sharma
  2023-06-01 13:55   ` Kamil Konieczny
  2023-05-31  7:55 ` [igt-dev] ✓ Fi.CI.BAT: success for check dsc hardware capability (rev2) Patchwork
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Swati Sharma @ 2023-05-31  6:54 UTC (permalink / raw)
  To: igt-dev

Instead of assuming dsc is supported on gen11+ platforms,
lets use has_dsc flag in i915_capability to check hardware
support.

v2: -moved changes to lib (Ankit)
v3: -keep includes in alphabetical order (Kamil)
    -don't use igt_require() in lib (Kamil)
    -improve return statement (Kamil)

Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 lib/igt_dsc.c               | 22 ++++++++++++++++++++++
 lib/igt_dsc.h               |  1 +
 tests/i915/kms_dsc.c        |  2 +-
 tests/i915/kms_dsc_helper.c | 10 ++++++++++
 tests/i915/kms_dsc_helper.h |  1 +
 tests/kms_invalid_mode.c    |  3 +--
 6 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
index 6cbd8bae..76a420c1 100644
--- a/lib/igt_dsc.c
+++ b/lib/igt_dsc.c
@@ -6,6 +6,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
+#include "igt_core.h"
 #include "igt_dsc.h"
 #include "igt_sysfs.h"
 
@@ -41,6 +42,27 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
 	return ret;
 }
 
+/*
+ * igt_is_dsc_supported_by_source:
+ * @drmfd: A drm file descriptor
+ *
+ * Returns: True if DSC is supported by source, false otherwise.
+ */
+bool igt_is_dsc_supported_by_source(int drmfd)
+{
+	char buf[4096];
+	int dir, res;
+
+	dir = igt_debugfs_dir(drmfd);
+	igt_assert(dir >= 0);
+
+	res = igt_debugfs_simple_read(dir, "i915_capabilities",
+				      buf, sizeof(buf));
+	close(dir);
+
+	return res > 0 ? strstr(buf, "has_dsc: yes") : 0;
+}
+
 /*
  * igt_is_dsc_supported_by_sink:
  * @drmfd: A drm file descriptor
diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
index 241fc0ac..b58743b5 100644
--- a/lib/igt_dsc.h
+++ b/lib/igt_dsc.h
@@ -9,6 +9,7 @@
 #include "igt_fb.h"
 #include "igt_kms.h"
 
+bool igt_is_dsc_supported_by_source(int drmfd);
 bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
 bool igt_is_fec_supported(int drmfd, char *connector_name);
 bool igt_is_dsc_enabled(int drmfd, char *connector_name);
diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
index d142fae2..b46c4449 100644
--- a/tests/i915/kms_dsc.c
+++ b/tests/i915/kms_dsc.c
@@ -265,7 +265,7 @@ igt_main
 		igt_install_exit_handler(kms_dsc_exit_handler);
 		igt_display_require(&data.display, data.drm_fd);
 		igt_display_require_output(&data.display);
-		igt_require(data.disp_ver >= 11);
+		igt_require(is_dsc_supported_by_source(data.drm_fd));
 	}
 
 	igt_describe("Tests basic display stream compression functionality if supported "
diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
index c90d833d..61f76dde 100644
--- a/tests/i915/kms_dsc_helper.c
+++ b/tests/i915/kms_dsc_helper.c
@@ -53,6 +53,16 @@ void kms_dsc_exit_handler(int sig)
 	restore_force_dsc_en();
 }
 
+bool is_dsc_supported_by_source(int drmfd)
+{
+	if (!igt_is_dsc_supported_by_source(drmfd)) {
+		igt_debug("DSC not supported by source\n");
+		return false;
+	}
+
+	return true;
+}
+
 bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output)
 {
 	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
index f66191c7..2109bd76 100644
--- a/tests/i915/kms_dsc_helper.h
+++ b/tests/i915/kms_dsc_helper.h
@@ -27,6 +27,7 @@ void save_force_dsc_en(int drmfd, igt_output_t *output);
 void restore_force_dsc_en(void);
 void kms_dsc_exit_handler(int sig);
 bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output);
+bool is_dsc_supported_by_source(int drmfd);
 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,
diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
index 63da3a1c..e4ab65f2 100644
--- a/tests/kms_invalid_mode.c
+++ b/tests/kms_invalid_mode.c
@@ -60,9 +60,8 @@ can_bigjoiner(data_t *data)
 	if (intel_display_ver(devid) > 12) {
 		igt_debug("Platform supports uncompressed bigjoiner\n");
 		return true;
-	} else if (intel_display_ver(devid) >= 11) {
+	} else if (igt_is_dsc_supported_by_source(data->drm_fd))
 		return igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
-	}
 
 	return false;
 }
-- 
2.25.1

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

* [igt-dev] ✓ Fi.CI.BAT: success for check dsc hardware capability (rev2)
  2023-05-31  6:54 [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability Swati Sharma
                   ` (2 preceding siblings ...)
  2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source() Swati Sharma
@ 2023-05-31  7:55 ` Patchwork
  2023-06-01 14:17 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2023-06-14 12:48 ` [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability Nautiyal, Ankit K
  5 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2023-05-31  7:55 UTC (permalink / raw)
  To: Swati Sharma; +Cc: igt-dev

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

== Series Details ==

Series: check dsc hardware capability (rev2)
URL   : https://patchwork.freedesktop.org/series/118570/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13204 -> IGTPW_9076
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

Participating hosts (36 -> 36)
------------------------------

  Additional (1): fi-kbl-soraka 
  Missing    (1): fi-kbl-8809g 

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_huc_copy@huc-copy:
    - fi-kbl-soraka:      NOTRUN -> [SKIP][1] ([fdo#109271] / [i915#2190])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/fi-kbl-soraka/igt@gem_huc_copy@huc-copy.html

  * igt@gem_lmem_swapping@basic:
    - fi-kbl-soraka:      NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#4613]) +3 similar issues
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/fi-kbl-soraka/igt@gem_lmem_swapping@basic.html

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-hsw-4770:        [PASS][3] -> [SKIP][4] ([fdo#109271])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/fi-hsw-4770/igt@i915_pm_rpm@basic-pci-d3-state.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/fi-hsw-4770/igt@i915_pm_rpm@basic-pci-d3-state.html

  * igt@i915_pm_rpm@basic-rte:
    - fi-hsw-4770:        [PASS][5] -> [FAIL][6] ([i915#7364])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/fi-hsw-4770/igt@i915_pm_rpm@basic-rte.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/fi-hsw-4770/igt@i915_pm_rpm@basic-rte.html

  * igt@i915_selftest@live@gt_heartbeat:
    - fi-kbl-soraka:      NOTRUN -> [DMESG-FAIL][7] ([i915#5334] / [i915#7872])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html

  * igt@i915_selftest@live@gt_pm:
    - bat-rpls-2:         [PASS][8] -> [DMESG-FAIL][9] ([i915#4258] / [i915#7913])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/bat-rpls-2/igt@i915_selftest@live@gt_pm.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/bat-rpls-2/igt@i915_selftest@live@gt_pm.html
    - fi-kbl-soraka:      NOTRUN -> [DMESG-FAIL][10] ([i915#1886] / [i915#7913])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html

  * igt@i915_selftest@live@reset:
    - bat-rpls-2:         [PASS][11] -> [ABORT][12] ([i915#4983] / [i915#7461] / [i915#7913] / [i915#8347])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/bat-rpls-2/igt@i915_selftest@live@reset.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/bat-rpls-2/igt@i915_selftest@live@reset.html
    - bat-rpls-1:         [PASS][13] -> [ABORT][14] ([i915#4983] / [i915#7461] / [i915#8347] / [i915#8384])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/bat-rpls-1/igt@i915_selftest@live@reset.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/bat-rpls-1/igt@i915_selftest@live@reset.html

  * igt@kms_chamelium_frames@hdmi-crc-fast:
    - fi-kbl-soraka:      NOTRUN -> [SKIP][15] ([fdo#109271]) +14 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/fi-kbl-soraka/igt@kms_chamelium_frames@hdmi-crc-fast.html

  * igt@kms_pipe_crc_basic@read-crc:
    - bat-adlp-9:         NOTRUN -> [SKIP][16] ([i915#3546]) +1 similar issue
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/bat-adlp-9/igt@kms_pipe_crc_basic@read-crc.html

  * igt@kms_setmode@basic-clone-single-crtc:
    - fi-kbl-soraka:      NOTRUN -> [SKIP][17] ([fdo#109271] / [i915#4579])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/fi-kbl-soraka/igt@kms_setmode@basic-clone-single-crtc.html

  
#### Possible fixes ####

  * igt@i915_module_load@load:
    - {bat-adlp-11}:      [ABORT][18] ([i915#4423] / [i915#8189]) -> [PASS][19]
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/bat-adlp-11/igt@i915_module_load@load.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/bat-adlp-11/igt@i915_module_load@load.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
  [i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
  [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
  [i915#4093]: https://gitlab.freedesktop.org/drm/intel/issues/4093
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4258]: https://gitlab.freedesktop.org/drm/intel/issues/4258
  [i915#4309]: https://gitlab.freedesktop.org/drm/intel/issues/4309
  [i915#4423]: https://gitlab.freedesktop.org/drm/intel/issues/4423
  [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#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
  [i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
  [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
  [i915#6868]: https://gitlab.freedesktop.org/drm/intel/issues/6868
  [i915#7059]: https://gitlab.freedesktop.org/drm/intel/issues/7059
  [i915#7364]: https://gitlab.freedesktop.org/drm/intel/issues/7364
  [i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
  [i915#7461]: https://gitlab.freedesktop.org/drm/intel/issues/7461
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
  [i915#7872]: https://gitlab.freedesktop.org/drm/intel/issues/7872
  [i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
  [i915#8189]: https://gitlab.freedesktop.org/drm/intel/issues/8189
  [i915#8347]: https://gitlab.freedesktop.org/drm/intel/issues/8347
  [i915#8384]: https://gitlab.freedesktop.org/drm/intel/issues/8384


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

  * CI: CI-20190529 -> None
  * IGT: IGT_7311 -> IGTPW_9076

  CI-20190529: 20190529
  CI_DRM_13204: 83a048e62ecf7838b583389e60c1defa530a5668 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_9076: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/index.html
  IGT_7311: c031030f39aff973330668a5a2f1593408da78ae @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

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

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

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

* Re: [igt-dev] [PATCH i-g-t 1/3] tests: s/igt_is_dsc_supported/igt_is_dsc_supported_by_sink
  2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t 1/3] tests: s/igt_is_dsc_supported/igt_is_dsc_supported_by_sink Swati Sharma
@ 2023-06-01 13:48   ` Kamil Konieczny
  0 siblings, 0 replies; 17+ messages in thread
From: Kamil Konieczny @ 2023-06-01 13:48 UTC (permalink / raw)
  To: igt-dev

On 2023-05-31 at 12:24:05 +0530, Swati Sharma wrote:
> Rename helper.
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>

Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

> ---
>  lib/igt_dsc.c               | 6 +++---
>  lib/igt_dsc.h               | 2 +-
>  tests/i915/kms_dsc_helper.c | 2 +-
>  tests/kms_invalid_mode.c    | 2 +-
>  4 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
> index 9e1ab9b1..6cbd8bae 100644
> --- a/lib/igt_dsc.c
> +++ b/lib/igt_dsc.c
> @@ -42,13 +42,13 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
>  }
>  
>  /*
> - * igt_is_dsc_supported:
> + * igt_is_dsc_supported_by_sink:
>   * @drmfd: A drm file descriptor
>   * @connector_name: Name of the libdrm connector we're going to use
>   *
> - * Returns: True if DSC is supported for the given connector, false otherwise.
> + * Returns: True if DSC is supported for the given connector/sink, false otherwise.
>   */
> -bool igt_is_dsc_supported(int drmfd, char *connector_name)
> +bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name)
>  {
>  	return check_dsc_debugfs(drmfd, connector_name, "DSC_Sink_Support: yes");
>  }
> diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
> index 9608aad4..241fc0ac 100644
> --- a/lib/igt_dsc.h
> +++ b/lib/igt_dsc.h
> @@ -9,7 +9,7 @@
>  #include "igt_fb.h"
>  #include "igt_kms.h"
>  
> -bool igt_is_dsc_supported(int drmfd, char *connector_name);
> +bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
>  bool igt_is_fec_supported(int drmfd, char *connector_name);
>  bool igt_is_dsc_enabled(int drmfd, char *connector_name);
>  bool igt_is_force_dsc_enabled(int drmfd, char *connector_name);
> diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
> index 02d1a484..1adf920b 100644
> --- a/tests/i915/kms_dsc_helper.c
> +++ b/tests/i915/kms_dsc_helper.c
> @@ -55,7 +55,7 @@ void kms_dsc_exit_handler(int sig)
>  
>  bool check_dsc_on_connector(int drmfd, igt_output_t *output)
>  {
> -	if (!igt_is_dsc_supported(drmfd, output->name)) {
> +	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
>  		igt_debug("DSC not supported on connector %s\n",
>  			  output->name);
>  		return false;
> diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
> index ec048305..63da3a1c 100644
> --- a/tests/kms_invalid_mode.c
> +++ b/tests/kms_invalid_mode.c
> @@ -61,7 +61,7 @@ can_bigjoiner(data_t *data)
>  		igt_debug("Platform supports uncompressed bigjoiner\n");
>  		return true;
>  	} else if (intel_display_ver(devid) >= 11) {
> -		return igt_is_dsc_supported(data->drm_fd, data->output->name);
> +		return igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
>  	}
>  
>  	return false;
> -- 
> 2.25.1
> 

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

* Re: [igt-dev] [PATCH i-g-t 2/3] tests: s/check_dsc_on_connector/is_dsc_supported_by_sink
  2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t 2/3] tests: s/check_dsc_on_connector/is_dsc_supported_by_sink Swati Sharma
@ 2023-06-01 13:49   ` Kamil Konieczny
  0 siblings, 0 replies; 17+ messages in thread
From: Kamil Konieczny @ 2023-06-01 13:49 UTC (permalink / raw)
  To: igt-dev

On 2023-05-31 at 12:24:06 +0530, Swati Sharma wrote:
> Rename function.
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>

Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

> ---
>  tests/i915/kms_dsc.c        | 2 +-
>  tests/i915/kms_dsc_helper.c | 2 +-
>  tests/i915/kms_dsc_helper.h | 2 +-
>  tests/i915/kms_psr2_sf.c    | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
> index 3ce28f84..d142fae2 100644
> --- a/tests/i915/kms_dsc.c
> +++ b/tests/i915/kms_dsc.c
> @@ -227,7 +227,7 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
>  		data->output = output;
>  		data->pipe = pipe;
>  
> -		if (!check_dsc_on_connector(data->drm_fd, data->output))
> +		if (!is_dsc_supported_by_sink(data->drm_fd, data->output))
>  			continue;
>  
>  		if (!is_dsc_output_format_supported(data->drm_fd, data->disp_ver,
> diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
> index 1adf920b..c90d833d 100644
> --- a/tests/i915/kms_dsc_helper.c
> +++ b/tests/i915/kms_dsc_helper.c
> @@ -53,7 +53,7 @@ void kms_dsc_exit_handler(int sig)
>  	restore_force_dsc_en();
>  }
>  
> -bool check_dsc_on_connector(int drmfd, igt_output_t *output)
> +bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output)
>  {
>  	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
>  		igt_debug("DSC not supported on connector %s\n",
> diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
> index 198f5afa..f66191c7 100644
> --- a/tests/i915/kms_dsc_helper.h
> +++ b/tests/i915/kms_dsc_helper.h
> @@ -26,7 +26,7 @@ void force_dsc_enable_bpc(int drmfd, igt_output_t *output, int input_bpc);
>  void save_force_dsc_en(int drmfd, igt_output_t *output);
>  void restore_force_dsc_en(void);
>  void kms_dsc_exit_handler(int sig);
> -bool check_dsc_on_connector(int drmfd, igt_output_t *output);
> +bool is_dsc_supported_by_sink(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,
> diff --git a/tests/i915/kms_psr2_sf.c b/tests/i915/kms_psr2_sf.c
> index 4cf98644..ffc41f98 100644
> --- a/tests/i915/kms_psr2_sf.c
> +++ b/tests/i915/kms_psr2_sf.c
> @@ -934,7 +934,7 @@ igt_main
>  				pipes[n_pipes] = data.pipe;
>  				outputs[n_pipes] = data.output;
>  
> -				if (check_dsc_on_connector(data.drm_fd, data.output))
> +				if (is_dsc_supported_by_sink(data.drm_fd, data.output))
>  					coexist_features[n_pipes] |= FEATURE_DSC;
>  
>  				n_pipes++;
> -- 
> 2.25.1
> 

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

* Re: [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source()
  2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source() Swati Sharma
@ 2023-06-01 13:55   ` Kamil Konieczny
  2023-06-02  7:24     ` Sharma, Swati2
  0 siblings, 1 reply; 17+ messages in thread
From: Kamil Konieczny @ 2023-06-01 13:55 UTC (permalink / raw)
  To: igt-dev

Hi Swati,

On 2023-05-31 at 12:24:07 +0530, Swati Sharma wrote:
> Instead of assuming dsc is supported on gen11+ platforms,
> lets use has_dsc flag in i915_capability to check hardware
> support.
> 
> v2: -moved changes to lib (Ankit)
> v3: -keep includes in alphabetical order (Kamil)
>     -don't use igt_require() in lib (Kamil)
>     -improve return statement (Kamil)
> 
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>  lib/igt_dsc.c               | 22 ++++++++++++++++++++++
>  lib/igt_dsc.h               |  1 +
>  tests/i915/kms_dsc.c        |  2 +-
>  tests/i915/kms_dsc_helper.c | 10 ++++++++++
>  tests/i915/kms_dsc_helper.h |  1 +
>  tests/kms_invalid_mode.c    |  3 +--
>  6 files changed, 36 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
> index 6cbd8bae..76a420c1 100644
> --- a/lib/igt_dsc.c
> +++ b/lib/igt_dsc.c
> @@ -6,6 +6,7 @@
>  #include <unistd.h>
>  #include <fcntl.h>
>  #include <string.h>
> +#include "igt_core.h"
>  #include "igt_dsc.h"
>  #include "igt_sysfs.h"
>  
> @@ -41,6 +42,27 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
>  	return ret;
>  }
>  
> +/*
> + * igt_is_dsc_supported_by_source:
> + * @drmfd: A drm file descriptor
> + *
> + * Returns: True if DSC is supported by source, false otherwise.
> + */
> +bool igt_is_dsc_supported_by_source(int drmfd)
> +{
> +	char buf[4096];
> +	int dir, res;
> +
> +	dir = igt_debugfs_dir(drmfd);
> +	igt_assert(dir >= 0);
> +
> +	res = igt_debugfs_simple_read(dir, "i915_capabilities",
> +				      buf, sizeof(buf));
> +	close(dir);
> +
> +	return res > 0 ? strstr(buf, "has_dsc: yes") : 0;
> +}
> +
>  /*
>   * igt_is_dsc_supported_by_sink:
>   * @drmfd: A drm file descriptor
> diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
> index 241fc0ac..b58743b5 100644
> --- a/lib/igt_dsc.h
> +++ b/lib/igt_dsc.h
> @@ -9,6 +9,7 @@
>  #include "igt_fb.h"
>  #include "igt_kms.h"
>  
> +bool igt_is_dsc_supported_by_source(int drmfd);
>  bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
>  bool igt_is_fec_supported(int drmfd, char *connector_name);
>  bool igt_is_dsc_enabled(int drmfd, char *connector_name);
> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
> index d142fae2..b46c4449 100644
> --- a/tests/i915/kms_dsc.c
> +++ b/tests/i915/kms_dsc.c
> @@ -265,7 +265,7 @@ igt_main
>  		igt_install_exit_handler(kms_dsc_exit_handler);
>  		igt_display_require(&data.display, data.drm_fd);
>  		igt_display_require_output(&data.display);
> -		igt_require(data.disp_ver >= 11);
> +		igt_require(is_dsc_supported_by_source(data.drm_fd));
>  	}
>  
>  	igt_describe("Tests basic display stream compression functionality if supported "
> diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
> index c90d833d..61f76dde 100644
> --- a/tests/i915/kms_dsc_helper.c
> +++ b/tests/i915/kms_dsc_helper.c
> @@ -53,6 +53,16 @@ void kms_dsc_exit_handler(int sig)
>  	restore_force_dsc_en();
>  }
>  
> +bool is_dsc_supported_by_source(int drmfd)
> +{
> +	if (!igt_is_dsc_supported_by_source(drmfd)) {
> +		igt_debug("DSC not supported by source\n");
> +		return false;
> +	}
> +
> +	return true;
> +}
> +
>  bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output)
>  {
>  	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
> diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
> index f66191c7..2109bd76 100644
> --- a/tests/i915/kms_dsc_helper.h
> +++ b/tests/i915/kms_dsc_helper.h
> @@ -27,6 +27,7 @@ void save_force_dsc_en(int drmfd, igt_output_t *output);
>  void restore_force_dsc_en(void);
>  void kms_dsc_exit_handler(int sig);
>  bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output);
> +bool is_dsc_supported_by_source(int drmfd);
>  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,
> diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
> index 63da3a1c..e4ab65f2 100644
> --- a/tests/kms_invalid_mode.c
> +++ b/tests/kms_invalid_mode.c
> @@ -60,9 +60,8 @@ can_bigjoiner(data_t *data)
>  	if (intel_display_ver(devid) > 12) {
>  		igt_debug("Platform supports uncompressed bigjoiner\n");
>  		return true;
> -	} else if (intel_display_ver(devid) >= 11) {
---------------------------------------------- ^
imho you should keep it here unless there are platforms <= 10 with
that capability ?
Also previous if had braces { } so you should also use them after else:

> +	} else if (igt_is_dsc_supported_by_source(data->drm_fd))
------------- ^
>  		return igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
> -	}

imho better:
	} else if (intel_display_ver(devid) >= 11) {
		return igt_is_dsc_supported_by_source(data->drm_fd) &&
		       igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
	}

Regards,
Kamil

> -	}
>  
>  	return false;
>  }
> -- 
> 2.25.1
> 

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

* [igt-dev] ✓ Fi.CI.IGT: success for check dsc hardware capability (rev2)
  2023-05-31  6:54 [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability Swati Sharma
                   ` (3 preceding siblings ...)
  2023-05-31  7:55 ` [igt-dev] ✓ Fi.CI.BAT: success for check dsc hardware capability (rev2) Patchwork
@ 2023-06-01 14:17 ` Patchwork
  2023-06-14 12:48 ` [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability Nautiyal, Ankit K
  5 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2023-06-01 14:17 UTC (permalink / raw)
  To: Swati Sharma; +Cc: igt-dev

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

== Series Details ==

Series: check dsc hardware capability (rev2)
URL   : https://patchwork.freedesktop.org/series/118570/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13204_full -> IGTPW_9076_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

Participating hosts (7 -> 7)
------------------------------

  No changes in participating hosts

New tests
---------

  New tests have been introduced between CI_DRM_13204_full and IGTPW_9076_full:

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

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-a-hdmi-a-3:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-b-hdmi-a-3:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-c-hdmi-a-3:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-d-hdmi-a-3:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-a-hdmi-a-3:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-b-hdmi-a-3:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-c-hdmi-a-3:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-d-hdmi-a-3:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_close_race@multigpu-basic-process:
    - shard-apl:          NOTRUN -> [SKIP][1] ([fdo#109271]) +6 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-apl1/igt@gem_close_race@multigpu-basic-process.html

  * igt@gem_exec_fair@basic-deadline:
    - shard-glk:          [PASS][2] -> [FAIL][3] ([i915#2846])
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-glk8/igt@gem_exec_fair@basic-deadline.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-glk6/igt@gem_exec_fair@basic-deadline.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-glk:          [PASS][4] -> [FAIL][5] ([i915#2842])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-glk6/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-glk6/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@i915_module_load@load:
    - shard-glk:          NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#6227])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-glk8/igt@i915_module_load@load.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@b-hdmi-a1:
    - shard-glk:          [PASS][7] -> [FAIL][8] ([i915#2122])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-glk2/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-hdmi-a1.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-glk2/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-hdmi-a1.html

  * igt@kms_hdmi_inject@inject-audio:
    - shard-glk:          [PASS][9] -> [SKIP][10] ([fdo#109271])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-glk1/igt@kms_hdmi_inject@inject-audio.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-glk7/igt@kms_hdmi_inject@inject-audio.html

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-25@pipe-c-dp-1:
    - shard-apl:          NOTRUN -> [SKIP][11] ([fdo#109271] / [i915#4579])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-apl7/igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-25@pipe-c-dp-1.html

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-b-hdmi-a-3 (NEW):
    - {shard-dg1}:        NOTRUN -> [SKIP][12] ([i915#5176]) +2 similar issues
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-dg1-13/igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-b-hdmi-a-3.html

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-d-hdmi-a-3 (NEW):
    - {shard-dg1}:        NOTRUN -> [SKIP][13] ([i915#4579] / [i915#5176])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-dg1-13/igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-d-hdmi-a-3.html

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-a-vga-1:
    - shard-snb:          NOTRUN -> [SKIP][14] ([fdo#109271]) +11 similar issues
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-snb5/igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-a-vga-1.html

  * igt@kms_plane_scaling@planes-downscale-factor-0-5-upscale-0-25@pipe-b-vga-1:
    - shard-snb:          NOTRUN -> [SKIP][15] ([fdo#109271] / [i915#4579]) +7 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-snb6/igt@kms_plane_scaling@planes-downscale-factor-0-5-upscale-0-25@pipe-b-vga-1.html

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-a-hdmi-a-3 (NEW):
    - {shard-dg1}:        NOTRUN -> [SKIP][16] ([i915#5235]) +2 similar issues
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-dg1-13/igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-a-hdmi-a-3.html

  * igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-d-hdmi-a-3 (NEW):
    - {shard-dg1}:        NOTRUN -> [SKIP][17] ([i915#4579] / [i915#5235])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-dg1-13/igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-25@pipe-d-hdmi-a-3.html

  * igt@kms_selftest@all-tests:
    - shard-glk:          NOTRUN -> [SKIP][18] ([fdo#109271] / [i915#4579]) +1 similar issue
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-glk4/igt@kms_selftest@all-tests.html

  * igt@vc4/vc4_wait_bo@used-bo-0ns:
    - shard-glk:          NOTRUN -> [SKIP][19] ([fdo#109271]) +4 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-glk5/igt@vc4/vc4_wait_bo@used-bo-0ns.html

  
#### Possible fixes ####

  * igt@gem_ctx_exec@basic-nohangcheck:
    - {shard-tglu}:       [FAIL][20] ([i915#6268]) -> [PASS][21]
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-tglu-10/igt@gem_ctx_exec@basic-nohangcheck.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-tglu-7/igt@gem_ctx_exec@basic-nohangcheck.html

  * igt@gem_eio@hibernate:
    - {shard-tglu}:       [ABORT][22] ([i915#7975] / [i915#8213] / [i915#8398]) -> [PASS][23]
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-tglu-10/igt@gem_eio@hibernate.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-tglu-5/igt@gem_eio@hibernate.html

  * igt@gem_exec_fair@basic-pace@rcs0:
    - {shard-rkl}:        [FAIL][24] ([i915#2842]) -> [PASS][25]
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-rkl-6/igt@gem_exec_fair@basic-pace@rcs0.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-rkl-1/igt@gem_exec_fair@basic-pace@rcs0.html

  * igt@gem_userptr_blits@huge-split:
    - shard-apl:          [FAIL][26] ([i915#3318]) -> [PASS][27]
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-apl3/igt@gem_userptr_blits@huge-split.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-apl1/igt@gem_userptr_blits@huge-split.html

  * igt@i915_pm_dc@dc6-dpms:
    - {shard-tglu}:       [FAIL][28] ([i915#3989] / [i915#454]) -> [PASS][29]
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-tglu-4/igt@i915_pm_dc@dc6-dpms.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-tglu-10/igt@i915_pm_dc@dc6-dpms.html

  * igt@i915_pm_rpm@dpms-mode-unset-non-lpsp:
    - {shard-rkl}:        [SKIP][30] ([i915#1397]) -> [PASS][31] +2 similar issues
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-rkl-7/igt@i915_pm_rpm@dpms-mode-unset-non-lpsp.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-rkl-4/igt@i915_pm_rpm@dpms-mode-unset-non-lpsp.html

  * igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-180-async-flip:
    - {shard-rkl}:        [FAIL][32] ([i915#3743]) -> [PASS][33]
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-rkl-7/igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-180-async-flip.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-rkl-6/igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-180-async-flip.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
    - shard-glk:          [FAIL][34] ([i915#2346]) -> [PASS][35]
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-glk6/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-glk1/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
    - shard-apl:          [FAIL][36] ([i915#2346]) -> [PASS][37]
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-apl3/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-apl4/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html

  * igt@kms_cursor_legacy@single-move@pipe-b:
    - {shard-rkl}:        [INCOMPLETE][38] ([i915#8011]) -> [PASS][39]
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-rkl-7/igt@kms_cursor_legacy@single-move@pipe-b.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-rkl-1/igt@kms_cursor_legacy@single-move@pipe-b.html

  * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2:
    - shard-glk:          [FAIL][40] ([i915#79]) -> [PASS][41] +1 similar issue
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-glk6/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-glk1/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2.html

  * igt@kms_flip_tiling@flip-change-tiling@hdmi-a-1-pipe-c-y-to-y:
    - shard-glk:          [INCOMPLETE][42] -> [PASS][43]
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-glk7/igt@kms_flip_tiling@flip-change-tiling@hdmi-a-1-pipe-c-y-to-y.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-glk9/igt@kms_flip_tiling@flip-change-tiling@hdmi-a-1-pipe-c-y-to-y.html

  * igt@kms_rotation_crc@multiplane-rotation:
    - {shard-rkl}:        [ABORT][44] ([i915#8311]) -> [PASS][45]
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-rkl-4/igt@kms_rotation_crc@multiplane-rotation.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-rkl-4/igt@kms_rotation_crc@multiplane-rotation.html

  
#### Warnings ####

  * igt@kms_hdmi_inject@inject-audio:
    - shard-snb:          [FAIL][46] ([IGT#3]) -> [SKIP][47] ([fdo#109271])
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13204/shard-snb6/igt@kms_hdmi_inject@inject-audio.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/shard-snb2/igt@kms_hdmi_inject@inject-audio.html

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

  [IGT#3]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/3
  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
  [fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
  [fdo#111656]: https://bugs.freedesktop.org/show_bug.cgi?id=111656
  [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
  [i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
  [i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
  [i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
  [i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
  [i915#3023]: https://gitlab.freedesktop.org/drm/intel/issues/3023
  [i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
  [i915#3318]: https://gitlab.freedesktop.org/drm/intel/issues/3318
  [i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
  [i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
  [i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
  [i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
  [i915#3743]: https://gitlab.freedesktop.org/drm/intel/issues/3743
  [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
  [i915#3952]: https://gitlab.freedesktop.org/drm/intel/issues/3952
  [i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
  [i915#3989]: https://gitlab.freedesktop.org/drm/intel/issues/3989
  [i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
  [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
  [i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
  [i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4771]: https://gitlab.freedesktop.org/drm/intel/issues/4771
  [i915#4816]: https://gitlab.freedesktop.org/drm/intel/issues/4816
  [i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
  [i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
  [i915#4854]: https://gitlab.freedesktop.org/drm/intel/issues/4854
  [i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
  [i915#4958]: https://gitlab.freedesktop.org/drm/intel/issues/4958
  [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
  [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
  [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
  [i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
  [i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
  [i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
  [i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
  [i915#6227]: https://gitlab.freedesktop.org/drm/intel/issues/6227
  [i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
  [i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
  [i915#6724]: https://gitlab.freedesktop.org/drm/intel/issues/6724
  [i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
  [i915#6786]: https://gitlab.freedesktop.org/drm/intel/issues/6786
  [i915#6806]: https://gitlab.freedesktop.org/drm/intel/issues/6806
  [i915#6953]: https://gitlab.freedesktop.org/drm/intel/issues/6953
  [i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
  [i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
  [i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
  [i915#7863]: https://gitlab.freedesktop.org/drm/intel/issues/7863
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
  [i915#7975]: https://gitlab.freedesktop.org/drm/intel/issues/7975
  [i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
  [i915#8213]: https://gitlab.freedesktop.org/drm/intel/issues/8213
  [i915#8228]: https://gitlab.freedesktop.org/drm/intel/issues/8228
  [i915#8292]: https://gitlab.freedesktop.org/drm/intel/issues/8292
  [i915#8311]: https://gitlab.freedesktop.org/drm/intel/issues/8311
  [i915#8398]: https://gitlab.freedesktop.org/drm/intel/issues/8398
  [i915#8411]: https://gitlab.freedesktop.org/drm/intel/issues/8411
  [i915#8414]: https://gitlab.freedesktop.org/drm/intel/issues/8414


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

  * CI: CI-20190529 -> None
  * IGT: IGT_7311 -> IGTPW_9076
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_13204: 83a048e62ecf7838b583389e60c1defa530a5668 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_9076: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9076/index.html
  IGT_7311: c031030f39aff973330668a5a2f1593408da78ae @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

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

* Re: [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source()
  2023-06-01 13:55   ` Kamil Konieczny
@ 2023-06-02  7:24     ` Sharma, Swati2
  2023-06-13 11:01       ` Kamil Konieczny
  2023-06-14 12:43       ` Nautiyal, Ankit K
  0 siblings, 2 replies; 17+ messages in thread
From: Sharma, Swati2 @ 2023-06-02  7:24 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev, Ankit Nautiyal

Hi Kamil,

Thanks for the reviews. Please find my reply inline.

On 01-Jun-23 7:25 PM, Kamil Konieczny wrote:
> Hi Swati,
> 
> On 2023-05-31 at 12:24:07 +0530, Swati Sharma wrote:
>> Instead of assuming dsc is supported on gen11+ platforms,
>> lets use has_dsc flag in i915_capability to check hardware
>> support.
>>
>> v2: -moved changes to lib (Ankit)
>> v3: -keep includes in alphabetical order (Kamil)
>>      -don't use igt_require() in lib (Kamil)
>>      -improve return statement (Kamil)
>>
>> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
>> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>> ---
>>   lib/igt_dsc.c               | 22 ++++++++++++++++++++++
>>   lib/igt_dsc.h               |  1 +
>>   tests/i915/kms_dsc.c        |  2 +-
>>   tests/i915/kms_dsc_helper.c | 10 ++++++++++
>>   tests/i915/kms_dsc_helper.h |  1 +
>>   tests/kms_invalid_mode.c    |  3 +--
>>   6 files changed, 36 insertions(+), 3 deletions(-)
>>
>> diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
>> index 6cbd8bae..76a420c1 100644
>> --- a/lib/igt_dsc.c
>> +++ b/lib/igt_dsc.c
>> @@ -6,6 +6,7 @@
>>   #include <unistd.h>
>>   #include <fcntl.h>
>>   #include <string.h>
>> +#include "igt_core.h"
>>   #include "igt_dsc.h"
>>   #include "igt_sysfs.h"
>>   
>> @@ -41,6 +42,27 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
>>   	return ret;
>>   }
>>   
>> +/*
>> + * igt_is_dsc_supported_by_source:
>> + * @drmfd: A drm file descriptor
>> + *
>> + * Returns: True if DSC is supported by source, false otherwise.
>> + */
>> +bool igt_is_dsc_supported_by_source(int drmfd)
>> +{
>> +	char buf[4096];
>> +	int dir, res;
>> +
>> +	dir = igt_debugfs_dir(drmfd);
>> +	igt_assert(dir >= 0);
>> +
>> +	res = igt_debugfs_simple_read(dir, "i915_capabilities",
>> +				      buf, sizeof(buf));
>> +	close(dir);
>> +
>> +	return res > 0 ? strstr(buf, "has_dsc: yes") : 0;
>> +}
>> +
>>   /*
>>    * igt_is_dsc_supported_by_sink:
>>    * @drmfd: A drm file descriptor
>> diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
>> index 241fc0ac..b58743b5 100644
>> --- a/lib/igt_dsc.h
>> +++ b/lib/igt_dsc.h
>> @@ -9,6 +9,7 @@
>>   #include "igt_fb.h"
>>   #include "igt_kms.h"
>>   
>> +bool igt_is_dsc_supported_by_source(int drmfd);
>>   bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
>>   bool igt_is_fec_supported(int drmfd, char *connector_name);
>>   bool igt_is_dsc_enabled(int drmfd, char *connector_name);
>> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
>> index d142fae2..b46c4449 100644
>> --- a/tests/i915/kms_dsc.c
>> +++ b/tests/i915/kms_dsc.c
>> @@ -265,7 +265,7 @@ igt_main
>>   		igt_install_exit_handler(kms_dsc_exit_handler);
>>   		igt_display_require(&data.display, data.drm_fd);
>>   		igt_display_require_output(&data.display);
>> -		igt_require(data.disp_ver >= 11);
>> +		igt_require(is_dsc_supported_by_source(data.drm_fd));
>>   	}
>>   
>>   	igt_describe("Tests basic display stream compression functionality if supported "
>> diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
>> index c90d833d..61f76dde 100644
>> --- a/tests/i915/kms_dsc_helper.c
>> +++ b/tests/i915/kms_dsc_helper.c
>> @@ -53,6 +53,16 @@ void kms_dsc_exit_handler(int sig)
>>   	restore_force_dsc_en();
>>   }
>>   
>> +bool is_dsc_supported_by_source(int drmfd)
>> +{
>> +	if (!igt_is_dsc_supported_by_source(drmfd)) {
>> +		igt_debug("DSC not supported by source\n");
>> +		return false;
>> +	}
>> +
>> +	return true;
>> +}
>> +
>>   bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output)
>>   {
>>   	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
>> diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
>> index f66191c7..2109bd76 100644
>> --- a/tests/i915/kms_dsc_helper.h
>> +++ b/tests/i915/kms_dsc_helper.h
>> @@ -27,6 +27,7 @@ void save_force_dsc_en(int drmfd, igt_output_t *output);
>>   void restore_force_dsc_en(void);
>>   void kms_dsc_exit_handler(int sig);
>>   bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output);
>> +bool is_dsc_supported_by_source(int drmfd);
>>   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,
>> diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
>> index 63da3a1c..e4ab65f2 100644
>> --- a/tests/kms_invalid_mode.c
>> +++ b/tests/kms_invalid_mode.c
>> @@ -60,9 +60,8 @@ can_bigjoiner(data_t *data)
>>   	if (intel_display_ver(devid) > 12) {
>>   		igt_debug("Platform supports uncompressed bigjoiner\n");
>>   		return true;
>> -	} else if (intel_display_ver(devid) >= 11) {
> ---------------------------------------------- ^
> imho you should keep it here unless there are platforms <= 10 with
> that capability ?

i915 driver supports dsc from display_ver >= 11
The whole point of removing this check is to get info from i915_cap to 
know if h/w supports dsc or not.

> Also previous if had braces { } so you should also use them after else:

okay.

> 
>> +	} else if (igt_is_dsc_supported_by_source(data->drm_fd))
> ------------- ^
>>   		return igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
>> -	}
> 
> imho better:
> 	} else if (intel_display_ver(devid) >= 11) {
> 		return igt_is_dsc_supported_by_source(data->drm_fd) &&
> 		       igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
> 	}
> 
> Regards,
> Kamil
> 
>> -	}
>>   
>>   	return false;
>>   }
>> -- 
>> 2.25.1
>>

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

* Re: [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source()
  2023-06-02  7:24     ` Sharma, Swati2
@ 2023-06-13 11:01       ` Kamil Konieczny
  2023-06-14  5:00         ` Sharma, Swati2
  2023-06-14 12:43       ` Nautiyal, Ankit K
  1 sibling, 1 reply; 17+ messages in thread
From: Kamil Konieczny @ 2023-06-13 11:01 UTC (permalink / raw)
  To: Sharma, Swati2; +Cc: igt-dev

Hi Swati,

On 2023-06-02 at 12:54:01 +0530, Sharma, Swati2 wrote:
> Hi Kamil,
> 
> Thanks for the reviews. Please find my reply inline.
> 
> On 01-Jun-23 7:25 PM, Kamil Konieczny wrote:
> > Hi Swati,
> > 
> > On 2023-05-31 at 12:24:07 +0530, Swati Sharma wrote:
> > > Instead of assuming dsc is supported on gen11+ platforms,
> > > lets use has_dsc flag in i915_capability to check hardware
> > > support.
> > > 
> > > v2: -moved changes to lib (Ankit)
> > > v3: -keep includes in alphabetical order (Kamil)
> > >      -don't use igt_require() in lib (Kamil)
> > >      -improve return statement (Kamil)
> > > 
> > > Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> > > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > > Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> > > ---
> > >   lib/igt_dsc.c               | 22 ++++++++++++++++++++++
> > >   lib/igt_dsc.h               |  1 +
> > >   tests/i915/kms_dsc.c        |  2 +-
> > >   tests/i915/kms_dsc_helper.c | 10 ++++++++++
> > >   tests/i915/kms_dsc_helper.h |  1 +
> > >   tests/kms_invalid_mode.c    |  3 +--
> > >   6 files changed, 36 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
> > > index 6cbd8bae..76a420c1 100644
> > > --- a/lib/igt_dsc.c
> > > +++ b/lib/igt_dsc.c
> > > @@ -6,6 +6,7 @@
> > >   #include <unistd.h>
> > >   #include <fcntl.h>
> > >   #include <string.h>
> > > +#include "igt_core.h"
> > >   #include "igt_dsc.h"
> > >   #include "igt_sysfs.h"
> > > @@ -41,6 +42,27 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
> > >   	return ret;
> > >   }
> > > +/*
> > > + * igt_is_dsc_supported_by_source:
> > > + * @drmfd: A drm file descriptor
> > > + *
> > > + * Returns: True if DSC is supported by source, false otherwise.
> > > + */
> > > +bool igt_is_dsc_supported_by_source(int drmfd)
> > > +{
> > > +	char buf[4096];
> > > +	int dir, res;
> > > +
> > > +	dir = igt_debugfs_dir(drmfd);
> > > +	igt_assert(dir >= 0);
> > > +
> > > +	res = igt_debugfs_simple_read(dir, "i915_capabilities",
> > > +				      buf, sizeof(buf));
> > > +	close(dir);
> > > +
> > > +	return res > 0 ? strstr(buf, "has_dsc: yes") : 0;
> > > +}
> > > +
> > >   /*
> > >    * igt_is_dsc_supported_by_sink:
> > >    * @drmfd: A drm file descriptor
> > > diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
> > > index 241fc0ac..b58743b5 100644
> > > --- a/lib/igt_dsc.h
> > > +++ b/lib/igt_dsc.h
> > > @@ -9,6 +9,7 @@
> > >   #include "igt_fb.h"
> > >   #include "igt_kms.h"
> > > +bool igt_is_dsc_supported_by_source(int drmfd);
> > >   bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
> > >   bool igt_is_fec_supported(int drmfd, char *connector_name);
> > >   bool igt_is_dsc_enabled(int drmfd, char *connector_name);
> > > diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
> > > index d142fae2..b46c4449 100644
> > > --- a/tests/i915/kms_dsc.c
> > > +++ b/tests/i915/kms_dsc.c
> > > @@ -265,7 +265,7 @@ igt_main
> > >   		igt_install_exit_handler(kms_dsc_exit_handler);
> > >   		igt_display_require(&data.display, data.drm_fd);
> > >   		igt_display_require_output(&data.display);
> > > -		igt_require(data.disp_ver >= 11);
> > > +		igt_require(is_dsc_supported_by_source(data.drm_fd));
> > >   	}
> > >   	igt_describe("Tests basic display stream compression functionality if supported "
> > > diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
> > > index c90d833d..61f76dde 100644
> > > --- a/tests/i915/kms_dsc_helper.c
> > > +++ b/tests/i915/kms_dsc_helper.c
> > > @@ -53,6 +53,16 @@ void kms_dsc_exit_handler(int sig)
> > >   	restore_force_dsc_en();
> > >   }
> > > +bool is_dsc_supported_by_source(int drmfd)
> > > +{
> > > +	if (!igt_is_dsc_supported_by_source(drmfd)) {
> > > +		igt_debug("DSC not supported by source\n");
> > > +		return false;
> > > +	}
> > > +
> > > +	return true;
> > > +}
> > > +
> > >   bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output)
> > >   {
> > >   	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
> > > diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
> > > index f66191c7..2109bd76 100644
> > > --- a/tests/i915/kms_dsc_helper.h
> > > +++ b/tests/i915/kms_dsc_helper.h
> > > @@ -27,6 +27,7 @@ void save_force_dsc_en(int drmfd, igt_output_t *output);
> > >   void restore_force_dsc_en(void);
> > >   void kms_dsc_exit_handler(int sig);
> > >   bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output);
> > > +bool is_dsc_supported_by_source(int drmfd);
> > >   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,
> > > diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
> > > index 63da3a1c..e4ab65f2 100644
> > > --- a/tests/kms_invalid_mode.c
> > > +++ b/tests/kms_invalid_mode.c
> > > @@ -60,9 +60,8 @@ can_bigjoiner(data_t *data)
> > >   	if (intel_display_ver(devid) > 12) {
-------------------------------------------- ^^^^

> > >   		igt_debug("Platform supports uncompressed bigjoiner\n");
> > >   		return true;
> > > -	} else if (intel_display_ver(devid) >= 11) {
-------------------------------------------- ^^^^

If you insist on removing this check above " >= 11"
maybe also remove check of " > 12 " ? Then you could just write:

	if (igt_is_dsc_supported_by_source(data->drm_fd) &&
	    igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name)) {

   		igt_debug("Platform supports uncompressed bigjoiner\n");
		return true;
	}

This way you could also support any future change when new
display will not support it.

Regards,
Kamil

> > ---------------------------------------------- ^
> > imho you should keep it here unless there are platforms <= 10 with
> > that capability ?
> 
> i915 driver supports dsc from display_ver >= 11
> The whole point of removing this check is to get info from i915_cap to know
> if h/w supports dsc or not.
> 
> > Also previous if had braces { } so you should also use them after else:
> 
> okay.
> 
> > 
> > > +	} else if (igt_is_dsc_supported_by_source(data->drm_fd))
> > ------------- ^
> > >   		return igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
> > > -	}
> > 
> > imho better:
> > 	} else if (intel_display_ver(devid) >= 11) {
> > 		return igt_is_dsc_supported_by_source(data->drm_fd) &&
> > 		       igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
> > 	}
> > 
> > Regards,
> > Kamil
> > 
> > > -	}
> > >   	return false;
> > >   }
> > > -- 
> > > 2.25.1
> > > 

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

* Re: [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source()
  2023-06-13 11:01       ` Kamil Konieczny
@ 2023-06-14  5:00         ` Sharma, Swati2
  2023-06-14  9:22           ` Kamil Konieczny
  0 siblings, 1 reply; 17+ messages in thread
From: Sharma, Swati2 @ 2023-06-14  5:00 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev, Ankit Nautiyal


On 13-Jun-23 4:31 PM, Kamil Konieczny wrote:
> Hi Swati,
> 
> On 2023-06-02 at 12:54:01 +0530, Sharma, Swati2 wrote:
>> Hi Kamil,
>>
>> Thanks for the reviews. Please find my reply inline.
>>
>> On 01-Jun-23 7:25 PM, Kamil Konieczny wrote:
>>> Hi Swati,
>>>
>>> On 2023-05-31 at 12:24:07 +0530, Swati Sharma wrote:
>>>> Instead of assuming dsc is supported on gen11+ platforms,
>>>> lets use has_dsc flag in i915_capability to check hardware
>>>> support.
>>>>
>>>> v2: -moved changes to lib (Ankit)
>>>> v3: -keep includes in alphabetical order (Kamil)
>>>>       -don't use igt_require() in lib (Kamil)
>>>>       -improve return statement (Kamil)
>>>>
>>>> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>>>> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
>>>> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>>>> ---
>>>>    lib/igt_dsc.c               | 22 ++++++++++++++++++++++
>>>>    lib/igt_dsc.h               |  1 +
>>>>    tests/i915/kms_dsc.c        |  2 +-
>>>>    tests/i915/kms_dsc_helper.c | 10 ++++++++++
>>>>    tests/i915/kms_dsc_helper.h |  1 +
>>>>    tests/kms_invalid_mode.c    |  3 +--
>>>>    6 files changed, 36 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
>>>> index 6cbd8bae..76a420c1 100644
>>>> --- a/lib/igt_dsc.c
>>>> +++ b/lib/igt_dsc.c
>>>> @@ -6,6 +6,7 @@
>>>>    #include <unistd.h>
>>>>    #include <fcntl.h>
>>>>    #include <string.h>
>>>> +#include "igt_core.h"
>>>>    #include "igt_dsc.h"
>>>>    #include "igt_sysfs.h"
>>>> @@ -41,6 +42,27 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
>>>>    	return ret;
>>>>    }
>>>> +/*
>>>> + * igt_is_dsc_supported_by_source:
>>>> + * @drmfd: A drm file descriptor
>>>> + *
>>>> + * Returns: True if DSC is supported by source, false otherwise.
>>>> + */
>>>> +bool igt_is_dsc_supported_by_source(int drmfd)
>>>> +{
>>>> +	char buf[4096];
>>>> +	int dir, res;
>>>> +
>>>> +	dir = igt_debugfs_dir(drmfd);
>>>> +	igt_assert(dir >= 0);
>>>> +
>>>> +	res = igt_debugfs_simple_read(dir, "i915_capabilities",
>>>> +				      buf, sizeof(buf));
>>>> +	close(dir);
>>>> +
>>>> +	return res > 0 ? strstr(buf, "has_dsc: yes") : 0;
>>>> +}
>>>> +
>>>>    /*
>>>>     * igt_is_dsc_supported_by_sink:
>>>>     * @drmfd: A drm file descriptor
>>>> diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
>>>> index 241fc0ac..b58743b5 100644
>>>> --- a/lib/igt_dsc.h
>>>> +++ b/lib/igt_dsc.h
>>>> @@ -9,6 +9,7 @@
>>>>    #include "igt_fb.h"
>>>>    #include "igt_kms.h"
>>>> +bool igt_is_dsc_supported_by_source(int drmfd);
>>>>    bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
>>>>    bool igt_is_fec_supported(int drmfd, char *connector_name);
>>>>    bool igt_is_dsc_enabled(int drmfd, char *connector_name);
>>>> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
>>>> index d142fae2..b46c4449 100644
>>>> --- a/tests/i915/kms_dsc.c
>>>> +++ b/tests/i915/kms_dsc.c
>>>> @@ -265,7 +265,7 @@ igt_main
>>>>    		igt_install_exit_handler(kms_dsc_exit_handler);
>>>>    		igt_display_require(&data.display, data.drm_fd);
>>>>    		igt_display_require_output(&data.display);
>>>> -		igt_require(data.disp_ver >= 11);
>>>> +		igt_require(is_dsc_supported_by_source(data.drm_fd));
>>>>    	}
>>>>    	igt_describe("Tests basic display stream compression functionality if supported "
>>>> diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
>>>> index c90d833d..61f76dde 100644
>>>> --- a/tests/i915/kms_dsc_helper.c
>>>> +++ b/tests/i915/kms_dsc_helper.c
>>>> @@ -53,6 +53,16 @@ void kms_dsc_exit_handler(int sig)
>>>>    	restore_force_dsc_en();
>>>>    }
>>>> +bool is_dsc_supported_by_source(int drmfd)
>>>> +{
>>>> +	if (!igt_is_dsc_supported_by_source(drmfd)) {
>>>> +		igt_debug("DSC not supported by source\n");
>>>> +		return false;
>>>> +	}
>>>> +
>>>> +	return true;
>>>> +}
>>>> +
>>>>    bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output)
>>>>    {
>>>>    	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
>>>> diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
>>>> index f66191c7..2109bd76 100644
>>>> --- a/tests/i915/kms_dsc_helper.h
>>>> +++ b/tests/i915/kms_dsc_helper.h
>>>> @@ -27,6 +27,7 @@ void save_force_dsc_en(int drmfd, igt_output_t *output);
>>>>    void restore_force_dsc_en(void);
>>>>    void kms_dsc_exit_handler(int sig);
>>>>    bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output);
>>>> +bool is_dsc_supported_by_source(int drmfd);
>>>>    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,
>>>> diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
>>>> index 63da3a1c..e4ab65f2 100644
>>>> --- a/tests/kms_invalid_mode.c
>>>> +++ b/tests/kms_invalid_mode.c
>>>> @@ -60,9 +60,8 @@ can_bigjoiner(data_t *data)
>>>>    	if (intel_display_ver(devid) > 12) {
> -------------------------------------------- ^^^^
> 
>>>>    		igt_debug("Platform supports uncompressed bigjoiner\n");
>>>>    		return true;
>>>> -	} else if (intel_display_ver(devid) >= 11) {
> -------------------------------------------- ^^^^
> 
> If you insist on removing this check above " >= 11"
> maybe also remove check of " > 12 " ? Then you could just write:
> 
> 	if (igt_is_dsc_supported_by_source(data->drm_fd) &&
> 	    igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name)) {
> 
>     		igt_debug("Platform supports uncompressed bigjoiner\n");
> 		return true;
> 	}

There are 2 things here:
1. if disp_ver > 12 then platform supports "uncompressed" big joiner, 
here we don't have to check dsc support since its uncompressed.
2. if disp_ver >= 11 && disp_ver <= 12 then platform supports 
"compressed" big joiner and we need to check dsc support which instead 
of using via gen check we are checking with debugfs now.

So, big joiner check we still need only dsc check is not required.

> 
> This way you could also support any future change when new
> display will not support it.
> 
> Regards,
> Kamil
> 
>>> ---------------------------------------------- ^
>>> imho you should keep it here unless there are platforms <= 10 with
>>> that capability ?
>>
>> i915 driver supports dsc from display_ver >= 11
>> The whole point of removing this check is to get info from i915_cap to know
>> if h/w supports dsc or not.
>>
>>> Also previous if had braces { } so you should also use them after else:
>>
>> okay.
>>
>>>
>>>> +	} else if (igt_is_dsc_supported_by_source(data->drm_fd))
>>> ------------- ^
>>>>    		return igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
>>>> -	}
>>>
>>> imho better:
>>> 	} else if (intel_display_ver(devid) >= 11) {
>>> 		return igt_is_dsc_supported_by_source(data->drm_fd) &&
>>> 		       igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
>>> 	}
>>>
>>> Regards,
>>> Kamil
>>>
>>>> -	}
>>>>    	return false;
>>>>    }
>>>> -- 
>>>> 2.25.1
>>>>

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

* Re: [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source()
  2023-06-14  5:00         ` Sharma, Swati2
@ 2023-06-14  9:22           ` Kamil Konieczny
  2023-06-14  9:33             ` Sharma, Swati2
  0 siblings, 1 reply; 17+ messages in thread
From: Kamil Konieczny @ 2023-06-14  9:22 UTC (permalink / raw)
  To: igt-dev

Hi Swati,

On 2023-06-14 at 10:30:25 +0530, Sharma, Swati2 wrote:
> 
> On 13-Jun-23 4:31 PM, Kamil Konieczny wrote:
> > Hi Swati,
> > 
> > On 2023-06-02 at 12:54:01 +0530, Sharma, Swati2 wrote:
> > > Hi Kamil,
> > > 
> > > Thanks for the reviews. Please find my reply inline.
> > > 
> > > On 01-Jun-23 7:25 PM, Kamil Konieczny wrote:
> > > > Hi Swati,
> > > > 
> > > > On 2023-05-31 at 12:24:07 +0530, Swati Sharma wrote:
> > > > > Instead of assuming dsc is supported on gen11+ platforms,
> > > > > lets use has_dsc flag in i915_capability to check hardware
> > > > > support.
> > > > > 
> > > > > v2: -moved changes to lib (Ankit)
> > > > > v3: -keep includes in alphabetical order (Kamil)
> > > > >       -don't use igt_require() in lib (Kamil)
> > > > >       -improve return statement (Kamil)
> > > > > 
> > > > > Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> > > > > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > > > > Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> > > > > ---
> > > > >    lib/igt_dsc.c               | 22 ++++++++++++++++++++++
> > > > >    lib/igt_dsc.h               |  1 +
> > > > >    tests/i915/kms_dsc.c        |  2 +-
> > > > >    tests/i915/kms_dsc_helper.c | 10 ++++++++++
> > > > >    tests/i915/kms_dsc_helper.h |  1 +
> > > > >    tests/kms_invalid_mode.c    |  3 +--
> > > > >    6 files changed, 36 insertions(+), 3 deletions(-)
> > > > > 
> > > > > diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
> > > > > index 6cbd8bae..76a420c1 100644
> > > > > --- a/lib/igt_dsc.c
> > > > > +++ b/lib/igt_dsc.c
> > > > > @@ -6,6 +6,7 @@
> > > > >    #include <unistd.h>
> > > > >    #include <fcntl.h>
> > > > >    #include <string.h>
> > > > > +#include "igt_core.h"
> > > > >    #include "igt_dsc.h"
> > > > >    #include "igt_sysfs.h"
> > > > > @@ -41,6 +42,27 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
> > > > >    	return ret;
> > > > >    }
> > > > > +/*
> > > > > + * igt_is_dsc_supported_by_source:
> > > > > + * @drmfd: A drm file descriptor
> > > > > + *
> > > > > + * Returns: True if DSC is supported by source, false otherwise.
> > > > > + */
> > > > > +bool igt_is_dsc_supported_by_source(int drmfd)
> > > > > +{
> > > > > +	char buf[4096];
> > > > > +	int dir, res;
> > > > > +
> > > > > +	dir = igt_debugfs_dir(drmfd);
> > > > > +	igt_assert(dir >= 0);
> > > > > +
> > > > > +	res = igt_debugfs_simple_read(dir, "i915_capabilities",
> > > > > +				      buf, sizeof(buf));
> > > > > +	close(dir);
> > > > > +
> > > > > +	return res > 0 ? strstr(buf, "has_dsc: yes") : 0;
> > > > > +}
> > > > > +
> > > > >    /*
> > > > >     * igt_is_dsc_supported_by_sink:
> > > > >     * @drmfd: A drm file descriptor
> > > > > diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
> > > > > index 241fc0ac..b58743b5 100644
> > > > > --- a/lib/igt_dsc.h
> > > > > +++ b/lib/igt_dsc.h
> > > > > @@ -9,6 +9,7 @@
> > > > >    #include "igt_fb.h"
> > > > >    #include "igt_kms.h"
> > > > > +bool igt_is_dsc_supported_by_source(int drmfd);
> > > > >    bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
> > > > >    bool igt_is_fec_supported(int drmfd, char *connector_name);
> > > > >    bool igt_is_dsc_enabled(int drmfd, char *connector_name);
> > > > > diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
> > > > > index d142fae2..b46c4449 100644
> > > > > --- a/tests/i915/kms_dsc.c
> > > > > +++ b/tests/i915/kms_dsc.c
> > > > > @@ -265,7 +265,7 @@ igt_main
> > > > >    		igt_install_exit_handler(kms_dsc_exit_handler);
> > > > >    		igt_display_require(&data.display, data.drm_fd);
> > > > >    		igt_display_require_output(&data.display);
> > > > > -		igt_require(data.disp_ver >= 11);
> > > > > +		igt_require(is_dsc_supported_by_source(data.drm_fd));
> > > > >    	}
> > > > >    	igt_describe("Tests basic display stream compression functionality if supported "
> > > > > diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
> > > > > index c90d833d..61f76dde 100644
> > > > > --- a/tests/i915/kms_dsc_helper.c
> > > > > +++ b/tests/i915/kms_dsc_helper.c
> > > > > @@ -53,6 +53,16 @@ void kms_dsc_exit_handler(int sig)
> > > > >    	restore_force_dsc_en();
> > > > >    }
> > > > > +bool is_dsc_supported_by_source(int drmfd)
> > > > > +{
> > > > > +	if (!igt_is_dsc_supported_by_source(drmfd)) {
> > > > > +		igt_debug("DSC not supported by source\n");
> > > > > +		return false;
> > > > > +	}
> > > > > +
> > > > > +	return true;
> > > > > +}
> > > > > +
> > > > >    bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output)
> > > > >    {
> > > > >    	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
> > > > > diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
> > > > > index f66191c7..2109bd76 100644
> > > > > --- a/tests/i915/kms_dsc_helper.h
> > > > > +++ b/tests/i915/kms_dsc_helper.h
> > > > > @@ -27,6 +27,7 @@ void save_force_dsc_en(int drmfd, igt_output_t *output);
> > > > >    void restore_force_dsc_en(void);
> > > > >    void kms_dsc_exit_handler(int sig);
> > > > >    bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output);
> > > > > +bool is_dsc_supported_by_source(int drmfd);
> > > > >    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,
> > > > > diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
> > > > > index 63da3a1c..e4ab65f2 100644
> > > > > --- a/tests/kms_invalid_mode.c
> > > > > +++ b/tests/kms_invalid_mode.c
> > > > > @@ -60,9 +60,8 @@ can_bigjoiner(data_t *data)
> > > > >    	if (intel_display_ver(devid) > 12) {
> > -------------------------------------------- ^^^^
> > 
> > > > >    		igt_debug("Platform supports uncompressed bigjoiner\n");
> > > > >    		return true;
> > > > > -	} else if (intel_display_ver(devid) >= 11) {
> > -------------------------------------------- ^^^^
> > 
> > If you insist on removing this check above " >= 11"
> > maybe also remove check of " > 12 " ? Then you could just write:
> > 
> > 	if (igt_is_dsc_supported_by_source(data->drm_fd) &&
> > 	    igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name)) {
> > 
> >     		igt_debug("Platform supports uncompressed bigjoiner\n");
> > 		return true;
> > 	}
> 
> There are 2 things here:
> 1. if disp_ver > 12 then platform supports "uncompressed" big joiner, here
> we don't have to check dsc support since its uncompressed.
> 2. if disp_ver >= 11 && disp_ver <= 12 then platform supports "compressed"
> big joiner and we need to check dsc support which instead of using via gen
> check we are checking with debugfs now.
> 
> So, big joiner check we still need only dsc check is not required.

Than you for explanation, maybe it will be worth to add
here some comment or igt_debug print line in > 12 case,
it is not a blocker,

Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

> 
> > 
> > This way you could also support any future change when new
> > display will not support it.
> > 
> > Regards,
> > Kamil
> > 
> > > > ---------------------------------------------- ^
> > > > imho you should keep it here unless there are platforms <= 10 with
> > > > that capability ?
> > > 
> > > i915 driver supports dsc from display_ver >= 11
> > > The whole point of removing this check is to get info from i915_cap to know
> > > if h/w supports dsc or not.
> > > 
> > > > Also previous if had braces { } so you should also use them after else:
> > > 
> > > okay.
> > > 
> > > > 
> > > > > +	} else if (igt_is_dsc_supported_by_source(data->drm_fd))
> > > > ------------- ^
> > > > >    		return igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
> > > > > -	}
> > > > 
> > > > imho better:
> > > > 	} else if (intel_display_ver(devid) >= 11) {
> > > > 		return igt_is_dsc_supported_by_source(data->drm_fd) &&
> > > > 		       igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
> > > > 	}
> > > > 
> > > > Regards,
> > > > Kamil
> > > > 
> > > > > -	}
> > > > >    	return false;
> > > > >    }
> > > > > -- 
> > > > > 2.25.1
> > > > > 

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

* Re: [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source()
  2023-06-14  9:22           ` Kamil Konieczny
@ 2023-06-14  9:33             ` Sharma, Swati2
  0 siblings, 0 replies; 17+ messages in thread
From: Sharma, Swati2 @ 2023-06-14  9:33 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev, Ankit Nautiyal

On 14-Jun-23 2:52 PM, Kamil Konieczny wrote:
> Hi Swati,
> 
> On 2023-06-14 at 10:30:25 +0530, Sharma, Swati2 wrote:
>>
>> On 13-Jun-23 4:31 PM, Kamil Konieczny wrote:
>>> Hi Swati,
>>>
>>> On 2023-06-02 at 12:54:01 +0530, Sharma, Swati2 wrote:
>>>> Hi Kamil,
>>>>
>>>> Thanks for the reviews. Please find my reply inline.
>>>>
>>>> On 01-Jun-23 7:25 PM, Kamil Konieczny wrote:
>>>>> Hi Swati,
>>>>>
>>>>> On 2023-05-31 at 12:24:07 +0530, Swati Sharma wrote:
>>>>>> Instead of assuming dsc is supported on gen11+ platforms,
>>>>>> lets use has_dsc flag in i915_capability to check hardware
>>>>>> support.
>>>>>>
>>>>>> v2: -moved changes to lib (Ankit)
>>>>>> v3: -keep includes in alphabetical order (Kamil)
>>>>>>        -don't use igt_require() in lib (Kamil)
>>>>>>        -improve return statement (Kamil)
>>>>>>
>>>>>> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>>>>>> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
>>>>>> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>>>>>> ---
>>>>>>     lib/igt_dsc.c               | 22 ++++++++++++++++++++++
>>>>>>     lib/igt_dsc.h               |  1 +
>>>>>>     tests/i915/kms_dsc.c        |  2 +-
>>>>>>     tests/i915/kms_dsc_helper.c | 10 ++++++++++
>>>>>>     tests/i915/kms_dsc_helper.h |  1 +
>>>>>>     tests/kms_invalid_mode.c    |  3 +--
>>>>>>     6 files changed, 36 insertions(+), 3 deletions(-)
>>>>>>
>>>>>> diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
>>>>>> index 6cbd8bae..76a420c1 100644
>>>>>> --- a/lib/igt_dsc.c
>>>>>> +++ b/lib/igt_dsc.c
>>>>>> @@ -6,6 +6,7 @@
>>>>>>     #include <unistd.h>
>>>>>>     #include <fcntl.h>
>>>>>>     #include <string.h>
>>>>>> +#include "igt_core.h"
>>>>>>     #include "igt_dsc.h"
>>>>>>     #include "igt_sysfs.h"
>>>>>> @@ -41,6 +42,27 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
>>>>>>     	return ret;
>>>>>>     }
>>>>>> +/*
>>>>>> + * igt_is_dsc_supported_by_source:
>>>>>> + * @drmfd: A drm file descriptor
>>>>>> + *
>>>>>> + * Returns: True if DSC is supported by source, false otherwise.
>>>>>> + */
>>>>>> +bool igt_is_dsc_supported_by_source(int drmfd)
>>>>>> +{
>>>>>> +	char buf[4096];
>>>>>> +	int dir, res;
>>>>>> +
>>>>>> +	dir = igt_debugfs_dir(drmfd);
>>>>>> +	igt_assert(dir >= 0);
>>>>>> +
>>>>>> +	res = igt_debugfs_simple_read(dir, "i915_capabilities",
>>>>>> +				      buf, sizeof(buf));
>>>>>> +	close(dir);
>>>>>> +
>>>>>> +	return res > 0 ? strstr(buf, "has_dsc: yes") : 0;
>>>>>> +}
>>>>>> +
>>>>>>     /*
>>>>>>      * igt_is_dsc_supported_by_sink:
>>>>>>      * @drmfd: A drm file descriptor
>>>>>> diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
>>>>>> index 241fc0ac..b58743b5 100644
>>>>>> --- a/lib/igt_dsc.h
>>>>>> +++ b/lib/igt_dsc.h
>>>>>> @@ -9,6 +9,7 @@
>>>>>>     #include "igt_fb.h"
>>>>>>     #include "igt_kms.h"
>>>>>> +bool igt_is_dsc_supported_by_source(int drmfd);
>>>>>>     bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
>>>>>>     bool igt_is_fec_supported(int drmfd, char *connector_name);
>>>>>>     bool igt_is_dsc_enabled(int drmfd, char *connector_name);
>>>>>> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
>>>>>> index d142fae2..b46c4449 100644
>>>>>> --- a/tests/i915/kms_dsc.c
>>>>>> +++ b/tests/i915/kms_dsc.c
>>>>>> @@ -265,7 +265,7 @@ igt_main
>>>>>>     		igt_install_exit_handler(kms_dsc_exit_handler);
>>>>>>     		igt_display_require(&data.display, data.drm_fd);
>>>>>>     		igt_display_require_output(&data.display);
>>>>>> -		igt_require(data.disp_ver >= 11);
>>>>>> +		igt_require(is_dsc_supported_by_source(data.drm_fd));
>>>>>>     	}
>>>>>>     	igt_describe("Tests basic display stream compression functionality if supported "
>>>>>> diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
>>>>>> index c90d833d..61f76dde 100644
>>>>>> --- a/tests/i915/kms_dsc_helper.c
>>>>>> +++ b/tests/i915/kms_dsc_helper.c
>>>>>> @@ -53,6 +53,16 @@ void kms_dsc_exit_handler(int sig)
>>>>>>     	restore_force_dsc_en();
>>>>>>     }
>>>>>> +bool is_dsc_supported_by_source(int drmfd)
>>>>>> +{
>>>>>> +	if (!igt_is_dsc_supported_by_source(drmfd)) {
>>>>>> +		igt_debug("DSC not supported by source\n");
>>>>>> +		return false;
>>>>>> +	}
>>>>>> +
>>>>>> +	return true;
>>>>>> +}
>>>>>> +
>>>>>>     bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output)
>>>>>>     {
>>>>>>     	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
>>>>>> diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
>>>>>> index f66191c7..2109bd76 100644
>>>>>> --- a/tests/i915/kms_dsc_helper.h
>>>>>> +++ b/tests/i915/kms_dsc_helper.h
>>>>>> @@ -27,6 +27,7 @@ void save_force_dsc_en(int drmfd, igt_output_t *output);
>>>>>>     void restore_force_dsc_en(void);
>>>>>>     void kms_dsc_exit_handler(int sig);
>>>>>>     bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output);
>>>>>> +bool is_dsc_supported_by_source(int drmfd);
>>>>>>     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,
>>>>>> diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
>>>>>> index 63da3a1c..e4ab65f2 100644
>>>>>> --- a/tests/kms_invalid_mode.c
>>>>>> +++ b/tests/kms_invalid_mode.c
>>>>>> @@ -60,9 +60,8 @@ can_bigjoiner(data_t *data)
>>>>>>     	if (intel_display_ver(devid) > 12) {
>>> -------------------------------------------- ^^^^
>>>
>>>>>>     		igt_debug("Platform supports uncompressed bigjoiner\n");
>>>>>>     		return true;
>>>>>> -	} else if (intel_display_ver(devid) >= 11) {
>>> -------------------------------------------- ^^^^
>>>
>>> If you insist on removing this check above " >= 11"
>>> maybe also remove check of " > 12 " ? Then you could just write:
>>>
>>> 	if (igt_is_dsc_supported_by_source(data->drm_fd) &&
>>> 	    igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name)) {
>>>
>>>      		igt_debug("Platform supports uncompressed bigjoiner\n");
>>> 		return true;
>>> 	}
>>
>> There are 2 things here:
>> 1. if disp_ver > 12 then platform supports "uncompressed" big joiner, here
>> we don't have to check dsc support since its uncompressed.
>> 2. if disp_ver >= 11 && disp_ver <= 12 then platform supports "compressed"
>> big joiner and we need to check dsc support which instead of using via gen
>> check we are checking with debugfs now.
>>
>> So, big joiner check we still need only dsc check is not required.
> 
> Than you for explanation, maybe it will be worth to add
> here some comment or igt_debug print line in > 12 case,
> it is not a blocker,
> 
> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

Thanks Kamil for the review. Will surely add it as igt_debug print
line.

> 
>>
>>>
>>> This way you could also support any future change when new
>>> display will not support it.
>>>
>>> Regards,
>>> Kamil
>>>
>>>>> ---------------------------------------------- ^
>>>>> imho you should keep it here unless there are platforms <= 10 with
>>>>> that capability ?
>>>>
>>>> i915 driver supports dsc from display_ver >= 11
>>>> The whole point of removing this check is to get info from i915_cap to know
>>>> if h/w supports dsc or not.
>>>>
>>>>> Also previous if had braces { } so you should also use them after else:
>>>>
>>>> okay.
>>>>
>>>>>
>>>>>> +	} else if (igt_is_dsc_supported_by_source(data->drm_fd))
>>>>> ------------- ^
>>>>>>     		return igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
>>>>>> -	}
>>>>>
>>>>> imho better:
>>>>> 	} else if (intel_display_ver(devid) >= 11) {
>>>>> 		return igt_is_dsc_supported_by_source(data->drm_fd) &&
>>>>> 		       igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
>>>>> 	}
>>>>>
>>>>> Regards,
>>>>> Kamil
>>>>>
>>>>>> -	}
>>>>>>     	return false;
>>>>>>     }
>>>>>> -- 
>>>>>> 2.25.1
>>>>>>

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

* Re: [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source()
  2023-06-02  7:24     ` Sharma, Swati2
  2023-06-13 11:01       ` Kamil Konieczny
@ 2023-06-14 12:43       ` Nautiyal, Ankit K
  1 sibling, 0 replies; 17+ messages in thread
From: Nautiyal, Ankit K @ 2023-06-14 12:43 UTC (permalink / raw)
  To: Sharma, Swati2, Kamil Konieczny, igt-dev


On 6/2/2023 12:54 PM, Sharma, Swati2 wrote:
> Hi Kamil,
>
> Thanks for the reviews. Please find my reply inline.
>
> On 01-Jun-23 7:25 PM, Kamil Konieczny wrote:
>> Hi Swati,
>>
>> On 2023-05-31 at 12:24:07 +0530, Swati Sharma wrote:
>>> Instead of assuming dsc is supported on gen11+ platforms,
>>> lets use has_dsc flag in i915_capability to check hardware
>>> support.
>>>
>>> v2: -moved changes to lib (Ankit)
>>> v3: -keep includes in alphabetical order (Kamil)
>>>      -don't use igt_require() in lib (Kamil)
>>>      -improve return statement (Kamil)
>>>
>>> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>>> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
>>> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>>> ---
>>>   lib/igt_dsc.c               | 22 ++++++++++++++++++++++
>>>   lib/igt_dsc.h               |  1 +
>>>   tests/i915/kms_dsc.c        |  2 +-
>>>   tests/i915/kms_dsc_helper.c | 10 ++++++++++
>>>   tests/i915/kms_dsc_helper.h |  1 +
>>>   tests/kms_invalid_mode.c    |  3 +--
>>>   6 files changed, 36 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
>>> index 6cbd8bae..76a420c1 100644
>>> --- a/lib/igt_dsc.c
>>> +++ b/lib/igt_dsc.c
>>> @@ -6,6 +6,7 @@
>>>   #include <unistd.h>
>>>   #include <fcntl.h>
>>>   #include <string.h>
>>> +#include "igt_core.h"
>>>   #include "igt_dsc.h"
>>>   #include "igt_sysfs.h"
>>>   @@ -41,6 +42,27 @@ static int write_dsc_debugfs(int drmfd, char 
>>> *connector_name, const char *file_n
>>>       return ret;
>>>   }
>>>   +/*
>>> + * igt_is_dsc_supported_by_source:
>>> + * @drmfd: A drm file descriptor
>>> + *
>>> + * Returns: True if DSC is supported by source, false otherwise.
>>> + */
>>> +bool igt_is_dsc_supported_by_source(int drmfd)
>>> +{
>>> +    char buf[4096];
>>> +    int dir, res;
>>> +
>>> +    dir = igt_debugfs_dir(drmfd);
>>> +    igt_assert(dir >= 0);
>>> +
>>> +    res = igt_debugfs_simple_read(dir, "i915_capabilities",
>>> +                      buf, sizeof(buf));
>>> +    close(dir);
>>> +
>>> +    return res > 0 ? strstr(buf, "has_dsc: yes") : 0;
>>> +}
>>> +
>>>   /*
>>>    * igt_is_dsc_supported_by_sink:
>>>    * @drmfd: A drm file descriptor
>>> diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
>>> index 241fc0ac..b58743b5 100644
>>> --- a/lib/igt_dsc.h
>>> +++ b/lib/igt_dsc.h
>>> @@ -9,6 +9,7 @@
>>>   #include "igt_fb.h"
>>>   #include "igt_kms.h"
>>>   +bool igt_is_dsc_supported_by_source(int drmfd);
>>>   bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
>>>   bool igt_is_fec_supported(int drmfd, char *connector_name);
>>>   bool igt_is_dsc_enabled(int drmfd, char *connector_name);
>>> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
>>> index d142fae2..b46c4449 100644
>>> --- a/tests/i915/kms_dsc.c
>>> +++ b/tests/i915/kms_dsc.c
>>> @@ -265,7 +265,7 @@ igt_main
>>>           igt_install_exit_handler(kms_dsc_exit_handler);
>>>           igt_display_require(&data.display, data.drm_fd);
>>>           igt_display_require_output(&data.display);
>>> -        igt_require(data.disp_ver >= 11);
>>> +        igt_require(is_dsc_supported_by_source(data.drm_fd));
>>>       }
>>>         igt_describe("Tests basic display stream compression 
>>> functionality if supported "
>>> diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
>>> index c90d833d..61f76dde 100644
>>> --- a/tests/i915/kms_dsc_helper.c
>>> +++ b/tests/i915/kms_dsc_helper.c
>>> @@ -53,6 +53,16 @@ void kms_dsc_exit_handler(int sig)
>>>       restore_force_dsc_en();
>>>   }
>>>   +bool is_dsc_supported_by_source(int drmfd)
>>> +{
>>> +    if (!igt_is_dsc_supported_by_source(drmfd)) {
>>> +        igt_debug("DSC not supported by source\n");
>>> +        return false;
>>> +    }
>>> +
>>> +    return true;
>>> +}
>>> +
>>>   bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output)
>>>   {
>>>       if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
>>> diff --git a/tests/i915/kms_dsc_helper.h b/tests/i915/kms_dsc_helper.h
>>> index f66191c7..2109bd76 100644
>>> --- a/tests/i915/kms_dsc_helper.h
>>> +++ b/tests/i915/kms_dsc_helper.h
>>> @@ -27,6 +27,7 @@ void save_force_dsc_en(int drmfd, igt_output_t 
>>> *output);
>>>   void restore_force_dsc_en(void);
>>>   void kms_dsc_exit_handler(int sig);
>>>   bool is_dsc_supported_by_sink(int drmfd, igt_output_t *output);
>>> +bool is_dsc_supported_by_source(int drmfd);
>>>   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,
>>> diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
>>> index 63da3a1c..e4ab65f2 100644
>>> --- a/tests/kms_invalid_mode.c
>>> +++ b/tests/kms_invalid_mode.c
>>> @@ -60,9 +60,8 @@ can_bigjoiner(data_t *data)
>>>       if (intel_display_ver(devid) > 12) {
>>>           igt_debug("Platform supports uncompressed bigjoiner\n");
>>>           return true;
>>> -    } else if (intel_display_ver(devid) >= 11) {
>> ---------------------------------------------- ^
>> imho you should keep it here unless there are platforms <= 10 with
>> that capability ?
>
> i915 driver supports dsc from display_ver >= 11
> The whole point of removing this check is to get info from i915_cap to 
> know if h/w supports dsc or not.
>
>> Also previous if had braces { } so you should also use them after else:
>
> okay.

LGTM.

As suggested by Kamil, should have braces if previous if block had braces.

With that fixed this is:

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

>
>>
>>> +    } else if (igt_is_dsc_supported_by_source(data->drm_fd))
>> ------------- ^
>>>           return igt_is_dsc_supported_by_sink(data->drm_fd, 
>>> data->output->name);
>>> -    }
>>
>> imho better:
>>     } else if (intel_display_ver(devid) >= 11) {
>>         return igt_is_dsc_supported_by_source(data->drm_fd) &&
>>                igt_is_dsc_supported_by_sink(data->drm_fd, 
>> data->output->name);
>>     }
>>
>> Regards,
>> Kamil
>>
>>> -    }
>>>         return false;
>>>   }
>>> -- 
>>> 2.25.1
>>>

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

* Re: [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability
  2023-05-31  6:54 [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability Swati Sharma
                   ` (4 preceding siblings ...)
  2023-06-01 14:17 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2023-06-14 12:48 ` Nautiyal, Ankit K
  5 siblings, 0 replies; 17+ messages in thread
From: Nautiyal, Ankit K @ 2023-06-14 12:48 UTC (permalink / raw)
  To: Swati Sharma, igt-dev

Changes LGTM.

With minor comments addressed in Patch#3:

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

On 5/31/2023 12:24 PM, Swati Sharma wrote:
> Instead of assuming dsc is supported gen11+, lets use has_dsc
> flag in i915_capability to check h/w support.
>
> Swati Sharma (3):
>    tests: s/igt_is_dsc_supported/igt_is_dsc_supported_by_sink
>    tests: s/check_dsc_on_connector/is_dsc_supported_by_sink
>    tests: add igt_is_dsc_supported_by_source()
>
>   lib/igt_dsc.c               | 28 +++++++++++++++++++++++++---
>   lib/igt_dsc.h               |  3 ++-
>   tests/i915/kms_dsc.c        |  4 ++--
>   tests/i915/kms_dsc_helper.c | 14 ++++++++++++--
>   tests/i915/kms_dsc_helper.h |  3 ++-
>   tests/i915/kms_psr2_sf.c    |  2 +-
>   tests/kms_invalid_mode.c    |  5 ++---
>   7 files changed, 46 insertions(+), 13 deletions(-)
>

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

* [igt-dev] [PATCH i-g-t 1/3] tests: s/igt_is_dsc_supported/igt_is_dsc_supported_by_sink
  2023-06-14 16:54 [igt-dev] [PATCH i-g-t v4 " Swati Sharma
@ 2023-06-14 16:54 ` Swati Sharma
  0 siblings, 0 replies; 17+ messages in thread
From: Swati Sharma @ 2023-06-14 16:54 UTC (permalink / raw)
  To: igt-dev

Rename helper.

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 lib/igt_dsc.c               | 6 +++---
 lib/igt_dsc.h               | 2 +-
 tests/i915/kms_dsc_helper.c | 2 +-
 tests/kms_invalid_mode.c    | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
index 9e1ab9b1..6cbd8bae 100644
--- a/lib/igt_dsc.c
+++ b/lib/igt_dsc.c
@@ -42,13 +42,13 @@ static int write_dsc_debugfs(int drmfd, char *connector_name, const char *file_n
 }
 
 /*
- * igt_is_dsc_supported:
+ * igt_is_dsc_supported_by_sink:
  * @drmfd: A drm file descriptor
  * @connector_name: Name of the libdrm connector we're going to use
  *
- * Returns: True if DSC is supported for the given connector, false otherwise.
+ * Returns: True if DSC is supported for the given connector/sink, false otherwise.
  */
-bool igt_is_dsc_supported(int drmfd, char *connector_name)
+bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name)
 {
 	return check_dsc_debugfs(drmfd, connector_name, "DSC_Sink_Support: yes");
 }
diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
index 9608aad4..241fc0ac 100644
--- a/lib/igt_dsc.h
+++ b/lib/igt_dsc.h
@@ -9,7 +9,7 @@
 #include "igt_fb.h"
 #include "igt_kms.h"
 
-bool igt_is_dsc_supported(int drmfd, char *connector_name);
+bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
 bool igt_is_fec_supported(int drmfd, char *connector_name);
 bool igt_is_dsc_enabled(int drmfd, char *connector_name);
 bool igt_is_force_dsc_enabled(int drmfd, char *connector_name);
diff --git a/tests/i915/kms_dsc_helper.c b/tests/i915/kms_dsc_helper.c
index 02d1a484..1adf920b 100644
--- a/tests/i915/kms_dsc_helper.c
+++ b/tests/i915/kms_dsc_helper.c
@@ -55,7 +55,7 @@ void kms_dsc_exit_handler(int sig)
 
 bool check_dsc_on_connector(int drmfd, igt_output_t *output)
 {
-	if (!igt_is_dsc_supported(drmfd, output->name)) {
+	if (!igt_is_dsc_supported_by_sink(drmfd, output->name)) {
 		igt_debug("DSC not supported on connector %s\n",
 			  output->name);
 		return false;
diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
index ec048305..63da3a1c 100644
--- a/tests/kms_invalid_mode.c
+++ b/tests/kms_invalid_mode.c
@@ -61,7 +61,7 @@ can_bigjoiner(data_t *data)
 		igt_debug("Platform supports uncompressed bigjoiner\n");
 		return true;
 	} else if (intel_display_ver(devid) >= 11) {
-		return igt_is_dsc_supported(data->drm_fd, data->output->name);
+		return igt_is_dsc_supported_by_sink(data->drm_fd, data->output->name);
 	}
 
 	return false;
-- 
2.25.1

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

end of thread, other threads:[~2023-06-14 16:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-31  6:54 [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability Swati Sharma
2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t 1/3] tests: s/igt_is_dsc_supported/igt_is_dsc_supported_by_sink Swati Sharma
2023-06-01 13:48   ` Kamil Konieczny
2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t 2/3] tests: s/check_dsc_on_connector/is_dsc_supported_by_sink Swati Sharma
2023-06-01 13:49   ` Kamil Konieczny
2023-05-31  6:54 ` [igt-dev] [PATCH i-g-t v3 3/3] tests: add igt_is_dsc_supported_by_source() Swati Sharma
2023-06-01 13:55   ` Kamil Konieczny
2023-06-02  7:24     ` Sharma, Swati2
2023-06-13 11:01       ` Kamil Konieczny
2023-06-14  5:00         ` Sharma, Swati2
2023-06-14  9:22           ` Kamil Konieczny
2023-06-14  9:33             ` Sharma, Swati2
2023-06-14 12:43       ` Nautiyal, Ankit K
2023-05-31  7:55 ` [igt-dev] ✓ Fi.CI.BAT: success for check dsc hardware capability (rev2) Patchwork
2023-06-01 14:17 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-06-14 12:48 ` [igt-dev] [PATCH i-g-t v3 0/3] check dsc hardware capability Nautiyal, Ankit K
  -- strict thread matches above, loose matches on Subject: below --
2023-06-14 16:54 [igt-dev] [PATCH i-g-t v4 " Swati Sharma
2023-06-14 16:54 ` [igt-dev] [PATCH i-g-t 1/3] tests: s/igt_is_dsc_supported/igt_is_dsc_supported_by_sink Swati Sharma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox