This adds defaults for the drm_driver.dumb_destroy and drm_driver.dumb_map_offset callbacks as discussed with Daniel.
vmwgfx is the only driver that doesn't use drm_gem_dumb_destroy().
vgem ---- vgem changes behaviour after this, because it didn't have .dumb_destroy set, something the docs mandates.
This patchset is part of a process to add a shmem gem library like the cma library. The common parts between the two goes into core or helpers.
Noralf.
Noralf Trønnes (41): drm/gem: Add drm_gem_dumb_map_offset() drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy drm/arc: Use .dumb_map_offset and .dumb_destroy defaults drm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults drm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults drm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults drm/kirin: Use .dumb_map_offset and .dumb_destroy defaults drm/imx: Use .dumb_map_offset and .dumb_destroy defaults drm/meson: Use .dumb_map_offset and .dumb_destroy defaults drm/mxsfb: Use .dumb_map_offset and .dumb_destroy defaults drm/pl111: Use .dumb_map_offset and .dumb_destroy defaults drm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults drm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults drm/sti: Use .dumb_map_offset and .dumb_destroy defaults drm/stm: Use .dumb_map_offset and .dumb_destroy defaults drm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults drm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults drm/vc4: Use .dumb_map_offset and .dumb_destroy defaults drm/zte: Use .dumb_map_offset and .dumb_destroy defaults drm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults drm/gma500: Use .dumb_map_offset and .dumb_destroy defaults drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults drm/tegra: Use .dumb_map_offset and .dumb_destroy defaults drm/cirrus: Use the drm_driver.dumb_destroy default drm/udl: Use the drm_driver.dumb_destroy default drm/qxl: Use the drm_driver.dumb_destroy default drm/amdgpu: Use the drm_driver.dumb_destroy default drm/omapdrm: Use the drm_driver.dumb_destroy default drm/ast: Use the drm_driver.dumb_destroy default drm/nouveau: Use the drm_driver.dumb_destroy default drm/i915: Use the drm_driver.dumb_destroy default drm/msm: Use the drm_driver.dumb_destroy default drm/exynos: Use the drm_driver.dumb_destroy default drm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default drm/mgag200: Use the drm_driver.dumb_destroy default drm/radeon: Use the drm_driver.dumb_destroy default drm/bochs: Use the drm_driver.dumb_destroy default drm/armada: Use the drm_driver.dumb_destroy default drm/virtio: Use the drm_driver.dumb_destroy default
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 - drivers/gpu/drm/arc/arcpgu_drv.c | 2 -- drivers/gpu/drm/arm/hdlcd_drv.c | 2 -- drivers/gpu/drm/arm/malidp_drv.c | 2 -- drivers/gpu/drm/armada/armada_drv.c | 1 - drivers/gpu/drm/armada/armada_gem.c | 6 ----- drivers/gpu/drm/armada/armada_gem.h | 2 -- drivers/gpu/drm/ast/ast_drv.c | 1 - drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 -- drivers/gpu/drm/bochs/bochs_drv.c | 1 - drivers/gpu/drm/cirrus/cirrus_drv.c | 1 - drivers/gpu/drm/drm_dumb_buffers.c | 26 ++++++++++++------ drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 -- drivers/gpu/drm/gma500/gem.c | 30 --------------------- drivers/gpu/drm/gma500/psb_drv.c | 2 -- drivers/gpu/drm/gma500/psb_drv.h | 2 -- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 - drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 -- drivers/gpu/drm/i915/i915_drv.c | 1 - drivers/gpu/drm/imx/imx-drm-core.c | 2 -- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 -- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 25 ------------------ drivers/gpu/drm/mediatek/mtk_drm_gem.h | 3 --- drivers/gpu/drm/meson/meson_drv.c | 2 -- drivers/gpu/drm/mgag200/mgag200_drv.c | 1 - drivers/gpu/drm/msm/msm_drv.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 -- drivers/gpu/drm/nouveau/nouveau_drm.c | 1 - drivers/gpu/drm/omapdrm/omap_drv.c | 1 - drivers/gpu/drm/pl111/pl111_drv.c | 2 -- drivers/gpu/drm/qxl/qxl_drv.c | 1 - drivers/gpu/drm/radeon/radeon_drv.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 26 ------------------ drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 3 --- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 -- drivers/gpu/drm/sti/sti_drv.c | 2 -- drivers/gpu/drm/stm/drv.c | 2 -- drivers/gpu/drm/sun4i/sun4i_drv.c | 2 -- drivers/gpu/drm/tegra/drm.c | 2 -- drivers/gpu/drm/tegra/gem.c | 21 --------------- drivers/gpu/drm/tegra/gem.h | 2 -- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 -- drivers/gpu/drm/udl/udl_drv.c | 1 - drivers/gpu/drm/vc4/vc4_drv.c | 2 -- drivers/gpu/drm/virtio/virtgpu_drv.c | 1 - drivers/gpu/drm/virtio/virtgpu_drv.h | 3 --- drivers/gpu/drm/virtio/virtgpu_gem.c | 7 ----- drivers/gpu/drm/zte/zx_drm_drv.c | 2 -- include/drm/drm_gem.h | 2 ++ include/drm/tinydrm/tinydrm.h | 4 +-- 54 files changed, 56 insertions(+), 201 deletions(-)
-- 2.7.4
Add a common drm_driver.dumb_map_offset function for GEM backed drivers.
Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++ include/drm/drm_gem.h | 2 ++ 2 files changed, 37 insertions(+)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 5df028a..a8d396b 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -311,6 +311,41 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) EXPORT_SYMBOL(drm_gem_handle_delete);
/** + * drm_gem_dumb_map_offset - return the fake mmap offset for a gem object + * @file: drm file-private structure containing the gem object + * @dev: corresponding drm_device + * @handle: gem object handle + * @offset: return location for the fake mmap offset + * + * This implements the &drm_driver.dumb_map_offset kms driver callback for + * drivers which use gem to manage their backing storage. + * + * Returns: + * 0 on success or a negative error code on failure. + */ +int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, + u32 handle, u64 *offset) +{ + struct drm_gem_object *obj; + int ret; + + obj = drm_gem_object_lookup(file, handle); + if (!obj) + return -ENOENT; + + ret = drm_gem_create_mmap_offset(obj); + if (ret) + goto out; + + *offset = drm_vma_node_offset_addr(&obj->vma_node); +out: + drm_gem_object_put_unlocked(obj); + + return ret; +} +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 diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 4a9d231..9c55c2a 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -302,6 +302,8 @@ void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages, bool dirty, bool accessed);
struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle); +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);
On Sun, 2017-07-23 at 21:16 +0200, Noralf Trønnes wrote:
Add a common drm_driver.dumb_map_offset function for GEM backed drivers.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
Reviewed-by: Philipp Zabel p.zabel@pengutronix.de
regards Philipp
Hi Noralf,
Thank you for the patch.
On Sunday 23 Jul 2017 21:16:17 Noralf Trønnes wrote:
Add a common drm_driver.dumb_map_offset function for GEM backed drivers.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
Reviewed-by: Laurent Pinchart laurent.pinchart@ideasonboard.com
drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++ include/drm/drm_gem.h | 2 ++ 2 files changed, 37 insertions(+)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 5df028a..a8d396b 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -311,6 +311,41 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) EXPORT_SYMBOL(drm_gem_handle_delete);
/**
- drm_gem_dumb_map_offset - return the fake mmap offset for a gem object
- @file: drm file-private structure containing the gem object
- @dev: corresponding drm_device
- @handle: gem object handle
- @offset: return location for the fake mmap offset
- This implements the &drm_driver.dumb_map_offset kms driver callback for
- drivers which use gem to manage their backing storage.
- Returns:
- 0 on success or a negative error code on failure.
- */
+int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
u32 handle, u64 *offset)
+{
- struct drm_gem_object *obj;
- int ret;
- obj = drm_gem_object_lookup(file, handle);
- if (!obj)
return -ENOENT;
- ret = drm_gem_create_mmap_offset(obj);
- if (ret)
goto out;
- *offset = drm_vma_node_offset_addr(&obj->vma_node);
+out:
- drm_gem_object_put_unlocked(obj);
- return ret;
+} +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
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 4a9d231..9c55c2a 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -302,6 +302,8 @@ void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages, bool dirty, bool accessed);
struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle); +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);
Hi Noralf,
On 23 July 2017 at 20:16, Noralf Trønnes noralf@tronnes.org wrote:
Add a common drm_driver.dumb_map_offset function for GEM backed drivers.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++ include/drm/drm_gem.h | 2 ++ 2 files changed, 37 insertions(+)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 5df028a..a8d396b 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -311,6 +311,41 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) EXPORT_SYMBOL(drm_gem_handle_delete);
/**
- drm_gem_dumb_map_offset - return the fake mmap offset for a gem object
- @file: drm file-private structure containing the gem object
- @dev: corresponding drm_device
- @handle: gem object handle
- @offset: return location for the fake mmap offset
- This implements the &drm_driver.dumb_map_offset kms driver callback for
- drivers which use gem to manage their backing storage.
- Returns:
- 0 on success or a negative error code on failure.
- */
+int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
u32 handle, u64 *offset)
+{
struct drm_gem_object *obj;
int ret;
obj = drm_gem_object_lookup(file, handle);
if (!obj)
return -ENOENT;
ret = drm_gem_create_mmap_offset(obj);
With later patches one goes to reuse this helper instead of drm_gem_cma_dumb_map_offset(). At the same time, the latter does not have the drm_gem_create_mmap_offset() call we see here.
Meanwhile some drivers have their own offset function which is virtually identical to the original drm_gem_cma_dumb_map_offset. Yet those are left unchanged.
For example in cirrus [1]: There the only code difference seems to be an "upcast" followed immediately by a "downcast". Which should effectively be a noop.
That said, I could be loosing my marbles.
HTH Emil
[1] https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/cirrus/cirrus...
Den 26.07.2017 14.05, skrev Emil Velikov:
Hi Noralf,
On 23 July 2017 at 20:16, Noralf Trønnes noralf@tronnes.org wrote:
Add a common drm_driver.dumb_map_offset function for GEM backed drivers.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++ include/drm/drm_gem.h | 2 ++ 2 files changed, 37 insertions(+)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 5df028a..a8d396b 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -311,6 +311,41 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) EXPORT_SYMBOL(drm_gem_handle_delete);
/**
- drm_gem_dumb_map_offset - return the fake mmap offset for a gem object
- @file: drm file-private structure containing the gem object
- @dev: corresponding drm_device
- @handle: gem object handle
- @offset: return location for the fake mmap offset
- This implements the &drm_driver.dumb_map_offset kms driver callback for
- drivers which use gem to manage their backing storage.
- Returns:
- 0 on success or a negative error code on failure.
- */
+int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
u32 handle, u64 *offset)
+{
struct drm_gem_object *obj;
int ret;
obj = drm_gem_object_lookup(file, handle);
if (!obj)
return -ENOENT;
ret = drm_gem_create_mmap_offset(obj);
With later patches one goes to reuse this helper instead of drm_gem_cma_dumb_map_offset(). At the same time, the latter does not have the drm_gem_create_mmap_offset() call we see here.
You're rigth, the cma library and a couple of other drivers if I recall correctly, call drm_gem_create_mmap_offset() during object creation. Daniel was of the opinion that this should happen when mmap is called. drm_gem_create_mmap_offset() is idempotent as the docs call it. Calling it a second time is ok, since it does nothing (needs to take a lock though).
I haven't removed drm_gem_create_mmap_offset() from the drivers that do it during object creation, trying to keep this from doing to much. The cma library will be changed though when I add the generic fb/gem helper.
Meanwhile some drivers have their own offset function which is virtually identical to the original drm_gem_cma_dumb_map_offset. Yet those are left unchanged.
For example in cirrus [1]: There the only code difference seems to be an "upcast" followed immediately by a "downcast". Which should effectively be a noop.
The main reason for that is to try and keep this simple so I'm able to add my shmem/gem library in reasonable time :-) I didn't want to do changes that wasn't straight forward. But yes, the cirrus drivers looks quite straight forward and the functions isn't used by other parts of the driver. I looked at a driver (omap?) that had similar functions, and those where called from other parts of the driver, so I expected the same here I guess.
You say "some drivers", can you name them? Some drivers takes locks or do other stuff that made me skip them.
Noralf.
That said, I could be loosing my marbles.
HTH Emil
[1] https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/cirrus/cirrus...
On 26 July 2017 at 19:41, Noralf Trønnes noralf@tronnes.org wrote:
Den 26.07.2017 14.05, skrev Emil Velikov:
Hi Noralf,
On 23 July 2017 at 20:16, Noralf Trønnes noralf@tronnes.org wrote:
Add a common drm_driver.dumb_map_offset function for GEM backed drivers.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++ include/drm/drm_gem.h | 2 ++ 2 files changed, 37 insertions(+)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 5df028a..a8d396b 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -311,6 +311,41 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) EXPORT_SYMBOL(drm_gem_handle_delete);
/**
- drm_gem_dumb_map_offset - return the fake mmap offset for a gem
object
- @file: drm file-private structure containing the gem object
- @dev: corresponding drm_device
- @handle: gem object handle
- @offset: return location for the fake mmap offset
- This implements the &drm_driver.dumb_map_offset kms driver callback
for
- drivers which use gem to manage their backing storage.
- Returns:
- 0 on success or a negative error code on failure.
- */
+int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
u32 handle, u64 *offset)
+{
struct drm_gem_object *obj;
int ret;
obj = drm_gem_object_lookup(file, handle);
if (!obj)
return -ENOENT;
ret = drm_gem_create_mmap_offset(obj);
With later patches one goes to reuse this helper instead of drm_gem_cma_dumb_map_offset(). At the same time, the latter does not have the drm_gem_create_mmap_offset() call we see here.
You're rigth, the cma library and a couple of other drivers if I recall correctly, call drm_gem_create_mmap_offset() during object creation. Daniel was of the opinion that this should happen when mmap is called. drm_gem_create_mmap_offset() is idempotent as the docs call it. Calling it a second time is ok, since it does nothing (needs to take a lock though).
I haven't removed drm_gem_create_mmap_offset() from the drivers that do it during object creation, trying to keep this from doing to much. The cma library will be changed though when I add the generic fb/gem helper.
I was not concerned about calling the function twice, but that it's not called at all ... Which doesn't seems to be the case - virtually all the .dumb_create callbacks effectively end up in __drm_gem_cma_create() which itself calls drm_gem_create_mmap_offset().
I should have looked deeper into the rabbit hole :-)
One thing that I forgot to mention: Depending on the tree you're working on, please grep through staging as well - the vbox drm driver got merged somewhat recently.
Meanwhile some drivers have their own offset function which is virtually identical to the original drm_gem_cma_dumb_map_offset. Yet those are left unchanged.
For example in cirrus [1]: There the only code difference seems to be an "upcast" followed immediately by a "downcast". Which should effectively be a noop.
The main reason for that is to try and keep this simple so I'm able to add my shmem/gem library in reasonable time :-) I didn't want to do changes that wasn't straight forward. But yes, the cirrus drivers looks quite straight forward and the functions isn't used by other parts of the driver. I looked at a driver (omap?) that had similar functions, and those where called from other parts of the driver, so I expected the same here I guess.
You say "some drivers", can you name them? Some drivers takes locks or do other stuff that made me skip them.
Agreed - keeping that cleanup separate might be the wise thing to do. Pardon if I came too impatient.
About a list - initial grep showed cirrus, bochs, qxl. Now, after having a more extensive look - cirrus, qxl, ast, nouveau, exynos, hibmc, mgag200, bochs, virtio.
On the "maybe" list - msm and omap have extra locking (is it still needed?) while armada has an import_attach restriction (where nobody else seems to bother?).
The remaining drivers seem a bit more complicated.
HTH Emil
Den 27.07.2017 02.13, skrev Emil Velikov:
On 26 July 2017 at 19:41, Noralf Trønnes noralf@tronnes.org wrote:
Den 26.07.2017 14.05, skrev Emil Velikov:
Hi Noralf,
On 23 July 2017 at 20:16, Noralf Trønnes noralf@tronnes.org wrote:
Add a common drm_driver.dumb_map_offset function for GEM backed drivers.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++ include/drm/drm_gem.h | 2 ++ 2 files changed, 37 insertions(+)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 5df028a..a8d396b 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -311,6 +311,41 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) EXPORT_SYMBOL(drm_gem_handle_delete);
/**
- drm_gem_dumb_map_offset - return the fake mmap offset for a gem
object
- @file: drm file-private structure containing the gem object
- @dev: corresponding drm_device
- @handle: gem object handle
- @offset: return location for the fake mmap offset
- This implements the &drm_driver.dumb_map_offset kms driver callback
for
- drivers which use gem to manage their backing storage.
- Returns:
- 0 on success or a negative error code on failure.
- */
+int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
u32 handle, u64 *offset)
+{
struct drm_gem_object *obj;
int ret;
obj = drm_gem_object_lookup(file, handle);
if (!obj)
return -ENOENT;
ret = drm_gem_create_mmap_offset(obj);
With later patches one goes to reuse this helper instead of drm_gem_cma_dumb_map_offset(). At the same time, the latter does not have the drm_gem_create_mmap_offset() call we see here.
You're rigth, the cma library and a couple of other drivers if I recall correctly, call drm_gem_create_mmap_offset() during object creation. Daniel was of the opinion that this should happen when mmap is called. drm_gem_create_mmap_offset() is idempotent as the docs call it. Calling it a second time is ok, since it does nothing (needs to take a lock though).
I haven't removed drm_gem_create_mmap_offset() from the drivers that do it during object creation, trying to keep this from doing to much. The cma library will be changed though when I add the generic fb/gem helper.
I was not concerned about calling the function twice, but that it's not called at all ... Which doesn't seems to be the case - virtually all the .dumb_create callbacks effectively end up in __drm_gem_cma_create() which itself calls drm_gem_create_mmap_offset().
I should have looked deeper into the rabbit hole :-)
One thing that I forgot to mention: Depending on the tree you're working on, please grep through staging as well - the vbox drm driver got merged somewhat recently.
Meanwhile some drivers have their own offset function which is virtually identical to the original drm_gem_cma_dumb_map_offset. Yet those are left unchanged.
For example in cirrus [1]: There the only code difference seems to be an "upcast" followed immediately by a "downcast". Which should effectively be a noop.
The main reason for that is to try and keep this simple so I'm able to add my shmem/gem library in reasonable time :-) I didn't want to do changes that wasn't straight forward. But yes, the cirrus drivers looks quite straight forward and the functions isn't used by other parts of the driver. I looked at a driver (omap?) that had similar functions, and those where called from other parts of the driver, so I expected the same here I guess.
You say "some drivers", can you name them? Some drivers takes locks or do other stuff that made me skip them.
Agreed - keeping that cleanup separate might be the wise thing to do. Pardon if I came too impatient.
About a list - initial grep showed cirrus, bochs, qxl. Now, after having a more extensive look - cirrus, qxl, ast, nouveau, exynos, hibmc, mgag200, bochs, virtio.
All of those except exynos gets their offset from ttm_buffer_object->vma_node and not drm_gem_object.vma_node. Is it the same vma_node?
I'll add exynos in the second round, I missed that one.
Thanks for the scrutiny, it's appreciated.
Noralf.
On the "maybe" list - msm and omap have extra locking (is it still needed?) while armada has an import_attach restriction (where nobody else seems to bother?).
The remaining drivers seem a bit more complicated.
HTH Emil
Hi Noralf,
On Wednesday 26 Jul 2017 20:41:53 Noralf Trønnes wrote:
Den 26.07.2017 14.05, skrev Emil Velikov:
On 23 July 2017 at 20:16, Noralf Trønnes noralf@tronnes.org wrote:
Add a common drm_driver.dumb_map_offset function for GEM backed drivers.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++ include/drm/drm_gem.h | 2 ++ 2 files changed, 37 insertions(+)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 5df028a..a8d396b 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -311,6 +311,41 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle)>> EXPORT_SYMBOL(drm_gem_handle_delete);
/**
- drm_gem_dumb_map_offset - return the fake mmap offset for a gem
object
- @file: drm file-private structure containing the gem object
- @dev: corresponding drm_device
- @handle: gem object handle
- @offset: return location for the fake mmap offset
- This implements the &drm_driver.dumb_map_offset kms driver callback
for
- drivers which use gem to manage their backing storage.
- Returns:
- 0 on success or a negative error code on failure.
- */
+int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
u32 handle, u64 *offset)
+{
struct drm_gem_object *obj;
int ret;
obj = drm_gem_object_lookup(file, handle);
if (!obj)
return -ENOENT;
ret = drm_gem_create_mmap_offset(obj);
With later patches one goes to reuse this helper instead of drm_gem_cma_dumb_map_offset(). At the same time, the latter does not have the drm_gem_create_mmap_offset() call we see here.
You're rigth, the cma library and a couple of other drivers if I recall correctly, call drm_gem_create_mmap_offset() during object creation. Daniel was of the opinion that this should happen when mmap is called. drm_gem_create_mmap_offset() is idempotent as the docs call it. Calling it a second time is ok, since it does nothing (needs to take a lock though).
I came to the exact same conclusion. It might be a slightly more efficient if we coudl call drm_gem_create_mmap_offset() at the GEM object creation time, but as that's not possible for all drivers, and as the .dumb_map_offset() operation is not in any hot path anyway, I stopped investigating how we could optimize the implementation.
I haven't removed drm_gem_create_mmap_offset() from the drivers that do it during object creation, trying to keep this from doing to much. The cma library will be changed though when I add the generic fb/gem helper.
Meanwhile some drivers have their own offset function which is virtually identical to the original drm_gem_cma_dumb_map_offset. Yet those are left unchanged.
For example in cirrus [1]: There the only code difference seems to be an "upcast" followed immediately by a "downcast". Which should effectively be a noop.
The main reason for that is to try and keep this simple so I'm able to add my shmem/gem library in reasonable time :-) I didn't want to do changes that wasn't straight forward. But yes, the cirrus drivers looks quite straight forward and the functions isn't used by other parts of the driver. I looked at a driver (omap?) that had similar functions, and those where called from other parts of the driver, so I expected the same here I guess.
For omapdrm I believe we could drop the custom .dumb_map_offset() operation, as the only use for customs offsets in the driver is for tiled buffers, which are created by an omapdrm-specific IOCTL. However, I can't tell at the moment whether userspace code that create tiled buffers with the OMAP_GEM_NEW ioctl get the mmap offset with OMAP_GEM_INFO as they should, or if DRM_IOCTL_MODE_MAP_DUMB gets sometimes abused for non-dumb buffers.
You say "some drivers", can you name them? Some drivers takes locks or do other stuff that made me skip them.
Noralf.
That said, I could be loosing my marbles.
HTH Emil
[1] https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/cirrus/cir rus_main.c#n292
On Sun, Jul 23, 2017 at 09:16:17PM +0200, Noralf Trønnes wrote:
Add a common drm_driver.dumb_map_offset function for GEM backed drivers.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
Reviewed-by: Sean Paul seanpaul@chromium.org
drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++ include/drm/drm_gem.h | 2 ++ 2 files changed, 37 insertions(+)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 5df028a..a8d396b 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -311,6 +311,41 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) EXPORT_SYMBOL(drm_gem_handle_delete);
/**
- drm_gem_dumb_map_offset - return the fake mmap offset for a gem object
- @file: drm file-private structure containing the gem object
- @dev: corresponding drm_device
- @handle: gem object handle
- @offset: return location for the fake mmap offset
- This implements the &drm_driver.dumb_map_offset kms driver callback for
- drivers which use gem to manage their backing storage.
- Returns:
- 0 on success or a negative error code on failure.
- */
+int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
u32 handle, u64 *offset)
+{
- struct drm_gem_object *obj;
- int ret;
- obj = drm_gem_object_lookup(file, handle);
- if (!obj)
return -ENOENT;
- ret = drm_gem_create_mmap_offset(obj);
- if (ret)
goto out;
- *offset = drm_vma_node_offset_addr(&obj->vma_node);
+out:
- drm_gem_object_put_unlocked(obj);
- return ret;
+} +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
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 4a9d231..9c55c2a 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -302,6 +302,8 @@ void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages, bool dirty, bool accessed);
struct drm_gem_object *drm_gem_object_lookup(struct drm_file *filp, u32 handle); +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); -- 2.7.4
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Almost everyone did end up using GEM as bo, so this adds defaults for the drm_driver.dumb_destroy and drm_driver.dumb_map_offset callbacks.
Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/drm_dumb_buffers.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/drm_dumb_buffers.c b/drivers/gpu/drm/drm_dumb_buffers.c index 10307cc..cd68ab4 100644 --- a/drivers/gpu/drm/drm_dumb_buffers.c +++ b/drivers/gpu/drm/drm_dumb_buffers.c @@ -24,6 +24,7 @@ */
#include <drm/drmP.h> +#include <drm/drm_gem.h>
#include "drm_crtc_internal.h"
@@ -42,9 +43,10 @@ * create dumb buffers suitable for scanout, which can then be used to create * KMS frame buffers. * - * To support dumb objects drivers must implement the &drm_driver.dumb_create, - * &drm_driver.dumb_destroy and &drm_driver.dumb_map_offset operations. See - * there for further details. + * 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 operations to + * drm_gem_dumb_map_offset(). 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 @@ -108,11 +110,16 @@ int drm_mode_mmap_dumb_ioctl(struct drm_device *dev, { struct drm_mode_map_dumb *args = data;
- /* call driver ioctl to get mmap offset */ - if (!dev->driver->dumb_map_offset) + if (!dev->driver->dumb_create) return -ENOSYS;
- return dev->driver->dumb_map_offset(file_priv, dev, args->handle, &args->offset); + if (dev->driver->dumb_map_offset) + return dev->driver->dumb_map_offset(file_priv, dev, + args->handle, + &args->offset); + else + return drm_gem_dumb_map_offset(file_priv, dev, args->handle, + &args->offset); }
int drm_mode_destroy_dumb_ioctl(struct drm_device *dev, @@ -120,9 +127,12 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev, { struct drm_mode_destroy_dumb *args = data;
- if (!dev->driver->dumb_destroy) + if (!dev->driver->dumb_create) return -ENOSYS;
- return dev->driver->dumb_destroy(file_priv, dev, args->handle); + if (dev->driver->dumb_destroy) + return dev->driver->dumb_destroy(file_priv, dev, args->handle); + else + return drm_gem_dumb_destroy(file_priv, dev, args->handle); }
Noralf Trønnes noralf@tronnes.org writes:
Almost everyone did end up using GEM as bo, so this adds defaults for the drm_driver.dumb_destroy and drm_driver.dumb_map_offset callbacks.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/drm_dumb_buffers.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/drm_dumb_buffers.c b/drivers/gpu/drm/drm_dumb_buffers.c index 10307cc..cd68ab4 100644 --- a/drivers/gpu/drm/drm_dumb_buffers.c +++ b/drivers/gpu/drm/drm_dumb_buffers.c @@ -24,6 +24,7 @@ */
#include <drm/drmP.h> +#include <drm/drm_gem.h>
#include "drm_crtc_internal.h"
@@ -42,9 +43,10 @@
- create dumb buffers suitable for scanout, which can then be used to create
- KMS frame buffers.
- To support dumb objects drivers must implement the &drm_driver.dumb_create,
- &drm_driver.dumb_destroy and &drm_driver.dumb_map_offset operations. See
- there for further details.
- 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 operations to
s/operations/default/ I think
Other than that, patch 1-2 are:
Reviewed-by: Eric Anholt eric@anholt.net
Thanks for working on these cleanups!
On Sun, Jul 23, 2017 at 09:16:18PM +0200, Noralf Trønnes wrote:
Almost everyone did end up using GEM as bo, so this adds defaults for the drm_driver.dumb_destroy and drm_driver.dumb_map_offset callbacks.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
With Eric's suggestion:
Reviewed-by: Sean Paul seanpaul@chromium.org
drivers/gpu/drm/drm_dumb_buffers.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/drm_dumb_buffers.c b/drivers/gpu/drm/drm_dumb_buffers.c index 10307cc..cd68ab4 100644 --- a/drivers/gpu/drm/drm_dumb_buffers.c +++ b/drivers/gpu/drm/drm_dumb_buffers.c @@ -24,6 +24,7 @@ */
#include <drm/drmP.h> +#include <drm/drm_gem.h>
#include "drm_crtc_internal.h"
@@ -42,9 +43,10 @@
- create dumb buffers suitable for scanout, which can then be used to create
- KMS frame buffers.
- To support dumb objects drivers must implement the &drm_driver.dumb_create,
- &drm_driver.dumb_destroy and &drm_driver.dumb_map_offset operations. See
- there for further details.
- 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 operations to
- drm_gem_dumb_map_offset(). 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
@@ -108,11 +110,16 @@ int drm_mode_mmap_dumb_ioctl(struct drm_device *dev, { struct drm_mode_map_dumb *args = data;
- /* call driver ioctl to get mmap offset */
- if (!dev->driver->dumb_map_offset)
- if (!dev->driver->dumb_create) return -ENOSYS;
- return dev->driver->dumb_map_offset(file_priv, dev, args->handle, &args->offset);
- if (dev->driver->dumb_map_offset)
return dev->driver->dumb_map_offset(file_priv, dev,
args->handle,
&args->offset);
- else
return drm_gem_dumb_map_offset(file_priv, dev, args->handle,
&args->offset);
}
int drm_mode_destroy_dumb_ioctl(struct drm_device *dev, @@ -120,9 +127,12 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev, { struct drm_mode_destroy_dumb *args = data;
- if (!dev->driver->dumb_destroy)
- if (!dev->driver->dumb_create) return -ENOSYS;
- return dev->driver->dumb_destroy(file_priv, dev, args->handle);
- if (dev->driver->dumb_destroy)
return dev->driver->dumb_destroy(file_priv, dev, args->handle);
- else
return drm_gem_dumb_destroy(file_priv, dev, args->handle);
}
-- 2.7.4
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Alexey Brodkin abrodkin@synopsys.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/arc/arcpgu_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c index 3e43a5d..415b7da 100644 --- a/drivers/gpu/drm/arc/arcpgu_drv.c +++ b/drivers/gpu/drm/arc/arcpgu_drv.c @@ -172,8 +172,6 @@ static struct drm_driver arcpgu_drm_driver = { .patchlevel = 0, .fops = &arcpgu_drm_ops, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_free_object_unlocked = drm_gem_cma_free_object,
Hi Noralf,
-----Original Message----- From: Noralf Trønnes [mailto:noralf@tronnes.org] Sent: Sunday, July 23, 2017 10:16 PM To: dri-devel@lists.freedesktop.org Cc: alexander.deucher@amd.com; Alexey.Brodkin@synopsys.com; alison.wang@freescale.com; benjamin.gaignard@linaro.org; bskeggs@redhat.com; boris.brezillon@free-electrons.com; brian.starkey@arm.com; puck.chen@hisilicon.com; christian.koenig@amd.com; ck.hu@mediatek.com; daniel.vetter@intel.com; airlied@redhat.com; eric@anholt.net; kraxel@redhat.com; jani.nikula@linux.intel.com; jy0922.shim@samsung.com; jsarha@ti.com; kyungmin.park@samsung.com; laurent.pinchart@ideasonboard.com; liviu.dudau@arm.com; marex@denx.de; mark.yao@rock-chips.com; maxime.ripard@free- electrons.com; narmstrong@baylibre.com; patrik.r.jakobsson@gmail.com; philippe.cornu@st.com; p.zabel@pengutronix.de; robdclark@gmail.com; zourongrong@gmail.com; linux@armlinux.org.uk; sw0312.kim@samsung.com; shawnguo@kernel.org; stefan@agner.ch; thierry.reding@gmail.com; tomi.valkeinen@ti.com; vincent.abriou@st.com; z.liuxinliang@hisilicon.com; kong.kongxinwei@hisilicon.com; yannick.fertre@st.com; Noralf Trønnes noralf@tronnes.org Subject: [PATCH 03/41] drm/arc: Use .dumb_map_offset and .dumb_destroy defaults
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Alexey Brodkin abrodkin@synopsys.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Alexey Brodkin abrodkin@synopsys.com
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Liviu Dudau liviu.dudau@arm.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/arm/hdlcd_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 90bd97b..f9bda7b 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -253,8 +253,6 @@ static struct drm_driver hdlcd_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_export = drm_gem_prime_export,
Hi Noralf,
Thanks for the patch,
On Sun, Jul 23, 2017 at 09:16:20PM +0200, Noralf Tr??nnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Liviu Dudau liviu.dudau@arm.com Signed-off-by: Noralf Tr??nnes noralf@tronnes.org
Acked-by: Brian Starkey brian.starkey@arm.com
drivers/gpu/drm/arm/hdlcd_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 90bd97b..f9bda7b 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -253,8 +253,6 @@ static struct drm_driver hdlcd_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_export = drm_gem_prime_export,
-- 2.7.4
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Liviu Dudau liviu.dudau@arm.com Cc: Brian Starkey brian.starkey@arm.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/arm/malidp_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index a6a05a7..1a57cc2 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -331,8 +331,6 @@ static struct drm_driver malidp_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_export = drm_gem_prime_export,
Hi Noralf,
On Sun, Jul 23, 2017 at 09:16:21PM +0200, Noralf Tr??nnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Liviu Dudau liviu.dudau@arm.com Cc: Brian Starkey brian.starkey@arm.com Signed-off-by: Noralf Tr??nnes noralf@tronnes.org
Acked-by: Brian Starkey brian.starkey@arm.com
drivers/gpu/drm/arm/malidp_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index a6a05a7..1a57cc2 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -331,8 +331,6 @@ static struct drm_driver malidp_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_export = drm_gem_prime_export,
-- 2.7.4
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Boris Brezillon boris.brezillon@free-electrons.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index 64f54dc..74d66e1 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -761,8 +761,6 @@ static struct drm_driver atmel_hlcdc_dc_driver = { .gem_prime_vunmap = drm_gem_cma_prime_vunmap, .gem_prime_mmap = drm_gem_cma_prime_mmap, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .fops = &fops, .name = "atmel-hlcdc", .desc = "Atmel HLCD Controller DRM",
Le Sun, 23 Jul 2017 21:16:22 +0200, Noralf Trønnes noralf@tronnes.org a écrit :
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Boris Brezillon boris.brezillon@free-electrons.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Boris Brezillon boris.brezillon@free-electrons.com
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index 64f54dc..74d66e1 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -761,8 +761,6 @@ static struct drm_driver atmel_hlcdc_dc_driver = { .gem_prime_vunmap = drm_gem_cma_prime_vunmap, .gem_prime_mmap = drm_gem_cma_prime_mmap, .dumb_create = drm_gem_cma_dumb_create,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .fops = &fops, .name = "atmel-hlcdc", .desc = "Atmel HLCD Controller DRM",
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Stefan Agner stefan@agner.ch Cc: Alison Wang alison.wang@freescale.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index 5cbde19..58e9e06 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -176,8 +176,6 @@ static struct drm_driver fsl_dcu_drm_driver = { .gem_prime_vunmap = drm_gem_cma_prime_vunmap, .gem_prime_mmap = drm_gem_cma_prime_mmap, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .fops = &fsl_dcu_drm_fops, .name = "fsl-dcu-drm", .desc = "Freescale DCU DRM",
On 2017-07-23 12:16, Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Stefan Agner stefan@agner.ch Cc: Alison Wang alison.wang@freescale.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Stefan Agner stefan@agner.ch
-- Stefan
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index 5cbde19..58e9e06 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -176,8 +176,6 @@ static struct drm_driver fsl_dcu_drm_driver = { .gem_prime_vunmap = drm_gem_cma_prime_vunmap, .gem_prime_mmap = drm_gem_cma_prime_mmap, .dumb_create = drm_gem_cma_dumb_create,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .fops = &fsl_dcu_drm_fops, .name = "fsl-dcu-drm", .desc = "Freescale DCU DRM",
Den 29.07.2017 19.24, skrev Stefan Agner:
On 2017-07-23 12:16, Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Stefan Agner stefan@agner.ch Cc: Alison Wang alison.wang@freescale.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Stefan Agner stefan@agner.ch
Thanks, applied to drm-misc.
Noralf.
-- Stefan
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index 5cbde19..58e9e06 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -176,8 +176,6 @@ static struct drm_driver fsl_dcu_drm_driver = { .gem_prime_vunmap = drm_gem_cma_prime_vunmap, .gem_prime_mmap = drm_gem_cma_prime_mmap, .dumb_create = drm_gem_cma_dumb_create,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .fops = &fsl_dcu_drm_fops, .name = "fsl-dcu-drm", .desc = "Freescale DCU DRM",
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Xinliang Liu z.liuxinliang@hisilicon.com Cc: Rongrong Zou zourongrong@gmail.com Cc: Xinwei Kong kong.kongxinwei@hisilicon.com Cc: Chen Feng puck.chen@hisilicon.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index 1178341..6ecc401 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -162,8 +162,6 @@ static struct drm_driver kirin_drm_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = kirin_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Philipp Zabel p.zabel@pengutronix.de Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/imx/imx-drm-core.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index f5c6212..f91cb72 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -182,8 +182,6 @@ static struct drm_driver imx_drm_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
On Sun, 2017-07-23 at 21:16 +0200, Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Philipp Zabel p.zabel@pengutronix.de Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/imx/imx-drm-core.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index f5c6212..f91cb72 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -182,8 +182,6 @@ static struct drm_driver imx_drm_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset,
Are there any users of drm_gem_cma_dumb_map_offset left after patch 21?
.dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
Acked-by: Philipp Zabel p.zabel@pengutronix.de
regards Philipp
Den 24.07.2017 09.46, skrev Philipp Zabel:
On Sun, 2017-07-23 at 21:16 +0200, Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Philipp Zabel p.zabel@pengutronix.de Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/imx/imx-drm-core.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index f5c6212..f91cb72 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -182,8 +182,6 @@ static struct drm_driver imx_drm_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset,
Are there any users of drm_gem_cma_dumb_map_offset left after patch 21?
You're quite right, there isn't, I forgot to remove it :-) Thanks.
Noralf.
.dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
Acked-by: Philipp Zabel p.zabel@pengutronix.de
regards Philipp
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Neil Armstrong narmstrong@baylibre.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/meson/meson_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index 5375e6d..7742c7d 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -116,8 +116,6 @@ static struct drm_driver meson_driver = {
/* GEM Ops */ .dumb_create = drm_gem_cma_dumb_create, - .dumb_destroy = drm_gem_dumb_destroy, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops,
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Marek Vasut marex@denx.de Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c index a34f41c..622d170 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -337,8 +337,6 @@ static struct drm_driver mxsfb_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_export = drm_gem_prime_export,
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Eric Anholt eric@anholt.net Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/pl111/pl111_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c index 8907bc2..29653fe 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -159,8 +159,6 @@ static struct drm_driver pl111_drm_driver = { .minor = 0, .patchlevel = 0, .dumb_create = drm_gem_cma_dumb_create, - .dumb_destroy = drm_gem_dumb_destroy, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops,
Noralf Trønnes noralf@tronnes.org writes:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Reviewed-by: Eric Anholt eric@anholt.net
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index d6a0255..c09cf84 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -238,8 +238,6 @@ static struct drm_driver rcar_du_driver = { .gem_prime_vunmap = drm_gem_cma_prime_vunmap, .gem_prime_mmap = drm_gem_cma_prime_mmap, .dumb_create = rcar_du_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .fops = &rcar_du_fops, .name = "rcar-du", .desc = "Renesas R-Car Display Unit",
Hi Noralf,
Thank you for the patch.
On Sunday 23 Jul 2017 21:16:29 Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Reviewed-by: Laurent Pinchart laurent.pinchart@ideasonboard.com
drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index d6a0255..c09cf84 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -238,8 +238,6 @@ static struct drm_driver rcar_du_driver = { .gem_prime_vunmap = drm_gem_cma_prime_vunmap, .gem_prime_mmap = drm_gem_cma_prime_mmap, .dumb_create = rcar_du_dumb_create,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .fops = &rcar_du_fops, .name = "rcar-du", .desc = "Renesas R-Car Display Unit",
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c index c2ca073..5925725 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c @@ -145,8 +145,6 @@ static struct drm_driver shmob_drm_driver = { .gem_prime_vunmap = drm_gem_cma_prime_vunmap, .gem_prime_mmap = drm_gem_cma_prime_mmap, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .fops = &shmob_drm_fops, .name = "shmob-drm", .desc = "Renesas SH Mobile DRM",
Hi Noralf,
Thank you for the patch.
On Sunday 23 Jul 2017 21:16:30 Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Reviewed-by: Laurent Pinchart laurent.pinchart@ideasonboard.com
drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c index c2ca073..5925725 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c @@ -145,8 +145,6 @@ static struct drm_driver shmob_drm_driver = { .gem_prime_vunmap = drm_gem_cma_prime_vunmap, .gem_prime_mmap = drm_gem_cma_prime_mmap, .dumb_create = drm_gem_cma_dumb_create,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .fops = &shmob_drm_fops, .name = "shmob-drm", .desc = "Renesas SH Mobile DRM",
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/sti/sti_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index 06ef1e38..1700c54 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -175,8 +175,6 @@ static struct drm_driver sti_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .fops = &sti_driver_fops,
.enable_vblank = sti_crtc_enable_vblank,
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Yannick Fertre yannick.fertre@st.com Cc: Philippe Cornu philippe.cornu@st.com Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/stm/drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index 095971f..b333b37 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -60,8 +60,6 @@ static struct drm_driver drv_driver = { .patchlevel = 0, .fops = &drv_driver_fops, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_free_object_unlocked = drm_gem_cma_free_object,
On 07/23/2017 09:16 PM, Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Yannick Fertre yannick.fertre@st.com Cc: Philippe Cornu philippe.cornu@st.com Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/stm/drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index 095971f..b333b37 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -60,8 +60,6 @@ static struct drm_driver drv_driver = { .patchlevel = 0, .fops = &drv_driver_fops, .dumb_create = drm_gem_cma_dumb_create,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_free_object_unlocked = drm_gem_cma_free_object,
Tested-by: Philippe Cornu philippe.cornu@st.com Acked-by: Philippe Cornu philippe.cornu@st.com
Many thanks for the cleanup.
Philippe :-)
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Maxime Ripard maxime.ripard@free-electrons.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/sun4i/sun4i_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 89cd590..d599206 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -40,8 +40,6 @@ static struct drm_driver sun4i_drv_driver = {
/* GEM Operations */ .dumb_create = drm_gem_cma_dumb_create, - .dumb_destroy = drm_gem_dumb_destroy, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops,
On Sun, Jul 23, 2017 at 09:16:33PM +0200, Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Maxime Ripard maxime.ripard@free-electrons.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/sun4i/sun4i_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 89cd590..d599206 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -40,8 +40,6 @@ static struct drm_driver sun4i_drv_driver = {
/* GEM Operations */ .dumb_create = drm_gem_cma_dumb_create,
- .dumb_destroy = drm_gem_dumb_destroy,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset, .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops,
Acked-by: Maxime Ripard maxime.ripard@free-electrons.com
Thanks! Maxime
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Jyri Sarha jsarha@ti.com Cc: Tomi Valkeinen tomi.valkeinen@ti.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index 049d2f5..b0d70f9 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -542,8 +542,6 @@ static struct drm_driver tilcdc_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
On 07/23/17 22:16, Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Jyri Sarha jsarha@ti.com Cc: Tomi Valkeinen tomi.valkeinen@ti.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Jyri Sarha jsarha@ti.com
Thanks!
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index 049d2f5..b0d70f9 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -542,8 +542,6 @@ static struct drm_driver tilcdc_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create,
.dumb_map_offset = drm_gem_cma_dumb_map_offset,
.dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Eric Anholt eric@anholt.net Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/vc4/vc4_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index c6b487c..d0ba20f 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -178,8 +178,6 @@ static struct drm_driver vc4_drm_driver = { .gem_prime_mmap = vc4_prime_mmap,
.dumb_create = vc4_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy,
.ioctls = vc4_drm_ioctls, .num_ioctls = ARRAY_SIZE(vc4_drm_ioctls),
Noralf Trønnes noralf@tronnes.org writes:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Reviewed-by: Eric Anholt eric@anholt.net
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Shawn Guo shawnguo@kernel.org Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/zte/zx_drm_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c index c983cdf..4524482 100644 --- a/drivers/gpu/drm/zte/zx_drm_drv.c +++ b/drivers/gpu/drm/zte/zx_drm_drv.c @@ -62,8 +62,6 @@ static struct drm_driver zx_drm_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create, - .dumb_map_offset = drm_gem_cma_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_export = drm_gem_prime_export,
On Sun, Jul 23, 2017 at 09:16:36PM +0200, Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Shawn Guo shawnguo@kernel.org
Acked-by: Shawn Guo shawnguo@kernel.org
Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/zte/zx_drm_drv.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c index c983cdf..4524482 100644 --- a/drivers/gpu/drm/zte/zx_drm_drv.c +++ b/drivers/gpu/drm/zte/zx_drm_drv.c @@ -62,8 +62,6 @@ static struct drm_driver zx_drm_driver = { .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create,
- .dumb_map_offset = drm_gem_cma_dumb_map_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_export = drm_gem_prime_export,
-- 2.7.4
tinydrm can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Signed-off-by: Noralf Trønnes noralf@tronnes.org --- include/drm/tinydrm/tinydrm.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/drm/tinydrm/tinydrm.h b/include/drm/tinydrm/tinydrm.h index 00b800d..4774fe3 100644 --- a/include/drm/tinydrm/tinydrm.h +++ b/include/drm/tinydrm/tinydrm.h @@ -56,9 +56,7 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe) .gem_prime_vmap = drm_gem_cma_prime_vmap, \ .gem_prime_vunmap = drm_gem_cma_prime_vunmap, \ .gem_prime_mmap = drm_gem_cma_prime_mmap, \ - .dumb_create = drm_gem_cma_dumb_create, \ - .dumb_map_offset = drm_gem_cma_dumb_map_offset, \ - .dumb_destroy = drm_gem_dumb_destroy + .dumb_create = drm_gem_cma_dumb_create
/** * TINYDRM_MODE - tinydrm display mode
On Sun, Jul 23, 2017 at 09:16:37PM +0200, Noralf Trønnes wrote:
tinydrm can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
Reviewed-by: Sean Paul seanpaul@chromium.org
include/drm/tinydrm/tinydrm.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/drm/tinydrm/tinydrm.h b/include/drm/tinydrm/tinydrm.h index 00b800d..4774fe3 100644 --- a/include/drm/tinydrm/tinydrm.h +++ b/include/drm/tinydrm/tinydrm.h @@ -56,9 +56,7 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe) .gem_prime_vmap = drm_gem_cma_prime_vmap, \ .gem_prime_vunmap = drm_gem_cma_prime_vunmap, \ .gem_prime_mmap = drm_gem_cma_prime_mmap, \
- .dumb_create = drm_gem_cma_dumb_create, \
- .dumb_map_offset = drm_gem_cma_dumb_map_offset, \
- .dumb_destroy = drm_gem_dumb_destroy
- .dumb_create = drm_gem_cma_dumb_create
/**
- TINYDRM_MODE - tinydrm display mode
-- 2.7.4
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: CK Hu ck.hu@mediatek.com Cc: Philipp Zabel p.zabel@pengutronix.de Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 -- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 25 ------------------------- drivers/gpu/drm/mediatek/mtk_drm_gem.h | 3 --- 3 files changed, 30 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index f0cb276..a2ca90f 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -293,8 +293,6 @@ static struct drm_driver mtk_drm_driver = { .gem_free_object_unlocked = mtk_drm_gem_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = mtk_drm_gem_dumb_create, - .dumb_map_offset = mtk_drm_gem_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index 7abc550..8ec963f 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -131,31 +131,6 @@ int mtk_drm_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev, return ret; }
-int mtk_drm_gem_dumb_map_offset(struct drm_file *file_priv, - struct drm_device *dev, uint32_t handle, - uint64_t *offset) -{ - struct drm_gem_object *obj; - int ret; - - obj = drm_gem_object_lookup(file_priv, handle); - if (!obj) { - DRM_ERROR("failed to lookup gem object.\n"); - return -EINVAL; - } - - ret = drm_gem_create_mmap_offset(obj); - if (ret) - goto out; - - *offset = drm_vma_node_offset_addr(&obj->vma_node); - DRM_DEBUG_KMS("offset = 0x%llx\n", *offset); - -out: - drm_gem_object_unreference_unlocked(obj); - return ret; -} - static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.h b/drivers/gpu/drm/mediatek/mtk_drm_gem.h index 2752718..534639b 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.h +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.h @@ -46,9 +46,6 @@ struct mtk_drm_gem_obj *mtk_drm_gem_create(struct drm_device *dev, size_t size, bool alloc_kmap); int mtk_drm_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev, struct drm_mode_create_dumb *args); -int mtk_drm_gem_dumb_map_offset(struct drm_file *file_priv, - struct drm_device *dev, uint32_t handle, - uint64_t *offset); int mtk_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); int mtk_drm_gem_mmap_buf(struct drm_gem_object *obj, struct vm_area_struct *vma);
On Sun, 2017-07-23 at 21:16 +0200, Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: CK Hu ck.hu@mediatek.com Cc: Philipp Zabel p.zabel@pengutronix.de Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Philipp Zabel p.zabel@pengutronix.de
regards Philipp
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Patrik Jakobsson patrik.r.jakobsson@gmail.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/gma500/gem.c | 30 ------------------------------ drivers/gpu/drm/gma500/psb_drv.c | 2 -- drivers/gpu/drm/gma500/psb_drv.h | 2 -- 3 files changed, 34 deletions(-)
diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c index 7da061a..1312397 100644 --- a/drivers/gpu/drm/gma500/gem.c +++ b/drivers/gpu/drm/gma500/gem.c @@ -48,36 +48,6 @@ int psb_gem_get_aperture(struct drm_device *dev, void *data, }
/** - * psb_gem_dumb_map_gtt - buffer mapping for dumb interface - * @file: our drm client file - * @dev: drm device - * @handle: GEM handle to the object (from dumb_create) - * - * Do the necessary setup to allow the mapping of the frame buffer - * into user memory. We don't have to do much here at the moment. - */ -int psb_gem_dumb_map_gtt(struct drm_file *file, struct drm_device *dev, - uint32_t handle, uint64_t *offset) -{ - int ret = 0; - struct drm_gem_object *obj; - - /* GEM does all our handle to object mapping */ - obj = drm_gem_object_lookup(file, handle); - if (obj == NULL) - return -ENOENT; - - /* Make it mmapable */ - ret = drm_gem_create_mmap_offset(obj); - if (ret) - goto out; - *offset = drm_vma_node_offset_addr(&obj->vma_node); -out: - drm_gem_object_unreference_unlocked(obj); - return ret; -} - -/** * psb_gem_create - create a mappable object * @file: the DRM file of the client * @dev: our device diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index 747c06b..37a3be7 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -494,8 +494,6 @@ static struct drm_driver driver = { .gem_vm_ops = &psb_gem_vm_ops,
.dumb_create = psb_gem_dumb_create, - .dumb_map_offset = psb_gem_dumb_map_gtt, - .dumb_destroy = drm_gem_dumb_destroy, .ioctls = psb_ioctls, .fops = &psb_gem_fops, .name = DRIVER_NAME, diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h index 8366708..821497d 100644 --- a/drivers/gpu/drm/gma500/psb_drv.h +++ b/drivers/gpu/drm/gma500/psb_drv.h @@ -750,8 +750,6 @@ extern int psb_gem_get_aperture(struct drm_device *dev, void *data, struct drm_file *file); extern int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args); -extern int psb_gem_dumb_map_gtt(struct drm_file *file, struct drm_device *dev, - uint32_t handle, uint64_t *offset); extern int psb_gem_fault(struct vm_fault *vmf);
/* psb_device.c */
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Mark Yao mark.yao@rock-chips.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 26 -------------------------- drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 3 --- 3 files changed, 31 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 131cb5c..848edcf 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -233,8 +233,6 @@ static struct drm_driver rockchip_drm_driver = { .gem_vm_ops = &drm_gem_cma_vm_ops, .gem_free_object_unlocked = rockchip_gem_free_object, .dumb_create = rockchip_gem_dumb_create, - .dumb_map_offset = rockchip_gem_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_import = drm_gem_prime_import, diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index b74ac71..f74333e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -393,32 +393,6 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv, return ERR_PTR(ret); }
-int rockchip_gem_dumb_map_offset(struct drm_file *file_priv, - struct drm_device *dev, uint32_t handle, - uint64_t *offset) -{ - struct drm_gem_object *obj; - int ret; - - obj = drm_gem_object_lookup(file_priv, handle); - if (!obj) { - DRM_ERROR("failed to lookup gem object.\n"); - return -EINVAL; - } - - ret = drm_gem_create_mmap_offset(obj); - if (ret) - goto out; - - *offset = drm_vma_node_offset_addr(&obj->vma_node); - DRM_DEBUG_KMS("offset = 0x%llx\n", *offset); - -out: - drm_gem_object_unreference_unlocked(obj); - - return 0; -} - /* * rockchip_gem_dumb_create - (struct drm_driver)->dumb_create callback * function diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h index 3f6ea4d..f237375 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h @@ -57,7 +57,4 @@ void rockchip_gem_free_object(struct drm_gem_object *obj); int rockchip_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev, struct drm_mode_create_dumb *args); -int rockchip_gem_dumb_map_offset(struct drm_file *file_priv, - struct drm_device *dev, uint32_t handle, - uint64_t *offset); #endif /* _ROCKCHIP_DRM_GEM_H */
On Sun, Jul 23, 2017 at 09:16:40PM +0200, Noralf Trønnes wrote:
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Mark Yao mark.yao@rock-chips.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 26 -------------------------- drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 3 --- 3 files changed, 31 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 131cb5c..848edcf 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -233,8 +233,6 @@ static struct drm_driver rockchip_drm_driver = { .gem_vm_ops = &drm_gem_cma_vm_ops, .gem_free_object_unlocked = rockchip_gem_free_object, .dumb_create = rockchip_gem_dumb_create,
- .dumb_map_offset = rockchip_gem_dumb_map_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_import = drm_gem_prime_import,
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index b74ac71..f74333e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -393,32 +393,6 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv, return ERR_PTR(ret); }
-int rockchip_gem_dumb_map_offset(struct drm_file *file_priv,
struct drm_device *dev, uint32_t handle,
uint64_t *offset)
-{
- struct drm_gem_object *obj;
- int ret;
- obj = drm_gem_object_lookup(file_priv, handle);
- if (!obj) {
DRM_ERROR("failed to lookup gem object.\n");
return -EINVAL;
- }
- ret = drm_gem_create_mmap_offset(obj);
- if (ret)
goto out;
- *offset = drm_vma_node_offset_addr(&obj->vma_node);
- DRM_DEBUG_KMS("offset = 0x%llx\n", *offset);
-out:
- drm_gem_object_unreference_unlocked(obj);
- return 0;
Bonus points for fixing a bug in rockchip where this function returns success when gem_create_mmap_offset fails :)
Reviewed-by: Sean Paul seanpaul@chromium.org
-}
/*
- rockchip_gem_dumb_create - (struct drm_driver)->dumb_create callback
- function
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h index 3f6ea4d..f237375 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h @@ -57,7 +57,4 @@ void rockchip_gem_free_object(struct drm_gem_object *obj); int rockchip_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev, struct drm_mode_create_dumb *args); -int rockchip_gem_dumb_map_offset(struct drm_file *file_priv,
struct drm_device *dev, uint32_t handle,
uint64_t *offset);
#endif /* _ROCKCHIP_DRM_GEM_H */
2.7.4
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Thierry Reding thierry.reding@gmail.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/tegra/drm.c | 2 -- drivers/gpu/drm/tegra/gem.c | 21 --------------------- drivers/gpu/drm/tegra/gem.h | 2 -- 3 files changed, 25 deletions(-)
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 3ba659a..224ce1d 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1077,8 +1077,6 @@ static struct drm_driver tegra_drm_driver = { .gem_prime_import = tegra_gem_prime_import,
.dumb_create = tegra_bo_dumb_create, - .dumb_map_offset = tegra_bo_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy,
.ioctls = tegra_drm_ioctls, .num_ioctls = ARRAY_SIZE(tegra_drm_ioctls), diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 7a39a35..c6079af 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -423,27 +423,6 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm, return 0; }
-int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm, - u32 handle, u64 *offset) -{ - struct drm_gem_object *gem; - struct tegra_bo *bo; - - gem = drm_gem_object_lookup(file, handle); - if (!gem) { - dev_err(drm->dev, "failed to lookup GEM object\n"); - return -EINVAL; - } - - bo = to_tegra_bo(gem); - - *offset = drm_vma_node_offset_addr(&bo->gem.vma_node); - - drm_gem_object_unreference_unlocked(gem); - - return 0; -} - static int tegra_bo_fault(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; diff --git a/drivers/gpu/drm/tegra/gem.h b/drivers/gpu/drm/tegra/gem.h index 8b32a6f..8eb9fd2 100644 --- a/drivers/gpu/drm/tegra/gem.h +++ b/drivers/gpu/drm/tegra/gem.h @@ -67,8 +67,6 @@ struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file, void tegra_bo_free_object(struct drm_gem_object *gem); int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm, struct drm_mode_create_dumb *args); -int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm, - u32 handle, u64 *offset);
int tegra_drm_mmap(struct file *file, struct vm_area_struct *vma);
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Dave Airlie airlied@redhat.com Cc: Gerd Hoffmann kraxel@redhat.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/cirrus/cirrus_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c index 910c300..69c4e35 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.c +++ b/drivers/gpu/drm/cirrus/cirrus_drv.c @@ -142,7 +142,6 @@ static struct drm_driver driver = { .gem_free_object_unlocked = cirrus_gem_free_object, .dumb_create = cirrus_dumb_create, .dumb_map_offset = cirrus_dumb_mmap_offset, - .dumb_destroy = drm_gem_dumb_destroy, };
static const struct dev_pm_ops cirrus_pm_ops = {
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Dave Airlie airlied@redhat.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/udl/udl_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c index 0f02e1ac..0b71865 100644 --- a/drivers/gpu/drm/udl/udl_drv.c +++ b/drivers/gpu/drm/udl/udl_drv.c @@ -54,7 +54,6 @@ static struct drm_driver driver = {
.dumb_create = udl_dumb_create, .dumb_map_offset = udl_gem_mmap, - .dumb_destroy = drm_gem_dumb_destroy, .fops = &udl_driver_fops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Dave Airlie airlied@redhat.com Cc: Gerd Hoffmann kraxel@redhat.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/qxl/qxl_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index 403e135..2445e75 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -263,7 +263,6 @@ static struct drm_driver qxl_driver = {
.dumb_create = qxl_mode_dumb_create, .dumb_map_offset = qxl_mode_dumb_mmap, - .dumb_destroy = drm_gem_dumb_destroy, #if defined(CONFIG_DEBUG_FS) .debugfs_init = qxl_debugfs_init, #endif
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Alex Deucher alexander.deucher@amd.com Cc: Christian König christian.koenig@amd.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 4699924..3c57102 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -822,7 +822,6 @@ static struct drm_driver kms_driver = { .gem_close_object = amdgpu_gem_object_close, .dumb_create = amdgpu_mode_dumb_create, .dumb_map_offset = amdgpu_mode_dumb_mmap, - .dumb_destroy = drm_gem_dumb_destroy, .fops = &amdgpu_driver_kms_fops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
-----Original Message----- From: Noralf Trønnes [mailto:noralf@tronnes.org] Sent: Sunday, July 23, 2017 3:17 PM To: dri-devel@lists.freedesktop.org Cc: Deucher, Alexander; abrodkin@synopsys.com; alison.wang@freescale.com; benjamin.gaignard@linaro.org; bskeggs@redhat.com; boris.brezillon@free-electrons.com; brian.starkey@arm.com; puck.chen@hisilicon.com; Koenig, Christian; ck.hu@mediatek.com; daniel.vetter@intel.com; airlied@redhat.com; eric@anholt.net; kraxel@redhat.com; jani.nikula@linux.intel.com; jy0922.shim@samsung.com; jsarha@ti.com; kyungmin.park@samsung.com; laurent.pinchart@ideasonboard.com; liviu.dudau@arm.com; marex@denx.de; mark.yao@rock-chips.com; maxime.ripard@free- electrons.com; narmstrong@baylibre.com; patrik.r.jakobsson@gmail.com; philippe.cornu@st.com; p.zabel@pengutronix.de; robdclark@gmail.com; zourongrong@gmail.com; linux@armlinux.org.uk; sw0312.kim@samsung.com; shawnguo@kernel.org; stefan@agner.ch; thierry.reding@gmail.com; tomi.valkeinen@ti.com; vincent.abriou@st.com; z.liuxinliang@hisilicon.com; kong.kongxinwei@hisilicon.com; yannick.fertre@st.com; Noralf Trønnes Subject: [PATCH 29/41] drm/amdgpu: Use the drm_driver.dumb_destroy default
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Alex Deucher alexander.deucher@amd.com Cc: Christian König christian.koenig@amd.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
This and the radeon patch are: Acked-by: Alex Deucher alexander.deucher@amd.com
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 4699924..3c57102 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -822,7 +822,6 @@ static struct drm_driver kms_driver = { .gem_close_object = amdgpu_gem_object_close, .dumb_create = amdgpu_mode_dumb_create, .dumb_map_offset = amdgpu_mode_dumb_mmap,
.dumb_destroy = drm_gem_dumb_destroy, .fops = &amdgpu_driver_kms_fops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
-- 2.7.4
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Tomi Valkeinen tomi.valkeinen@ti.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/omapdrm/omap_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 022029e..ce3341d 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -517,7 +517,6 @@ static struct drm_driver omap_drm_driver = { .gem_vm_ops = &omap_gem_vm_ops, .dumb_create = omap_gem_dumb_create, .dumb_map_offset = omap_gem_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .ioctls = ioctls, .num_ioctls = DRM_OMAP_NUM_IOCTLS, .fops = &omapdriver_fops,
Hi Noralf,
Thank you for the patch.
On Sunday 23 Jul 2017 21:16:46 Noralf Trønnes wrote:
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Tomi Valkeinen tomi.valkeinen@ti.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Reviewed-by: Laurent Pinchart laurent.pinchart@ideasonboard.com
drivers/gpu/drm/omapdrm/omap_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 022029e..ce3341d 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -517,7 +517,6 @@ static struct drm_driver omap_drm_driver = { .gem_vm_ops = &omap_gem_vm_ops, .dumb_create = omap_gem_dumb_create, .dumb_map_offset = omap_gem_dumb_map_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .ioctls = ioctls, .num_ioctls = DRM_OMAP_NUM_IOCTLS, .fops = &omapdriver_fops,
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Dave Airlie airlied@redhat.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/ast/ast_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c index 3022b39..69dab82 100644 --- a/drivers/gpu/drm/ast/ast_drv.c +++ b/drivers/gpu/drm/ast/ast_drv.c @@ -209,7 +209,6 @@ static struct drm_driver driver = { .gem_free_object_unlocked = ast_gem_free_object, .dumb_create = ast_dumb_create, .dumb_map_offset = ast_dumb_mmap_offset, - .dumb_destroy = drm_gem_dumb_destroy,
};
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Ben Skeggs bskeggs@redhat.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/nouveau/nouveau_drm.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 2600b3b..df7e203 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -998,7 +998,6 @@ driver_stub = {
.dumb_create = nouveau_display_dumb_create, .dumb_map_offset = nouveau_display_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy,
.name = DRIVER_NAME, .desc = DRIVER_DESC,
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Daniel Vetter daniel.vetter@intel.com Cc: Jani Nikula jani.nikula@linux.intel.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/i915/i915_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index d310d82..4c96a72 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -2755,7 +2755,6 @@ static struct drm_driver driver = {
.dumb_create = i915_gem_dumb_create, .dumb_map_offset = i915_gem_mmap_gtt, - .dumb_destroy = drm_gem_dumb_destroy, .ioctls = i915_ioctls, .num_ioctls = ARRAY_SIZE(i915_ioctls), .fops = &i915_driver_fops,
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Rob Clark robdclark@gmail.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/msm/msm_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index f49f6ac..b0129e7 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -832,7 +832,6 @@ static struct drm_driver msm_driver = { .gem_vm_ops = &vm_ops, .dumb_create = msm_gem_dumb_create, .dumb_map_offset = msm_gem_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_export = drm_gem_prime_export,
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Joonyoung Shim jy0922.shim@samsung.com Cc: Seung-Woo Kim sw0312.kim@samsung.com Cc: Kyungmin Park kyungmin.park@samsung.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index cab9e12..be91b8e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -146,7 +146,6 @@ static struct drm_driver exynos_drm_driver = { .gem_vm_ops = &exynos_drm_gem_vm_ops, .dumb_create = exynos_drm_gem_dumb_create, .dumb_map_offset = exynos_drm_gem_dumb_map_offset, - .dumb_destroy = drm_gem_dumb_destroy, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_export = drm_gem_prime_export,
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Chen Feng puck.chen@hisilicon.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index 4d018ca..d4f6f1f 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -67,7 +67,6 @@ static struct drm_driver hibmc_driver = { .gem_free_object_unlocked = hibmc_gem_free_object, .dumb_create = hibmc_dumb_create, .dumb_map_offset = hibmc_dumb_mmap_offset, - .dumb_destroy = drm_gem_dumb_destroy, .irq_handler = hibmc_drm_interrupt, };
On Sun, Jul 23, 2017 at 09:16:52PM +0200, Noralf Trønnes wrote:
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Chen Feng puck.chen@hisilicon.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Reviewed-by: Sean Paul seanpaul@chromium.org
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index 4d018ca..d4f6f1f 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -67,7 +67,6 @@ static struct drm_driver hibmc_driver = { .gem_free_object_unlocked = hibmc_gem_free_object, .dumb_create = hibmc_dumb_create, .dumb_map_offset = hibmc_dumb_mmap_offset,
- .dumb_destroy = drm_gem_dumb_destroy, .irq_handler = hibmc_drm_interrupt,
};
-- 2.7.4
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Dave Airlie airlied@redhat.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/mgag200/mgag200_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c index 4189160..74cdde2 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -102,7 +102,6 @@ static struct drm_driver driver = { .gem_free_object_unlocked = mgag200_gem_free_object, .dumb_create = mgag200_dumb_create, .dumb_map_offset = mgag200_dumb_mmap_offset, - .dumb_destroy = drm_gem_dumb_destroy, };
static struct pci_driver mgag200_pci_driver = {
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Alex Deucher alexander.deucher@amd.com Cc: Christian König christian.koenig@amd.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/radeon/radeon_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index b401f16..f4becad 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -583,7 +583,6 @@ static struct drm_driver kms_driver = { .gem_close_object = radeon_gem_object_close, .dumb_create = radeon_mode_dumb_create, .dumb_map_offset = radeon_mode_dumb_mmap, - .dumb_destroy = drm_gem_dumb_destroy, .fops = &radeon_driver_kms_fops,
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Gerd Hoffmann kraxel@redhat.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/bochs/bochs_drv.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index a1d2884..7b203184 100644 --- a/drivers/gpu/drm/bochs/bochs_drv.c +++ b/drivers/gpu/drm/bochs/bochs_drv.c @@ -93,7 +93,6 @@ static struct drm_driver bochs_driver = { .gem_free_object_unlocked = bochs_gem_free_object, .dumb_create = bochs_dumb_create, .dumb_map_offset = bochs_dumb_mmap_offset, - .dumb_destroy = drm_gem_dumb_destroy, };
/* ---------------------------------------------------------------------- */
armada_gem_dumb_destroy() is the same as drm_gem_dumb_destroy() which is the drm_driver.dumb_destroy default, so no need to set it.
Cc: Russell King linux@armlinux.org.uk Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/armada/armada_drv.c | 1 - drivers/gpu/drm/armada/armada_gem.c | 6 ------ drivers/gpu/drm/armada/armada_gem.h | 2 -- 3 files changed, 9 deletions(-)
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index 0b3227c..8a37b9a 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -71,7 +71,6 @@ static struct drm_driver armada_drm_driver = { .gem_prime_import = armada_gem_prime_import, .dumb_create = armada_gem_dumb_create, .dumb_map_offset = armada_gem_dumb_map_offset, - .dumb_destroy = armada_gem_dumb_destroy, .gem_vm_ops = &armada_gem_vm_ops, .major = 1, .minor = 0, diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c index a76ca21..9d69132 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c @@ -300,12 +300,6 @@ int armada_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, return ret; }
-int armada_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev, - uint32_t handle) -{ - return drm_gem_handle_delete(file, handle); -} - /* Private driver gem ioctls */ int armada_gem_create_ioctl(struct drm_device *dev, void *data, struct drm_file *file) diff --git a/drivers/gpu/drm/armada/armada_gem.h b/drivers/gpu/drm/armada/armada_gem.h index 6e524e0..78d5690 100644 --- a/drivers/gpu/drm/armada/armada_gem.h +++ b/drivers/gpu/drm/armada/armada_gem.h @@ -37,8 +37,6 @@ int armada_gem_dumb_create(struct drm_file *, struct drm_device *, struct drm_mode_create_dumb *); int armada_gem_dumb_map_offset(struct drm_file *, struct drm_device *, uint32_t, uint64_t *); -int armada_gem_dumb_destroy(struct drm_file *, struct drm_device *, - uint32_t); struct dma_buf *armada_gem_prime_export(struct drm_device *dev, struct drm_gem_object *obj, int flags); struct drm_gem_object *armada_gem_prime_import(struct drm_device *,
virtio_gpu_mode_dumb_destroy() is the same as drm_gem_dumb_destroy() which is the drm_driver.dumb_destroy default, so no need to set it.
Cc: David Airlie airlied@linux.ie Cc: Gerd Hoffmann kraxel@redhat.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/virtio/virtgpu_drv.c | 1 - drivers/gpu/drm/virtio/virtgpu_drv.h | 3 --- drivers/gpu/drm/virtio/virtgpu_gem.c | 7 ------- 3 files changed, 11 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c index 63d35c7..49a3d8d 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -122,7 +122,6 @@ static struct drm_driver driver = {
.dumb_create = virtio_gpu_mode_dumb_create, .dumb_map_offset = virtio_gpu_mode_dumb_mmap, - .dumb_destroy = virtio_gpu_mode_dumb_destroy,
#if defined(CONFIG_DEBUG_FS) .debugfs_init = virtio_gpu_debugfs_init, diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h index 3a66abb..da2fb58 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -236,9 +236,6 @@ struct virtio_gpu_object *virtio_gpu_alloc_object(struct drm_device *dev, int virtio_gpu_mode_dumb_create(struct drm_file *file_priv, struct drm_device *dev, struct drm_mode_create_dumb *args); -int virtio_gpu_mode_dumb_destroy(struct drm_file *file_priv, - struct drm_device *dev, - uint32_t handle); int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv, struct drm_device *dev, uint32_t handle, uint64_t *offset_p); diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index cc025d8..72ad7b1 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -118,13 +118,6 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv, return ret; }
-int virtio_gpu_mode_dumb_destroy(struct drm_file *file_priv, - struct drm_device *dev, - uint32_t handle) -{ - return drm_gem_handle_delete(file_priv, handle); -} - int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv, struct drm_device *dev, uint32_t handle, uint64_t *offset_p)
Den 23.07.2017 21.16, skrev Noralf Trønnes:
This adds defaults for the drm_driver.dumb_destroy and drm_driver.dumb_map_offset callbacks as discussed with Daniel.
vmwgfx is the only driver that doesn't use drm_gem_dumb_destroy().
vgem
vgem changes behaviour after this, because it didn't have .dumb_destroy set, something the docs mandates.
This patchset is part of a process to add a shmem gem library like the cma library. The common parts between the two goes into core or helpers.
Noralf.
Philipp made me aware that I forgot to remove drm_gem_cma_dumb_map_offset(). I'll make a follow up patch when this is merged.
Noralf.
Noralf Trønnes (41): drm/gem: Add drm_gem_dumb_map_offset() drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy drm/arc: Use .dumb_map_offset and .dumb_destroy defaults drm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults drm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults drm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults drm/kirin: Use .dumb_map_offset and .dumb_destroy defaults drm/imx: Use .dumb_map_offset and .dumb_destroy defaults drm/meson: Use .dumb_map_offset and .dumb_destroy defaults drm/mxsfb: Use .dumb_map_offset and .dumb_destroy defaults drm/pl111: Use .dumb_map_offset and .dumb_destroy defaults drm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults drm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults drm/sti: Use .dumb_map_offset and .dumb_destroy defaults drm/stm: Use .dumb_map_offset and .dumb_destroy defaults drm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults drm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults drm/vc4: Use .dumb_map_offset and .dumb_destroy defaults drm/zte: Use .dumb_map_offset and .dumb_destroy defaults drm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults drm/gma500: Use .dumb_map_offset and .dumb_destroy defaults drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults drm/tegra: Use .dumb_map_offset and .dumb_destroy defaults drm/cirrus: Use the drm_driver.dumb_destroy default drm/udl: Use the drm_driver.dumb_destroy default drm/qxl: Use the drm_driver.dumb_destroy default drm/amdgpu: Use the drm_driver.dumb_destroy default drm/omapdrm: Use the drm_driver.dumb_destroy default drm/ast: Use the drm_driver.dumb_destroy default drm/nouveau: Use the drm_driver.dumb_destroy default drm/i915: Use the drm_driver.dumb_destroy default drm/msm: Use the drm_driver.dumb_destroy default drm/exynos: Use the drm_driver.dumb_destroy default drm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default drm/mgag200: Use the drm_driver.dumb_destroy default drm/radeon: Use the drm_driver.dumb_destroy default drm/bochs: Use the drm_driver.dumb_destroy default drm/armada: Use the drm_driver.dumb_destroy default drm/virtio: Use the drm_driver.dumb_destroy default
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 - drivers/gpu/drm/arc/arcpgu_drv.c | 2 -- drivers/gpu/drm/arm/hdlcd_drv.c | 2 -- drivers/gpu/drm/arm/malidp_drv.c | 2 -- drivers/gpu/drm/armada/armada_drv.c | 1 - drivers/gpu/drm/armada/armada_gem.c | 6 ----- drivers/gpu/drm/armada/armada_gem.h | 2 -- drivers/gpu/drm/ast/ast_drv.c | 1 - drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 -- drivers/gpu/drm/bochs/bochs_drv.c | 1 - drivers/gpu/drm/cirrus/cirrus_drv.c | 1 - drivers/gpu/drm/drm_dumb_buffers.c | 26 ++++++++++++------ drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 -- drivers/gpu/drm/gma500/gem.c | 30 --------------------- drivers/gpu/drm/gma500/psb_drv.c | 2 -- drivers/gpu/drm/gma500/psb_drv.h | 2 -- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 - drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 -- drivers/gpu/drm/i915/i915_drv.c | 1 - drivers/gpu/drm/imx/imx-drm-core.c | 2 -- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 -- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 25 ------------------ drivers/gpu/drm/mediatek/mtk_drm_gem.h | 3 --- drivers/gpu/drm/meson/meson_drv.c | 2 -- drivers/gpu/drm/mgag200/mgag200_drv.c | 1 - drivers/gpu/drm/msm/msm_drv.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 -- drivers/gpu/drm/nouveau/nouveau_drm.c | 1 - drivers/gpu/drm/omapdrm/omap_drv.c | 1 - drivers/gpu/drm/pl111/pl111_drv.c | 2 -- drivers/gpu/drm/qxl/qxl_drv.c | 1 - drivers/gpu/drm/radeon/radeon_drv.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 26 ------------------ drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 3 --- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 -- drivers/gpu/drm/sti/sti_drv.c | 2 -- drivers/gpu/drm/stm/drv.c | 2 -- drivers/gpu/drm/sun4i/sun4i_drv.c | 2 -- drivers/gpu/drm/tegra/drm.c | 2 -- drivers/gpu/drm/tegra/gem.c | 21 --------------- drivers/gpu/drm/tegra/gem.h | 2 -- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 -- drivers/gpu/drm/udl/udl_drv.c | 1 - drivers/gpu/drm/vc4/vc4_drv.c | 2 -- drivers/gpu/drm/virtio/virtgpu_drv.c | 1 - drivers/gpu/drm/virtio/virtgpu_drv.h | 3 --- drivers/gpu/drm/virtio/virtgpu_gem.c | 7 ----- drivers/gpu/drm/zte/zx_drm_drv.c | 2 -- include/drm/drm_gem.h | 2 ++ include/drm/tinydrm/tinydrm.h | 4 +-- 54 files changed, 56 insertions(+), 201 deletions(-)
-- 2.7.4
On Mon, Jul 24, 2017 at 09:39:08PM +0200, Noralf Trønnes wrote:
Den 23.07.2017 21.16, skrev Noralf Trønnes:
This adds defaults for the drm_driver.dumb_destroy and drm_driver.dumb_map_offset callbacks as discussed with Daniel.
vmwgfx is the only driver that doesn't use drm_gem_dumb_destroy().
vgem
vgem changes behaviour after this, because it didn't have .dumb_destroy set, something the docs mandates.
This patchset is part of a process to add a shmem gem library like the cma library. The common parts between the two goes into core or helpers.
Noralf.
Philipp made me aware that I forgot to remove drm_gem_cma_dumb_map_offset(). I'll make a follow up patch when this is merged.
Great work, and others already started reviewing. I suggest you start merging as the acks/r-bs land and then resend in 2-3 weeks with the remaining patches. I can then go through them and review the leftovers.
Cheers, Daniel
Noralf.
Noralf Trønnes (41): drm/gem: Add drm_gem_dumb_map_offset() drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy drm/arc: Use .dumb_map_offset and .dumb_destroy defaults drm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults drm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults drm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults drm/kirin: Use .dumb_map_offset and .dumb_destroy defaults drm/imx: Use .dumb_map_offset and .dumb_destroy defaults drm/meson: Use .dumb_map_offset and .dumb_destroy defaults drm/mxsfb: Use .dumb_map_offset and .dumb_destroy defaults drm/pl111: Use .dumb_map_offset and .dumb_destroy defaults drm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults drm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults drm/sti: Use .dumb_map_offset and .dumb_destroy defaults drm/stm: Use .dumb_map_offset and .dumb_destroy defaults drm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults drm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults drm/vc4: Use .dumb_map_offset and .dumb_destroy defaults drm/zte: Use .dumb_map_offset and .dumb_destroy defaults drm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults drm/gma500: Use .dumb_map_offset and .dumb_destroy defaults drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults drm/tegra: Use .dumb_map_offset and .dumb_destroy defaults drm/cirrus: Use the drm_driver.dumb_destroy default drm/udl: Use the drm_driver.dumb_destroy default drm/qxl: Use the drm_driver.dumb_destroy default drm/amdgpu: Use the drm_driver.dumb_destroy default drm/omapdrm: Use the drm_driver.dumb_destroy default drm/ast: Use the drm_driver.dumb_destroy default drm/nouveau: Use the drm_driver.dumb_destroy default drm/i915: Use the drm_driver.dumb_destroy default drm/msm: Use the drm_driver.dumb_destroy default drm/exynos: Use the drm_driver.dumb_destroy default drm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default drm/mgag200: Use the drm_driver.dumb_destroy default drm/radeon: Use the drm_driver.dumb_destroy default drm/bochs: Use the drm_driver.dumb_destroy default drm/armada: Use the drm_driver.dumb_destroy default drm/virtio: Use the drm_driver.dumb_destroy default
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 - drivers/gpu/drm/arc/arcpgu_drv.c | 2 -- drivers/gpu/drm/arm/hdlcd_drv.c | 2 -- drivers/gpu/drm/arm/malidp_drv.c | 2 -- drivers/gpu/drm/armada/armada_drv.c | 1 - drivers/gpu/drm/armada/armada_gem.c | 6 ----- drivers/gpu/drm/armada/armada_gem.h | 2 -- drivers/gpu/drm/ast/ast_drv.c | 1 - drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 -- drivers/gpu/drm/bochs/bochs_drv.c | 1 - drivers/gpu/drm/cirrus/cirrus_drv.c | 1 - drivers/gpu/drm/drm_dumb_buffers.c | 26 ++++++++++++------ drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 -- drivers/gpu/drm/gma500/gem.c | 30 --------------------- drivers/gpu/drm/gma500/psb_drv.c | 2 -- drivers/gpu/drm/gma500/psb_drv.h | 2 -- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 - drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 -- drivers/gpu/drm/i915/i915_drv.c | 1 - drivers/gpu/drm/imx/imx-drm-core.c | 2 -- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 -- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 25 ------------------ drivers/gpu/drm/mediatek/mtk_drm_gem.h | 3 --- drivers/gpu/drm/meson/meson_drv.c | 2 -- drivers/gpu/drm/mgag200/mgag200_drv.c | 1 - drivers/gpu/drm/msm/msm_drv.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 -- drivers/gpu/drm/nouveau/nouveau_drm.c | 1 - drivers/gpu/drm/omapdrm/omap_drv.c | 1 - drivers/gpu/drm/pl111/pl111_drv.c | 2 -- drivers/gpu/drm/qxl/qxl_drv.c | 1 - drivers/gpu/drm/radeon/radeon_drv.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 26 ------------------ drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 3 --- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 -- drivers/gpu/drm/sti/sti_drv.c | 2 -- drivers/gpu/drm/stm/drv.c | 2 -- drivers/gpu/drm/sun4i/sun4i_drv.c | 2 -- drivers/gpu/drm/tegra/drm.c | 2 -- drivers/gpu/drm/tegra/gem.c | 21 --------------- drivers/gpu/drm/tegra/gem.h | 2 -- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 -- drivers/gpu/drm/udl/udl_drv.c | 1 - drivers/gpu/drm/vc4/vc4_drv.c | 2 -- drivers/gpu/drm/virtio/virtgpu_drv.c | 1 - drivers/gpu/drm/virtio/virtgpu_drv.h | 3 --- drivers/gpu/drm/virtio/virtgpu_gem.c | 7 ----- drivers/gpu/drm/zte/zx_drm_drv.c | 2 -- include/drm/drm_gem.h | 2 ++ include/drm/tinydrm/tinydrm.h | 4 +-- 54 files changed, 56 insertions(+), 201 deletions(-)
-- 2.7.4
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
On 07/23/2017 09:16 PM, Noralf Trønnes wrote:
This adds defaults for the drm_driver.dumb_destroy and drm_driver.dumb_map_offset callbacks as discussed with Daniel.
vmwgfx is the only driver that doesn't use drm_gem_dumb_destroy().
vgem
vgem changes behaviour after this, because it didn't have .dumb_destroy set, something the docs mandates.
This patchset is part of a process to add a shmem gem library like the cma library. The common parts between the two goes into core or helpers.
Noralf.
Noralf Trønnes (41): drm/gem: Add drm_gem_dumb_map_offset() drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy drm/arc: Use .dumb_map_offset and .dumb_destroy defaults drm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults drm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults drm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults drm/kirin: Use .dumb_map_offset and .dumb_destroy defaults drm/imx: Use .dumb_map_offset and .dumb_destroy defaults drm/meson: Use .dumb_map_offset and .dumb_destroy defaults drm/mxsfb: Use .dumb_map_offset and .dumb_destroy defaults drm/pl111: Use .dumb_map_offset and .dumb_destroy defaults drm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults drm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults drm/sti: Use .dumb_map_offset and .dumb_destroy defaults drm/stm: Use .dumb_map_offset and .dumb_destroy defaults
for stm
Tested-by: Philippe Cornu philippe.cornu@st.com
Many thanks for the cleanup. Philippe :-)
drm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults drm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults drm/vc4: Use .dumb_map_offset and .dumb_destroy defaults drm/zte: Use .dumb_map_offset and .dumb_destroy defaults drm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults drm/gma500: Use .dumb_map_offset and .dumb_destroy defaults drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults drm/tegra: Use .dumb_map_offset and .dumb_destroy defaults drm/cirrus: Use the drm_driver.dumb_destroy default drm/udl: Use the drm_driver.dumb_destroy default drm/qxl: Use the drm_driver.dumb_destroy default drm/amdgpu: Use the drm_driver.dumb_destroy default drm/omapdrm: Use the drm_driver.dumb_destroy default drm/ast: Use the drm_driver.dumb_destroy default drm/nouveau: Use the drm_driver.dumb_destroy default drm/i915: Use the drm_driver.dumb_destroy default drm/msm: Use the drm_driver.dumb_destroy default drm/exynos: Use the drm_driver.dumb_destroy default drm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default drm/mgag200: Use the drm_driver.dumb_destroy default drm/radeon: Use the drm_driver.dumb_destroy default drm/bochs: Use the drm_driver.dumb_destroy default drm/armada: Use the drm_driver.dumb_destroy default drm/virtio: Use the drm_driver.dumb_destroy default
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 - drivers/gpu/drm/arc/arcpgu_drv.c | 2 -- drivers/gpu/drm/arm/hdlcd_drv.c | 2 -- drivers/gpu/drm/arm/malidp_drv.c | 2 -- drivers/gpu/drm/armada/armada_drv.c | 1 - drivers/gpu/drm/armada/armada_gem.c | 6 ----- drivers/gpu/drm/armada/armada_gem.h | 2 -- drivers/gpu/drm/ast/ast_drv.c | 1 - drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 -- drivers/gpu/drm/bochs/bochs_drv.c | 1 - drivers/gpu/drm/cirrus/cirrus_drv.c | 1 - drivers/gpu/drm/drm_dumb_buffers.c | 26 ++++++++++++------ drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 -- drivers/gpu/drm/gma500/gem.c | 30 --------------------- drivers/gpu/drm/gma500/psb_drv.c | 2 -- drivers/gpu/drm/gma500/psb_drv.h | 2 -- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 - drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 -- drivers/gpu/drm/i915/i915_drv.c | 1 - drivers/gpu/drm/imx/imx-drm-core.c | 2 -- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 -- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 25 ------------------ drivers/gpu/drm/mediatek/mtk_drm_gem.h | 3 --- drivers/gpu/drm/meson/meson_drv.c | 2 -- drivers/gpu/drm/mgag200/mgag200_drv.c | 1 - drivers/gpu/drm/msm/msm_drv.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 -- drivers/gpu/drm/nouveau/nouveau_drm.c | 1 - drivers/gpu/drm/omapdrm/omap_drv.c | 1 - drivers/gpu/drm/pl111/pl111_drv.c | 2 -- drivers/gpu/drm/qxl/qxl_drv.c | 1 - drivers/gpu/drm/radeon/radeon_drv.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 26 ------------------ drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 3 --- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 -- drivers/gpu/drm/sti/sti_drv.c | 2 -- drivers/gpu/drm/stm/drv.c | 2 -- drivers/gpu/drm/sun4i/sun4i_drv.c | 2 -- drivers/gpu/drm/tegra/drm.c | 2 -- drivers/gpu/drm/tegra/gem.c | 21 --------------- drivers/gpu/drm/tegra/gem.h | 2 -- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 -- drivers/gpu/drm/udl/udl_drv.c | 1 - drivers/gpu/drm/vc4/vc4_drv.c | 2 -- drivers/gpu/drm/virtio/virtgpu_drv.c | 1 - drivers/gpu/drm/virtio/virtgpu_drv.h | 3 --- drivers/gpu/drm/virtio/virtgpu_gem.c | 7 ----- drivers/gpu/drm/zte/zx_drm_drv.c | 2 -- include/drm/drm_gem.h | 2 ++ include/drm/tinydrm/tinydrm.h | 4 +-- 54 files changed, 56 insertions(+), 201 deletions(-)
-- 2.7.4
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Den 23.07.2017 21.16, skrev Noralf Trønnes:
This adds defaults for the drm_driver.dumb_destroy and drm_driver.dumb_map_offset callbacks as discussed with Daniel.
vmwgfx is the only driver that doesn't use drm_gem_dumb_destroy().
vgem
vgem changes behaviour after this, because it didn't have .dumb_destroy set, something the docs mandates.
This patchset is part of a process to add a shmem gem library like the cma library. The common parts between the two goes into core or helpers.
Noralf.
Thanks for reviews and testing. The first batch is applied to drm-misc-next:
[01/41] drm/gem: Add drm_gem_dumb_map_offset() [02/41] drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy [03/41] drm/arc: Use .dumb_map_offset and .dumb_destroy defaults [04/41] drm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults [05/41] drm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults [06/41] drm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults [09/41] drm/imx: Use .dumb_map_offset and .dumb_destroy defaults [12/41] drm/pl111: Use .dumb_map_offset and .dumb_destroy defaults [13/41] drm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults [14/41] drm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults [16/41] drm/stm: Use .dumb_map_offset and .dumb_destroy defaults [17/41] drm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults [18/41] drm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults [19/41] drm/vc4: Use .dumb_map_offset and .dumb_destroy defaults [20/41] drm/zte: Use .dumb_map_offset and .dumb_destroy defaults [21/41] drm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults [22/41] drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults [24/41] drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults [29/41] drm/amdgpu: Use the drm_driver.dumb_destroy default [30/41] drm/omapdrm: Use the drm_driver.dumb_destroy default [32/41] drm/nouveau: Use the drm_driver.dumb_destroy default [36/41] drm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default
Noralf Trønnes (41): drm/gem: Add drm_gem_dumb_map_offset() drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy drm/arc: Use .dumb_map_offset and .dumb_destroy defaults drm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults drm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults drm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults drm/kirin: Use .dumb_map_offset and .dumb_destroy defaults drm/imx: Use .dumb_map_offset and .dumb_destroy defaults drm/meson: Use .dumb_map_offset and .dumb_destroy defaults drm/mxsfb: Use .dumb_map_offset and .dumb_destroy defaults drm/pl111: Use .dumb_map_offset and .dumb_destroy defaults drm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults drm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults drm/sti: Use .dumb_map_offset and .dumb_destroy defaults drm/stm: Use .dumb_map_offset and .dumb_destroy defaults drm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults drm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults drm/vc4: Use .dumb_map_offset and .dumb_destroy defaults drm/zte: Use .dumb_map_offset and .dumb_destroy defaults drm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults drm/gma500: Use .dumb_map_offset and .dumb_destroy defaults drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults drm/tegra: Use .dumb_map_offset and .dumb_destroy defaults drm/cirrus: Use the drm_driver.dumb_destroy default drm/udl: Use the drm_driver.dumb_destroy default drm/qxl: Use the drm_driver.dumb_destroy default drm/amdgpu: Use the drm_driver.dumb_destroy default drm/omapdrm: Use the drm_driver.dumb_destroy default drm/ast: Use the drm_driver.dumb_destroy default drm/nouveau: Use the drm_driver.dumb_destroy default drm/i915: Use the drm_driver.dumb_destroy default drm/msm: Use the drm_driver.dumb_destroy default drm/exynos: Use the drm_driver.dumb_destroy default drm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default drm/mgag200: Use the drm_driver.dumb_destroy default drm/radeon: Use the drm_driver.dumb_destroy default drm/bochs: Use the drm_driver.dumb_destroy default drm/armada: Use the drm_driver.dumb_destroy default drm/virtio: Use the drm_driver.dumb_destroy default
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 - drivers/gpu/drm/arc/arcpgu_drv.c | 2 -- drivers/gpu/drm/arm/hdlcd_drv.c | 2 -- drivers/gpu/drm/arm/malidp_drv.c | 2 -- drivers/gpu/drm/armada/armada_drv.c | 1 - drivers/gpu/drm/armada/armada_gem.c | 6 ----- drivers/gpu/drm/armada/armada_gem.h | 2 -- drivers/gpu/drm/ast/ast_drv.c | 1 - drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 -- drivers/gpu/drm/bochs/bochs_drv.c | 1 - drivers/gpu/drm/cirrus/cirrus_drv.c | 1 - drivers/gpu/drm/drm_dumb_buffers.c | 26 ++++++++++++------ drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++ drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 -- drivers/gpu/drm/gma500/gem.c | 30 --------------------- drivers/gpu/drm/gma500/psb_drv.c | 2 -- drivers/gpu/drm/gma500/psb_drv.h | 2 -- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 - drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 -- drivers/gpu/drm/i915/i915_drv.c | 1 - drivers/gpu/drm/imx/imx-drm-core.c | 2 -- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 -- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 25 ------------------ drivers/gpu/drm/mediatek/mtk_drm_gem.h | 3 --- drivers/gpu/drm/meson/meson_drv.c | 2 -- drivers/gpu/drm/mgag200/mgag200_drv.c | 1 - drivers/gpu/drm/msm/msm_drv.c | 1 - drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 -- drivers/gpu/drm/nouveau/nouveau_drm.c | 1 - drivers/gpu/drm/omapdrm/omap_drv.c | 1 - drivers/gpu/drm/pl111/pl111_drv.c | 2 -- drivers/gpu/drm/qxl/qxl_drv.c | 1 - drivers/gpu/drm/radeon/radeon_drv.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 -- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 26 ------------------ drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 3 --- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 -- drivers/gpu/drm/sti/sti_drv.c | 2 -- drivers/gpu/drm/stm/drv.c | 2 -- drivers/gpu/drm/sun4i/sun4i_drv.c | 2 -- drivers/gpu/drm/tegra/drm.c | 2 -- drivers/gpu/drm/tegra/gem.c | 21 --------------- drivers/gpu/drm/tegra/gem.h | 2 -- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 -- drivers/gpu/drm/udl/udl_drv.c | 1 - drivers/gpu/drm/vc4/vc4_drv.c | 2 -- drivers/gpu/drm/virtio/virtgpu_drv.c | 1 - drivers/gpu/drm/virtio/virtgpu_drv.h | 3 --- drivers/gpu/drm/virtio/virtgpu_gem.c | 7 ----- drivers/gpu/drm/zte/zx_drm_drv.c | 2 -- include/drm/drm_gem.h | 2 ++ include/drm/tinydrm/tinydrm.h | 4 +-- 54 files changed, 56 insertions(+), 201 deletions(-)
-- 2.7.4
dri-devel@lists.freedesktop.org