Message ID | e51f11814e6db911123f938c5bb1d73814fc6731.1687423204.git.geert+renesas@glider.be (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm: renesas: shmobile: Atomic conversion + DT support | expand |
Hi Geert, Thank you for the patch. On Thu, Jun 22, 2023 at 11:21:41AM +0200, Geert Uytterhoeven wrote: > Move the shmob_drm_crtc_finish_page_flip() function up, to avoid having > to move it during the modification in the next change. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 40 +++++++++++-------- > 1 file changed, 24 insertions(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c > index 2c0ca802d36026f4..1d7fcf64bf2aab80 100644 > --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c > +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c > @@ -270,6 +270,30 @@ static void shmob_drm_crtc_start(struct shmob_drm_crtc *scrtc) > scrtc->started = true; > } > > +/* ----------------------------------------------------------------------------- > + * Page Flip > + */ > + > +void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) > +{ > + struct drm_pending_vblank_event *event; > + struct drm_device *dev = scrtc->base.dev; > + unsigned long flags; > + > + spin_lock_irqsave(&dev->event_lock, flags); > + event = scrtc->event; > + scrtc->event = NULL; > + if (event) { > + drm_crtc_send_vblank_event(&scrtc->base, event); > + drm_crtc_vblank_put(&scrtc->base); > + } > + spin_unlock_irqrestore(&dev->event_lock, flags); > +} > + > +/* ----------------------------------------------------------------------------- > + * CRTC Functions > + */ > + > static void shmob_drm_crtc_stop(struct shmob_drm_crtc *scrtc) > { > struct drm_crtc *crtc = &scrtc->base; > @@ -412,22 +436,6 @@ static const struct drm_crtc_helper_funcs crtc_helper_funcs = { > .mode_set_base = shmob_drm_crtc_mode_set_base, > }; > > -void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) > -{ > - struct drm_pending_vblank_event *event; > - struct drm_device *dev = scrtc->base.dev; > - unsigned long flags; > - > - spin_lock_irqsave(&dev->event_lock, flags); > - event = scrtc->event; > - scrtc->event = NULL; > - if (event) { > - drm_crtc_send_vblank_event(&scrtc->base, event); > - drm_crtc_vblank_put(&scrtc->base); > - } > - spin_unlock_irqrestore(&dev->event_lock, flags); > -} > - > static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc, > struct drm_framebuffer *fb, > struct drm_pending_vblank_event *event,
diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c index 2c0ca802d36026f4..1d7fcf64bf2aab80 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c @@ -270,6 +270,30 @@ static void shmob_drm_crtc_start(struct shmob_drm_crtc *scrtc) scrtc->started = true; } +/* ----------------------------------------------------------------------------- + * Page Flip + */ + +void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) +{ + struct drm_pending_vblank_event *event; + struct drm_device *dev = scrtc->base.dev; + unsigned long flags; + + spin_lock_irqsave(&dev->event_lock, flags); + event = scrtc->event; + scrtc->event = NULL; + if (event) { + drm_crtc_send_vblank_event(&scrtc->base, event); + drm_crtc_vblank_put(&scrtc->base); + } + spin_unlock_irqrestore(&dev->event_lock, flags); +} + +/* ----------------------------------------------------------------------------- + * CRTC Functions + */ + static void shmob_drm_crtc_stop(struct shmob_drm_crtc *scrtc) { struct drm_crtc *crtc = &scrtc->base; @@ -412,22 +436,6 @@ static const struct drm_crtc_helper_funcs crtc_helper_funcs = { .mode_set_base = shmob_drm_crtc_mode_set_base, }; -void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) -{ - struct drm_pending_vblank_event *event; - struct drm_device *dev = scrtc->base.dev; - unsigned long flags; - - spin_lock_irqsave(&dev->event_lock, flags); - event = scrtc->event; - scrtc->event = NULL; - if (event) { - drm_crtc_send_vblank_event(&scrtc->base, event); - drm_crtc_vblank_put(&scrtc->base); - } - spin_unlock_irqrestore(&dev->event_lock, flags); -} - static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_pending_vblank_event *event,
Move the shmob_drm_crtc_finish_page_flip() function up, to avoid having to move it during the modification in the next change. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> --- .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-)