Commit 014f0515 authored by Jani Nikula's avatar Jani Nikula

drm/i915/debugfs: switch crtc debugfs to struct intel_crtc

Convert the crtc debugfs code to use struct intel_crtc instead of struct
drm_crtc.

v2: Fix build for CONFIG_DRM_I915_DEBUG_VBLANK_EVADE=y (kernel test robot)
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230320124429.786985-1-jani.nikula@intel.com
parent 091496e6
...@@ -212,7 +212,7 @@ static void intel_crtc_destroy(struct drm_crtc *_crtc) ...@@ -212,7 +212,7 @@ static void intel_crtc_destroy(struct drm_crtc *_crtc)
static int intel_crtc_late_register(struct drm_crtc *crtc) static int intel_crtc_late_register(struct drm_crtc *crtc)
{ {
intel_crtc_debugfs_add(crtc); intel_crtc_debugfs_add(to_intel_crtc(crtc));
return 0; return 0;
} }
......
...@@ -542,10 +542,10 @@ static const struct file_operations crtc_updates_fops = { ...@@ -542,10 +542,10 @@ static const struct file_operations crtc_updates_fops = {
.write = crtc_updates_write .write = crtc_updates_write
}; };
static void crtc_updates_add(struct drm_crtc *crtc) static void crtc_updates_add(struct intel_crtc *crtc)
{ {
debugfs_create_file("i915_update_info", 0644, crtc->debugfs_entry, debugfs_create_file("i915_update_info", 0644, crtc->base.debugfs_entry,
to_intel_crtc(crtc), &crtc_updates_fops); crtc, &crtc_updates_fops);
} }
#else #else
...@@ -555,7 +555,7 @@ static void crtc_updates_info(struct seq_file *m, ...@@ -555,7 +555,7 @@ static void crtc_updates_info(struct seq_file *m,
{ {
} }
static void crtc_updates_add(struct drm_crtc *crtc) static void crtc_updates_add(struct intel_crtc *crtc)
{ {
} }
#endif #endif
...@@ -1366,7 +1366,7 @@ static const struct file_operations i915_dsc_bpc_fops = { ...@@ -1366,7 +1366,7 @@ static const struct file_operations i915_dsc_bpc_fops = {
*/ */
static int i915_current_bpc_show(struct seq_file *m, void *data) static int i915_current_bpc_show(struct seq_file *m, void *data)
{ {
struct intel_crtc *crtc = to_intel_crtc(m->private); struct intel_crtc *crtc = m->private;
struct intel_crtc_state *crtc_state; struct intel_crtc_state *crtc_state;
int ret; int ret;
...@@ -1440,15 +1440,17 @@ void intel_connector_debugfs_add(struct intel_connector *intel_connector) ...@@ -1440,15 +1440,17 @@ void intel_connector_debugfs_add(struct intel_connector *intel_connector)
* *
* Failure to add debugfs entries should generally be ignored. * Failure to add debugfs entries should generally be ignored.
*/ */
void intel_crtc_debugfs_add(struct drm_crtc *crtc) void intel_crtc_debugfs_add(struct intel_crtc *crtc)
{ {
if (!crtc->debugfs_entry) struct dentry *root = crtc->base.debugfs_entry;
if (!root)
return; return;
crtc_updates_add(crtc); crtc_updates_add(crtc);
intel_drrs_crtc_debugfs_add(to_intel_crtc(crtc)); intel_drrs_crtc_debugfs_add(crtc);
intel_fbc_crtc_debugfs_add(to_intel_crtc(crtc)); intel_fbc_crtc_debugfs_add(crtc);
debugfs_create_file("i915_current_bpc", 0444, crtc->debugfs_entry, crtc, debugfs_create_file("i915_current_bpc", 0444, root, crtc,
&i915_current_bpc_fops); &i915_current_bpc_fops);
} }
...@@ -6,18 +6,18 @@ ...@@ -6,18 +6,18 @@
#ifndef __INTEL_DISPLAY_DEBUGFS_H__ #ifndef __INTEL_DISPLAY_DEBUGFS_H__
#define __INTEL_DISPLAY_DEBUGFS_H__ #define __INTEL_DISPLAY_DEBUGFS_H__
struct drm_crtc;
struct drm_i915_private; struct drm_i915_private;
struct intel_connector; struct intel_connector;
struct intel_crtc;
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
void intel_display_debugfs_register(struct drm_i915_private *i915); void intel_display_debugfs_register(struct drm_i915_private *i915);
void intel_connector_debugfs_add(struct intel_connector *connector); void intel_connector_debugfs_add(struct intel_connector *connector);
void intel_crtc_debugfs_add(struct drm_crtc *crtc); void intel_crtc_debugfs_add(struct intel_crtc *crtc);
#else #else
static inline void intel_display_debugfs_register(struct drm_i915_private *i915) {} static inline void intel_display_debugfs_register(struct drm_i915_private *i915) {}
static inline void intel_connector_debugfs_add(struct intel_connector *connector) {} static inline void intel_connector_debugfs_add(struct intel_connector *connector) {}
static inline void intel_crtc_debugfs_add(struct drm_crtc *crtc) {} static inline void intel_crtc_debugfs_add(struct intel_crtc *crtc) {}
#endif #endif
#endif /* __INTEL_DISPLAY_DEBUGFS_H__ */ #endif /* __INTEL_DISPLAY_DEBUGFS_H__ */
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