* [PATCH] drm: sti: remove useless call to dev->struct_mutex
@ 2016-04-22 15:03 Benjamin Gaignard
2016-04-22 16:59 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Gaignard @ 2016-04-22 15:03 UTC (permalink / raw)
To: dri-devel, vincent.abriou, fabien.dessenne, daniel; +Cc: Benjamin Gaignard
No need to protect debugfs functions with dev->struct_mutex
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
---
drivers/gpu/drm/sti/sti_cursor.c | 7 -------
drivers/gpu/drm/sti/sti_drv.c | 6 ------
drivers/gpu/drm/sti/sti_dvo.c | 7 -------
drivers/gpu/drm/sti/sti_gdp.c | 14 --------------
drivers/gpu/drm/sti/sti_hda.c | 7 -------
drivers/gpu/drm/sti/sti_hdmi.c | 7 -------
drivers/gpu/drm/sti/sti_hqvdp.c | 7 -------
drivers/gpu/drm/sti/sti_mixer.c | 7 -------
drivers/gpu/drm/sti/sti_tvout.c | 7 -------
drivers/gpu/drm/sti/sti_vid.c | 7 -------
10 files changed, 76 deletions(-)
diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
index 3abb400..e6ee4c5 100644
--- a/drivers/gpu/drm/sti/sti_cursor.c
+++ b/drivers/gpu/drm/sti/sti_cursor.c
@@ -103,12 +103,6 @@ static int cursor_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_cursor *cursor = (struct sti_cursor *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "%s: (vaddr = 0x%p)",
sti_plane_to_str(&cursor->plane), cursor->regs);
@@ -127,7 +121,6 @@ static int cursor_dbg_show(struct seq_file *s, void *data)
DBGFS_DUMP(CUR_AWE);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 6bd6aba..a8eece2 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -72,11 +72,6 @@ static int sti_drm_fps_dbg_show(struct seq_file *s, void *data)
struct drm_info_node *node = s->private;
struct drm_device *dev = node->minor->dev;
struct drm_plane *p;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
list_for_each_entry(p, &dev->mode_config.plane_list, head) {
struct sti_plane *plane = to_sti_plane(p);
@@ -86,7 +81,6 @@ static int sti_drm_fps_dbg_show(struct seq_file *s, void *data)
plane->fps_info.fips_str);
}
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
index 25f7663..d439128 100644
--- a/drivers/gpu/drm/sti/sti_dvo.c
+++ b/drivers/gpu/drm/sti/sti_dvo.c
@@ -177,12 +177,6 @@ static int dvo_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_dvo *dvo = (struct sti_dvo *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "DVO: (vaddr = 0x%p)", dvo->regs);
DBGFS_DUMP(DVO_AWG_DIGSYNC_CTRL);
@@ -193,7 +187,6 @@ static int dvo_dbg_show(struct seq_file *s, void *data)
dvo_dbg_awg_microcode(s, dvo->regs + DVO_DIGSYNC_INSTR_I);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index ff3d3e7..3d098f1 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -207,14 +207,8 @@ static int gdp_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
struct drm_plane *drm_plane = &gdp->plane.drm_plane;
struct drm_crtc *crtc = drm_plane->crtc;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "%s: (vaddr = 0x%p)",
sti_plane_to_str(&gdp->plane), gdp->regs);
@@ -247,7 +241,6 @@ static int gdp_dbg_show(struct seq_file *s, void *data)
seq_printf(s, " Connected to DRM CRTC #%d (%s)\n",
crtc->base.id, sti_mixer_to_str(to_sti_mixer(crtc)));
- mutex_unlock(&dev->struct_mutex);
return 0;
}
@@ -278,13 +271,7 @@ static int gdp_node_dbg_show(struct seq_file *s, void *arg)
{
struct drm_info_node *node = s->private;
struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
unsigned int b;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
for (b = 0; b < GDP_NODE_NB_BANK; b++) {
seq_printf(s, "\n%s[%d].top", sti_plane_to_str(&gdp->plane), b);
@@ -293,7 +280,6 @@ static int gdp_node_dbg_show(struct seq_file *s, void *arg)
gdp_node_dump_node(s, gdp->node_list[b].btm_field);
}
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
index ec0d017..d0e1647 100644
--- a/drivers/gpu/drm/sti/sti_hda.c
+++ b/drivers/gpu/drm/sti/sti_hda.c
@@ -375,12 +375,6 @@ static int hda_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_hda *hda = (struct sti_hda *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "HD Analog: (vaddr = 0x%p)", hda->regs);
DBGFS_DUMP(HDA_ANA_CFG);
@@ -396,7 +390,6 @@ static int hda_dbg_show(struct seq_file *s, void *data)
hda_dbg_video_dacs_ctrl(s, hda->video_dacs_ctrl);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 6ef0715..85545eb 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -628,12 +628,6 @@ static int hdmi_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_hdmi *hdmi = (struct sti_hdmi *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "HDMI: (vaddr = 0x%p)", hdmi->regs);
DBGFS_DUMP("\n", HDMI_CFG);
@@ -690,7 +684,6 @@ static int hdmi_dbg_show(struct seq_file *s, void *data)
DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD6, HDMI_IFRAME_SLOT_VENDOR);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index e05b0dc..6230565 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -554,14 +554,8 @@ static int hqvdp_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_hqvdp *hqvdp = (struct sti_hqvdp *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
int cmd, cmd_offset, infoxp70;
void *virt;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "%s: (vaddr = 0x%p)",
sti_plane_to_str(&hqvdp->plane), hqvdp->regs);
@@ -629,7 +623,6 @@ static int hqvdp_dbg_show(struct seq_file *s, void *data)
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c
index e7425c3..cc89d75 100644
--- a/drivers/gpu/drm/sti/sti_mixer.c
+++ b/drivers/gpu/drm/sti/sti_mixer.c
@@ -150,12 +150,6 @@ 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_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "%s: (vaddr = 0x%p)",
sti_mixer_to_str(mixer), mixer->regs);
@@ -175,7 +169,6 @@ static int mixer_dbg_show(struct seq_file *s, void *arg)
mixer_dbg_mxn(s, mixer->regs + GAM_MIXER_MX0);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
index 2c99016..d641a5f 100644
--- a/drivers/gpu/drm/sti/sti_tvout.c
+++ b/drivers/gpu/drm/sti/sti_tvout.c
@@ -514,13 +514,7 @@ static int tvout_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_tvout *tvout = (struct sti_tvout *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
struct drm_crtc *crtc;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "TVOUT: (vaddr = 0x%p)", tvout->regs);
@@ -586,7 +580,6 @@ static int tvout_dbg_show(struct seq_file *s, void *data)
DBGFS_DUMP(TVO_AUX_IN_VID_FORMAT);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_vid.c b/drivers/gpu/drm/sti/sti_vid.c
index 5a2c5dc..cba3214 100644
--- a/drivers/gpu/drm/sti/sti_vid.c
+++ b/drivers/gpu/drm/sti/sti_vid.c
@@ -91,12 +91,6 @@ 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_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "VID: (vaddr= 0x%p)", vid->regs);
@@ -121,7 +115,6 @@ static int vid_dbg_show(struct seq_file *s, void *arg)
DBGFS_DUMP(VID_CSAT);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
--
1.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] drm: sti: remove useless call to dev->struct_mutex
2016-04-22 15:03 [PATCH] drm: sti: remove useless call to dev->struct_mutex Benjamin Gaignard
@ 2016-04-22 16:59 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2016-04-22 16:59 UTC (permalink / raw)
To: Benjamin Gaignard; +Cc: vincent.abriou, fabien.dessenne, dri-devel
On Fri, Apr 22, 2016 at 05:03:09PM +0200, Benjamin Gaignard wrote:
> No need to protect debugfs functions with dev->struct_mutex
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/sti/sti_cursor.c | 7 -------
> drivers/gpu/drm/sti/sti_drv.c | 6 ------
> drivers/gpu/drm/sti/sti_dvo.c | 7 -------
> drivers/gpu/drm/sti/sti_gdp.c | 14 --------------
> drivers/gpu/drm/sti/sti_hda.c | 7 -------
> drivers/gpu/drm/sti/sti_hdmi.c | 7 -------
> drivers/gpu/drm/sti/sti_hqvdp.c | 7 -------
> drivers/gpu/drm/sti/sti_mixer.c | 7 -------
> drivers/gpu/drm/sti/sti_tvout.c | 7 -------
> drivers/gpu/drm/sti/sti_vid.c | 7 -------
> 10 files changed, 76 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
> index 3abb400..e6ee4c5 100644
> --- a/drivers/gpu/drm/sti/sti_cursor.c
> +++ b/drivers/gpu/drm/sti/sti_cursor.c
> @@ -103,12 +103,6 @@ static int cursor_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_cursor *cursor = (struct sti_cursor *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "%s: (vaddr = 0x%p)",
> sti_plane_to_str(&cursor->plane), cursor->regs);
> @@ -127,7 +121,6 @@ static int cursor_dbg_show(struct seq_file *s, void *data)
> DBGFS_DUMP(CUR_AWE);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index 6bd6aba..a8eece2 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -72,11 +72,6 @@ static int sti_drm_fps_dbg_show(struct seq_file *s, void *data)
> struct drm_info_node *node = s->private;
> struct drm_device *dev = node->minor->dev;
> struct drm_plane *p;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> list_for_each_entry(p, &dev->mode_config.plane_list, head) {
> struct sti_plane *plane = to_sti_plane(p);
> @@ -86,7 +81,6 @@ static int sti_drm_fps_dbg_show(struct seq_file *s, void *data)
> plane->fps_info.fips_str);
> }
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
> index 25f7663..d439128 100644
> --- a/drivers/gpu/drm/sti/sti_dvo.c
> +++ b/drivers/gpu/drm/sti/sti_dvo.c
> @@ -177,12 +177,6 @@ static int dvo_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_dvo *dvo = (struct sti_dvo *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "DVO: (vaddr = 0x%p)", dvo->regs);
> DBGFS_DUMP(DVO_AWG_DIGSYNC_CTRL);
> @@ -193,7 +187,6 @@ static int dvo_dbg_show(struct seq_file *s, void *data)
> dvo_dbg_awg_microcode(s, dvo->regs + DVO_DIGSYNC_INSTR_I);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
> index ff3d3e7..3d098f1 100644
> --- a/drivers/gpu/drm/sti/sti_gdp.c
> +++ b/drivers/gpu/drm/sti/sti_gdp.c
> @@ -207,14 +207,8 @@ static int gdp_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> struct drm_plane *drm_plane = &gdp->plane.drm_plane;
> struct drm_crtc *crtc = drm_plane->crtc;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "%s: (vaddr = 0x%p)",
> sti_plane_to_str(&gdp->plane), gdp->regs);
> @@ -247,7 +241,6 @@ static int gdp_dbg_show(struct seq_file *s, void *data)
> seq_printf(s, " Connected to DRM CRTC #%d (%s)\n",
> crtc->base.id, sti_mixer_to_str(to_sti_mixer(crtc)));
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> @@ -278,13 +271,7 @@ static int gdp_node_dbg_show(struct seq_file *s, void *arg)
> {
> struct drm_info_node *node = s->private;
> struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> unsigned int b;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> for (b = 0; b < GDP_NODE_NB_BANK; b++) {
> seq_printf(s, "\n%s[%d].top", sti_plane_to_str(&gdp->plane), b);
> @@ -293,7 +280,6 @@ static int gdp_node_dbg_show(struct seq_file *s, void *arg)
> gdp_node_dump_node(s, gdp->node_list[b].btm_field);
> }
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
> index ec0d017..d0e1647 100644
> --- a/drivers/gpu/drm/sti/sti_hda.c
> +++ b/drivers/gpu/drm/sti/sti_hda.c
> @@ -375,12 +375,6 @@ static int hda_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_hda *hda = (struct sti_hda *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "HD Analog: (vaddr = 0x%p)", hda->regs);
> DBGFS_DUMP(HDA_ANA_CFG);
> @@ -396,7 +390,6 @@ static int hda_dbg_show(struct seq_file *s, void *data)
> hda_dbg_video_dacs_ctrl(s, hda->video_dacs_ctrl);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
> index 6ef0715..85545eb 100644
> --- a/drivers/gpu/drm/sti/sti_hdmi.c
> +++ b/drivers/gpu/drm/sti/sti_hdmi.c
> @@ -628,12 +628,6 @@ static int hdmi_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_hdmi *hdmi = (struct sti_hdmi *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "HDMI: (vaddr = 0x%p)", hdmi->regs);
> DBGFS_DUMP("\n", HDMI_CFG);
> @@ -690,7 +684,6 @@ static int hdmi_dbg_show(struct seq_file *s, void *data)
> DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD6, HDMI_IFRAME_SLOT_VENDOR);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
> index e05b0dc..6230565 100644
> --- a/drivers/gpu/drm/sti/sti_hqvdp.c
> +++ b/drivers/gpu/drm/sti/sti_hqvdp.c
> @@ -554,14 +554,8 @@ static int hqvdp_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_hqvdp *hqvdp = (struct sti_hqvdp *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> int cmd, cmd_offset, infoxp70;
> void *virt;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "%s: (vaddr = 0x%p)",
> sti_plane_to_str(&hqvdp->plane), hqvdp->regs);
> @@ -629,7 +623,6 @@ static int hqvdp_dbg_show(struct seq_file *s, void *data)
>
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c
> index e7425c3..cc89d75 100644
> --- a/drivers/gpu/drm/sti/sti_mixer.c
> +++ b/drivers/gpu/drm/sti/sti_mixer.c
> @@ -150,12 +150,6 @@ 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_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "%s: (vaddr = 0x%p)",
> sti_mixer_to_str(mixer), mixer->regs);
> @@ -175,7 +169,6 @@ static int mixer_dbg_show(struct seq_file *s, void *arg)
> mixer_dbg_mxn(s, mixer->regs + GAM_MIXER_MX0);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
> index 2c99016..d641a5f 100644
> --- a/drivers/gpu/drm/sti/sti_tvout.c
> +++ b/drivers/gpu/drm/sti/sti_tvout.c
> @@ -514,13 +514,7 @@ static int tvout_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_tvout *tvout = (struct sti_tvout *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> struct drm_crtc *crtc;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "TVOUT: (vaddr = 0x%p)", tvout->regs);
>
> @@ -586,7 +580,6 @@ static int tvout_dbg_show(struct seq_file *s, void *data)
> DBGFS_DUMP(TVO_AUX_IN_VID_FORMAT);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_vid.c b/drivers/gpu/drm/sti/sti_vid.c
> index 5a2c5dc..cba3214 100644
> --- a/drivers/gpu/drm/sti/sti_vid.c
> +++ b/drivers/gpu/drm/sti/sti_vid.c
> @@ -91,12 +91,6 @@ 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_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "VID: (vaddr= 0x%p)", vid->regs);
>
> @@ -121,7 +115,6 @@ static int vid_dbg_show(struct seq_file *s, void *arg)
> DBGFS_DUMP(VID_CSAT);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> --
> 1.9.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 04/35] drm: Forbid legacy MAP functions for DRIVER_MODESET
@ 2016-04-26 17:29 Daniel Vetter
2016-04-27 7:21 ` [PATCH] drm: sti: remove useless call to dev->struct_mutex Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2016-04-26 17:29 UTC (permalink / raw)
To: DRI Development
Cc: Daniel Vetter, Daniel Vetter, Intel Graphics Development,
Ben Skeggs
Like in
commit 0e975980d435d58df2d430d688b8c18778b42218
Author: Peter Antoine <peter.antoine@intel.com>
Date: Tue Jun 23 08:18:49 2015 +0100
drm: Turn off Legacy Context Functions
we need to again make an exception for nouveau, but everyone else
really doesn't need this.
Cc: Peter Antoine <peter.antoine@intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
drivers/gpu/drm/drm_bufs.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index d92db7007f62..e8a12a4fd400 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -396,6 +396,10 @@ int drm_legacy_addmap_ioctl(struct drm_device *dev, void *data,
if (!(capable(CAP_SYS_ADMIN) || map->type == _DRM_AGP || map->type == _DRM_SHM))
return -EPERM;
+ if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
+ drm_core_check_feature(dev, DRIVER_MODESET))
+ return -EINVAL;
+
err = drm_addmap_core(dev, map->offset, map->size, map->type,
map->flags, &maplist);
@@ -438,6 +442,10 @@ int drm_legacy_getmap_ioctl(struct drm_device *dev, void *data,
int idx;
int i;
+ if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
+ drm_core_check_feature(dev, DRIVER_MODESET))
+ return -EINVAL;
+
idx = map->offset;
if (idx < 0)
return -EINVAL;
@@ -569,6 +577,10 @@ int drm_legacy_rmmap_ioctl(struct drm_device *dev, void *data,
struct drm_map_list *r_list;
int ret;
+ if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
+ drm_core_check_feature(dev, DRIVER_MODESET))
+ return -EINVAL;
+
mutex_lock(&dev->struct_mutex);
list_for_each_entry(r_list, &dev->maplist, head) {
if (r_list->map &&
--
2.8.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] drm: sti: remove useless call to dev->struct_mutex
2016-04-26 17:29 [PATCH 04/35] drm: Forbid legacy MAP functions for DRIVER_MODESET Daniel Vetter
@ 2016-04-27 7:21 ` Daniel Vetter
2016-04-27 7:58 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2016-04-27 7:21 UTC (permalink / raw)
To: DRI Development
Cc: Daniel Vetter, Intel Graphics Development, Benjamin Gaignard
From: Benjamin Gaignard <benjamin.gaignard@linaro.org>
No need to protect debugfs functions with dev->struct_mutex
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/gpu/drm/sti/sti_cursor.c | 7 -------
drivers/gpu/drm/sti/sti_drv.c | 6 ------
drivers/gpu/drm/sti/sti_dvo.c | 7 -------
drivers/gpu/drm/sti/sti_gdp.c | 14 --------------
drivers/gpu/drm/sti/sti_hda.c | 7 -------
drivers/gpu/drm/sti/sti_hdmi.c | 7 -------
drivers/gpu/drm/sti/sti_hqvdp.c | 7 -------
drivers/gpu/drm/sti/sti_mixer.c | 7 -------
drivers/gpu/drm/sti/sti_tvout.c | 7 -------
drivers/gpu/drm/sti/sti_vid.c | 7 -------
10 files changed, 76 deletions(-)
diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
index 3abb400151ac..e6ee4c526665 100644
--- a/drivers/gpu/drm/sti/sti_cursor.c
+++ b/drivers/gpu/drm/sti/sti_cursor.c
@@ -103,12 +103,6 @@ static int cursor_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_cursor *cursor = (struct sti_cursor *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "%s: (vaddr = 0x%p)",
sti_plane_to_str(&cursor->plane), cursor->regs);
@@ -127,7 +121,6 @@ static int cursor_dbg_show(struct seq_file *s, void *data)
DBGFS_DUMP(CUR_AWE);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 6bd6abaa5a70..a8eece20b6b4 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -72,11 +72,6 @@ static int sti_drm_fps_dbg_show(struct seq_file *s, void *data)
struct drm_info_node *node = s->private;
struct drm_device *dev = node->minor->dev;
struct drm_plane *p;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
list_for_each_entry(p, &dev->mode_config.plane_list, head) {
struct sti_plane *plane = to_sti_plane(p);
@@ -86,7 +81,6 @@ static int sti_drm_fps_dbg_show(struct seq_file *s, void *data)
plane->fps_info.fips_str);
}
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
index 25f76632002c..d439128e6309 100644
--- a/drivers/gpu/drm/sti/sti_dvo.c
+++ b/drivers/gpu/drm/sti/sti_dvo.c
@@ -177,12 +177,6 @@ static int dvo_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_dvo *dvo = (struct sti_dvo *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "DVO: (vaddr = 0x%p)", dvo->regs);
DBGFS_DUMP(DVO_AWG_DIGSYNC_CTRL);
@@ -193,7 +187,6 @@ static int dvo_dbg_show(struct seq_file *s, void *data)
dvo_dbg_awg_microcode(s, dvo->regs + DVO_DIGSYNC_INSTR_I);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index ff3d3e7e7704..3d098f1ab919 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -207,14 +207,8 @@ static int gdp_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
struct drm_plane *drm_plane = &gdp->plane.drm_plane;
struct drm_crtc *crtc = drm_plane->crtc;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "%s: (vaddr = 0x%p)",
sti_plane_to_str(&gdp->plane), gdp->regs);
@@ -247,7 +241,6 @@ static int gdp_dbg_show(struct seq_file *s, void *data)
seq_printf(s, " Connected to DRM CRTC #%d (%s)\n",
crtc->base.id, sti_mixer_to_str(to_sti_mixer(crtc)));
- mutex_unlock(&dev->struct_mutex);
return 0;
}
@@ -278,13 +271,7 @@ static int gdp_node_dbg_show(struct seq_file *s, void *arg)
{
struct drm_info_node *node = s->private;
struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
unsigned int b;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
for (b = 0; b < GDP_NODE_NB_BANK; b++) {
seq_printf(s, "\n%s[%d].top", sti_plane_to_str(&gdp->plane), b);
@@ -293,7 +280,6 @@ static int gdp_node_dbg_show(struct seq_file *s, void *arg)
gdp_node_dump_node(s, gdp->node_list[b].btm_field);
}
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
index ec0d017eaf1a..d0e1647ce41a 100644
--- a/drivers/gpu/drm/sti/sti_hda.c
+++ b/drivers/gpu/drm/sti/sti_hda.c
@@ -375,12 +375,6 @@ static int hda_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_hda *hda = (struct sti_hda *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "HD Analog: (vaddr = 0x%p)", hda->regs);
DBGFS_DUMP(HDA_ANA_CFG);
@@ -396,7 +390,6 @@ static int hda_dbg_show(struct seq_file *s, void *data)
hda_dbg_video_dacs_ctrl(s, hda->video_dacs_ctrl);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 6ef0715bd5b9..85545ebf88d3 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -628,12 +628,6 @@ static int hdmi_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_hdmi *hdmi = (struct sti_hdmi *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "HDMI: (vaddr = 0x%p)", hdmi->regs);
DBGFS_DUMP("\n", HDMI_CFG);
@@ -690,7 +684,6 @@ static int hdmi_dbg_show(struct seq_file *s, void *data)
DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD6, HDMI_IFRAME_SLOT_VENDOR);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index e05b0dc523ff..6230565048c3 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -554,14 +554,8 @@ static int hqvdp_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_hqvdp *hqvdp = (struct sti_hqvdp *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
int cmd, cmd_offset, infoxp70;
void *virt;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "%s: (vaddr = 0x%p)",
sti_plane_to_str(&hqvdp->plane), hqvdp->regs);
@@ -629,7 +623,6 @@ static int hqvdp_dbg_show(struct seq_file *s, void *data)
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c
index e7425c38fc93..cc89d75273df 100644
--- a/drivers/gpu/drm/sti/sti_mixer.c
+++ b/drivers/gpu/drm/sti/sti_mixer.c
@@ -150,12 +150,6 @@ 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_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "%s: (vaddr = 0x%p)",
sti_mixer_to_str(mixer), mixer->regs);
@@ -175,7 +169,6 @@ static int mixer_dbg_show(struct seq_file *s, void *arg)
mixer_dbg_mxn(s, mixer->regs + GAM_MIXER_MX0);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
index 2c99016443e5..d641a5fe512b 100644
--- a/drivers/gpu/drm/sti/sti_tvout.c
+++ b/drivers/gpu/drm/sti/sti_tvout.c
@@ -514,13 +514,7 @@ static int tvout_dbg_show(struct seq_file *s, void *data)
{
struct drm_info_node *node = s->private;
struct sti_tvout *tvout = (struct sti_tvout *)node->info_ent->data;
- struct drm_device *dev = node->minor->dev;
struct drm_crtc *crtc;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "TVOUT: (vaddr = 0x%p)", tvout->regs);
@@ -586,7 +580,6 @@ static int tvout_dbg_show(struct seq_file *s, void *data)
DBGFS_DUMP(TVO_AUX_IN_VID_FORMAT);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
diff --git a/drivers/gpu/drm/sti/sti_vid.c b/drivers/gpu/drm/sti/sti_vid.c
index 5a2c5dc3687b..cba32140a763 100644
--- a/drivers/gpu/drm/sti/sti_vid.c
+++ b/drivers/gpu/drm/sti/sti_vid.c
@@ -91,12 +91,6 @@ 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_device *dev = node->minor->dev;
- int ret;
-
- ret = mutex_lock_interruptible(&dev->struct_mutex);
- if (ret)
- return ret;
seq_printf(s, "VID: (vaddr= 0x%p)", vid->regs);
@@ -121,7 +115,6 @@ static int vid_dbg_show(struct seq_file *s, void *arg)
DBGFS_DUMP(VID_CSAT);
seq_puts(s, "\n");
- mutex_unlock(&dev->struct_mutex);
return 0;
}
--
2.8.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] drm: sti: remove useless call to dev->struct_mutex
2016-04-27 7:21 ` [PATCH] drm: sti: remove useless call to dev->struct_mutex Daniel Vetter
@ 2016-04-27 7:58 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2016-04-27 7:58 UTC (permalink / raw)
To: DRI Development
Cc: Daniel Vetter, Intel Graphics Development, Benjamin Gaignard
On Wed, Apr 27, 2016 at 09:21:29AM +0200, Daniel Vetter wrote:
> From: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>
> No need to protect debugfs functions with dev->struct_mutex
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Oops, resent wrong patch, but the iteration that dropped the nouveau
special case was busted anyway.
-Daniel
> ---
> drivers/gpu/drm/sti/sti_cursor.c | 7 -------
> drivers/gpu/drm/sti/sti_drv.c | 6 ------
> drivers/gpu/drm/sti/sti_dvo.c | 7 -------
> drivers/gpu/drm/sti/sti_gdp.c | 14 --------------
> drivers/gpu/drm/sti/sti_hda.c | 7 -------
> drivers/gpu/drm/sti/sti_hdmi.c | 7 -------
> drivers/gpu/drm/sti/sti_hqvdp.c | 7 -------
> drivers/gpu/drm/sti/sti_mixer.c | 7 -------
> drivers/gpu/drm/sti/sti_tvout.c | 7 -------
> drivers/gpu/drm/sti/sti_vid.c | 7 -------
> 10 files changed, 76 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
> index 3abb400151ac..e6ee4c526665 100644
> --- a/drivers/gpu/drm/sti/sti_cursor.c
> +++ b/drivers/gpu/drm/sti/sti_cursor.c
> @@ -103,12 +103,6 @@ static int cursor_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_cursor *cursor = (struct sti_cursor *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "%s: (vaddr = 0x%p)",
> sti_plane_to_str(&cursor->plane), cursor->regs);
> @@ -127,7 +121,6 @@ static int cursor_dbg_show(struct seq_file *s, void *data)
> DBGFS_DUMP(CUR_AWE);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index 6bd6abaa5a70..a8eece20b6b4 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -72,11 +72,6 @@ static int sti_drm_fps_dbg_show(struct seq_file *s, void *data)
> struct drm_info_node *node = s->private;
> struct drm_device *dev = node->minor->dev;
> struct drm_plane *p;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> list_for_each_entry(p, &dev->mode_config.plane_list, head) {
> struct sti_plane *plane = to_sti_plane(p);
> @@ -86,7 +81,6 @@ static int sti_drm_fps_dbg_show(struct seq_file *s, void *data)
> plane->fps_info.fips_str);
> }
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
> index 25f76632002c..d439128e6309 100644
> --- a/drivers/gpu/drm/sti/sti_dvo.c
> +++ b/drivers/gpu/drm/sti/sti_dvo.c
> @@ -177,12 +177,6 @@ static int dvo_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_dvo *dvo = (struct sti_dvo *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "DVO: (vaddr = 0x%p)", dvo->regs);
> DBGFS_DUMP(DVO_AWG_DIGSYNC_CTRL);
> @@ -193,7 +187,6 @@ static int dvo_dbg_show(struct seq_file *s, void *data)
> dvo_dbg_awg_microcode(s, dvo->regs + DVO_DIGSYNC_INSTR_I);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
> index ff3d3e7e7704..3d098f1ab919 100644
> --- a/drivers/gpu/drm/sti/sti_gdp.c
> +++ b/drivers/gpu/drm/sti/sti_gdp.c
> @@ -207,14 +207,8 @@ static int gdp_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> struct drm_plane *drm_plane = &gdp->plane.drm_plane;
> struct drm_crtc *crtc = drm_plane->crtc;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "%s: (vaddr = 0x%p)",
> sti_plane_to_str(&gdp->plane), gdp->regs);
> @@ -247,7 +241,6 @@ static int gdp_dbg_show(struct seq_file *s, void *data)
> seq_printf(s, " Connected to DRM CRTC #%d (%s)\n",
> crtc->base.id, sti_mixer_to_str(to_sti_mixer(crtc)));
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> @@ -278,13 +271,7 @@ static int gdp_node_dbg_show(struct seq_file *s, void *arg)
> {
> struct drm_info_node *node = s->private;
> struct sti_gdp *gdp = (struct sti_gdp *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> unsigned int b;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> for (b = 0; b < GDP_NODE_NB_BANK; b++) {
> seq_printf(s, "\n%s[%d].top", sti_plane_to_str(&gdp->plane), b);
> @@ -293,7 +280,6 @@ static int gdp_node_dbg_show(struct seq_file *s, void *arg)
> gdp_node_dump_node(s, gdp->node_list[b].btm_field);
> }
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
> index ec0d017eaf1a..d0e1647ce41a 100644
> --- a/drivers/gpu/drm/sti/sti_hda.c
> +++ b/drivers/gpu/drm/sti/sti_hda.c
> @@ -375,12 +375,6 @@ static int hda_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_hda *hda = (struct sti_hda *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "HD Analog: (vaddr = 0x%p)", hda->regs);
> DBGFS_DUMP(HDA_ANA_CFG);
> @@ -396,7 +390,6 @@ static int hda_dbg_show(struct seq_file *s, void *data)
> hda_dbg_video_dacs_ctrl(s, hda->video_dacs_ctrl);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
> index 6ef0715bd5b9..85545ebf88d3 100644
> --- a/drivers/gpu/drm/sti/sti_hdmi.c
> +++ b/drivers/gpu/drm/sti/sti_hdmi.c
> @@ -628,12 +628,6 @@ static int hdmi_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_hdmi *hdmi = (struct sti_hdmi *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "HDMI: (vaddr = 0x%p)", hdmi->regs);
> DBGFS_DUMP("\n", HDMI_CFG);
> @@ -690,7 +684,6 @@ static int hdmi_dbg_show(struct seq_file *s, void *data)
> DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD6, HDMI_IFRAME_SLOT_VENDOR);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
> index e05b0dc523ff..6230565048c3 100644
> --- a/drivers/gpu/drm/sti/sti_hqvdp.c
> +++ b/drivers/gpu/drm/sti/sti_hqvdp.c
> @@ -554,14 +554,8 @@ static int hqvdp_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_hqvdp *hqvdp = (struct sti_hqvdp *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> int cmd, cmd_offset, infoxp70;
> void *virt;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "%s: (vaddr = 0x%p)",
> sti_plane_to_str(&hqvdp->plane), hqvdp->regs);
> @@ -629,7 +623,6 @@ static int hqvdp_dbg_show(struct seq_file *s, void *data)
>
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c
> index e7425c38fc93..cc89d75273df 100644
> --- a/drivers/gpu/drm/sti/sti_mixer.c
> +++ b/drivers/gpu/drm/sti/sti_mixer.c
> @@ -150,12 +150,6 @@ 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_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "%s: (vaddr = 0x%p)",
> sti_mixer_to_str(mixer), mixer->regs);
> @@ -175,7 +169,6 @@ static int mixer_dbg_show(struct seq_file *s, void *arg)
> mixer_dbg_mxn(s, mixer->regs + GAM_MIXER_MX0);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
> index 2c99016443e5..d641a5fe512b 100644
> --- a/drivers/gpu/drm/sti/sti_tvout.c
> +++ b/drivers/gpu/drm/sti/sti_tvout.c
> @@ -514,13 +514,7 @@ static int tvout_dbg_show(struct seq_file *s, void *data)
> {
> struct drm_info_node *node = s->private;
> struct sti_tvout *tvout = (struct sti_tvout *)node->info_ent->data;
> - struct drm_device *dev = node->minor->dev;
> struct drm_crtc *crtc;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "TVOUT: (vaddr = 0x%p)", tvout->regs);
>
> @@ -586,7 +580,6 @@ static int tvout_dbg_show(struct seq_file *s, void *data)
> DBGFS_DUMP(TVO_AUX_IN_VID_FORMAT);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/sti/sti_vid.c b/drivers/gpu/drm/sti/sti_vid.c
> index 5a2c5dc3687b..cba32140a763 100644
> --- a/drivers/gpu/drm/sti/sti_vid.c
> +++ b/drivers/gpu/drm/sti/sti_vid.c
> @@ -91,12 +91,6 @@ 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_device *dev = node->minor->dev;
> - int ret;
> -
> - ret = mutex_lock_interruptible(&dev->struct_mutex);
> - if (ret)
> - return ret;
>
> seq_printf(s, "VID: (vaddr= 0x%p)", vid->regs);
>
> @@ -121,7 +115,6 @@ static int vid_dbg_show(struct seq_file *s, void *arg)
> DBGFS_DUMP(VID_CSAT);
> seq_puts(s, "\n");
>
> - mutex_unlock(&dev->struct_mutex);
> return 0;
> }
>
> --
> 2.8.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-27 7:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-22 15:03 [PATCH] drm: sti: remove useless call to dev->struct_mutex Benjamin Gaignard
2016-04-22 16:59 ` Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2016-04-26 17:29 [PATCH 04/35] drm: Forbid legacy MAP functions for DRIVER_MODESET Daniel Vetter
2016-04-27 7:21 ` [PATCH] drm: sti: remove useless call to dev->struct_mutex Daniel Vetter
2016-04-27 7:58 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox