Re: [PATCH] drm: Don't export the drm_gem_dumb_destroy() function

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

 



On Tue, Dec 15, 2020 at 09:51:47PM +0200, Laurent Pinchart wrote:
> The drm_gem_dumb_destroy() isn't used in drivers, don't export it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>

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

Again I'm assuming you'll apply this somewhere.
-Daniel

> ---
> Changes since v1:
> 
> - Move function prototype from drm_gem.h to drm_internal.h
> - Drop function documentation
> - Replace uint32_t with u32
> ---
>  drivers/gpu/drm/drm_dumb_buffers.c |  8 +++++---
>  drivers/gpu/drm/drm_gem.c          | 12 +-----------
>  drivers/gpu/drm/drm_internal.h     |  3 +++
>  include/drm/drm_gem.h              |  3 ---
>  4 files changed, 9 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dumb_buffers.c b/drivers/gpu/drm/drm_dumb_buffers.c
> index d18a740fe0f1..ad17fa21cebb 100644
> --- a/drivers/gpu/drm/drm_dumb_buffers.c
> +++ b/drivers/gpu/drm/drm_dumb_buffers.c
> @@ -29,6 +29,7 @@
>  #include <drm/drm_mode.h>
>  
>  #include "drm_crtc_internal.h"
> +#include "drm_internal.h"
>  
>  /**
>   * DOC: overview
> @@ -46,9 +47,10 @@
>   * KMS frame buffers.
>   *
>   * To support dumb objects drivers must implement the &drm_driver.dumb_create
> - * operation. &drm_driver.dumb_destroy defaults to drm_gem_dumb_destroy() if
> - * not set and &drm_driver.dumb_map_offset defaults to
> - * drm_gem_dumb_map_offset(). See the callbacks for further details.
> + * and &drm_driver.dumb_map_offset operations (the latter defaults to
> + * drm_gem_dumb_map_offset() if not set). Drivers that don't use GEM handles
> + * additionally need to implement the &drm_driver.dumb_destroy operation. See
> + * the callbacks for further details.
>   *
>   * Note that dumb objects may not be used for gpu acceleration, as has been
>   * attempted on some ARM embedded platforms. Such drivers really must have
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index 92f89cee213e..34b2f111c01c 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -335,22 +335,12 @@ int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
>  }
>  EXPORT_SYMBOL_GPL(drm_gem_dumb_map_offset);
>  
> -/**
> - * drm_gem_dumb_destroy - dumb fb callback helper for gem based drivers
> - * @file: drm file-private structure to remove the dumb handle from
> - * @dev: corresponding drm_device
> - * @handle: the dumb handle to remove
> - *
> - * This implements the &drm_driver.dumb_destroy kms driver callback for drivers
> - * which use gem to manage their backing storage.
> - */
>  int drm_gem_dumb_destroy(struct drm_file *file,
>  			 struct drm_device *dev,
> -			 uint32_t handle)
> +			 u32 handle)
>  {
>  	return drm_gem_handle_delete(file, handle);
>  }
> -EXPORT_SYMBOL(drm_gem_dumb_destroy);
>  
>  /**
>   * drm_gem_handle_create_tail - internal functions to create a handle
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index 81d386b5b92a..fad2249ee67b 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -191,6 +191,9 @@ void drm_gem_unpin(struct drm_gem_object *obj);
>  int drm_gem_vmap(struct drm_gem_object *obj, struct dma_buf_map *map);
>  void drm_gem_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map);
>  
> +int drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,
> +			 u32 handle);
> +
>  /* drm_debugfs.c drm_debugfs_crc.c */
>  #if defined(CONFIG_DEBUG_FS)
>  int drm_debugfs_init(struct drm_minor *minor, int minor_id,
> diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
> index 5e6daa1c982f..240049566592 100644
> --- a/include/drm/drm_gem.h
> +++ b/include/drm/drm_gem.h
> @@ -416,8 +416,5 @@ int drm_gem_fence_array_add_implicit(struct xarray *fence_array,
>  				     bool write);
>  int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
>  			    u32 handle, u64 *offset);
> -int drm_gem_dumb_destroy(struct drm_file *file,
> -			 struct drm_device *dev,
> -			 uint32_t handle);
>  
>  #endif /* __DRM_GEM_H__ */
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
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