Skip to content

Commit 62d3562

Browse files
committed
drm/msm/dpu: move encoder status to standard encoder debugfs dir
Now as we have standard per-encoder debugfs directory, move DPU encoder status file to that directory. Signed-off-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/570219/ Link: https://lore.kernel.org/r/[email protected]
1 parent 236fa38 commit 62d3562

File tree

1 file changed

+6
-39
lines changed

1 file changed

+6
-39
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ struct dpu_encoder_virt {
186186
struct drm_crtc *crtc;
187187
struct drm_connector *connector;
188188

189-
struct dentry *debugfs_root;
190189
struct mutex enc_lock;
191190
DECLARE_BITMAP(frame_busy_mask, MAX_PHYS_ENCODERS_PER_VIRTUAL);
192191
void (*crtc_frame_event_cb)(void *, u32 event);
@@ -2078,7 +2077,8 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)
20782077
#ifdef CONFIG_DEBUG_FS
20792078
static int _dpu_encoder_status_show(struct seq_file *s, void *data)
20802079
{
2081-
struct dpu_encoder_virt *dpu_enc = s->private;
2080+
struct drm_encoder *drm_enc = s->private;
2081+
struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc);
20822082
int i;
20832083

20842084
mutex_lock(&dpu_enc->enc_lock);
@@ -2101,48 +2101,16 @@ static int _dpu_encoder_status_show(struct seq_file *s, void *data)
21012101

21022102
DEFINE_SHOW_ATTRIBUTE(_dpu_encoder_status);
21032103

2104-
static int _dpu_encoder_init_debugfs(struct drm_encoder *drm_enc)
2104+
static void dpu_encoder_debugfs_init(struct drm_encoder *drm_enc, struct dentry *root)
21052105
{
2106-
struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc);
2107-
2108-
char name[12];
2109-
2110-
if (!drm_enc->dev) {
2111-
DPU_ERROR("invalid encoder or kms\n");
2112-
return -EINVAL;
2113-
}
2114-
2115-
snprintf(name, sizeof(name), "encoder%u", drm_enc->base.id);
2116-
2117-
/* create overall sub-directory for the encoder */
2118-
dpu_enc->debugfs_root = debugfs_create_dir(name,
2119-
drm_enc->dev->primary->debugfs_root);
2120-
21212106
/* don't error check these */
21222107
debugfs_create_file("status", 0600,
2123-
dpu_enc->debugfs_root, dpu_enc, &_dpu_encoder_status_fops);
2124-
2125-
return 0;
2108+
root, drm_enc, &_dpu_encoder_status_fops);
21262109
}
21272110
#else
2128-
static int _dpu_encoder_init_debugfs(struct drm_encoder *drm_enc)
2129-
{
2130-
return 0;
2131-
}
2111+
#define dpu_encoder_debugfs_init NULL
21322112
#endif
21332113

2134-
static int dpu_encoder_late_register(struct drm_encoder *encoder)
2135-
{
2136-
return _dpu_encoder_init_debugfs(encoder);
2137-
}
2138-
2139-
static void dpu_encoder_early_unregister(struct drm_encoder *encoder)
2140-
{
2141-
struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(encoder);
2142-
2143-
debugfs_remove_recursive(dpu_enc->debugfs_root);
2144-
}
2145-
21462114
static int dpu_encoder_virt_add_phys_encs(
21472115
struct drm_device *dev,
21482116
struct msm_display_info *disp_info,
@@ -2329,8 +2297,7 @@ static const struct drm_encoder_helper_funcs dpu_encoder_helper_funcs = {
23292297
};
23302298

23312299
static const struct drm_encoder_funcs dpu_encoder_funcs = {
2332-
.late_register = dpu_encoder_late_register,
2333-
.early_unregister = dpu_encoder_early_unregister,
2300+
.debugfs_init = dpu_encoder_debugfs_init,
23342301
};
23352302

23362303
struct drm_encoder *dpu_encoder_init(struct drm_device *dev,

0 commit comments

Comments
 (0)