@@ -44,17 +44,17 @@ static const struct sti_compositor_data stih407_compositor_data = {
};
void sti_compositor_debugfs_init(struct sti_compositor *compo,
- struct drm_minor *minor)
+ struct drm_crtc *crtc)
{
unsigned int i;
for (i = 0; i < STI_MAX_VID; i++)
if (compo->vid[i])
- vid_debugfs_init(compo->vid[i], minor);
+ vid_debugfs_init(compo->vid[i], crtc);
for (i = 0; i < STI_MAX_MIXER; i++)
if (compo->mixer[i])
- sti_mixer_debugfs_init(compo->mixer[i], minor);
+ sti_mixer_debugfs_init(compo->mixer[i], crtc);
}
static int sti_compositor_bind(struct device *dev,
@@ -80,6 +80,6 @@ struct sti_compositor {
};
void sti_compositor_debugfs_init(struct sti_compositor *compo,
- struct drm_minor *minor);
+ struct drm_crtc *crtc);
#endif
@@ -318,7 +318,7 @@ static int sti_crtc_late_register(struct drm_crtc *crtc)
struct sti_compositor *compo = dev_get_drvdata(mixer->dev);
if (drm_crtc_index(crtc) == 0)
- sti_compositor_debugfs_init(compo, crtc->dev->primary);
+ sti_compositor_debugfs_init(compo, crtc);
return 0;
}
@@ -147,8 +147,8 @@ static void mixer_dbg_mxn(struct seq_file *s, void *addr)
static int mixer_dbg_show(struct seq_file *s, void *arg)
{
- struct drm_info_node *node = s->private;
- struct sti_mixer *mixer = (struct sti_mixer *)node->info_ent->data;
+ struct drm_debugfs_crtc_entry *entry = s->private;
+ struct sti_mixer *mixer = (struct sti_mixer *)entry->file.data;
seq_printf(s, "%s: (vaddr = 0x%p)",
sti_mixer_to_str(mixer), mixer->regs);
@@ -170,39 +170,18 @@ static int mixer_dbg_show(struct seq_file *s, void *arg)
return 0;
}
-static struct drm_info_list mixer0_debugfs_files[] = {
- { "mixer_main", mixer_dbg_show, 0, NULL },
-};
-
-static struct drm_info_list mixer1_debugfs_files[] = {
- { "mixer_aux", mixer_dbg_show, 0, NULL },
-};
-
-void sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor)
+void sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_crtc *crtc)
{
- unsigned int i;
- struct drm_info_list *mixer_debugfs_files;
- int nb_files;
-
switch (mixer->id) {
case STI_MIXER_MAIN:
- mixer_debugfs_files = mixer0_debugfs_files;
- nb_files = ARRAY_SIZE(mixer0_debugfs_files);
+ drm_debugfs_crtc_add_file(crtc, "mixer_main", mixer_dbg_show, mixer);
break;
case STI_MIXER_AUX:
- mixer_debugfs_files = mixer1_debugfs_files;
- nb_files = ARRAY_SIZE(mixer1_debugfs_files);
+ drm_debugfs_crtc_add_file(crtc, "mixer_aux", mixer_dbg_show, mixer);
break;
default:
return;
}
-
- for (i = 0; i < nb_files; i++)
- mixer_debugfs_files[i].data = mixer;
-
- drm_debugfs_create_files(mixer_debugfs_files,
- nb_files,
- minor->debugfs_root, minor);
}
void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable)
@@ -58,7 +58,7 @@ int sti_mixer_active_video_area(struct sti_mixer *mixer,
void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable);
-void sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor);
+void sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_crtc *crtc);
/* depth in Cross-bar control = z order */
#define GAM_MIXER_NB_DEPTH_LEVEL 6
@@ -92,8 +92,8 @@ static void vid_dbg_mst(struct seq_file *s, int val)
static int vid_dbg_show(struct seq_file *s, void *arg)
{
- struct drm_info_node *node = s->private;
- struct sti_vid *vid = (struct sti_vid *)node->info_ent->data;
+ struct drm_debugfs_crtc_entry *entry = s->private;
+ struct sti_vid *vid = (struct sti_vid *)entry->file.data;
seq_printf(s, "VID: (vaddr= 0x%p)", vid->regs);
@@ -120,20 +120,9 @@ static int vid_dbg_show(struct seq_file *s, void *arg)
return 0;
}
-static struct drm_info_list vid_debugfs_files[] = {
- { "vid", vid_dbg_show, 0, NULL },
-};
-
-void vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor)
+void vid_debugfs_init(struct sti_vid *vid, struct drm_crtc *crtc)
{
- unsigned int i;
-
- for (i = 0; i < ARRAY_SIZE(vid_debugfs_files); i++)
- vid_debugfs_files[i].data = vid;
-
- drm_debugfs_create_files(vid_debugfs_files,
- ARRAY_SIZE(vid_debugfs_files),
- minor->debugfs_root, minor);
+ drm_debugfs_crtc_add_file(crtc, "vid", vid_dbg_show, vid);
}
void sti_vid_commit(struct sti_vid *vid,
@@ -26,6 +26,6 @@ void sti_vid_disable(struct sti_vid *vid);
struct sti_vid *sti_vid_create(struct device *dev, struct drm_device *drm_dev,
int id, void __iomem *baseaddr);
-void vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor);
+void vid_debugfs_init(struct sti_vid *vid, struct drm_crtc *crtc);
#endif
Replace the use of drm_debugfs_add_files() with the new drm_debugfs_crtc_add_files() function, which centers the debugfs files management on the drm_crtc instead of drm_device. Using this function on late register callbacks is more adequate as the callback passes a drm_crtc as parameter. Signed-off-by: Maíra Canal <mcanal@igalia.com> --- drivers/gpu/drm/sti/sti_compositor.c | 6 +++--- drivers/gpu/drm/sti/sti_compositor.h | 2 +- drivers/gpu/drm/sti/sti_crtc.c | 2 +- drivers/gpu/drm/sti/sti_mixer.c | 31 +++++----------------------- drivers/gpu/drm/sti/sti_mixer.h | 2 +- drivers/gpu/drm/sti/sti_vid.c | 19 ++++------------- drivers/gpu/drm/sti/sti_vid.h | 2 +- 7 files changed, 16 insertions(+), 48 deletions(-)