public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Suraj Kandpal <suraj.kandpal@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: swati2.sharma@intel.com, Suraj Kandpal <suraj.kandpal@intel.com>,
	Karthik B S <karthik.b.s@intel.com>
Subject: [PATCH i-g-t v2] tests/intel/kms_pm_backlight: Setup output before reading writing backlight
Date: Tue,  7 Apr 2026 11:13:02 +0530	[thread overview]
Message-ID: <20260407054302.1454584-1-suraj.kandpal@intel.com> (raw)
In-Reply-To: <20260331073400.1316874-1-suraj.kandpal@intel.com>

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>
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
---
v1 -> v2:
- Remove setup and commit function from check dpms as it is not
needed there (Karthik)

 tests/intel/kms_pm_backlight.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tests/intel/kms_pm_backlight.c b/tests/intel/kms_pm_backlight.c
index daa70c716..f108e8387 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);
 	}
-- 
2.34.1


  parent reply	other threads:[~2026-04-07  5:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Suraj Kandpal [this message]
2026-04-07  8:17   ` [PATCH i-g-t v2] " 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

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=20260407054302.1454584-1-suraj.kandpal@intel.com \
    --to=suraj.kandpal@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@intel.com \
    --cc=swati2.sharma@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox