All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 2/2] tests/pm_backlight: Enable all possible outputs to allow tests to succeed.
Date: Tue, 10 Oct 2017 19:14:59 +0300	[thread overview]
Message-ID: <20171010161459.GU10981@intel.com> (raw)
In-Reply-To: <20171010160428.2187-3-maarten.lankhorst@linux.intel.com>

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@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.

> +
> +		igt_display_commit2(&display, display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
>  	}
>  
>  	igt_subtest("basic-brightness")
> @@ -174,5 +198,8 @@ igt_main
>  	igt_fixture {
>  		/* Restore old brightness */
>  		backlight_write(old, "brightness");
> +
> +		igt_display_fini(&display);
> +		close(display.drm_fd);
>  	}
>  }
> -- 
> 2.14.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-10-10 16:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 16:04 [PATCH i-g-t 0/2] tests/BAT: Reduce reliance on fbcon Maarten Lankhorst
2017-10-10 16:04 ` [PATCH i-g-t 1/2] tests/debugfs_test: Try to light all outputs to increase chances of finding fails Maarten Lankhorst
2017-10-10 20:12   ` Chris Wilson
2017-10-11 10:28     ` Maarten Lankhorst
2017-10-25  1:36       ` Pandiyan, Dhinakaran
2017-10-25  7:56         ` Maarten Lankhorst
2017-10-12 10:01     ` [PATCH i-g-t v2 1/2] tests/debugfs_test: Try to light all outputs to increase chances of finding fails, v2 Maarten Lankhorst
2017-10-12 10:47       ` [PATCH i-g-t v3 1/2] tests/debugfs_test: Try to light all outputs to increase chances of finding fails, v3 Maarten Lankhorst
2017-10-12 14:05         ` Chris Wilson
2017-10-10 16:04 ` [PATCH i-g-t 2/2] tests/pm_backlight: Enable all possible outputs to allow tests to succeed Maarten Lankhorst
2017-10-10 16:14   ` Ville Syrjälä [this message]
2017-10-10 16:23     ` Maarten Lankhorst
2017-10-11  9:24       ` Ville Syrjälä
2017-10-11  9:25         ` [PATCH i-g-t] tests/pm_backlight: Enable connected output to allow tests to succeed, v2 Maarten Lankhorst
2017-10-12 10:00           ` [PATCH i-g-t v2 2/2] tests/pm_backlight: Enable connected output to allow tests to succeed, v3 Maarten Lankhorst
2017-10-12 10:55             ` [PATCH i-g-t v3 2/2] tests/pm_backlight: Enable connected output to allow tests to succeed, v4 Maarten Lankhorst
2017-10-12 12:29               ` Ville Syrjälä
2017-10-10 19:26 ` ✗ Fi.CI.BAT: warning for tests/BAT: Reduce reliance on fbcon Patchwork
2017-10-11 13:09 ` ✗ Fi.CI.BAT: warning for tests/BAT: Reduce reliance on fbcon. (rev2) Patchwork
2017-10-12 10:28 ` ✗ Fi.CI.BAT: failure for tests/BAT: Reduce reliance on fbcon. (rev4) Patchwork
2017-10-12 11:29 ` ✓ Fi.CI.BAT: success for tests/BAT: Reduce reliance on fbcon. (rev6) Patchwork
2017-10-12 12:56 ` ✗ Fi.CI.IGT: warning " 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=20171010161459.GU10981@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.