[igt-dev] [PATCH i-g-t] tests/i915/i915_pm_dc: Validate display enters to DC9 state

Gupta, Anshuman anshuman.gupta at intel.com
Wed Jan 20 07:05:24 UTC 2021



> -----Original Message-----
> From: Bhatt, Jigar <jigar.bhatt at intel.com>
> Sent: Monday, January 18, 2021 5:18 PM
> To: igt-dev at lists.freedesktop.org
> Cc: Bhatt, Jigar <jigar.bhatt at intel.com>; Shankar, Uma
> <uma.shankar at intel.com>; Gupta, Anshuman
> <anshuman.gupta at intel.com>
> Subject: [PATCH i-g-t] tests/i915/i915_pm_dc: Validate display enters to
> DC9 state
I would name this patch as Add DC9 igt test
> 
> From: jbhatt <jigar.bhatt at intel.com>
> 
> Signed-off-by: jbhatt <jigar.bhatt at intel.com>
> ---
>  tests/i915/i915_pm_dc.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/tests/i915/i915_pm_dc.c b/tests/i915/i915_pm_dc.c index
> 30c6024..679ac94 100644
> --- a/tests/i915/i915_pm_dc.c
> +++ b/tests/i915/i915_pm_dc.c
> @@ -384,6 +384,25 @@ static void test_dc_state_dpms(data_t *data, int
> dc_flag)
>  	cleanup_dc_dpms(data);
>  }
> 
> +static bool check_dc9(uint32_t debugfs_fd, int prev_dc5, int prev_dc6)
> +{
> +        char buf[4096];
> +        char *str;
> +        igt_debugfs_simple_read(debugfs_fd, "i915_pm_req_res_info", buf,
> sizeof(buf));
Please add a check to the return value by igt_debugfs_simple_read, in case debugfs is not 
Present skip the test.
> +        str = strstr(buf, "DC9 Ready = ");
	str = strstr(buf, "DC9 Ready = yes"); and assert on str would avoid below operation ?
> +        igt_assert_f((str&&strlen(str)>12&&str[12]=='y'&&strstr(str,"yes")),
> "Not in DC9 ready\n");
    Please use correct message DC9 is not ready, and  add a comment below since we do not have DC9
Counter so we rely on dc5/dc6 counter reset to check if Display Engine was in DC9.
> +        return igt_wait((read_dc_counter(debugfs_fd,
> +CHECK_DC5)>prev_dc5 || read_dc_counter(debugfs_fd,
> +CHECK_DC6)>prev_dc6),3000,100); } static void test_dc9_dpms(data_t
> +*data) {
> +        require_dc_counter(data->debugfs_fd, CHECK_DC5);
> +        require_dc_counter(data->debugfs_fd, CHECK_DC6);
> +        int dc5_prev=read_dc_counter(data->debugfs_fd, CHECK_DC5);
> +        int dc6_prev=read_dc_counter(data->debugfs_fd, CHECK_DC6);
> +        dpms_off(data);
> +        igt_assert_f(check_dc9(data->debugfs_fd,dc5_prev,dc6_prev),"\n
> Not in DC9");
> +        dpms_on(data);
> +}
>  IGT_TEST_DESCRIPTION("These tests validate Display Power DC states");
> int main(int argc, char *argv[])  { @@ -449,6 +468,10 @@ int main(int argc,
> char *argv[])
>  		test_dc_state_dpms(&data, CHECK_DC6);
>  	}
> 
> +	igt_describe("This test validates display engine entry to DC9 state");
> +		igt_subtest("dc9-dpms") {
> +                test_dc9_dpms(&data);
> +        }
>  	igt_fixture {
>  		free(data.pwr_dmn_info);
>  		close(data.debugfs_fd);
> --
> 2.8.1



More information about the igt-dev mailing list