public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_dp_dsc: Read the debugfs only once
@ 2019-06-10 23:26 Anusha Srivatsa
  2019-06-10 23:26 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_dp_dsc: Add a subtest to force DSC output BPP Anusha Srivatsa
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Anusha Srivatsa @ 2019-06-10 23:26 UTC (permalink / raw)
  To: igt-dev; +Cc: Manasi Navare, Anusha Srivatsa

Instead of doing a debugfs_simple_read and then
a debugfs_read(), lets read the debugfs node just once.
We anyway get the suitable return from the following
strstr operation.

For any following subtests, we will be reading only the
contents of the buffer. We can avoid the simple_read
altogether.

Cc: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
---
 tests/kms_dp_dsc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tests/kms_dp_dsc.c b/tests/kms_dp_dsc.c
index e2e3aaa0..7f2bf276 100644
--- a/tests/kms_dp_dsc.c
+++ b/tests/kms_dp_dsc.c
@@ -80,8 +80,6 @@ static bool is_dp_dsc_supported(data_t *data)
 
 	strcpy(file_name, data->conn_name);
 	strcat(file_name, "/i915_dsc_fec_support");
-	igt_require(igt_debugfs_simple_read(data->debugfs_fd, file_name, buf,
-					    sizeof(buf)) > 0);
 	igt_debugfs_read(data->drm_fd, file_name, buf);
 
 	return strstr(buf, "DSC_Sink_Support: yes");
-- 
2.17.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_dp_dsc: Create subtest if connector is connected.
@ 2019-05-29 23:39 Anusha
  2019-05-29 23:39 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_dp_dsc: Add a subtest to force DSC output BPP Anusha
  0 siblings, 1 reply; 9+ messages in thread
From: Anusha @ 2019-05-29 23:39 UTC (permalink / raw)
  To: igt-dev; +Cc: Manasi Navare, Anusha Srivatsa, Petri Latvala

From: Anusha Srivatsa <anusha.srivatsa@intel.com>

Instead of creating a subtest and skipping, check the
conditions and only if they satisfy, go ahead and create
the subtest.

Check if the connector is connected, supports DSC and
if DP then it supports FEC as well. Only if these three
conditions are satisfied then create then try to force
DSC on the connector.

Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
---
 tests/kms_dp_dsc.c | 54 ++++++++++++++++++++++------------------------
 1 file changed, 26 insertions(+), 28 deletions(-)

diff --git a/tests/kms_dp_dsc.c b/tests/kms_dp_dsc.c
index e2e3aaa0..b99037af 100644
--- a/tests/kms_dp_dsc.c
+++ b/tests/kms_dp_dsc.c
@@ -271,35 +271,33 @@ igt_main
 	}
 
 	for (test_cnt = 0; test_cnt < ARRAY_SIZE(tests); test_cnt++) {
-
-		igt_subtest_f("basic-dsc-enable-%s",
-			      kmstest_connector_type_str(tests[test_cnt])) {
-			test_conn_cnt = 0;
-			for (i = 0; i < res->count_connectors; i++) {
-				connector = drmModeGetConnectorCurrent(data.drm_fd,
-								       res->connectors[i]);
-				if (connector->connection != DRM_MODE_CONNECTED ||
-				    connector->connector_type !=
-				    tests[test_cnt])
-					continue;
-				output = igt_output_from_connector(&data.display, connector);
-				sprintf(data.conn_name, "%s-%d",
-					kmstest_connector_type_str(connector->connector_type),
-					connector->connector_type_id);
-				if(!is_dp_dsc_supported(&data)) {
-					igt_debug("DSC not supported on connector %s \n",
-						  data.conn_name);
-					continue;
-				}
-				if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
-				    !is_dp_fec_supported(&data)) {
-					igt_debug("DSC cannot be enabled without FEC on %s\n",
-						  data.conn_name);
-					continue;
-				}
-				test_conn_cnt++;
-				run_test(&data, output, test_basic_dsc_enable);
+		test_conn_cnt = 0;
+		for (i = 0; i < res->count_connectors; i++) {
+			connector = drmModeGetConnectorCurrent(data.drm_fd,
+							       res->connectors[i]);
+			if (connector->connection != DRM_MODE_CONNECTED ||
+			    connector->connector_type !=
+			    tests[test_cnt])
+				continue;
+			output = igt_output_from_connector(&data.display, connector);
+			sprintf(data.conn_name, "%s-%d",
+				kmstest_connector_type_str(connector->connector_type),
+				connector->connector_type_id);
+			if(!is_dp_dsc_supported(&data)) {
+				igt_debug("DSC not supported on connector %s \n",
+					  data.conn_name);
+				continue;
+			}
+			if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
+			    !is_dp_fec_supported(&data)) {
+				igt_debug("DSC cannot be enabled without FEC on %s\n",
+					  data.conn_name);
+				continue;
 			}
+			test_conn_cnt++;
+			igt_subtest_f("basic-dsc-enable-%s",
+				      kmstest_connector_type_str(tests[test_cnt]))
+			run_test(&data, output, test_basic_dsc_enable);
 			igt_skip_on(test_conn_cnt == 0);
 		}
 	}
-- 
2.17.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-06-20  0:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-10 23:26 [igt-dev] [PATCH i-g-t 1/2] tests/kms_dp_dsc: Read the debugfs only once Anusha Srivatsa
2019-06-10 23:26 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_dp_dsc: Add a subtest to force DSC output BPP Anusha Srivatsa
2019-06-11 19:55   ` Manasi Navare
2019-06-13 22:33     ` Srivatsa, Anusha
2019-06-20  0:44     ` Srivatsa, Anusha
2019-06-11  0:07 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_dp_dsc: Read the debugfs only once Patchwork
2019-06-11 19:07 ` [igt-dev] [PATCH i-g-t 1/2] " Manasi Navare
2019-06-12  8:00 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-05-29 23:39 [igt-dev] [PATCH i-g-t 1/2] tests/kms_dp_dsc: Create subtest if connector is connected Anusha
2019-05-29 23:39 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_dp_dsc: Add a subtest to force DSC output BPP Anusha

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