All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/3] tests/kms_dsc: Extend support to HDMI
Date: Mon, 19 Jul 2021 17:49:52 +0530	[thread overview]
Message-ID: <20210719121953.14449-3-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20210719121953.14449-1-bhanuprakash.modem@intel.com>

As HDMI also supports DSC, we need to extend the test coverage.
This patch will remove the connector type check to support HDMI.

Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
Cc: Patnana Venkata Sai <venkata.sai.patnana@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Navare Manasi D <manasi.d.navare@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/{kms_dp_dsc.c => kms_dsc.c} | 43 +++++++++++++++++++------------
 tests/meson.build                 |  2 +-
 2 files changed, 28 insertions(+), 17 deletions(-)
 rename tests/{kms_dp_dsc.c => kms_dsc.c} (90%)

diff --git a/tests/kms_dp_dsc.c b/tests/kms_dsc.c
similarity index 90%
rename from tests/kms_dp_dsc.c
rename to tests/kms_dsc.c
index 6e8dda77dc..839185fad3 100644
--- a/tests/kms_dp_dsc.c
+++ b/tests/kms_dsc.c
@@ -75,23 +75,23 @@ static inline void manual(const char *expected)
 	igt_debug_manual_check("all", expected);
 }
 
-static void force_dp_dsc_enable(data_t *data)
+static void force_dsc_enable(data_t *data)
 {
 	int ret;
 
 	igt_debug ("Forcing DSC enable on %s\n", data->conn_name);
-	ret = igt_force_dp_dsc_enable(data->drm_fd,
+	ret = igt_force_dsc_enable(data->drm_fd,
 				      data->output->config.connector);
 	igt_assert_f(ret > 0, "debugfs_write failed");
 }
 
-static void force_dp_dsc_set_bpp(data_t *data)
+static void force_dsc_enable_bpp(data_t *data)
 {
 	int ret;
 
 	igt_debug("Forcing DSC BPP to %d on %s\n",
 		  data->compression_bpp, data->conn_name);
-	ret = igt_force_dp_dsc_enable_bpp(data->drm_fd,
+	ret = igt_force_dsc_enable_bpp(data->drm_fd,
 					  data->output->config.connector,
 					  data->compression_bpp);
 	igt_assert_f(ret > 0, "debugfs_write failed");
@@ -103,7 +103,7 @@ static void save_force_dsc_en(data_t *data)
 		igt_is_force_dsc_enabled(data->drm_fd,
 					 data->output->config.connector);
 	force_dsc_restore_fd =
-		igt_get_dp_dsc_debugfs_fd(data->drm_fd,
+		igt_get_dsc_debugfs_fd(data->drm_fd,
 					  data->output->config.connector);
 	igt_assert(force_dsc_restore_fd >= 0);
 }
@@ -133,11 +133,24 @@ static void test_cleanup(data_t *data)
 	}
 }
 
-static void kms_dp_dsc_exit_handler(int sig)
+static void kms_dsc_exit_handler(int sig)
 {
 	restore_force_dsc_en();
 }
 
+static bool is_external_panel(drmModeConnector *connector)
+{
+	switch (connector->connector_type) {
+		case DRM_MODE_CONNECTOR_LVDS:
+		case DRM_MODE_CONNECTOR_eDP:
+		case DRM_MODE_CONNECTOR_DSI:
+		case DRM_MODE_CONNECTOR_DPI:
+			return false;
+		default:
+			return true;
+	}
+}
+
 static bool check_dsc_on_connector(data_t *data, uint32_t drmConnector)
 {
 	drmModeConnector *connector;
@@ -145,9 +158,7 @@ static bool check_dsc_on_connector(data_t *data, uint32_t drmConnector)
 
 	connector = drmModeGetConnectorCurrent(data->drm_fd,
 					       drmConnector);
-	if (connector->connection != DRM_MODE_CONNECTED ||
-	    ((connector->connector_type != DRM_MODE_CONNECTOR_eDP) &&
-	    (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort)))
+	if (connector->connection != DRM_MODE_CONNECTED)
 		return false;
 
 	output = igt_output_from_connector(&data->display, connector);
@@ -155,13 +166,13 @@ static bool check_dsc_on_connector(data_t *data, uint32_t drmConnector)
 		kmstest_connector_type_str(connector->connector_type),
 		connector->connector_type_id);
 
-	if (!igt_is_dp_dsc_supported(data->drm_fd, connector)) {
+	if (!igt_is_dsc_supported(data->drm_fd, connector)) {
 		igt_debug("DSC not supported on connector %s\n",
 			  data->conn_name);
 		return false;
 	}
-	if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort &&
-	    !igt_is_dp_fec_supported(data->drm_fd, connector)) {
+	if (is_external_panel(connector) &&
+	    !igt_is_fec_supported(data->drm_fd, connector)) {
 		igt_debug("DSC cannot be enabled without FEC on %s\n",
 			  data->conn_name);
 		return false;
@@ -185,10 +196,10 @@ static void update_display(data_t *data, enum dsc_test_type test_type)
 
 	igt_debug("DSC is supported on %s\n", data->conn_name);
 	save_force_dsc_en(data);
-	force_dp_dsc_enable(data);
+	force_dsc_enable(data);
 	if (test_type == test_dsc_compression_bpp) {
 		igt_debug("Trying to set BPP to %d\n", data->compression_bpp);
-		force_dp_dsc_set_bpp(data);
+		force_dsc_enable_bpp(data);
 	}
 
 	igt_output_set_pipe(data->output, data->pipe);
@@ -205,7 +216,7 @@ static void update_display(data_t *data, enum dsc_test_type test_type)
 	 */
 	manual("RGB test pattern without corruption");
 
-	enabled = igt_is_dp_dsc_enabled(data->drm_fd,
+	enabled = igt_is_dsc_enabled(data->drm_fd,
 					data->output->config.connector);
 	restore_force_dsc_en();
 	if (test_type == test_dsc_compression_bpp) {
@@ -272,7 +283,7 @@ igt_main
 		igt_require_intel(data.drm_fd);
 		data.devid = intel_get_drm_devid(data.drm_fd);
 		kmstest_set_vt_graphics_mode();
-		igt_install_exit_handler(kms_dp_dsc_exit_handler);
+		igt_install_exit_handler(kms_dsc_exit_handler);
 		igt_display_require(&data.display, data.drm_fd);
 		igt_require(res = drmModeGetResources(data.drm_fd));
 	}
diff --git a/tests/meson.build b/tests/meson.build
index d3de40be07..1bdfddbb2a 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -31,9 +31,9 @@ test_progs = [
 	'kms_cursor_legacy',
 	'kms_dither',
 	'kms_dp_aux_dev',
-	'kms_dp_dsc',
 	'kms_dp_tiled_display',
 	'kms_draw_crc',
+	'kms_dsc',
 	'kms_fbcon_fbt',
 	'kms_fence_pin_leak',
 	'kms_flip',
-- 
2.25.1

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

  parent reply	other threads:[~2021-07-19 12:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 12:19 [igt-dev] [PATCH i-g-t 0/3] Extend DSC support to HDMI Bhanuprakash Modem
2021-07-19 12:19 ` [igt-dev] [PATCH i-g-t 1/3] lib/igt_kms: Rename dp_dsc to dsc Bhanuprakash Modem
2021-07-19 12:19 ` Bhanuprakash Modem [this message]
2021-07-19 12:19 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_invalid_dotclock: Update to use renamed DSC api Bhanuprakash Modem
2021-07-19 12:35 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Extend DSC support to HDMI Patchwork
2021-07-19 12:41 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210719121953.14449-3-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.