[PATCH 2/3] drm: Make drm_gem_fb_alloc available for drivers to use

Liviu Dudau liviu.dudau at arm.com
Wed Aug 15 11:08:38 UTC 2018


On Thu, Jul 26, 2018 at 03:10:04PM +0100, Alexandru Gheorghe wrote:
> Some drivers can't use drm_gem_fb_create, so instead of copying the
> logic that does the framebuffer allocation allow them to use core
> drm_gem_fb_alloc.
> 
> Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe at arm.com>

To me it looks like an useful thing to have exported, so for what is worth:

Acked-by: Liviu Dudau <liviu.dudau at arm.com>

Sean, Maarten, Laurent, Gustavo, Daniel(s), do you have any objections?

Best regards,
Liviu

> ---
>  drivers/gpu/drm/drm_gem_framebuffer_helper.c | 3 ++-
>  include/drm/drm_gem_framebuffer_helper.h     | 5 +++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> index 2810d4131411..64eddf5a1bd9 100644
> --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> @@ -57,7 +57,7 @@ struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb,
>  }
>  EXPORT_SYMBOL_GPL(drm_gem_fb_get_obj);
>  
> -static struct drm_framebuffer *
> +struct drm_framebuffer *
>  drm_gem_fb_alloc(struct drm_device *dev,
>  		 const struct drm_mode_fb_cmd2 *mode_cmd,
>  		 struct drm_gem_object **obj, unsigned int num_planes,
> @@ -85,6 +85,7 @@ drm_gem_fb_alloc(struct drm_device *dev,
>  
>  	return fb;
>  }
> +EXPORT_SYMBOL_GPL(drm_gem_fb_alloc);
>  
>  /**
>   * drm_gem_fb_destroy - Free GEM backed framebuffer
> diff --git a/include/drm/drm_gem_framebuffer_helper.h b/include/drm/drm_gem_framebuffer_helper.h
> index a38de7eb55b4..d20c1356000a 100644
> --- a/include/drm/drm_gem_framebuffer_helper.h
> +++ b/include/drm/drm_gem_framebuffer_helper.h
> @@ -14,6 +14,11 @@ struct drm_simple_display_pipe;
>  
>  struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb,
>  					  unsigned int plane);
> +struct drm_framebuffer *
> +drm_gem_fb_alloc(struct drm_device *dev,
> +		 const struct drm_mode_fb_cmd2 *mode_cmd,
> +		 struct drm_gem_object **obj, unsigned int num_planes,
> +		 const struct drm_framebuffer_funcs *funcs);
>  void drm_gem_fb_destroy(struct drm_framebuffer *fb);
>  int drm_gem_fb_create_handle(struct drm_framebuffer *fb, struct drm_file *file,
>  			     unsigned int *handle);
> -- 
> 2.18.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯


More information about the dri-devel mailing list