Commit 71e801b9 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm: Clear fd/handle callbacks in struct drm_driver

Clear all assignments of struct drm_driver's fd/handle callbacks to
drm_gem_prime_fd_to_handle() and drm_gem_prime_handle_to_fd(). These
functions are called by default. Add a TODO item to convert vmwgfx
to the defaults as well.

v2:
	* remove TODO item (Zack)
	* also update amdgpu's amdgpu_partition_driver
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarSimon Ser <contact@emersion.fr>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Acked-by: Jeffrey Hugo <quic_jhugo@quicinc.com> # qaic
Link: https://patchwork.freedesktop.org/patch/msgid/20230620080252.16368-3-tzimmermann@suse.de
parent 6b85aa68
...@@ -373,8 +373,6 @@ static const struct drm_driver driver = { ...@@ -373,8 +373,6 @@ static const struct drm_driver driver = {
.open = ivpu_open, .open = ivpu_open,
.postclose = ivpu_postclose, .postclose = ivpu_postclose,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = ivpu_gem_prime_import, .gem_prime_import = ivpu_gem_prime_import,
.ioctls = ivpu_drm_ioctls, .ioctls = ivpu_drm_ioctls,
......
...@@ -165,7 +165,6 @@ static const struct drm_driver qaic_accel_driver = { ...@@ -165,7 +165,6 @@ static const struct drm_driver qaic_accel_driver = {
.ioctls = qaic_drm_ioctls, .ioctls = qaic_drm_ioctls,
.num_ioctls = ARRAY_SIZE(qaic_drm_ioctls), .num_ioctls = ARRAY_SIZE(qaic_drm_ioctls),
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = qaic_gem_prime_import, .gem_prime_import = qaic_gem_prime_import,
}; };
......
...@@ -2850,8 +2850,6 @@ static const struct drm_driver amdgpu_kms_driver = { ...@@ -2850,8 +2850,6 @@ static const struct drm_driver amdgpu_kms_driver = {
.show_fdinfo = amdgpu_show_fdinfo, .show_fdinfo = amdgpu_show_fdinfo,
#endif #endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = amdgpu_gem_prime_import, .gem_prime_import = amdgpu_gem_prime_import,
.name = DRIVER_NAME, .name = DRIVER_NAME,
...@@ -2876,8 +2874,6 @@ const struct drm_driver amdgpu_partition_driver = { ...@@ -2876,8 +2874,6 @@ const struct drm_driver amdgpu_partition_driver = {
.fops = &amdgpu_driver_kms_fops, .fops = &amdgpu_driver_kms_fops,
.release = &amdgpu_driver_release_kms, .release = &amdgpu_driver_release_kms,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = amdgpu_gem_prime_import, .gem_prime_import = amdgpu_gem_prime_import,
.name = DRIVER_NAME, .name = DRIVER_NAME,
......
...@@ -37,8 +37,6 @@ static const struct drm_ioctl_desc armada_ioctls[] = { ...@@ -37,8 +37,6 @@ static const struct drm_ioctl_desc armada_ioctls[] = {
DEFINE_DRM_GEM_FOPS(armada_drm_fops); DEFINE_DRM_GEM_FOPS(armada_drm_fops);
static const struct drm_driver armada_drm_driver = { static const struct drm_driver armada_drm_driver = {
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = armada_gem_prime_import, .gem_prime_import = armada_gem_prime_import,
.dumb_create = armada_gem_dumb_create, .dumb_create = armada_gem_dumb_create,
.major = 1, .major = 1,
......
...@@ -51,15 +51,10 @@ MODULE_IMPORT_NS(DMA_BUF); ...@@ -51,15 +51,10 @@ MODULE_IMPORT_NS(DMA_BUF);
* between applications, they can't be guessed like the globally unique GEM * between applications, they can't be guessed like the globally unique GEM
* names. * names.
* *
* Drivers that support the PRIME API implement the * Drivers that support the PRIME API implement the drm_gem_object_funcs.export
* &drm_driver.prime_handle_to_fd and &drm_driver.prime_fd_to_handle operations. * and &drm_driver.gem_prime_import hooks. &dma_buf_ops implementations for
* GEM based drivers must use drm_gem_prime_handle_to_fd() and * drivers are all individually exported for drivers which need to overwrite
* drm_gem_prime_fd_to_handle() to implement these. For GEM based drivers the * or reimplement some of them.
* actual driver interfaces is provided through the &drm_gem_object_funcs.export
* and &drm_driver.gem_prime_import hooks.
*
* &dma_buf_ops implementations for GEM drivers are all individually exported
* for drivers which need to overwrite or reimplement some of them.
* *
* Reference Counting for GEM Drivers * Reference Counting for GEM Drivers
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
...@@ -481,8 +481,6 @@ static const struct drm_driver etnaviv_drm_driver = { ...@@ -481,8 +481,6 @@ static const struct drm_driver etnaviv_drm_driver = {
.driver_features = DRIVER_GEM | DRIVER_RENDER, .driver_features = DRIVER_GEM | DRIVER_RENDER,
.open = etnaviv_open, .open = etnaviv_open,
.postclose = etnaviv_postclose, .postclose = etnaviv_postclose,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = etnaviv_gem_prime_import_sg_table, .gem_prime_import_sg_table = etnaviv_gem_prime_import_sg_table,
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
.debugfs_init = etnaviv_debugfs_init, .debugfs_init = etnaviv_debugfs_init,
......
...@@ -109,8 +109,6 @@ static const struct drm_driver exynos_drm_driver = { ...@@ -109,8 +109,6 @@ static const struct drm_driver exynos_drm_driver = {
.open = exynos_drm_open, .open = exynos_drm_open,
.postclose = exynos_drm_postclose, .postclose = exynos_drm_postclose,
.dumb_create = exynos_drm_gem_dumb_create, .dumb_create = exynos_drm_gem_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = exynos_drm_gem_prime_import, .gem_prime_import = exynos_drm_gem_prime_import,
.gem_prime_import_sg_table = exynos_drm_gem_prime_import_sg_table, .gem_prime_import_sg_table = exynos_drm_gem_prime_import_sg_table,
.ioctls = exynos_ioctls, .ioctls = exynos_ioctls,
......
...@@ -1818,8 +1818,6 @@ static const struct drm_driver i915_drm_driver = { ...@@ -1818,8 +1818,6 @@ static const struct drm_driver i915_drm_driver = {
.postclose = i915_driver_postclose, .postclose = i915_driver_postclose,
.show_fdinfo = i915_drm_client_fdinfo, .show_fdinfo = i915_drm_client_fdinfo,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = i915_gem_prime_import, .gem_prime_import = i915_gem_prime_import,
.dumb_create = i915_gem_dumb_create, .dumb_create = i915_gem_dumb_create,
......
...@@ -276,9 +276,7 @@ static const struct drm_driver lima_drm_driver = { ...@@ -276,9 +276,7 @@ static const struct drm_driver lima_drm_driver = {
.patchlevel = 0, .patchlevel = 0,
.gem_create_object = lima_gem_create_object, .gem_create_object = lima_gem_create_object,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = drm_gem_shmem_prime_import_sg_table, .gem_prime_import_sg_table = drm_gem_shmem_prime_import_sg_table,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
}; };
struct lima_block_reader { struct lima_block_reader {
......
...@@ -556,8 +556,6 @@ static const struct drm_driver mtk_drm_driver = { ...@@ -556,8 +556,6 @@ static const struct drm_driver mtk_drm_driver = {
.dumb_create = mtk_drm_gem_dumb_create, .dumb_create = mtk_drm_gem_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = mtk_drm_gem_prime_import, .gem_prime_import = mtk_drm_gem_prime_import,
.gem_prime_import_sg_table = mtk_gem_prime_import_sg_table, .gem_prime_import_sg_table = mtk_gem_prime_import_sg_table,
.fops = &mtk_drm_fops, .fops = &mtk_drm_fops,
......
...@@ -1086,8 +1086,6 @@ static const struct drm_driver msm_driver = { ...@@ -1086,8 +1086,6 @@ static const struct drm_driver msm_driver = {
.postclose = msm_postclose, .postclose = msm_postclose,
.dumb_create = msm_gem_dumb_create, .dumb_create = msm_gem_dumb_create,
.dumb_map_offset = msm_gem_dumb_map_offset, .dumb_map_offset = msm_gem_dumb_map_offset,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = msm_gem_prime_import_sg_table, .gem_prime_import_sg_table = msm_gem_prime_import_sg_table,
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
.debugfs_init = msm_debugfs_init, .debugfs_init = msm_debugfs_init,
......
...@@ -1240,8 +1240,6 @@ driver_stub = { ...@@ -1240,8 +1240,6 @@ driver_stub = {
.num_ioctls = ARRAY_SIZE(nouveau_ioctls), .num_ioctls = ARRAY_SIZE(nouveau_ioctls),
.fops = &nouveau_driver_fops, .fops = &nouveau_driver_fops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = nouveau_gem_prime_import_sg_table, .gem_prime_import_sg_table = nouveau_gem_prime_import_sg_table,
.dumb_create = nouveau_display_dumb_create, .dumb_create = nouveau_display_dumb_create,
......
...@@ -655,8 +655,6 @@ static const struct drm_driver omap_drm_driver = { ...@@ -655,8 +655,6 @@ static const struct drm_driver omap_drm_driver = {
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
.debugfs_init = omap_debugfs_init, .debugfs_init = omap_debugfs_init,
#endif #endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = omap_gem_prime_import, .gem_prime_import = omap_gem_prime_import,
.dumb_create = omap_gem_dumb_create, .dumb_create = omap_gem_dumb_create,
.dumb_map_offset = omap_gem_dumb_map_offset, .dumb_map_offset = omap_gem_dumb_map_offset,
......
...@@ -544,8 +544,6 @@ static const struct drm_driver panfrost_drm_driver = { ...@@ -544,8 +544,6 @@ static const struct drm_driver panfrost_drm_driver = {
.minor = 2, .minor = 2,
.gem_create_object = panfrost_gem_create_object, .gem_create_object = panfrost_gem_create_object,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = panfrost_gem_prime_import_sg_table, .gem_prime_import_sg_table = panfrost_gem_prime_import_sg_table,
}; };
......
...@@ -224,8 +224,6 @@ static const struct drm_driver pl111_drm_driver = { ...@@ -224,8 +224,6 @@ static const struct drm_driver pl111_drm_driver = {
.minor = 0, .minor = 0,
.patchlevel = 0, .patchlevel = 0,
.dumb_create = drm_gem_dma_dumb_create, .dumb_create = drm_gem_dma_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = pl111_gem_import_sg_table, .gem_prime_import_sg_table = pl111_gem_import_sg_table,
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
......
...@@ -290,8 +290,6 @@ static struct drm_driver qxl_driver = { ...@@ -290,8 +290,6 @@ static struct drm_driver qxl_driver = {
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
.debugfs_init = qxl_debugfs_init, .debugfs_init = qxl_debugfs_init,
#endif #endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = qxl_gem_prime_import_sg_table, .gem_prime_import_sg_table = qxl_gem_prime_import_sg_table,
.fops = &qxl_fops, .fops = &qxl_fops,
.ioctls = qxl_ioctls, .ioctls = qxl_ioctls,
......
...@@ -604,8 +604,6 @@ static const struct drm_driver kms_driver = { ...@@ -604,8 +604,6 @@ static const struct drm_driver kms_driver = {
.dumb_map_offset = radeon_mode_dumb_mmap, .dumb_map_offset = radeon_mode_dumb_mmap,
.fops = &radeon_driver_kms_fops, .fops = &radeon_driver_kms_fops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = radeon_gem_prime_import_sg_table, .gem_prime_import_sg_table = radeon_gem_prime_import_sg_table,
.name = DRIVER_NAME, .name = DRIVER_NAME,
......
...@@ -605,8 +605,6 @@ DEFINE_DRM_GEM_DMA_FOPS(rcar_du_fops); ...@@ -605,8 +605,6 @@ DEFINE_DRM_GEM_DMA_FOPS(rcar_du_fops);
static const struct drm_driver rcar_du_driver = { static const struct drm_driver rcar_du_driver = {
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
.dumb_create = rcar_du_dumb_create, .dumb_create = rcar_du_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = rcar_du_gem_prime_import_sg_table, .gem_prime_import_sg_table = rcar_du_gem_prime_import_sg_table,
.fops = &rcar_du_fops, .fops = &rcar_du_fops,
.name = "rcar-du", .name = "rcar-du",
......
...@@ -224,8 +224,6 @@ DEFINE_DRM_GEM_FOPS(rockchip_drm_driver_fops); ...@@ -224,8 +224,6 @@ DEFINE_DRM_GEM_FOPS(rockchip_drm_driver_fops);
static const struct drm_driver rockchip_drm_driver = { static const struct drm_driver rockchip_drm_driver = {
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC,
.dumb_create = rockchip_gem_dumb_create, .dumb_create = rockchip_gem_dumb_create,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = rockchip_gem_prime_import_sg_table, .gem_prime_import_sg_table = rockchip_gem_prime_import_sg_table,
.fops = &rockchip_drm_driver_fops, .fops = &rockchip_drm_driver_fops,
.name = DRIVER_NAME, .name = DRIVER_NAME,
......
...@@ -887,8 +887,6 @@ static const struct drm_driver tegra_drm_driver = { ...@@ -887,8 +887,6 @@ static const struct drm_driver tegra_drm_driver = {
.debugfs_init = tegra_debugfs_init, .debugfs_init = tegra_debugfs_init,
#endif #endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = tegra_gem_prime_import, .gem_prime_import = tegra_gem_prime_import,
.dumb_create = tegra_bo_dumb_create, .dumb_create = tegra_bo_dumb_create,
......
...@@ -171,8 +171,6 @@ static const struct drm_driver v3d_drm_driver = { ...@@ -171,8 +171,6 @@ static const struct drm_driver v3d_drm_driver = {
#endif #endif
.gem_create_object = v3d_create_object, .gem_create_object = v3d_create_object,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = v3d_prime_import_sg_table, .gem_prime_import_sg_table = v3d_prime_import_sg_table,
.ioctls = v3d_drm_ioctls, .ioctls = v3d_drm_ioctls,
......
...@@ -186,8 +186,6 @@ static const struct drm_driver driver = { ...@@ -186,8 +186,6 @@ static const struct drm_driver driver = {
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
.debugfs_init = virtio_gpu_debugfs_init, .debugfs_init = virtio_gpu_debugfs_init,
#endif #endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = virtgpu_gem_prime_import, .gem_prime_import = virtgpu_gem_prime_import,
.gem_prime_import_sg_table = virtgpu_gem_prime_import_sg_table, .gem_prime_import_sg_table = virtgpu_gem_prime_import_sg_table,
......
...@@ -474,8 +474,6 @@ DEFINE_DRM_GEM_FOPS(xen_drm_dev_fops); ...@@ -474,8 +474,6 @@ DEFINE_DRM_GEM_FOPS(xen_drm_dev_fops);
static const struct drm_driver xen_drm_driver = { static const struct drm_driver xen_drm_driver = {
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
.release = xen_drm_drv_release, .release = xen_drm_drv_release,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = xen_drm_front_gem_import_sg_table, .gem_prime_import_sg_table = xen_drm_front_gem_import_sg_table,
.dumb_create = xen_drm_drv_dumb_create, .dumb_create = xen_drm_drv_dumb_create,
.fops = &xen_drm_dev_fops, .fops = &xen_drm_dev_fops,
......
...@@ -167,8 +167,6 @@ drm_gem_dma_prime_import_sg_table(struct drm_device *dev, ...@@ -167,8 +167,6 @@ drm_gem_dma_prime_import_sg_table(struct drm_device *dev,
*/ */
#define DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE(dumb_create_func) \ #define DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE(dumb_create_func) \
.dumb_create = (dumb_create_func), \ .dumb_create = (dumb_create_func), \
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, \
.prime_fd_to_handle = drm_gem_prime_fd_to_handle, \
.gem_prime_import_sg_table = drm_gem_dma_prime_import_sg_table .gem_prime_import_sg_table = drm_gem_dma_prime_import_sg_table
/** /**
...@@ -203,9 +201,7 @@ drm_gem_dma_prime_import_sg_table(struct drm_device *dev, ...@@ -203,9 +201,7 @@ drm_gem_dma_prime_import_sg_table(struct drm_device *dev,
* DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE() instead. * DRM_GEM_DMA_DRIVER_OPS_WITH_DUMB_CREATE() instead.
*/ */
#define DRM_GEM_DMA_DRIVER_OPS_VMAP_WITH_DUMB_CREATE(dumb_create_func) \ #define DRM_GEM_DMA_DRIVER_OPS_VMAP_WITH_DUMB_CREATE(dumb_create_func) \
.dumb_create = dumb_create_func, \ .dumb_create = (dumb_create_func), \
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, \
.prime_fd_to_handle = drm_gem_prime_fd_to_handle, \
.gem_prime_import_sg_table = drm_gem_dma_prime_import_sg_table_vmap .gem_prime_import_sg_table = drm_gem_dma_prime_import_sg_table_vmap
/** /**
......
...@@ -278,8 +278,6 @@ int drm_gem_shmem_dumb_create(struct drm_file *file, struct drm_device *dev, ...@@ -278,8 +278,6 @@ int drm_gem_shmem_dumb_create(struct drm_file *file, struct drm_device *dev,
* the &drm_driver structure. * the &drm_driver structure.
*/ */
#define DRM_GEM_SHMEM_DRIVER_OPS \ #define DRM_GEM_SHMEM_DRIVER_OPS \
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, \
.prime_fd_to_handle = drm_gem_prime_fd_to_handle, \
.gem_prime_import_sg_table = drm_gem_shmem_prime_import_sg_table, \ .gem_prime_import_sg_table = drm_gem_shmem_prime_import_sg_table, \
.dumb_create = drm_gem_shmem_dumb_create .dumb_create = drm_gem_shmem_dumb_create
......
...@@ -159,9 +159,7 @@ void drm_gem_vram_simple_display_pipe_cleanup_fb( ...@@ -159,9 +159,7 @@ void drm_gem_vram_simple_display_pipe_cleanup_fb(
#define DRM_GEM_VRAM_DRIVER \ #define DRM_GEM_VRAM_DRIVER \
.debugfs_init = drm_vram_mm_debugfs_init, \ .debugfs_init = drm_vram_mm_debugfs_init, \
.dumb_create = drm_gem_vram_driver_dumb_create, \ .dumb_create = drm_gem_vram_driver_dumb_create, \
.dumb_map_offset = drm_gem_ttm_dumb_map_offset, \ .dumb_map_offset = drm_gem_ttm_dumb_map_offset
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, \
.prime_fd_to_handle = drm_gem_prime_fd_to_handle
/* /*
* VRAM memory manager * VRAM memory manager
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment