Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1670549 > unrolled thread

Re: [PATCH] drm: hdlcd: Update PM code to save/restore console.

Started byDaniel Vetter <daniel@ffwll.ch>
First post2017-06-20 11:40 +0200
Last post2017-06-20 16:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] drm: hdlcd: Update PM code to save/restore console. Daniel Vetter <daniel@ffwll.ch> - 2017-06-20 11:40 +0200
    [PATCH] drm: Convert CMA fbdev console suspend helpers to use bool Liviu Dudau <Liviu.Dudau@arm.com> - 2017-06-20 12:30 +0200
      Re: [PATCH] drm: Convert CMA fbdev console suspend helpers to use  bool Daniel Vetter <daniel@ffwll.ch> - 2017-06-20 16:30 +0200

#1670549 — Re: [PATCH] drm: hdlcd: Update PM code to save/restore console.

FromDaniel Vetter <daniel@ffwll.ch>
Date2017-06-20 11:40 +0200
SubjectRe: [PATCH] drm: hdlcd: Update PM code to save/restore console.
Message-ID<tUnNF-6PZ-47@gated-at.bofh.it>
On Mon, Jun 19, 2017 at 05:45:21PM +0200, Noralf Trønnes wrote:
> 
> Den 19.06.2017 15.17, skrev Liviu Dudau:
> > On Fri, Jun 16, 2017 at 06:58:36PM +0200, Noralf Trønnes wrote:
> > > Den 16.06.2017 15.53, skrev Liviu Dudau:
> > > > Update the PM code to suspend/resume the fbdev_cma console.
> > > > 
> > > > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> > > > ---
> > > >    drivers/gpu/drm/arm/hdlcd_drv.c | 11 ++++++++++-
> > > >    1 file changed, 10 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> > > > index d3da87fbd85a..89cd408cde6f 100644
> > > > --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> > > > +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> > > > @@ -13,6 +13,7 @@
> > > >    #include <linux/spinlock.h>
> > > >    #include <linux/clk.h>
> > > >    #include <linux/component.h>
> > > > +#include <linux/console.h>
> > > >    #include <linux/list.h>
> > > >    #include <linux/of_graph.h>
> > > >    #include <linux/of_reserved_mem.h>
> > > > @@ -435,9 +436,15 @@ static int __maybe_unused hdlcd_pm_suspend(struct device *dev)
> > > >    		return 0;
> > > >    	drm_kms_helper_poll_disable(drm);
> > > > +	console_lock();
> > > > +	drm_fbdev_cma_set_suspend(hdlcd->fbdev, 1);
> > > > +	console_unlock();
> > > You can use drm_fbdev_cma_set_suspend_unlocked() instead, it takes the
> > > lock for you and can speed up resume if the lock is contented.
> > Hi Noralf,
> > 
> > Thanks for pointing out the helpful function. As you look to be the author of it,
> > any reason why the signature of the function doesn't match the drm_fb_helper_ one
> > being called through? (I'm talking about int vs bool for the state/suspend arguments).
> 
> I don't remember, but probably to match drm_fbdev_cma_set_suspend()
> which uses int. drm_fb_helper_set_suspend*() uses bool, but calls
> into fb_set_suspend() which uses int, but as a boolean.

I'd be happy to apply a patch which changes them all to bool ...

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

[toc] | [next] | [standalone]


#1670643 — [PATCH] drm: Convert CMA fbdev console suspend helpers to use bool

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2017-06-20 12:30 +0200
Subject[PATCH] drm: Convert CMA fbdev console suspend helpers to use bool
Message-ID<tUoA2-7os-5@gated-at.bofh.it>
In reply to#1670549
drm_fbdev_cma_set_suspend{,_unlocked} use an integer parameter
to describe whether the intended state is a suspend or a resume.
It then passes the value to drm_fb_helper_set_suspend{,_unlocked}
which uses a boolean. Switch to using bool everywhere.

Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
---
 drivers/gpu/drm/drm_fb_cma_helper.c | 4 ++--
 include/drm/drm_fb_cma_helper.h     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c
index 53f9bdf470d7..ade319d10e70 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -640,7 +640,7 @@ EXPORT_SYMBOL_GPL(drm_fbdev_cma_hotplug_event);
  * Calls drm_fb_helper_set_suspend, which is a wrapper around
  * fb_set_suspend implemented by fbdev core.
  */
-void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, int state)
+void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, bool state)
 {
 	if (fbdev_cma)
 		drm_fb_helper_set_suspend(&fbdev_cma->fb_helper, state);
@@ -657,7 +657,7 @@ EXPORT_SYMBOL(drm_fbdev_cma_set_suspend);
  * fb_set_suspend implemented by fbdev core.
  */
 void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma,
-					int state)
+					bool state)
 {
 	if (fbdev_cma)
 		drm_fb_helper_set_suspend_unlocked(&fbdev_cma->fb_helper,
diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h
index 199a63f48659..a323781afc3f 100644
--- a/include/drm/drm_fb_cma_helper.h
+++ b/include/drm/drm_fb_cma_helper.h
@@ -24,9 +24,9 @@ void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma);
 
 void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
 void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);
-void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, int state);
+void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, bool state);
 void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma,
-					int state);
+					bool state);
 
 void drm_fb_cma_destroy(struct drm_framebuffer *fb);
 int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
-- 
2.13.1

[toc] | [prev] | [next] | [standalone]


#1670824 — Re: [PATCH] drm: Convert CMA fbdev console suspend helpers to use bool

FromDaniel Vetter <daniel@ffwll.ch>
Date2017-06-20 16:30 +0200
SubjectRe: [PATCH] drm: Convert CMA fbdev console suspend helpers to use bool
Message-ID<tUskh-1iC-11@gated-at.bofh.it>
In reply to#1670643
On Tue, Jun 20, 2017 at 11:23:20AM +0100, Liviu Dudau wrote:
> drm_fbdev_cma_set_suspend{,_unlocked} use an integer parameter
> to describe whether the intended state is a suspend or a resume.
> It then passes the value to drm_fb_helper_set_suspend{,_unlocked}
> which uses a boolean. Switch to using bool everywhere.
> 
> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>

Sweet, patch applied, thanks.
-Daniel

> ---
>  drivers/gpu/drm/drm_fb_cma_helper.c | 4 ++--
>  include/drm/drm_fb_cma_helper.h     | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c
> index 53f9bdf470d7..ade319d10e70 100644
> --- a/drivers/gpu/drm/drm_fb_cma_helper.c
> +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
> @@ -640,7 +640,7 @@ EXPORT_SYMBOL_GPL(drm_fbdev_cma_hotplug_event);
>   * Calls drm_fb_helper_set_suspend, which is a wrapper around
>   * fb_set_suspend implemented by fbdev core.
>   */
> -void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, int state)
> +void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, bool state)
>  {
>  	if (fbdev_cma)
>  		drm_fb_helper_set_suspend(&fbdev_cma->fb_helper, state);
> @@ -657,7 +657,7 @@ EXPORT_SYMBOL(drm_fbdev_cma_set_suspend);
>   * fb_set_suspend implemented by fbdev core.
>   */
>  void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma,
> -					int state)
> +					bool state)
>  {
>  	if (fbdev_cma)
>  		drm_fb_helper_set_suspend_unlocked(&fbdev_cma->fb_helper,
> diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h
> index 199a63f48659..a323781afc3f 100644
> --- a/include/drm/drm_fb_cma_helper.h
> +++ b/include/drm/drm_fb_cma_helper.h
> @@ -24,9 +24,9 @@ void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma);
>  
>  void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
>  void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);
> -void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, int state);
> +void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, bool state);
>  void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma,
> -					int state);
> +					bool state);
>  
>  void drm_fb_cma_destroy(struct drm_framebuffer *fb);
>  int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
> -- 
> 2.13.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web