From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t] tests/pm_backlight: Enable connected output to allow tests to succeed, v2.
Date: Fri, 13 Oct 2017 16:10:48 +0200 [thread overview]
Message-ID: <20171013141049.5242-3-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20171013141049.5242-1-maarten.lankhorst@linux.intel.com>
If the connected output is 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 reading intel_backlight/device
for the output name, and enable that output at start of this test.
Changes since v1:
- Enable the connected output, instead of enabling all outputs.
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 | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/tests/pm_backlight.c b/tests/pm_backlight.c
index 8258d4e4c124..6909f7dc64b3 100644
--- a/tests/pm_backlight.c
+++ b/tests/pm_backlight.c
@@ -155,13 +155,44 @@ igt_main
{
struct context context = {0};
int old;
+ igt_display_t display;
igt_skip_on_simulation();
igt_fixture {
+ enum pipe pipe;
+ igt_output_t *output;
+ bool found = false;
+ char full_name[32] = {};
+ char *name;
+
/* 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));
+
+ /* should be ../../cardX-$output */
+ igt_assert_lt(12, readlink(BACKLIGHT_PATH "/device", full_name, sizeof(full_name) - 1));
+ name = basename(full_name);
+
+ for_each_pipe_with_valid_output(&display, pipe, output) {
+ if (strcmp(name + 6, output->name))
+ continue;
+
+ igt_output_set_pipe(output, pipe);
+ found = true;
+ break;
+ }
+
+ igt_assert_f(found, "Could not map \"%s\" to output (%s?)\n", name, name + 6);
+
+ igt_display_commit2(&display, display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
}
igt_subtest("basic-brightness")
@@ -174,5 +205,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
next prev parent reply other threads:[~2017-10-13 14:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 14:10 [PATCH] HAX: Do not restore mode through fbcon Maarten Lankhorst
2017-10-13 14:10 ` [PATCH i-g-t 1/2] tests/kms_plane_lowres: Rework tests to work without fbcon Maarten Lankhorst
2017-10-13 14:10 ` Maarten Lankhorst [this message]
2017-10-13 14:58 ` [PATCH i-g-t] " Maarten Lankhorst
2017-10-23 10:05 ` Mika Kahola
2017-10-23 10:14 ` Maarten Lankhorst
2017-10-13 14:10 ` [PATCH i-g-t 2/2] tests/drm_read: Change tests to not require fbcon Maarten Lankhorst
2017-10-13 14:22 ` Chris Wilson
2017-10-16 7:40 ` Maarten Lankhorst
2017-10-13 16:44 ` ✗ Fi.CI.BAT: failure for HAX: Do not restore mode through fbcon (rev2) Patchwork
2017-10-13 19:06 ` ✗ Fi.CI.BAT: warning for tests/pm_backlight: Enable connected output to allow tests to succeed, v2. (rev2) Patchwork
2017-10-20 14:12 ` ✗ Fi.CI.BAT: failure for HAX: Do not restore mode through fbcon (rev2) Patchwork
2017-10-20 15:07 ` Patchwork
2017-10-20 15:17 ` ✗ Fi.CI.IGT: " Patchwork
2017-10-20 17:08 ` Patchwork
2017-10-21 12:53 ` ✗ Fi.CI.BAT: " Patchwork
2017-10-21 13:43 ` ✗ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2017-10-11 9:24 [PATCH i-g-t 2/2] tests/pm_backlight: Enable all possible outputs to allow tests to succeed 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
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=20171013141049.5242-3-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox