@@ -93,3 +93,39 @@ void intel_dark_screen_disable(struct intel_crtc_state *crtc_state)
intel_de_write(dev_priv, DARK_SCREEN(cpu_transcoder), 0);
}
+
+static int intel_darkscreen_debugfs_status_get(void *data, u64 *val)
+{
+ struct intel_crtc *crtc = data;
+
+ *val = crtc->dark_screen.enable;
+
+ return 0;
+}
+
+static int intel_darkscreen_debugfs_status_set(void *data, u64 val)
+{
+ struct intel_crtc *crtc = data;
+ struct intel_crtc_state *crtc_state;
+
+ crtc->dark_screen.enable = val;
+
+ crtc_state = to_intel_crtc_state(crtc->base.state);
+
+ if (val)
+ intel_dark_screen_enable(crtc_state);
+ else
+ intel_dark_screen_disable(crtc_state);
+
+ return 0;
+}
+
+DEFINE_DEBUGFS_ATTRIBUTE(intel_darkscreen_debugfs_status_fops,
+ intel_darkscreen_debugfs_status_get,
+ intel_darkscreen_debugfs_status_set, "%llu\n");
+
+void intel_darkscreen_crtc_debugfs_add(struct intel_crtc *crtc)
+{
+ debugfs_create_file("i915_darkscreen_status", 0644, crtc->base.debugfs_entry,
+ crtc, &intel_darkscreen_debugfs_status_fops);
+}
@@ -16,6 +16,7 @@
#include "intel_crtc.h"
#include "intel_de.h"
#include "intel_crtc_state_dump.h"
+#include "intel_darkscreen.h"
#include "intel_display_debugfs.h"
#include "intel_display_power.h"
#include "intel_display_power_well.h"
@@ -1541,6 +1542,7 @@ void intel_crtc_debugfs_add(struct intel_crtc *crtc)
intel_drrs_crtc_debugfs_add(crtc);
intel_fbc_crtc_debugfs_add(crtc);
hsw_ips_crtc_debugfs_add(crtc);
+ intel_darkscreen_crtc_debugfs_add(crtc);
debugfs_create_file("i915_current_bpc", 0444, root, crtc,
&i915_current_bpc_fops);