Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/i915/i915_pm_backlight: Brightness test during DPMS on and off
@ 2022-04-24  0:57 Mohammed Thasleem
  2023-03-25 19:05 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (14 more replies)
  0 siblings, 15 replies; 22+ messages in thread
From: Mohammed Thasleem @ 2022-04-24  0:57 UTC (permalink / raw)
  To: igt-dev

Set brightness by deviding max brightness, store and read it back.
The actual brightness should be same during DPMS on and off cycle.

Signed-off-by: Mohammed Thasleem <mohammed.thasleem@intel.com>
---
 tests/i915/i915_pm_backlight.c | 37 ++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/tests/i915/i915_pm_backlight.c b/tests/i915/i915_pm_backlight.c
index 82960662..3961f4fc 100644
--- a/tests/i915/i915_pm_backlight.c
+++ b/tests/i915/i915_pm_backlight.c
@@ -188,6 +188,32 @@ check_suspend(igt_output_t *output)
 	igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
 }
 
+static void check_dpms_cycle(igt_display_t *display, igt_output_t *output, struct context *context)
+{
+	int max, val_1, val_2;
+
+	backlight_read(&max, "max_brightness", context);
+	igt_assert(max);
+
+	backlight_write(max / 2, "brightness", context);
+	backlight_read(&val_1, "actual_brightness", context);
+
+	igt_require(igt_setup_runtime_pm(output->display->drm_fd));
+
+	kmstest_set_connector_dpms(output->display->drm_fd,
+				   output->config.connector,
+				   DRM_MODE_DPMS_OFF);
+	igt_require(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED));
+
+	kmstest_set_connector_dpms(output->display->drm_fd,
+				   output->config.connector,
+				   DRM_MODE_DPMS_ON);
+	igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_ACTIVE));
+
+	backlight_read(&val_2, "actual_brightness", context);
+	igt_assert_eq(val_1, val_2);
+}
+
 static void test_cleanup(igt_display_t *display, igt_output_t *output)
 {
 	igt_output_set_pipe(output, PIPE_NONE);
@@ -325,6 +351,17 @@ igt_main
 		}
 	}
 
+	igt_describe("test brightness with dpms on and off cycle");
+	igt_subtest_with_dynamic("brightness-with-dpms") {
+		for (int j = 0; j < (dual_edp ? 2 : 1); j++) {
+			test_setup(display, &contexts->output[j]);
+			igt_dynamic_f("%s", igt_output_name(contexts[j].output)) {
+				check_dpms_cycle(&display, &contexts->output[j], &contexts[j]);
+				test_cleanup(&display, &contexts->output[j]);
+			}
+		}
+	}
+
 	igt_fixture {
 		/* Restore old brightness */
 		for (i = 0; i < (dual_edp ? 2 : 1); i++)
-- 
2.25.1

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

end of thread, other threads:[~2024-09-28  9:45 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-24  0:57 [igt-dev] [PATCH i-g-t] tests/i915/i915_pm_backlight: Brightness test during DPMS on and off Mohammed Thasleem
2023-03-25 19:05 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-03-25 20:12 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2024-06-07 10:33 ` [PATCH i-g-t] tests/intel/kms_pm_backlight: " Mohammed Thasleem
2024-06-07 11:15   ` Jani Nikula
2024-07-04 11:31   ` Mohammed Thasleem
2024-09-18  5:31     ` Hogander, Jouni
2024-09-18  7:36       ` Jani Nikula
2024-09-26 19:38     ` Mohammed Thasleem
2024-09-28  9:44       ` Naladala, Ramanaidu
2024-06-07 21:08 ` ✓ Fi.CI.BAT: success for tests/i915/i915_pm_backlight: Brightness test during DPMS on and off (rev2) Patchwork
2024-06-07 21:31 ` ✓ CI.xeBAT: " Patchwork
2024-06-08 11:05 ` ✗ CI.xeFULL: failure " Patchwork
2024-06-08 11:10 ` ✗ Fi.CI.IGT: " Patchwork
2024-07-04 18:28 ` ✓ Fi.CI.BAT: success for tests/i915/i915_pm_backlight: Brightness test during DPMS on and off (rev3) Patchwork
2024-07-04 18:29 ` ✓ CI.xeBAT: " Patchwork
2024-07-04 23:46 ` ✓ CI.xeFULL: " Patchwork
2024-07-05  7:51 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-09-26 21:03 ` ✓ Fi.CI.BAT: success for tests/i915/i915_pm_backlight: Brightness test during DPMS on and off (rev4) Patchwork
2024-09-26 21:11 ` ✓ CI.xeBAT: " Patchwork
2024-09-27  3:44 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-09-27 23:14 ` ✗ CI.xeFULL: " Patchwork

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