Skip to contentSkip to conversation

drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy

PATCH Superseded Noralf Trønnes 16 participants 78 messages Jul 23, 2017 – Aug 4, 2017

Subsystems (42)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy

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

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

PATCH 1/41 drm/gem: Add drm_gem_dumb_map_offset()

Add a common drm_driver.dumb_map_offset function for GEM backed drivers.

---
 drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++
 include/drm/drm_gem.h     |  2 ++
 2 files changed, 37 insertions(+)
drivers/gpu/drm/drm_gem.c +35 -0
index 5df028a..a8d396b 100644
@@ -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
include/drm/drm_gem.h +2 -0
index 4a9d231..9c55c2a 100644
@@ -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);
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/41
#3 lore raw

Re: [PATCH 01/41] drm/gem: Add drm_gem_dumb_map_offset()

In reply to Noralf Trønnes

Hi Noralf,

Thank you for the patch.

Quoted 3 lines · 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.

Quoted 64 lines
---
 drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++
 include/drm/drm_gem.h     |  2 ++
 2 files changed, 37 insertions(+)
drivers/gpu/drm/drm_gem.c +35 -0
index 5df028a..a8d396b 100644
@@ -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
include/drm/drm_gem.h +0 -0
index 4a9d231..9c55c2a 100644
@@ -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,

include/drm/drm_gem.h +0 -0
 			 struct drm_device *dev,
 			 uint32_t handle);
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

Re: [PATCH 01/41] drm/gem: Add drm_gem_dumb_map_offset()

In reply to Noralf Trønnes

Hi Noralf,

Quoted 29 lines · Noralf Trønnes

Add a common drm_driver.dumb_map_offset function for GEM backed drivers.

---
 drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++
 include/drm/drm_gem.h     |  2 ++
 2 files changed, 37 insertions(+)
drivers/gpu/drm/drm_gem.c +13 -0
index 5df028a..a8d396b 100644
@@ -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,

drivers/gpu/drm/drm_gem.c drm_gem_handle_delete(struct drm_file *filp, u32 handle) · line 336

Quoted 10 lines
drivers/gpu/drm/drm_gem.c +10 -0
+                           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_main.c#n292
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Re: [PATCH 01/41] drm/gem: Add drm_gem_dumb_map_offset()

Den 26.07.2017 14.05, skrev Emil Velikov:

Quoted 39 lines

Hi Noralf,

Quoted 35 lines · Noralf Trønnes

Add a common drm_driver.dumb_map_offset function for GEM backed drivers.

---
  drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++
  include/drm/drm_gem.h     |  2 ++
  2 files changed, 37 insertions(+)
drivers/gpu/drm/drm_gem.c +19 -0
index 5df028a..a8d396b 100644
@@ -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);
Quoted 8 lines

drivers/gpu/drm/drm_gem.c drm_gem_handle_delete(struct drm_file *filp, u32 handle) · line 336

Quoted 4 lines
drivers/gpu/drm/drm_gem.c +4 -0
+       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.

Quoted 7 lines

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.

Quoted 7 lines

That said, I could be loosing my marbles.

HTH
Emil

[1] https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/cirrus/cirrus_main.c#n292

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Re: [PATCH 01/41] drm/gem: Add drm_gem_dumb_map_offset()

Quoted 65 lines · Noralf Trønnes

Den 26.07.2017 14.05, skrev Emil Velikov:

Quoted 46 lines

Hi Noralf,

Quoted 41 lines · Noralf Trønnes

Add a common drm_driver.dumb_map_offset function for GEM backed drivers.

---
  drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++
  include/drm/drm_gem.h     |  2 ++
  2 files changed, 37 insertions(+)
drivers/gpu/drm/drm_gem.c +1 -0
index 5df028a..a8d396b 100644
@@ -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,

drivers/gpu/drm/drm_gem.c +7 -0
+                           u32 handle, u64 *offset)
+{
+       struct drm_gem_object *obj;
+       int ret;
+
+       obj = drm_gem_object_lookup(file, handle);
+       if (!obj)
Quoted 8 lines

drivers/gpu/drm/drm_gem.c drm_gem_handle_delete(struct drm_file *filp, u32 handle) · line 336

Quoted 3 lines
drivers/gpu/drm/drm_gem.c +3 -0
+               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).

Quoted 5 lines

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.

Quoted 17 lines
Quoted 7 lines

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.

Quoted 3 lines

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
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw

Re: [PATCH 01/41] drm/gem: Add drm_gem_dumb_map_offset()

Den 27.07.2017 02.13, skrev Emil Velikov:

Quoted 97 lines · Noralf Trønnes
Quoted 60 lines

Den 26.07.2017 14.05, skrev Emil Velikov:

Quoted 43 lines

Hi Noralf,

Quoted 39 lines · Noralf Trønnes

Add a common drm_driver.dumb_map_offset function for GEM backed drivers.

---
   drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++
   include/drm/drm_gem.h     |  2 ++
   2 files changed, 37 insertions(+)
drivers/gpu/drm/drm_gem.c +1 -0
index 5df028a..a8d396b 100644
@@ -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,

drivers/gpu/drm/drm_gem.c +6 -0
+                           u32 handle, u64 *offset)
+{
+       struct drm_gem_object *obj;
+       int ret;
+
+       obj = drm_gem_object_lookup(file, handle);
Quoted 8 lines

drivers/gpu/drm/drm_gem.c drm_gem_handle_delete(struct drm_file *filp, u32 handle) · line 336

Quoted 4 lines
drivers/gpu/drm/drm_gem.c +4 -0
+       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).

Quoted 5 lines

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.

Quoted 16 lines
Quoted 7 lines

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.

Quoted 3 lines

You say "some drivers", can you name them?
Some drivers takes locks or do other stuff that made me skip them.

Quoted 6 lines

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.

Quoted 9 lines

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

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

Re: [PATCH 01/41] drm/gem: Add drm_gem_dumb_map_offset()

In reply to Noralf Trønnes

Hi Noralf,

Quoted 52 lines · On Wednesday 26 Jul 2017 20:41:53 Noralf Trønnes wrote:

Den 26.07.2017 14.05, skrev Emil Velikov:

Quoted 42 lines · Noralf Trønnes
Quoted 41 lines

Add a common drm_driver.dumb_map_offset function for GEM backed drivers.

---

  drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++
  include/drm/drm_gem.h     |  2 ++
  2 files changed, 37 insertions(+)
drivers/gpu/drm/drm_gem.c +0 -0
index 5df028a..a8d396b 100644
@@ -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,

drivers/gpu/drm/drm_gem.c +7 -0
+                           u32 handle, u64 *offset)
+{
+       struct drm_gem_object *obj;
+       int ret;
+
+       obj = drm_gem_object_lookup(file, handle);
+       if (!obj)
Quoted 8 lines

drivers/gpu/drm/drm_gem.c drm_gem_handle_delete(struct drm_file *filp, u32 handle) · line 336

Quoted 3 lines
drivers/gpu/drm/drm_gem.c +3 -0
+               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.

Quoted 6 lines

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.

Quoted 13 lines

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.

Quoted 7 lines

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.

Quoted 7 lines

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.

Quoted 13 lines

You say "some drivers", can you name them?
Some drivers takes locks or do other stuff that made me skip them.

Noralf.

Quoted 8 lines

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

Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/41
#9 lore raw

Re: [PATCH 01/41] drm/gem: Add drm_gem_dumb_map_offset()

In reply to Noralf Trønnes
Quoted 3 lines · Noralf Trønnes

Add a common drm_driver.dumb_map_offset function for GEM backed drivers.

Quoted 71 lines
---
 drivers/gpu/drm/drm_gem.c | 35 +++++++++++++++++++++++++++++++++++
 include/drm/drm_gem.h     |  2 ++
 2 files changed, 37 insertions(+)
drivers/gpu/drm/drm_gem.c +35 -0
index 5df028a..a8d396b 100644
@@ -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
include/drm/drm_gem.h +2 -0
index 4a9d231..9c55c2a 100644
@@ -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);
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw

PATCH 2/41 drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy

In reply to Noralf Trønnes

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.

---
 drivers/gpu/drm/drm_dumb_buffers.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)
drivers/gpu/drm/drm_dumb_buffers.c +18 -8
index 10307cc..cd68ab4 100644
@@ -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);
 }
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 2/41
#11 lore raw
Quoted 22 lines · Noralf Trønnes

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.

---
 drivers/gpu/drm/drm_dumb_buffers.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)
drivers/gpu/drm/drm_dumb_buffers.c +1 -0
index 10307cc..cd68ab4 100644
@@ -24,6 +24,7 @@
  */
 
 #include <drm/drmP.h>
+#include <drm/drm_gem.h>
 
 #include "drm_crtc_internal.h"
 

drivers/gpu/drm/drm_dumb_buffers.c line 48

Quoted 9 lines
drivers/gpu/drm/drm_dumb_buffers.c +3 -3
@@ -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:

Thanks for working on these cleanups!

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 2/41
#12 lore raw
In reply to Noralf Trønnes
Quoted 5 lines · Noralf Trønnes

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.

With Eric's suggestion:

Quoted 72 lines
---
 drivers/gpu/drm/drm_dumb_buffers.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)
drivers/gpu/drm/drm_dumb_buffers.c +18 -8
index 10307cc..cd68ab4 100644
@@ -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);
 }
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#13 lore raw

PATCH 3/41 drm/arc: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/arc/arcpgu_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/arc/arcpgu_drv.c +0 -2
index 3e43a5d..415b7da 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 3/41
#14 lore raw

RE: [PATCH 03/41] drm/arc: Use .dumb_map_offset and .dumb_destroy defaults

#15 lore raw

PATCH 4/41 drm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/arm/hdlcd_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/arm/hdlcd_drv.c +0 -2
index 90bd97b..f9bda7b 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 4/41
#16 lore raw

Re: [PATCH 04/41] drm/arm: hdlcd: Use .dumb_map_offset and .dumb_destroy defaults

Hi Noralf,

Thanks for the patch,

Quoted 5 lines · Noralf Tr??nnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

Quoted 20 lines

---
drivers/gpu/drm/arm/hdlcd_drv.c | 2 --

1 file changed, 2 deletions(-)
drivers/gpu/drm/arm/hdlcd_drv.c +0 -2
index 90bd97b..f9bda7b 100644
@@ -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,
Signature · 1 line
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#17 lore raw

PATCH 5/41 drm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

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 <[email protected]>
Cc Brian Starkey <[email protected]>
---
 drivers/gpu/drm/arm/malidp_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/arm/malidp_drv.c +0 -2
index a6a05a7..1a57cc2 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 5/41
#18 lore raw

Re: [PATCH 05/41] drm/arm: mali-dp: Use .dumb_map_offset and .dumb_destroy defaults

Hi Noralf,

Quoted 6 lines · Noralf Tr??nnes

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 <[email protected]>
Cc Brian Starkey <[email protected]>
Quoted 20 lines

---
drivers/gpu/drm/arm/malidp_drv.c | 2 --

1 file changed, 2 deletions(-)
drivers/gpu/drm/arm/malidp_drv.c +0 -2
index a6a05a7..1a57cc2 100644
@@ -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,
Signature · 1 line
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#19 lore raw

PATCH 6/41 drm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -2
index 64f54dc..74d66e1 100644
@@ -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",
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 6/41
#20 lore raw

Re: [PATCH 06/41] drm/atmel-hlcdc: Use .dumb_map_offset and .dumb_destroy defaults

Quoted 5 lines · Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

Quoted 9 lines
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -0
index 64f54dc..74d66e1 100644

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c static struct drm_driver atmel_hlcdc_dc_driver = { · line 766

Quoted 8 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -2
@@ -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",

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#21 lore raw

PATCH 7/41 drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

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 <[email protected]>
Cc Alison Wang <[email protected]>
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -2
index 5cbde19..58e9e06 100644
@@ -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",
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v1 7/41
#22 lore raw

Re: [PATCH 07/41] drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults

Quoted 6 lines · Noralf Trønnes

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 <[email protected]>
Cc Alison Wang <[email protected]>

--
Stefan

Quoted 10 lines
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -0
index 5cbde19..58e9e06 100644

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static struct drm_driver fsl_dcu_drm_driver = { · line 181

Quoted 8 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -2
@@ -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",

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author Applied
#23 lore raw

Re: [PATCH 07/41] drm/fsl-dcu: Use .dumb_map_offset and .dumb_destroy defaults

Den 29.07.2017 19.24, skrev Stefan Agner:

Quoted 8 lines · Noralf Trønnes
Quoted 6 lines

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 <[email protected]>
Cc Alison Wang <[email protected]>

Thanks, applied to drm-misc.

Noralf.

Quoted 7 lines

--
Stefan

Quoted 4 lines
---
  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 --
  1 file changed, 2 deletions(-)
Quoted 14 lines
Quoted 6 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -0
index 5cbde19..58e9e06 100644

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static struct drm_driver fsl_dcu_drm_driver = { · line 181

Quoted 8 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -2
@@ -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",

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#24 lore raw

PATCH 8/41 drm/kirin: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

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 <[email protected]>
Cc Rongrong Zou <[email protected]>
Cc Xinwei Kong <[email protected]>
Cc Chen Feng <[email protected]>
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +0 -2
index 1178341..6ecc401 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#25 lore raw

PATCH 9/41 drm/imx: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/imx/imx-drm-core.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/imx/imx-drm-core.c +0 -2
index f5c6212..f91cb72 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v1 9/41
#26 lore raw

Re: [PATCH 09/41] drm/imx: Use .dumb_map_offset and .dumb_destroy defaults

Quoted 14 lines · Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/imx/imx-drm-core.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/imx/imx-drm-core.c +0 -0
index f5c6212..f91cb72 100644

drivers/gpu/drm/imx/imx-drm-core.c static struct drm_driver imx_drm_driver = { · line 185

Quoted 4 lines
drivers/gpu/drm/imx/imx-drm-core.c +0 -1
@@ -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?

drivers/gpu/drm/imx/imx-drm-core.c static struct drm_driver imx_drm_driver = { · line 187

Quoted 4 lines
drivers/gpu/drm/imx/imx-drm-core.c +0 -1
-	.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,

regards
Philipp

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#27 lore raw

Re: [PATCH 09/41] drm/imx: Use .dumb_map_offset and .dumb_destroy defaults

Den 24.07.2017 09.46, skrev Philipp Zabel:

Quoted 10 lines · Noralf Trønnes
Quoted 9 lines

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
  drivers/gpu/drm/imx/imx-drm-core.c | 2 --
  1 file changed, 2 deletions(-)
Quoted 10 lines

drivers/gpu/drm/imx/imx-drm-core.c static struct drm_driver imx_drm_driver = { · line 185

Quoted 9 lines
drivers/gpu/drm/imx/imx-drm-core.c +0 -1
index f5c6212..f91cb72 100644
@@ -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.

Quoted 9 lines

drivers/gpu/drm/imx/imx-drm-core.c static struct drm_driver imx_drm_driver = { · line 187

Quoted 4 lines
drivers/gpu/drm/imx/imx-drm-core.c +0 -1
-	.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,

regards
Philipp

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#28 lore raw

PATCH 10/41 drm/meson: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/meson/meson_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/meson/meson_drv.c +0 -2
index 5375e6d..7742c7d 100644
@@ -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,
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#29 lore raw

PATCH 11/41 drm/mxsfb: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/mxsfb/mxsfb_drv.c +0 -2
index a34f41c..622d170 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#30 lore raw

PATCH 12/41 drm/pl111: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/pl111/pl111_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/pl111/pl111_drv.c +0 -2
index 8907bc2..29653fe 100644
@@ -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,
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#32 lore raw

PATCH 13/41 drm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

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 <[email protected]>
---
 drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -2
index d6a0255..c09cf84 100644
@@ -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",
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 13/41
#33 lore raw

Re: [PATCH 13/41] drm/rcar-du: Use .dumb_map_offset and .dumb_destroy defaults

Hi Noralf,

Thank you for the patch.

Quoted 5 lines · 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 <[email protected]>
Quoted 17 lines
---
 drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 --
 1 file changed, 2 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index d6a0255..c09cf84 100644

drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -2
@@ -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",
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#34 lore raw

PATCH 14/41 drm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

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 <[email protected]>
---
 drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/shmobile/shmob_drm_drv.c +0 -2
index c2ca073..5925725 100644
@@ -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",
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 14/41
#35 lore raw

Re: [PATCH 14/41] drm/shmobile: Use .dumb_map_offset and .dumb_destroy defaults

Hi Noralf,

Thank you for the patch.

Quoted 5 lines · 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 <[email protected]>
Quoted 17 lines
---
 drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/shmobile/shmob_drm_drv.c index c2ca073..5925725 100644

drivers/gpu/drm/shmobile/shmob_drm_drv.c +0 -2
@@ -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",
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#36 lore raw

PATCH 15/41 drm/sti: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

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 <[email protected]>
Cc Vincent Abriou <[email protected]>
---
 drivers/gpu/drm/sti/sti_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/sti/sti_drv.c +0 -2
index 06ef1e38..1700c54 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#37 lore raw

PATCH 16/41 drm/stm: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

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 <[email protected]>
Cc Philippe Cornu <[email protected]>
Cc Benjamin Gaignard <[email protected]>
Cc Vincent Abriou <[email protected]>
---
 drivers/gpu/drm/stm/drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/stm/drv.c +0 -2
index 095971f..b333b37 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Tested-by Acked-by on v1 16/41
#38 lore raw

Re: [PATCH 16/41] drm/stm: Use .dumb_map_offset and .dumb_destroy defaults

Quoted 18 lines · Noralf Trønnes

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 <[email protected]>
Cc Philippe Cornu <[email protected]>
Cc Benjamin Gaignard <[email protected]>
Cc Vincent Abriou <[email protected]>
---
  drivers/gpu/drm/stm/drv.c | 2 --
  1 file changed, 2 deletions(-)
drivers/gpu/drm/stm/drv.c +0 -0
index 095971f..b333b37 100644

drivers/gpu/drm/stm/drv.c static struct drm_driver drv_driver = { · line 65

Quoted 8 lines
drivers/gpu/drm/stm/drv.c +0 -2
@@ -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,

Many thanks for the cleanup.

Philippe :-)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#39 lore raw

PATCH 17/41 drm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/sun4i/sun4i_drv.c +0 -2
index 89cd590..d599206 100644
@@ -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,
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 17/41
#40 lore raw

Re: [PATCH 17/41] drm/sun4i: Use .dumb_map_offset and .dumb_destroy defaults

Quoted 14 lines · Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/sun4i/sun4i_drv.c +0 -0
index 89cd590..d599206 100644

drivers/gpu/drm/sun4i/sun4i_drv.c static struct drm_driver sun4i_drv_driver = { · line 44

Quoted 7 lines
drivers/gpu/drm/sun4i/sun4i_drv.c +0 -2
@@ -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,

Thanks!
Maxime

Signature · 3 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#41 lore raw

PATCH 18/41 drm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

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 <[email protected]>
Cc Tomi Valkeinen <[email protected]>
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +0 -2
index 049d2f5..b0d70f9 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 18/41
#42 lore raw

Re: [PATCH 18/41] drm/tilcdc: Use .dumb_map_offset and .dumb_destroy defaults

Quoted 6 lines · Noralf Trønnes

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 <[email protected]>
Cc Tomi Valkeinen <[email protected]>

Thanks!

Quoted 10 lines
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +0 -0
index 049d2f5..b0d70f9 100644

drivers/gpu/drm/tilcdc/tilcdc_drv.c static struct drm_driver tilcdc_driver = { · line 547

Quoted 8 lines
drivers/gpu/drm/tilcdc/tilcdc_drv.c +0 -2
@@ -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,

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#43 lore raw

PATCH 19/41 drm/vc4: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/vc4/vc4_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/vc4/vc4_drv.c +0 -2
index c6b487c..d0ba20f 100644
@@ -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),
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#45 lore raw

PATCH 20/41 drm/zte: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 drivers/gpu/drm/zte/zx_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/zte/zx_drm_drv.c +0 -2
index c983cdf..4524482 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 20/41
#46 lore raw

Re: [PATCH 20/41] drm/zte: Use .dumb_map_offset and .dumb_destroy defaults

Quoted 4 lines · Noralf Trønnes

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 <[email protected]>
Quoted 21 lines
---
 drivers/gpu/drm/zte/zx_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/zte/zx_drm_drv.c +0 -2
index c983cdf..4524482 100644
@@ -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,
Signature · 1 line
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#47 lore raw

PATCH 21/41 drm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

tinydrm can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 include/drm/tinydrm/tinydrm.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
include/drm/tinydrm/tinydrm.h +1 -3
index 00b800d..4774fe3 100644
@@ -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
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 21/41
#48 lore raw

Re: [PATCH 21/41] drm/tinydrm: Use .dumb_map_offset and .dumb_destroy defaults

Quoted 4 lines · Noralf Trønnes

tinydrm can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

Quoted 26 lines
---
 include/drm/tinydrm/tinydrm.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
include/drm/tinydrm/tinydrm.h +1 -3
index 00b800d..4774fe3 100644
@@ -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
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#49 lore raw

PATCH 22/41 drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 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(-)
drivers/gpu/drm/mediatek/mtk_drm_drv.c +0 -2
index f0cb276..a2ca90f 100644
@@ -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,
drivers/gpu/drm/mediatek/mtk_drm_gem.c +0 -25
index 7abc550..8ec963f 100644
@@ -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)
 
drivers/gpu/drm/mediatek/mtk_drm_gem.h +0 -3
index 2752718..534639b 100644
@@ -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);
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v1 22/41
#50 lore raw

Re: [PATCH 22/41] drm/mediatek: Use .dumb_map_offset and .dumb_destroy defaults

Quoted 6 lines · Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

regards
Philipp

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#51 lore raw

PATCH 23/41 drm/gma500: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

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 <[email protected]>
---
 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(-)
drivers/gpu/drm/gma500/gem.c +0 -30
index 7da061a..1312397 100644
@@ -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
drivers/gpu/drm/gma500/psb_drv.c +0 -2
index 747c06b..37a3be7 100644
@@ -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,
drivers/gpu/drm/gma500/psb_drv.h +0 -2
index 8366708..821497d 100644
@@ -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 */
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#52 lore raw

PATCH 24/41 drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 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(-)
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +0 -2
index 131cb5c..848edcf 100644
@@ -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,
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0 -26
index b74ac71..f74333e 100644
@@ -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
drivers/gpu/drm/rockchip/rockchip_drm_gem.h +0 -3
index 3f6ea4d..f237375 100644
@@ -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 */
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 24/41
#53 lore raw

Re: [PATCH 24/41] drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults

Quoted 46 lines · Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 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(-)
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +0 -2
index 131cb5c..848edcf 100644
@@ -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,
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0 -14
index b74ac71..f74333e 100644
@@ -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);

drivers/gpu/drm/rockchip/rockchip_drm_gem.c rockchip_gem_create_with_handle(struct drm_file *file_priv, · line 419

Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0 -10
-	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 :)

Quoted 24 lines
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0 -2
-}
-
 /*
  * rockchip_gem_dumb_create - (struct drm_driver)->dumb_create callback
  * function
drivers/gpu/drm/rockchip/rockchip_drm_gem.h +0 -3
index 3f6ea4d..f237375 100644
@@ -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 */
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#54 lore raw

PATCH 25/41 drm/tegra: Use .dumb_map_offset and .dumb_destroy defaults

In reply to Noralf Trønnes

This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them.

---
 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(-)
drivers/gpu/drm/tegra/drm.c +0 -2
index 3ba659a..224ce1d 100644
@@ -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),
drivers/gpu/drm/tegra/gem.c +0 -21
index 7a39a35..c6079af 100644
@@ -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;
drivers/gpu/drm/tegra/gem.h +0 -2
index 8b32a6f..8eb9fd2 100644
@@ -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);
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#55 lore raw

PATCH 26/41 drm/cirrus: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

Cc Dave Airlie <[email protected]>
Cc Gerd Hoffmann <[email protected]>
---
 drivers/gpu/drm/cirrus/cirrus_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/cirrus/cirrus_drv.c +0 -1
index 910c300..69c4e35 100644
@@ -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 = {
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#56 lore raw

PATCH 27/41 drm/udl: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

---
 drivers/gpu/drm/udl/udl_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/udl/udl_drv.c +0 -1
index 0f02e1ac..0b71865 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#57 lore raw

PATCH 28/41 drm/qxl: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

Cc Dave Airlie <[email protected]>
Cc Gerd Hoffmann <[email protected]>
---
 drivers/gpu/drm/qxl/qxl_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/qxl/qxl_drv.c +0 -1
index 403e135..2445e75 100644
@@ -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
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#58 lore raw

PATCH 29/41 drm/amdgpu: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

Cc Alex Deucher <[email protected]>
Cc Christian König <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
index 4699924..3c57102 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v1 29/41
#59 lore raw

RE: [PATCH 29/41] drm/amdgpu: Use the drm_driver.dumb_destroy default

Quoted 23 lines

-----Original Message-----
From: Noralf Trønnes [mailto:[email protected]]
Sent: Sunday, July 23, 2017 3:17 PM
To: [email protected]
Cc: Deucher, Alexander; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Koenig, Christian; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; maxime.ripard@free- electrons.com; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Noralf Trønnes
Subject: [PATCH 29/41] drm/amdgpu: Use the drm_driver.dumb_destroy default

Quoted 6 lines

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

Cc Alex Deucher <[email protected]>
Cc Christian König <[email protected]>

This and the radeon patch are:

Quoted 18 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -2
index 4699924..3c57102 100644
@@ -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,
--
Quoted 1 line

2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#60 lore raw

PATCH 30/41 drm/omapdrm: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

---
 drivers/gpu/drm/omapdrm/omap_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/omapdrm/omap_drv.c +0 -1
index 022029e..ce3341d 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 30/41
#61 lore raw

Re: [PATCH 30/41] drm/omapdrm: Use the drm_driver.dumb_destroy default

Hi Noralf,

Thank you for the patch.

Quoted 5 lines · 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.

Quoted 16 lines
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 1 -
 1 file changed, 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/omapdrm/omap_drv.c index 022029e..ce3341d 100644

drivers/gpu/drm/omapdrm/omap_drv.c +0 -1
@@ -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,
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#62 lore raw

PATCH 31/41 drm/ast: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

---
 drivers/gpu/drm/ast/ast_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/ast/ast_drv.c +0 -1
index 3022b39..69dab82 100644
@@ -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,
 
 };
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#63 lore raw

PATCH 32/41 drm/nouveau: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

---
 drivers/gpu/drm/nouveau/nouveau_drm.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_drm.c +0 -1
index 2600b3b..df7e203 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#64 lore raw

PATCH 33/41 drm/i915: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/i915_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.c +0 -1
index d310d82..4c96a72 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#65 lore raw

PATCH 34/41 drm/msm: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

---
 drivers/gpu/drm/msm/msm_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/msm_drv.c +0 -1
index f49f6ac..b0129e7 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#66 lore raw

PATCH 35/41 drm/exynos: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

Cc Joonyoung Shim <[email protected]>
Cc Seung-Woo Kim <[email protected]>
Cc Kyungmin Park <[email protected]>
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -1
index cab9e12..be91b8e 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#67 lore raw

PATCH 36/41 drm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +0 -1
index 4d018ca..d4f6f1f 100644
@@ -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,
 };
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 36/41
#68 lore raw

Re: [PATCH 36/41] drm/hisilicon: hibmc: Use the drm_driver.dumb_destroy default

Quoted 5 lines · Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

Quoted 23 lines
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +0 -1
index 4d018ca..d4f6f1f 100644
@@ -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,
 };
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#69 lore raw

PATCH 37/41 drm/mgag200: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

---
 drivers/gpu/drm/mgag200/mgag200_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_drv.c +0 -1
index 4189160..74cdde2 100644
@@ -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 = {
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#70 lore raw

PATCH 38/41 drm/radeon: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

Cc Alex Deucher <[email protected]>
Cc Christian König <[email protected]>
---
 drivers/gpu/drm/radeon/radeon_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/radeon/radeon_drv.c +0 -1
index b401f16..f4becad 100644
@@ -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,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#71 lore raw

PATCH 39/41 drm/bochs: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default, so no need to set it.

---
 drivers/gpu/drm/bochs/bochs_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/bochs/bochs_drv.c +0 -1
index a1d2884..7b203184 100644
@@ -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,
 };
 
 /* ---------------------------------------------------------------------- */
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#72 lore raw

PATCH 40/41 drm/armada: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

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.

---
 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(-)
drivers/gpu/drm/armada/armada_drv.c +0 -1
index 0b3227c..8a37b9a 100644
@@ -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,
drivers/gpu/drm/armada/armada_gem.c +0 -6
index a76ca21..9d69132 100644
@@ -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)
drivers/gpu/drm/armada/armada_gem.h +0 -2
index 6e524e0..78d5690 100644
@@ -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 *,
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#73 lore raw

PATCH 41/41 drm/virtio: Use the drm_driver.dumb_destroy default

In reply to Noralf Trønnes

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 <[email protected]>
Cc Gerd Hoffmann <[email protected]>
---
 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(-)
drivers/gpu/drm/virtio/virtgpu_drv.c +0 -1
index 63d35c7..49a3d8d 100644
@@ -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,
drivers/gpu/drm/virtio/virtgpu_drv.h +0 -3
index 3a66abb..da2fb58 100644
@@ -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);
drivers/gpu/drm/virtio/virtgpu_gem.c +0 -7
index cc025d8..72ad7b1 100644
@@ -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)
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#74 lore raw
In reply to Noralf Trønnes

Den 23.07.2017 21.16, skrev Noralf Trønnes:

Quoted 10 lines

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.

Quoted 5 lines

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.

Quoted 99 lines

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(-)
Quoted 3 lines

--
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#75 lore raw
Quoted 12 lines · Noralf Trønnes

Den 23.07.2017 21.16, skrev Noralf Trønnes:

Quoted 10 lines

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.

Quoted 8 lines
Quoted 5 lines

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

Quoted 110 lines

Noralf.

Quoted 99 lines

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(-)
Quoted 3 lines

--
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Tested-by on the v1 series
#76 lore raw
In reply to Noralf Trønnes
Quoted 25 lines · 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.

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

Quoted 8 lines

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

Many thanks for the cleanup.
Philippe :-)

Quoted 82 lines

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(-)
Quoted 8 lines

--
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#77 lore raw
In reply to Noralf Trønnes

Den 23.07.2017 21.16, skrev Noralf Trønnes:

Quoted 10 lines

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.

Quoted 5 lines

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

Quoted 99 lines

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(-)
Quoted 3 lines

--
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel