[Intel-gfx] [PATCH i-g-t 2/2] tests/pm_backlight: Enable all possible outputs to allow tests to succeed.

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Tue Oct 10 16:23:26 UTC 2017


Op 10-10-17 om 18:14 schreef Ville Syrjälä:
> On Tue, Oct 10, 2017 at 06:04:28PM +0200, Maarten Lankhorst wrote:
>> If all outputs are disabled before this test is run, then the test
>> will fail because actual_brightness stays at 0 instead of the value
>> of the desired brightness. Fix this by enabling all outputs at the
>> start of this test.
>>
>> Sample failure:
>> IGT-Version: 1.20-g01c550a27986 (x86_64) (Linux: 4.14.0-rc3-fbconhax+ x86_64)
>> (pm_backlight:1203) CRITICAL: Test assertion failure function test_and_verify, file pm_backlight.c:111:
>> (pm_backlight:1203) CRITICAL: Failed assertion: ({ typeof(0) _a = (0); typeof(val - tolerance) _b = (val - tolerance); _a > _b ? _a : _b; }) <= result
>> (pm_backlight:1203) CRITICAL: error: 91200 > 0
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
>> ---
>>  tests/pm_backlight.c | 27 +++++++++++++++++++++++++++
>>  1 file changed, 27 insertions(+)
>>
>> diff --git a/tests/pm_backlight.c b/tests/pm_backlight.c
>> index 8258d4e4c124..b365c7f6dc60 100644
>> --- a/tests/pm_backlight.c
>> +++ b/tests/pm_backlight.c
>> @@ -155,13 +155,37 @@ igt_main
>>  {
>>  	struct context context = {0};
>>  	int old;
>> +	igt_display_t display;
>>  
>>  	igt_skip_on_simulation();
>>  
>>  	igt_fixture {
>> +		enum pipe pipe;
>> +
>>  		/* Get the max value and skip the whole test if sysfs interface not available */
>>  		igt_skip_on(backlight_read(&old, "brightness"));
>>  		igt_assert(backlight_read(&context.max, "max_brightness") > -1);
>> +
>> +		/*
>> +		 * Backlight tests requires the output to be enabled,
>> +		 * try to enable all.
>> +		 */
>> +		kmstest_set_vt_graphics_mode();
>> +		igt_display_init(&display, drm_open_driver(DRIVER_INTEL));
>> +
>> +		for_each_pipe(&display, pipe) {
>> +			igt_output_t *output;
>> +
>> +			for_each_valid_output_on_pipe(&display, pipe, output) {
>> +				if (output->pending_pipe != PIPE_NONE)
>> +					continue;
>> +
>> +				igt_output_set_pipe(output, pipe);
>> +				break;
>> +			}
>> +		}
> Since the test depends on intel_backlight I think we could even look up
> the correct backlight based on the connector. Would actually guarantee
> that we manage to light up the correct connector instead of wasting our
> precious pipes lighting up stuff we don't need.
Through readlink /sys/class/backlight/intel_backlight/device you mean? Should be doable, but feels hacky..


More information about the Intel-gfx mailing list