Re: [PATCH RFC i-g-t] igt: Add a dpms property test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 07, 2016 at 01:42:59PM +0200, Marta Lofstedt wrote:
> This testcase will set the dpms drm property to
> DRM_MODE_DPMS_ON and DPMS_MODE_OFF and check that the
> property values was updated and that the new state corresponds
> to the crtc active property.
> 
> Signed-off-by: Marta Lofstedt <marta.lofstedt@xxxxxxxxx>
> ---
>  tests/Makefile.sources |   1 +
>  tests/drm_dpms.c       | 168 +++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 169 insertions(+)
>  create mode 100644 tests/drm_dpms.c
> 
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index 04dd2d5..6d6e3db 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -14,6 +14,7 @@ VC4_TESTS_M = \
>  TESTS_progs_M = \
>  	core_get_client_auth \
>  	drm_mm \
> +	drm_dpms \

This should be a kms_ test

>  	drv_getparams_basic \
>  	drv_selftest \
>  	drv_suspend \

<snip>

> +static void dpms_property(igt_display_t *display)
> +{
> +	enum pipe pipe;
> +	igt_output_t *output;
> +
> +	for_each_connected_output(display, output) {
> +		bool found = false;
> +
> +		for_each_pipe(display, pipe) {
> +			if (!igt_pipe_connector_valid(pipe, output))
> +				continue;
> +
> +			found = true;
> +			run_dpms_test(display, pipe, output);
> +			break;
> +		}
> +
> +		igt_assert_f(found,
> +			     "Connected output should have at least 1 valid crtc\n");

That's a requirement for the test to run (igt_require_f) not an
assertion. If the hardware doesn't meet the test criteria igt_require_f
will SKIP, but igt_assert_f will FAIL.

> +	}
> +}
> +
> +igt_main
> +{
> +	igt_display_t display;
> +
> +	igt_skip_on_simulation();
> +
> +	igt_fixture {
> +		display.drm_fd = drm_open_driver_master(DRIVER_ANY);
> +
> +		kmstest_set_vt_graphics_mode();
> +
> +		igt_display_init(&display, display.drm_fd);
> +	}
> +
> +	igt_subtest("dpms_property")
> +		dpms_property(&display);

Doesn't this want to a subtest for each connector?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux