Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: suraj.kandpal@intel.com, swati2.sharma@intel.com,
	Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
Subject: [PATCH i-g-t v1] tests/intel/kms_pm_backlight: Add brightness-with-suspend subtest
Date: Tue, 12 May 2026 16:50:19 +0530	[thread overview]
Message-ID: <20260512112019.676242-1-santhosh.reddy.guddati@intel.com> (raw)

Verify backlight brightness is preserved after suspend resume cycle,
The test sets backlight to  a value , suspend the system and checks the
brightness value is preserved after resume.

Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
---
 tests/intel/kms_pm_backlight.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/intel/kms_pm_backlight.c b/tests/intel/kms_pm_backlight.c
index 58c0b4427..c2228986e 100644
--- a/tests/intel/kms_pm_backlight.c
+++ b/tests/intel/kms_pm_backlight.c
@@ -65,6 +65,9 @@
  *
  * SUBTEST: brightness-with-dpms
  * Description: test brightness with dpms on and off cycle.
+ *
+ * SUBTEST: brightness-with-suspend
+ * Description: Test that brightness set before suspend is preserved after resume.
  */
 
 enum {
@@ -72,6 +75,7 @@ enum {
 	TEST_DPMS,
 	TEST_DPMS_CYCLE,
 	TEST_SUSPEND,
+	TEST_SUSPEND_CYCLE,
 };
 
 #define TOLERANCE 5 /* percent */
@@ -188,6 +192,8 @@ static void check_dpms_cycle(igt_backlight_context_t *context)
 {
 	int max, val_1, val_2;
 
+	printf("Toggling DPMS...\n");
+
 	igt_backlight_read(&max, "max_brightness", context);
 	igt_assert(max);
 
@@ -206,6 +212,24 @@ check_suspend(igt_output_t *output)
 	igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
 }
 
+static void check_suspend_cycle(igt_backlight_context_t *context)
+{
+	int max, val1, val2;
+
+	igt_backlight_read(&max, "max_brightness", context);
+	igt_assert(max);
+
+	igt_backlight_write(max / 2, "brightness", context);
+	igt_backlight_read(&val1, "actual_brightness", context);
+
+	igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
+
+	igt_backlight_read(&val2, "actual_brightness", context);
+	igt_assert_f(val2 == val1,
+		     "actual_brightness after resume [%d] does not match value before suspend [%d]\n",
+		     val2, val1);
+}
+
 static void test_cleanup(igt_display_t *display, igt_backlight_context_t *context)
 {
 	igt_output_t *output = context->output;
@@ -273,6 +297,8 @@ int igt_main()
 		{ "brightness-with-dpms", "test brightness with dpms on and off cycle.",
 		   check_dpms_cycle, TEST_DPMS_CYCLE},
 		{ "fade-with-suspend", "test the fade with suspend.", test_fade, TEST_SUSPEND },
+		{ "brightness-with-suspend", "test brightness is preserved after suspend/resume.",
+		   check_suspend_cycle, TEST_SUSPEND_CYCLE },
 	};
 
 	igt_fixture() {
-- 
2.34.1


             reply	other threads:[~2026-05-12 11:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 11:20 Santhosh Reddy Guddati [this message]
2026-05-12 21:27 ` ✓ i915.CI.BAT: success for tests/intel/kms_pm_backlight: Add brightness-with-suspend subtest Patchwork
2026-05-12 22:33 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-13  3:08 ` [PATCH i-g-t v1] " Karthik B S
2026-05-13 14:01 ` ✗ Xe.CI.FULL: failure for " Patchwork
2026-05-13 20:46 ` ✗ i915.CI.Full: " 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=20260512112019.676242-1-santhosh.reddy.guddati@intel.com \
    --to=santhosh.reddy.guddati@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=suraj.kandpal@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