<p dir="ltr"></p>
<p dir="ltr">On 28-Sep-2018 9:00 PM, "Laurent Pinchart" <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>> wrote:<br>
><br>
> Hi Souptick,<br>
><br>
> On Friday, 28 September 2018 18:05:18 EEST Laurent Pinchart wrote:<br>
> > On Thursday, 27 September 2018 09:34:18 EEST Souptick Joarder wrote:<br>
> > > On Tue, Sep 18, 2018 at 10:05 PM Souptick Joarder wrote:<br>
> > >> convert drm_atomic_helper_suspend/resume() to use<br>
> > >> drm_mode_config_helper_suspend/resume().<br>
> > >> <br>
> > >> remove suspend_state field from the rcar_du_device<br>
> > >> structure as it is no more required.<br>
> > >> <br>
> > >> With this conversion, also drm_fbdev_cma_set_suspend_unlocked()<br>
> > >> will left with no consumer. So this function can be removed.<br>
> > >> <br>
> > >> Signed-off-by: Souptick Joarder <<a href="mailto:jrdr.linux@gmail.com">jrdr.linux@gmail.com</a>><br>
> > > <br>
> > > Laurent, any comment on this patch ??<br>
> > <br>
> > Sorry for the delay, and thanks for pinging me.<br>
> > <br>
> > Reviewed-by: Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>><br>
> > <br>
> > Should I apply this to my tree or do you plan to merge it through drm-misc<br>
> > as it touches drm_fb_cma_helper.c ?<br>
><br>
> I just realized that the same patch got supplied by Noralf Trønnes nearly a <br>
> year ago, and was later superseded by <a href="https://patchwork.freedesktop.org/patch/">https://patchwork.freedesktop.org/patch/</a><br>
> 247861/. I think we should thus apply Noralf's patches instead (once he sends <br>
> v4 out).</p>
<p dir="ltr">Sure, you can go ahead with his patch.</p>
<p dir="ltr">Shall I remove drm_fbdev_cma_set_suspend_unlocked in a separate patch once all the consumer remove this function ?<br>
><br>
> > >> ---<br>
> > >> <br>
> > >> drivers/gpu/drm/drm_fb_cma_helper.c | 18 ------------------<br>
> > >> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 21 ++-------------------<br>
> > >> drivers/gpu/drm/rcar-du/rcar_du_drv.h | 1 -<br>
> > >> include/drm/drm_fb_cma_helper.h | 2 --<br>
> > >> 4 files changed, 2 insertions(+), 40 deletions(-)<br>
> > >> <br>
> > >> diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c<br>
> > >> b/drivers/gpu/drm/drm_fb_cma_helper.c index 47e0e2f..96efc88 100644<br>
> > >> --- a/drivers/gpu/drm/drm_fb_cma_helper.c<br>
> > >> +++ b/drivers/gpu/drm/drm_fb_cma_helper.c<br>
> > >> @@ -224,21 +224,3 @@ void drm_fbdev_cma_hotplug_event(struct<br>
> > >> drm_fbdev_cma *fbdev_cma)<br>
> > >> drm_fb_helper_hotplug_event(&fbdev_cma->fb_helper);<br>
> > >> }<br>
> > >> EXPORT_SYMBOL_GPL(drm_fbdev_cma_hotplug_event);<br>
> > >> <br>
> > >> -<br>
> > >> -/**<br>
> > >> - * drm_fbdev_cma_set_suspend_unlocked - wrapper around<br>
> > >> - *<br>
> > >> drm_fb_helper_set_suspend_unlocked<br>
> > >> - * @fbdev_cma: The drm_fbdev_cma struct, may be NULL<br>
> > >> - * @state: desired state, zero to resume, non-zero to suspend<br>
> > >> - *<br>
> > >> - * Calls drm_fb_helper_set_suspend, which is a wrapper around<br>
> > >> - * fb_set_suspend implemented by fbdev core.<br>
> > >> - */<br>
> > >> -void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma<br>
> > >> *fbdev_cma,<br>
> > >> - bool state)<br>
> > >> -{<br>
> > >> - if (fbdev_cma)<br>
> > >> - <br>
> > >> drm_fb_helper_set_suspend_unlocked(&fbdev_cma->fb_helper,<br>
> > >> - state);<br>
> > >> -}<br>
> > >> -EXPORT_SYMBOL(drm_fbdev_cma_set_suspend_unlocked);<br>
> > >> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c<br>
> > >> b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 02aee6c..288220f 100644<br>
> > >> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c<br>
> > >> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c<br>
> > >> @@ -357,32 +357,15 @@ static void rcar_du_lastclose(struct drm_device<br>
> > >> *dev)<br>
> > >> <br>
> > >> static int rcar_du_pm_suspend(struct device *dev)<br>
> > >> {<br>
> > >> struct rcar_du_device *rcdu = dev_get_drvdata(dev);<br>
> > >> - struct drm_atomic_state *state;<br>
> > >> <br>
> > >> - drm_kms_helper_poll_disable(rcdu->ddev);<br>
> > >> - drm_fbdev_cma_set_suspend_unlocked(rcdu->fbdev, true);<br>
> > >> -<br>
> > >> - state = drm_atomic_helper_suspend(rcdu->ddev);<br>
> > >> - if (IS_ERR(state)) {<br>
> > >> - drm_fbdev_cma_set_suspend_unlocked(rcdu->fbdev, false);<br>
> > >> - drm_kms_helper_poll_enable(rcdu->ddev);<br>
> > >> - return PTR_ERR(state);<br>
> > >> - }<br>
> > >> -<br>
> > >> - rcdu->suspend_state = state;<br>
> > >> -<br>
> > >> - return 0;<br>
> > >> + return drm_mode_config_helper_suspend(rcdu->ddev);<br>
> > >> }<br>
> > >> <br>
> > >> static int rcar_du_pm_resume(struct device *dev)<br>
> > >> {<br>
> > >> struct rcar_du_device *rcdu = dev_get_drvdata(dev);<br>
> > >> <br>
> > >> - drm_atomic_helper_resume(rcdu->ddev, rcdu->suspend_state);<br>
> > >> - drm_fbdev_cma_set_suspend_unlocked(rcdu->fbdev, false);<br>
> > >> - drm_kms_helper_poll_enable(rcdu->ddev);<br>
> > >> -<br>
> > >> - return 0;<br>
> > >> + return drm_mode_config_helper_resume(rcdu->ddev);<br>
> > >> }<br>
> > >> #endif<br>
> > >> <br>
> > >> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.h<br>
> > >> b/drivers/gpu/drm/rcar-du/rcar_du_drv.h index b3a25e8..ff25c8d 100644<br>
> > >> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.h<br>
> > >> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.h<br>
> > >> @@ -78,7 +78,6 @@ struct rcar_du_device {<br>
> > >> struct drm_device *ddev;<br>
> > >> struct drm_fbdev_cma *fbdev;<br>
> > >> <br>
> > >> - struct drm_atomic_state *suspend_state;<br>
> > >> <br>
> > >> struct rcar_du_crtc crtcs[RCAR_DU_MAX_CRTCS];<br>
> > >> unsigned int num_crtcs;<br>
> > >> diff --git a/include/drm/drm_fb_cma_helper.h<br>
> > >> b/include/drm/drm_fb_cma_helper.h index 4a65f0d..8dbbe1e 100644<br>
> > >> --- a/include/drm/drm_fb_cma_helper.h<br>
> > >> +++ b/include/drm/drm_fb_cma_helper.h<br>
> > >> @@ -26,8 +26,6 @@ struct drm_fbdev_cma *drm_fbdev_cma_init(struct<br>
> > >> drm_device *dev,<br>
> > >> <br>
> > >> void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);<br>
> > >> void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);<br>
> > >> -void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma<br>
> > >> *fbdev_cma,<br>
> > >> - bool state);<br>
> > >> <br>
> > >> struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct<br>
> > >> drm_framebuffer *fb,<br>
> > >> unsigned int plane);<br>
><br>
> -- <br>
> Regards,<br>
><br>
> Laurent Pinchart<br>
><br>
><br>
></p>