Message ID | 20210916211552.33490-12-greenfoo@u92.eu (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Kieran Bingham |
Headers | show |
Series | drm: cleanup: Use DRM_MODESET_LOCK_ALL_* helpers where possible | expand |
On Thu, Sep 16, 2021 at 11:15:48PM +0200, Fernando Ramos wrote: > As requested in Documentation/gpu/todo.rst, replace driver calls to > drm_modeset_lock_all() with DRM_MODESET_LOCK_ALL_BEGIN() and > DRM_MODESET_LOCK_ALL_END() > > Signed-off-by: Fernando Ramos <greenfoo@u92.eu> > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > index 768012243b44..4cbc79eaee17 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > @@ -1172,14 +1172,16 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) > struct drm_display_mode *mode; > struct drm_framebuffer *fb; > struct drm_plane_state *state; > + struct drm_modeset_acquire_ctx ctx; > struct dpu_crtc_state *cstate; > > int i, out_width; > + int ret; Please put ret with i & out_width > > dpu_crtc = s->private; > crtc = &dpu_crtc->base; > > - drm_modeset_lock_all(crtc->dev); > + DRM_MODESET_LOCK_ALL_BEGIN(crtc->dev, ctx, 0, ret); > cstate = to_dpu_crtc_state(crtc->state); > > mode = &crtc->state->adjusted_mode; > @@ -1263,7 +1265,7 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) > dpu_crtc->vblank_cb_time = ktime_set(0, 0); > } > > - drm_modeset_unlock_all(crtc->dev); > + DRM_MODESET_LOCK_ALL_END(crtc->dev, ctx, ret); > > return 0; Return ret here > } > -- > 2.33.0 >
> > int i, out_width; > > + int ret; > > Please put ret with i & out_width Done! > > - drm_modeset_unlock_all(crtc->dev); > > + DRM_MODESET_LOCK_ALL_END(crtc->dev, ctx, ret); > > > > return 0; > > Return ret here Done!
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 768012243b44..4cbc79eaee17 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -1172,14 +1172,16 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) struct drm_display_mode *mode; struct drm_framebuffer *fb; struct drm_plane_state *state; + struct drm_modeset_acquire_ctx ctx; struct dpu_crtc_state *cstate; int i, out_width; + int ret; dpu_crtc = s->private; crtc = &dpu_crtc->base; - drm_modeset_lock_all(crtc->dev); + DRM_MODESET_LOCK_ALL_BEGIN(crtc->dev, ctx, 0, ret); cstate = to_dpu_crtc_state(crtc->state); mode = &crtc->state->adjusted_mode; @@ -1263,7 +1265,7 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) dpu_crtc->vblank_cb_time = ktime_set(0, 0); } - drm_modeset_unlock_all(crtc->dev); + DRM_MODESET_LOCK_ALL_END(crtc->dev, ctx, ret); return 0; }
As requested in Documentation/gpu/todo.rst, replace driver calls to drm_modeset_lock_all() with DRM_MODESET_LOCK_ALL_BEGIN() and DRM_MODESET_LOCK_ALL_END() Signed-off-by: Fernando Ramos <greenfoo@u92.eu> --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)