Re: [PATCH 1/7] drm/fb-helper: Set/clear dev->fb_helper in dummy init/fini

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 14, 2017 at 08:10:02PM +0100, Noralf Trønnes wrote:
> Set dev->fb_helper even when fbdev emulation is compiled out,
> so drivers can use it to free the structure.
> Clear it for consistency.
> 
> Fixes: 29ad20b22c8f ("drm: Add drm_device->fb_helper pointer")
> Signed-off-by: Noralf Trønnes <noralf@xxxxxxxxxxx>

Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>

> ---
>  include/drm/drm_fb_helper.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 1494b12a984a..1bd624579db7 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -33,6 +33,7 @@
>  struct drm_fb_helper;
>  
>  #include <drm/drm_crtc.h>
> +#include <drm/drm_device.h>
>  #include <linux/kgdb.h>
>  
>  enum mode_set_atomic {
> @@ -332,11 +333,17 @@ static inline int drm_fb_helper_init(struct drm_device *dev,
>  		       struct drm_fb_helper *helper,
>  		       int max_conn)
>  {
> +	/* So drivers can use it to free the struct */
> +	helper->dev = dev;
> +	dev->fb_helper = helper;

Not sure I forgot it, or it got dropped, but I'd like
dev->mode_config.fb_helper better. That's where all the other kms stuff
resides.

But 100% bikeshed, so feel free to ignore. Definitely only a follow-up
patch.
-Daniel

> +
>  	return 0;
>  }
>  
>  static inline void drm_fb_helper_fini(struct drm_fb_helper *helper)
>  {
> +	if (helper && helper->dev)
> +		helper->dev->fb_helper = NULL;
>  }
>  
>  static inline int drm_fb_helper_blank(int blank, struct fb_info *info)
> -- 
> 2.14.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux