Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v1] tests/intel/kms_pm_backlight: Add brightness-with-suspend subtest
@ 2026-05-12 11:20 Santhosh Reddy Guddati
  2026-05-12 21:27 ` ✓ i915.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Santhosh Reddy Guddati @ 2026-05-12 11:20 UTC (permalink / raw)
  To: igt-dev; +Cc: suraj.kandpal, swati2.sharma, Santhosh Reddy Guddati

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


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

end of thread, other threads:[~2026-05-13 20:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 11:20 [PATCH i-g-t v1] tests/intel/kms_pm_backlight: Add brightness-with-suspend subtest Santhosh Reddy Guddati
2026-05-12 21:27 ` ✓ i915.CI.BAT: success for " 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

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