Commit 1fb4da5f authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/ips: Make IPS debugfs per-crtc

IPS is a per-pipe feature, so let's move the debugfs stuff
under the crtc directory, and only register it when IPS
is actually available.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230327133942.22063-1-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent fd6435ea
...@@ -270,12 +270,10 @@ void hsw_ips_get_config(struct intel_crtc_state *crtc_state) ...@@ -270,12 +270,10 @@ void hsw_ips_get_config(struct intel_crtc_state *crtc_state)
static int hsw_ips_debugfs_status_show(struct seq_file *m, void *unused) static int hsw_ips_debugfs_status_show(struct seq_file *m, void *unused)
{ {
struct drm_i915_private *i915 = m->private; struct intel_crtc *crtc = m->private;
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
intel_wakeref_t wakeref; intel_wakeref_t wakeref;
if (!HAS_IPS(i915))
return -ENODEV;
wakeref = intel_runtime_pm_get(&i915->runtime_pm); wakeref = intel_runtime_pm_get(&i915->runtime_pm);
seq_printf(m, "Enabled by kernel parameter: %s\n", seq_printf(m, "Enabled by kernel parameter: %s\n",
...@@ -297,10 +295,11 @@ static int hsw_ips_debugfs_status_show(struct seq_file *m, void *unused) ...@@ -297,10 +295,11 @@ static int hsw_ips_debugfs_status_show(struct seq_file *m, void *unused)
DEFINE_SHOW_ATTRIBUTE(hsw_ips_debugfs_status); DEFINE_SHOW_ATTRIBUTE(hsw_ips_debugfs_status);
void hsw_ips_debugfs_register(struct drm_i915_private *i915) void hsw_ips_crtc_debugfs_add(struct intel_crtc *crtc)
{ {
struct drm_minor *minor = i915->drm.primary; if (!hsw_crtc_supports_ips(crtc))
return;
debugfs_create_file("i915_ips_status", 0444, minor->debugfs_root, debugfs_create_file("i915_ips_status", 0444, crtc->base.debugfs_entry,
i915, &hsw_ips_debugfs_status_fops); crtc, &hsw_ips_debugfs_status_fops);
} }
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <linux/types.h> #include <linux/types.h>
struct drm_i915_private;
struct intel_atomic_state; struct intel_atomic_state;
struct intel_crtc; struct intel_crtc;
struct intel_crtc_state; struct intel_crtc_state;
...@@ -23,6 +22,6 @@ bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state); ...@@ -23,6 +22,6 @@ bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state);
int hsw_ips_compute_config(struct intel_atomic_state *state, int hsw_ips_compute_config(struct intel_atomic_state *state,
struct intel_crtc *crtc); struct intel_crtc *crtc);
void hsw_ips_get_config(struct intel_crtc_state *crtc_state); void hsw_ips_get_config(struct intel_crtc_state *crtc_state);
void hsw_ips_debugfs_register(struct drm_i915_private *i915); void hsw_ips_crtc_debugfs_add(struct intel_crtc *crtc);
#endif /* __HSW_IPS_H__ */ #endif /* __HSW_IPS_H__ */
...@@ -1092,7 +1092,6 @@ void intel_display_debugfs_register(struct drm_i915_private *i915) ...@@ -1092,7 +1092,6 @@ void intel_display_debugfs_register(struct drm_i915_private *i915)
ARRAY_SIZE(intel_display_debugfs_list), ARRAY_SIZE(intel_display_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
hsw_ips_debugfs_register(i915);
intel_dmc_debugfs_register(i915); intel_dmc_debugfs_register(i915);
intel_fbc_debugfs_register(i915); intel_fbc_debugfs_register(i915);
intel_hpd_debugfs_register(i915); intel_hpd_debugfs_register(i915);
...@@ -1461,6 +1460,7 @@ void intel_crtc_debugfs_add(struct intel_crtc *crtc) ...@@ -1461,6 +1460,7 @@ void intel_crtc_debugfs_add(struct intel_crtc *crtc)
crtc_updates_add(crtc); crtc_updates_add(crtc);
intel_drrs_crtc_debugfs_add(crtc); intel_drrs_crtc_debugfs_add(crtc);
intel_fbc_crtc_debugfs_add(crtc); intel_fbc_crtc_debugfs_add(crtc);
hsw_ips_crtc_debugfs_add(crtc);
debugfs_create_file("i915_current_bpc", 0444, root, crtc, debugfs_create_file("i915_current_bpc", 0444, root, crtc,
&i915_current_bpc_fops); &i915_current_bpc_fops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment