[i-g-t] HAX: Add helper with DPMS off to turn off the display
Bhanuprakash Modem
bhanuprakash.modem at intel.com
Thu Jun 8 15:01:18 UTC 2023
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
lib/igt_kms.c | 18 ++++++++++++++++++
lib/igt_kms.h | 2 ++
2 files changed, 20 insertions(+)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 5341c6373..d3ca483cc 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6037,3 +6037,21 @@ bool i915_pipe_output_combo_valid(igt_display_t *display)
*/
return igt_check_bigjoiner_support(display);
}
+
+void igt_dpms_turn_off_display(int drm_fd)
+{
+ igt_display_t display;
+ igt_output_t *output;
+
+ if (!drmModeGetResources(drm_fd))
+ return;
+
+ igt_display_require(&display, drm_fd);
+
+ for_each_connected_output(&display, output)
+ igt_output_set_prop_value(output, IGT_CONNECTOR_DPMS, DRM_MODE_DPMS_OFF);
+
+ igt_display_commit2(&display, COMMIT_ATOMIC);
+
+ igt_display_fini(&display);
+}
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 1b6988c17..1bd954d97 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1005,4 +1005,6 @@ bool igt_check_bigjoiner_support(igt_display_t *display);
bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
bool i915_pipe_output_combo_valid(igt_display_t *display);
+void igt_dpms_turn_off_display(int drm_fd);
+
#endif /* __IGT_KMS_H__ */
--
2.40.0
More information about the Intel-gfx-trybot
mailing list