public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/kms_pm_backlight: Setup output before reading writing backlight
@ 2026-03-31  7:34 Suraj Kandpal
  2026-03-31 11:45 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (12 more replies)
  0 siblings, 13 replies; 17+ messages in thread
From: Suraj Kandpal @ 2026-03-31  7:34 UTC (permalink / raw)
  To: igt-dev; +Cc: swati2.sharma, Suraj Kandpal

Currently many pm backlight tests assume that panel will stay up until
unless we tell it to go down or AUX transactions are happening.
That is not the case, some panels when they detect that there are no
changes or commits going in, it will go to a lower power state. This
causes issue in this test like AUX suddenly timing out (mostly in
fade tests where each backlight change has a 10ms sleep and many
steps giving panel to internally go in low power state). Also since
changing backlight has its own interface it does not count as a commit
hence does not contribute to the panel staying on.
Also trying to change a backlight when panel is not up does not make sense.
To solve this setup the output and do a flip to make sure panel is not
down to simulate a real life use case on when backlight is changed.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 tests/intel/kms_pm_backlight.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/intel/kms_pm_backlight.c b/tests/intel/kms_pm_backlight.c
index daa70c716..1e1e0fdbd 100644
--- a/tests/intel/kms_pm_backlight.c
+++ b/tests/intel/kms_pm_backlight.c
@@ -84,6 +84,24 @@ enum {
 
 IGT_TEST_DESCRIPTION("Basic backlight sysfs test");
 
+static void setup_output_and_commit(igt_backlight_context_t *context)
+{
+	igt_output_t *output = context->output;
+	igt_display_t *display = output->display;
+	drmModeModeInfo *mode;
+	igt_plane_t *primary;
+	struct igt_fb fb;
+
+	mode = igt_output_get_mode(output);
+	igt_create_pattern_fb(display->drm_fd,
+			      mode->hdisplay, mode->vdisplay,
+			      DRM_FORMAT_XRGB8888,
+			      DRM_FORMAT_MOD_LINEAR, &fb);
+	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+	igt_plane_set_fb(primary, &fb);
+	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+}
+
 static void test_and_verify(igt_backlight_context_t *context, int val)
 {
 	const int tolerance = val * TOLERANCE / 100;
@@ -133,10 +151,12 @@ static void test_fade(igt_backlight_context_t *context)
 
 	/* Fade out, then in */
 	for (i = context->max; i > 0; i -= context->max / FADESTEPS) {
+		setup_output_and_commit(context);
 		test_and_verify(context, i);
 		nanosleep(&ts, NULL);
 	}
 	for (i = 0; i <= context->max; i += context->max / FADESTEPS) {
+		setup_output_and_commit(context);
 		test_and_verify(context, i);
 		nanosleep(&ts, NULL);
 	}
@@ -154,6 +174,7 @@ static void check_dpms_cycle(igt_backlight_context_t *context)
 
 	igt_pm_dpms_toggle(context->output);
 
+	setup_output_and_commit(context);
 	igt_backlight_read(&val_2, "actual_brightness", context);
 	igt_assert_eq(val_1, val_2);
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-04-10  1:32 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31  7:34 [PATCH i-g-t] tests/intel/kms_pm_backlight: Setup output before reading writing backlight Suraj Kandpal
2026-03-31 11:45 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-03-31 12:10 ` ✓ i915.CI.BAT: " Patchwork
2026-03-31 17:00 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-01  0:32 ` ✓ i915.CI.Full: " Patchwork
2026-04-07  5:21 ` [PATCH i-g-t] " Karthik B S
2026-04-07  5:43 ` [PATCH i-g-t v2] " Suraj Kandpal
2026-04-07  8:17   ` Karthik B S
2026-04-08  4:35     ` Naladala, Ramanaidu
2026-04-08  5:03   ` [PATCH i-g-t v3] " Suraj Kandpal
2026-04-07  6:50 ` ✓ Xe.CI.BAT: success for tests/intel/kms_pm_backlight: Setup output before reading writing backlight (rev2) Patchwork
2026-04-07  7:29 ` ✓ i915.CI.BAT: " Patchwork
2026-04-07  9:11 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-07  9:40 ` ✗ i915.CI.Full: failure " Patchwork
2026-04-09 23:39 ` ✓ Xe.CI.BAT: success for tests/intel/kms_pm_backlight: Setup output before reading writing backlight (rev4) Patchwork
2026-04-09 23:48 ` ✗ i915.CI.BAT: failure " Patchwork
2026-04-10  1:32 ` ✓ Xe.CI.FULL: success " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox