lkml.org 
[lkml]   [2018]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRE: [PATCH] drm: mxsfb: fix runtime PM handling
Date


Anson Huang
Best Regards!


> -----Original Message-----
> From: Marek Vasut [mailto:marex@denx.de]
> Sent: Friday, July 13, 2018 5:03 PM
> To: Anson Huang <anson.huang@nxp.com>; airlied@linux.ie;
> dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org
> Cc: dl-linux-imx <linux-imx@nxp.com>
> Subject: Re: [PATCH] drm: mxsfb: fix runtime PM handling
>
> On 07/13/2018 10:54 AM, Anson Huang wrote:
> > As display power domain is combined with lcdif node on some i.MX
> > platforms like i.MX6SL, when lcdif driver is enabled, the mxsfb_load
> > is called to enable runtime pm, and a pair of pm_runtime_get_sync and
> > pm_runtime_put_sync are also called, that will cause generic power
> > domain driver to disable lcdif power domain and lcdif is no longer
> > working, the lcdif power should ONLY be turned off when display is
> > disabled, so move the pm_runtime_put_sync to mxsfb_unload and remove
> > the pm_runtime_get_sync in mxsfb_unload as well, in this way, when
> > display is enabled, the lcdif power will be always ON until the
> > display is disabled.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
>
> Doesn't this also mean the block will always be on, thus wasting power ?

I think drm driver should have somewhere to implement the display
disable case, like when fb0 is blank (echo 1 > /sys/class/graphics/fb0/blank),
then lcdif can be powered gated, and
when display is back on (unblank), lcdif needs to be re-initialization and display will
be on, current implementation is incorrect, with kernel booting up, lcdif
is NOT working at all.

The runtime power gating case can be implemented later to save power,
need lcdif experts to do it. Thanks.

Anson.

>
> > ---
> > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> > b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> > index ffe5137..1ba179b 100644
> > --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> > +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> > @@ -235,7 +235,6 @@ static int mxsfb_load(struct drm_device *drm,
> > unsigned long flags)
> >
> > pm_runtime_get_sync(drm->dev);
> > ret = drm_irq_install(drm, platform_get_irq(pdev, 0));
> > - pm_runtime_put_sync(drm->dev);
> >
> > if (ret < 0) {
> > dev_err(drm->dev, "Failed to install IRQ handler\n"); @@ -264,6
> > +263,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long
> > flags)
> > err_irq:
> > drm_panel_detach(mxsfb->panel);
> > err_vblank:
> > + pm_runtime_put_sync(drm->dev);
> > pm_runtime_disable(drm->dev);
> >
> > return ret;
> > @@ -279,7 +279,6 @@ static void mxsfb_unload(struct drm_device *drm)
> > drm_kms_helper_poll_fini(drm);
> > drm_mode_config_cleanup(drm);
> >
> > - pm_runtime_get_sync(drm->dev);
> > drm_irq_uninstall(drm);
> > pm_runtime_put_sync(drm->dev);
> >
> >
>
>
> --
> Best regards,
> Marek Vasut
\
 
 \ /
  Last update: 2018-07-15 22:06    [W:0.054 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site