All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kulkarni, Vandita" <vandita.kulkarni@intel.com>
To: "Patnana, Venkata Sai" <venkata.sai.patnana@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH v2 i-g-t] tests/i915/kms_dsc: To test modeset on dsc with highest mode
Date: Tue, 16 Nov 2021 05:25:14 +0000	[thread overview]
Message-ID: <20581fa387a74359aa871f6a2eacb90d@intel.com> (raw)
In-Reply-To: <20211115152938.21269-1-venkata.sai.patnana@intel.com>

> -----Original Message-----
> From: Patnana, Venkata Sai <venkata.sai.patnana@intel.com>
> Sent: Monday, November 15, 2021 9:00 PM
> To: igt-dev@lists.freedesktop.org
> Cc: Patnana, Venkata Sai <venkata.sai.patnana@intel.com>; Kulkarni,
> Vandita <vandita.kulkarni@intel.com>; B S, Karthik <karthik.b.s@intel.com>;
> Modem, Bhanuprakash <bhanuprakash.modem@intel.com>; Sharma,
> Swati2 <swati2.sharma@intel.com>
> Subject: [PATCH v2 i-g-t] tests/i915/kms_dsc: To test modeset on dsc with
> highest mode
> 
> From: Patnana Venkata Sai <venkata.sai.patnana@intel.com>
> 
> Force dsc enable supports resolutions above 5K in DP.
> Bigjoiner does not support force bpp also due to bigjoiner limitation pipe D
> we are skipping. In this patch, changes are done to pick the highest mode
> rather the default mode.

This patch seems to be doing more than what it is saying.
I see that there are new test names being added.

Please split the patch.
Let this patch just do the testing of dsc on modes greater than 5k,
 inline with the current driver design.

Thanks,
Vandita
> 
> v2: Updated indentation
> 
> Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
> Cc: Karthik B S <karthik.b.s@intel.com>
> Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> Cc: Swati Sharma <swati2.sharma@intel.com>
> 
> Signed-off-by: Patnana Venkata Sai <venkata.sai.patnana@intel.com>
> ---
>  tests/i915/kms_dsc.c | 149 +++++++++++++++++++++++++++++-------------
> -
>  1 file changed, 102 insertions(+), 47 deletions(-)
> 
> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c index
> dcfe8b9669..dff5ce29d2 100644
> --- a/tests/i915/kms_dsc.c
> +++ b/tests/i915/kms_dsc.c
> @@ -63,8 +63,8 @@ typedef struct {
>  	drmModeEncoder *encoder;
>  	int crtc;
>  	int compression_bpp;
> +	int n_pipes;
>  	enum pipe pipe;
> -	char conn_name[128];
>  } data_t;
> 
>  bool force_dsc_en_orig;
> @@ -79,7 +79,7 @@ static void force_dsc_enable(data_t *data)  {
>  	int ret;
> 
> -	igt_debug ("Forcing DSC enable on %s\n", data->conn_name);
> +	igt_debug ("Forcing DSC enable on %s\n", data->output->name);
>  	ret = igt_force_dsc_enable(data->drm_fd,
>  				      data->output->config.connector);
>  	igt_assert_f(ret > 0, "debugfs_write failed"); @@ -90,7 +90,7 @@
> 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);
> +		  data->compression_bpp, data->output->name);
>  	ret = igt_force_dsc_enable_bpp(data->drm_fd,
>  					  data->output->config.connector,
>  					  data->compression_bpp);
> @@ -151,41 +151,55 @@ static bool is_external_panel(drmModeConnector
> *connector)
>  	}
>  }
> 
> -static bool check_dsc_on_connector(data_t *data, uint32_t drmConnector)
> +static int sort_drm_modes(const void *a, const void *b) {
> +	const drmModeModeInfo *mode1 = a, *mode2 = b;
> +
> +	return (mode1->clock < mode2->clock) - (mode2->clock < mode1-
> >clock);
> +}
> +
> +static igt_output_t *check_dsc_on_connector(data_t *data, uint32_t
> +drmConnector)
>  {
>  	drmModeConnector *connector;
>  	igt_output_t *output;
> -
>  	connector = drmModeGetConnectorCurrent(data->drm_fd,
>  					       drmConnector);
>  	if (connector->connection != DRM_MODE_CONNECTED)
> -		return false;
> +		return NULL;
> 
>  	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);
> +
> +        /* As dsc supports >= 5k modes, we need to supress lower
> +         * resolutions.
> +	 */
> +	qsort(output->config.connector->modes,
> +	      output->config.connector->count_modes,
> +	      sizeof(drmModeModeInfo),
> +	      sort_drm_modes);
> +	if (output->config.connector->connector_type ==
> DRM_MODE_CONNECTOR_DisplayPort &&
> +	    output->config.connector->modes[0].hdisplay < 5120)
> +		return NULL;
> 
>  	if (!igt_is_dsc_supported(data->drm_fd, connector)) {
>  		igt_debug("DSC not supported on connector %s\n",
> -			  data->conn_name);
> -		return false;
> +			  output->name);
> +		return NULL;
>  	}
>  	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;
> +			  output->name);
> +		return NULL;
>  	}
> -	data->output = output;
> -	return true;
> +	return output;
>  }
> 
>  /*
>   * Re-probe connectors and do a modeset with DSC
>   *
>   */
> -static void update_display(data_t *data, enum dsc_test_type test_type)
> +static void update_display(data_t *data, enum dsc_test_type test_type,
> +			   unsigned int drm_format)
>  {
>  	bool enabled;
>  	igt_plane_t *primary;
> @@ -194,7 +208,7 @@ static void update_display(data_t *data, enum
> dsc_test_type test_type)
>  	igt_output_set_pipe(data->output, PIPE_NONE);
>  	igt_display_commit(&data->display);
> 
> -	igt_debug("DSC is supported on %s\n", data->conn_name);
> +	igt_debug("DSC is supported on %s\n", data->output->name);
>  	save_force_dsc_en(data);
>  	force_dsc_enable(data);
>  	if (test_type == test_dsc_compression_bpp) { @@ -203,8 +217,15
> @@ static void update_display(data_t *data, enum dsc_test_type
> test_type)
>  	}
> 
>  	igt_output_set_pipe(data->output, data->pipe);
> +	qsort(data->output->config.connector->modes,
> +	      data->output->config.connector->count_modes,
> +	      sizeof(drmModeModeInfo),
> +	      sort_drm_modes);
> +	igt_output_override_mode(data->output,
> +&data->output->config.connector->modes[0]);
>  	primary = igt_output_get_plane_type(data->output,
>  					    DRM_PLANE_TYPE_PRIMARY);
> +	igt_skip_on_f(!igt_plane_has_format_mod(primary, drm_format,
> DRM_FORMAT_MOD_LINEAR),
> +		      "plane %s format does not have support \n",
> +igt_format_str(drm_format));
> 
>  	/* Now set the output to the desired mode */
>  	igt_plane_set_fb(primary, &data->fb_test_pattern); @@ -217,29
> +238,33 @@ static void update_display(data_t *data, enum dsc_test_type
> test_type)
>  	manual("RGB test pattern without corruption");
> 
>  	enabled = igt_is_dsc_enabled(data->drm_fd,
> -					data->output->config.connector);
> +				     data->output->config.connector);
>  	restore_force_dsc_en();
> -	if (test_type == test_dsc_compression_bpp) {
> -		igt_debug("Rest compression BPP \n");
> -		data->compression_bpp = 0;
> -		force_dsc_enable_bpp(data);
> -	}
> +
> +	igt_debug("Reset compression BPP \n");
> +	data->compression_bpp = 0;
> +	force_dsc_enable_bpp(data);
> 
>  	igt_assert_f(enabled,
>  		     "Default DSC enable failed on Connector: %s Pipe: %s\n",
> -		     data->conn_name,
> +		     data->output->name,
>  		     kmstest_pipe_name(data->pipe));
>  }
> 
> -static void run_test(data_t *data, enum dsc_test_type test_type)
> +static void run_test(data_t *data, enum dsc_test_type test_type,
> +		     unsigned int drm_format)
>  {
>  	enum pipe pipe;
>  	char test_name[10];
> -	drmModeModeInfo *mode = igt_output_get_mode(data->output);
> 
> -	igt_create_pattern_fb(data->drm_fd, mode->hdisplay,
> -			      mode->vdisplay,
> -			      DRM_FORMAT_XRGB8888,
> +	igt_skip_on_f (test_type == test_dsc_compression_bpp &&
> +		       data->output->config.connector->modes[0].hdisplay >=
> 5120,
> +		       "Bigjoiner does not support force bpp\n");
> +
> +	igt_create_pattern_fb(data->drm_fd,
> +			      data->output->config.connector-
> >modes[0].hdisplay,
> +			      data->output->config.connector-
> >modes[0].vdisplay,
> +			      drm_format,
>  			      DRM_FORMAT_MOD_LINEAR,
>  			      &data->fb_test_pattern);
> 
> @@ -253,14 +278,19 @@ static void run_test(data_t *data, enum
> dsc_test_type test_type)
>  		}
> 
>  		snprintf(test_name, sizeof(test_name), "-%dbpp", data-
> >compression_bpp);
> -		if (igt_pipe_connector_valid(pipe, data->output)) {
> -			data->pipe = pipe;
> +		if (!igt_pipe_connector_valid(pipe, data->output))
> +			continue;
> 
> -			igt_dynamic_f("%s-pipe-%s%s", data->output-
> >name,
> -					kmstest_pipe_name(pipe),
> -					(test_type ==
> test_dsc_compression_bpp) ?
> -					 test_name : "")
> -				update_display(data, test_type);
> +		igt_dynamic_f("%s-pipe-%s%s", data->output->name,
> +			      kmstest_pipe_name(pipe),
> +			      (test_type == test_dsc_compression_bpp) ?
> +			      test_name : "") {
> +			igt_require_f((data->output->config.connector-
> >modes[0].hdisplay >= 5120) &&
> +				      (pipe < (data->n_pipes - 1)),
> +				      "pipe-%s not supported due to bigjoiner
> limitation\n",
> +				      kmstest_pipe_name(pipe));
> +			data->pipe = pipe;
> +			update_display(data, test_type, drm_format);
>  		}
> 
>  		if (test_type == test_dsc_compression_bpp) @@ -275,7
> +305,17 @@ igt_main
>  	data_t data = {};
>  	drmModeRes *res;
>  	drmModeConnector *connector = NULL;
> -	int i, j;
> +	igt_output_t *outputs[IGT_MAX_PIPES] = {};
> +	igt_output_t *output;
> +	int i, j, supported_connectors = 0;
> +	struct {
> +		unsigned int bpc;
> +		int format;
> +		char format_str[20];
> +	} test_list[] = {
> +		{8, DRM_FORMAT_XRGB8888, "XRGB8888"},
> +		{10, DRM_FORMAT_XRGB2101010, "XRGB2101010"},
> +	};
>  	igt_fixture {
>  		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
>  		data.devid = intel_get_drm_devid(data.drm_fd); @@ -
> 283,14 +323,30 @@ igt_main
>  		igt_install_exit_handler(kms_dsc_exit_handler);
>  		igt_display_require(&data.display, data.drm_fd);
>  		igt_require(res = drmModeGetResources(data.drm_fd));
> -	}
> -	igt_subtest_with_dynamic("basic-dsc-enable") {
>  		for (j = 0; j < res->count_connectors; j++) {
> -			if (!check_dsc_on_connector(&data, res-
> >connectors[j]))
> -				continue;
> -			run_test(&data, test_basic_dsc_enable);
> +			output = check_dsc_on_connector(&data, res-
> >connectors[j]);
> +
> +			if (output)
> +				outputs[supported_connectors++] = output;
>  		}
> +		igt_require_f(supported_connectors, "No DSC supported
> panel connected.\n");
> +		data.n_pipes = 0;
> +		for_each_pipe(&data.display, i)
> +			data.n_pipes++;
> +
>  	}
> +
> +	for (i=0; i < ARRAY_SIZE(test_list); i++) {
> +		igt_subtest_with_dynamic_f("basic-dsc-enable-%s",
> +					   test_list[i].format_str) {
> +			for (j = 0; j < supported_connectors; j++) {
> +				data.output = outputs[j];
> +				run_test(&data, test_basic_dsc_enable,
> +					 test_list[i].format);
> +			}
> +		}
> +	}
> +
>  	/* currently we are validating compression bpp on XRGB8888 format
> only */
>  	igt_subtest_with_dynamic("XRGB8888-dsc-compression") {
>  		uint32_t bpp_list[] = {
> @@ -302,13 +358,12 @@ igt_main
> 
>  		igt_require(intel_display_ver(data.devid) >= 13);
> 
> -		for (j = 0; j < res->count_connectors; j++) {
> -			if (!check_dsc_on_connector(&data, res-
> >connectors[j]))
> -				continue;
> -
> +		for (j = 0; j < supported_connectors; j++) {
> +			data.output = outputs[j];
>  			for (i = 0; i < ARRAY_SIZE(bpp_list); i++) {
>  				data.compression_bpp = bpp_list[i];
> -				run_test(&data,
> test_dsc_compression_bpp);
> +				run_test(&data, test_dsc_compression_bpp,
> +					 DRM_FORMAT_XRGB8888);
>  			}
>  		}
>  	}
> --
> 2.25.1

  reply	other threads:[~2021-11-16  5:25 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 12:27 [igt-dev] [PATCH i-g-t] tests/i915/kms_dsc: To test modeset on highest mode venkata.sai.patnana
2021-11-12 13:23 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
2021-11-12 13:42 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2021-11-15  4:58   ` Patnana, Venkata Sai
2021-11-15 17:47     ` Vudum, Lakshminarayana
2021-11-15  7:34 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/kms_dsc: To test modeset on highest mode (rev2) Patchwork
2021-11-15 10:21 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-11-15 15:08 ` [igt-dev] [PATCH i-g-t] tests/i915/kms_dsc: To test modeset on dsc with highest mode venkata.sai.patnana
2021-11-15 15:13 ` [igt-dev] [PATCH i-g-t] tests/i915/kms_dsc: To test modeset on " Sharma, Swati2
2021-11-15 15:29 ` [igt-dev] [PATCH v2 i-g-t] tests/i915/kms_dsc: To test modeset on dsc with " venkata.sai.patnana
2021-11-16  5:25   ` Kulkarni, Vandita [this message]
2021-11-15 16:18 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/kms_dsc: To test modeset on highest mode (rev4) Patchwork
2021-11-15 18:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-11-16  7:25 ` [igt-dev] [PATCH v3 i-g-t] tests/i915/kms_dsc: To test modeset on dsc with highest mode venkata.sai.patnana
2021-11-16  8:24 ` [igt-dev] [PATCH v4 " venkata.sai.patnana
2021-11-17  4:35   ` Kulkarni, Vandita
2021-11-17  7:31     ` Sharma, Swati2
2021-11-17  7:38       ` Sharma, Swati2
2021-11-16  8:33 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/kms_dsc: To test modeset on highest mode (rev5) Patchwork
2021-11-16  8:58 ` [igt-dev] ✗ GitLab.Pipeline: warning for tests/i915/kms_dsc: To test modeset on highest mode (rev6) Patchwork
2021-11-16  9:15 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2021-11-16  9:35 ` [igt-dev] ✓ Fi.CI.IGT: success for tests/i915/kms_dsc: To test modeset on highest mode (rev5) Patchwork
2021-11-16 10:22 ` [igt-dev] ✗ Fi.CI.IGT: failure for tests/i915/kms_dsc: To test modeset on highest mode (rev6) Patchwork
2021-11-17  5:17   ` Patnana, Venkata Sai
2021-11-17  5:52 ` [igt-dev] ✓ Fi.CI.IGT: success " 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=20581fa387a74359aa871f6a2eacb90d@intel.com \
    --to=vandita.kulkarni@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=venkata.sai.patnana@intel.com \
    /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.