public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Mohammed Thasleem <mohammed.thasleem@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH v2] tests/i915/i915_pm_dc : Check DC5 state with externel active panel
Date: Wed, 21 Dec 2022 09:17:02 -0500	[thread overview]
Message-ID: <Y6MVXsw5XF6K/uxn@intel.com> (raw)
In-Reply-To: <20221220135734.6354-1-mohammed.thasleem@intel.com>

On Tue, Dec 20, 2022 at 07:27:34PM +0530, Mohammed Thasleem wrote:
> This test validates negative scenario of DC5 state by keeping
> all connectors's DPMS property set to ON.
> 
> v2: Added function to check externel panel and skip test if not found.
> 
> Signed-off-by: Mohammed Thasleem <mohammed.thasleem@intel.com>
> ---
>  tests/i915/i915_pm_dc.c | 44 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/tests/i915/i915_pm_dc.c b/tests/i915/i915_pm_dc.c
> index ba49d014..5a987728 100644
> --- a/tests/i915/i915_pm_dc.c
> +++ b/tests/i915/i915_pm_dc.c
> @@ -246,6 +246,13 @@ static void check_dc_counter(data_t *data, int dc_flag, uint32_t prev_dc_count)
>  		     data->debugfs_dump = igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
>  }
>  
> +static void check_dc_counter_negative(data_t *data, int dc_flag, uint32_t prev_dc_count)
> +{
> +	igt_assert_f(!dc_state_wait_entry(data->debugfs_fd, dc_flag, prev_dc_count),
> +			"%s state is achieved\n%s:\n%s\n", dc_state_name(dc_flag), PWR_DOMAIN_INFO,
> +			data->debugfs_dump = igt_sysfs_get(data->debugfs_fd, PWR_DOMAIN_INFO));
> +}
> +
>  static void setup_videoplayback(data_t *data)
>  {
>  	color_t red_green_blue[] = {
> @@ -411,6 +418,18 @@ static void test_dc_state_dpms(data_t *data, int dc_flag)
>  	cleanup_dc_dpms(data);
>  }
>  
> +static void test_dc_state_dpms_negative(data_t *data, int dc_flag)
> +{
> +	uint32_t dc_counter;
> +
> +	require_dc_counter(data->debugfs_fd, dc_flag);
> +	setup_dc_dpms(data);
> +	dc_counter = read_dc_counter(data->debugfs_fd, dc_flag);
> +	dpms_on(data);

I would say that probably the most effective negative test and
with a bigger coverage is to add a simple assert for dc0 inside
the dpms_on function along with the runtime_pm_active assert.

> +	check_dc_counter_negative(data, dc_flag, dc_counter);
> +	cleanup_dc_dpms(data);
> +}
> +
>  static bool support_dc6(int debugfs_fd)
>  {
>  	char buf[4096];
> @@ -485,6 +504,23 @@ static void test_dc9_dpms(data_t *data)
>  	setup_dc9_dpms(data, dc_target);
>  }
>  
> +static void check_external_panel(igt_display_t *display)
> +{
> +	igt_output_t *output = NULL;
> +	int external_panel = 0;
> +
> +	for_each_connected_output(display, output) {
> +		drmModeConnectorPtr c = output->config.connector;
> +
> +		if (c->connector_type != DRM_MODE_CONNECTOR_eDP &&
> +		    c->connection == DRM_MODE_CONNECTED) {
> +			external_panel++;
> +		}
> +	}
> +	igt_skip_on_f(!external_panel,
> +		      "External panel not detected, skip execution\n");
> +}
> +
>  static void kms_poll_state_restore(int sig)
>  {
>  	int sysfs_fd;
> @@ -552,6 +588,14 @@ igt_main
>  		test_dc_state_dpms(&data, CHECK_DC5);
>  	}
>  
> +	igt_describe("This test validates negative scenario of DC5 display "
> +		     "engine entry to DC5 state while all connectors's DPMS "
> +		     "property set to ON");
> +	igt_subtest("dc5-dpms-negative") {
> +		check_external_panel(&data.display);
> +		test_dc_state_dpms_negative(&data, CHECK_DC5);
> +	}
> +
>  	igt_describe("This test validates display engine entry to DC5 state "
>  		     "while all connectors's DPMS property set to OFF");
>  	igt_subtest("dc6-dpms") {
> -- 
> 2.25.1
> 

  parent reply	other threads:[~2022-12-21 14:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 19:11 [igt-dev] [PATCH i-g-t] tests/i915/i915_pm_dc : Check DC5 state with externel active panel Mohammed Thasleem
2022-12-18 22:14 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-12-18 23:52 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2022-12-20 13:57 ` [igt-dev] [PATCH v2] " Mohammed Thasleem
2022-06-30  5:57   ` [igt-dev] [PATCH i-g-t] " Mohammed Thasleem
2023-01-24 15:24     ` Imre Deak
2022-12-21 14:17   ` Rodrigo Vivi [this message]
2022-12-21 17:31     ` [igt-dev] [PATCH v2] " Rodrigo Vivi
2022-12-30 19:43   ` Swati Sharma
2023-01-27 14:38   ` [igt-dev] [PATCH i-g-t] " Mohammed Thasleem
2023-02-03  6:29     ` Swati Sharma
2022-12-28 12:42 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/i915/i915_pm_dc : Check DC5 state with externel active panel (rev3) Patchwork
2023-01-06  7:48 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/i915_pm_dc : Check DC5 state with externel active panel (rev4) Patchwork
2023-01-06 12:34 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-01-27 15:21 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/i915_pm_dc : Check DC5 state with externel active panel (rev5) Patchwork
2023-01-27 18:00 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=Y6MVXsw5XF6K/uxn@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=mohammed.thasleem@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox