[igt-dev] [PATCH i-g-t v6] tests/i915/i915_pm_dc: Add DC9 igt test

Anshuman Gupta anshuman.gupta at intel.com
Thu Mar 4 07:42:15 UTC 2021


On 2021-03-04 at 12:39:17 +0530, Jigar Bhatt wrote:
> DC9 igt test validation depends on DC{5,6} counters reset.
> When Display Engine enters to DC9, it resets DMC f/w and DC5/DC6 counter.
> We don't have a DC9 counter unlike DC{5,6},
> therefore this tests uses DC{5,6} counter reset method to validate DC9.
> 
> v6:
> - assert for DC6 counter in setup_dc9_dpms.
> - Move  dpms_off() to test_dc9_dpms() [ Gupta Anshuman ]
> 
> Signed-off-by: Jigar Bhatt <jigar.bhatt at intel.com>
> ---
>  tests/i915/i915_pm_dc.c | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/tests/i915/i915_pm_dc.c b/tests/i915/i915_pm_dc.c
> index 30c6024..a3931fc 100644
> --- a/tests/i915/i915_pm_dc.c
> +++ b/tests/i915/i915_pm_dc.c
> @@ -383,6 +383,35 @@ static void test_dc_state_dpms(data_t *data, int dc_flag)
>  	dpms_on(data);
>  	cleanup_dc_dpms(data);
>  }
> +tatic bool check_dc9(uint32_t debugfs_fd, int prev_dc5, int prev_dc6, int seconds)
> +{
> +        /*
> +         * 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), seconds, 100);
	   break this line, it is more then 100 chars.
	   applicable to entire patch.	
	   use kerenl/scripts/checkpatch.pl	
> +}
> +static void setup_dc9_dpms(data_t *data, int prev_dc5, int prev_dc6)
> +{
> +        igt_disable_runtime_pm();
> +        data->runtime_suspend_disabled = true;
> +        dpms_off(data);
> +        igt_assert_f(igt_wait(read_dc_counter(data->debugfs_fd, CHECK_DC6) > prev_dc6, 1000, 100),"Not in DC9\n");
	   You need to skip here by using igt_skip_f and current messgae is misleading.			

	   I thought earlier it is enough to check DC6 becuase if DC6 counter increases, surely it will increase DC5 too.
	   but their are some platform which don't support DC6 but supports DC5 and DC9, so this test need to be flexible. 
           In case DC6 is not supported, here it should check for DC5.
> +        dpms_on(data);
> +        data->runtime_suspend_disabled = false;
> +        igt_restore_runtime_pm();
> +        igt_setup_runtime_pm(data->drm_fd);
> +
> +}
> +static void test_dc9_dpms(data_t *data)
> +{
> +        require_dc_counter(data->debugfs_fd, CHECK_DC5);
> +        require_dc_counter(data->debugfs_fd, CHECK_DC6);
	   this may skip on some platfrom which do not support DC6, you entire test will skip here.	
> +        setup_dc9_dpms(data, read_dc_counter(data->debugfs_fd, CHECK_DC5), read_dc_counter(data->debugfs_fd, CHECK_DC6));
> +        dpms_off(data);
> +        igt_assert_f(!check_dc9(data->debugfs_fd, read_dc_counter(data->debugfs_fd, CHECK_DC5), read_dc_counter(data->debugfs_fd, CHECK_DC6), 3000),"Not in DC9\n");
> +        dpms_on(data);
> +}
Br,
Anshuman.
>  
>  IGT_TEST_DESCRIPTION("These tests validate Display Power DC states");
>  int main(int argc, char *argv[])
> @@ -449,6 +478,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