Skip to contentSkip to conversation

drm: Improve dumb callback docs

PATCH In review Daniel Vetter 2 participants 2 messages Nov 27, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Improve dumb callback docs

Noticed while reviewing a patch from Eric. Also add a todo for the dumb_map_offset callbacks (it should be simple to do, but piles of work). Plus fix up vbox, because vbox.

Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Nicholas Mc Guire <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Fabio Rafael da Rosa <[email protected]>
---
 Documentation/gpu/todo.rst           | 10 ++++++++++
 drivers/staging/vboxvideo/vbox_drv.c |  1 -
 include/drm/drm_drv.h                |  9 +++++++--
 3 files changed, 17 insertions(+), 3 deletions(-)
Documentation/gpu/todo.rst +10 -0
index 31ef4adc91c9..8c2df0ed37d9 100644
@@ -28,6 +28,16 @@ them, but also all the virtual ones used by KVM, so everyone qualifies).
 
 Contact: Daniel Vetter, Thierry Reding, respective driver maintainers
 
+Remove custom dumb_map_offset implementations
+---------------------------------------------
+
+All GEM based drivers should be using drm_gem_create_mmap_offset() instead.
+Audit each individual driver, make sure it'll work with the generic
+implementation (there's lots of outdated locking leftovers in various
+implementations), and then remove it.
+
+Contact: Daniel Vetter, respective driver maintainers
+
 Switch from reference/unreference to get/put
 --------------------------------------------
 
drivers/staging/vboxvideo/vbox_drv.c +0 -1
index 257030460fb6..d3e23dd70c1b 100644
@@ -279,7 +279,6 @@ static struct drm_driver driver = {
 	.gem_free_object_unlocked = vbox_gem_free_object,
 	.dumb_create = vbox_dumb_create,
 	.dumb_map_offset = vbox_dumb_mmap_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,
include/drm/drm_drv.h +7 -2
index dbb2f6ad184a..c3d6d53555d3 100644
@@ -527,8 +527,10 @@ struct drm_driver {
 	 * @dumb_map_offset:
 	 *
 	 * Allocate an offset in the drm device node's address space to be able to
-	 * memory map a dumb buffer. GEM-based drivers must use
-	 * drm_gem_create_mmap_offset() to implement this.
+	 * memory map a dumb buffer.
+	 *
+	 * The default implementation is drm_gem_create_mmap_offset(). GEM based
+	 * drivers must not overwrite this.
 	 *
 	 * Called by the user via ioctl.
 	 *
@@ -548,6 +550,9 @@ struct drm_driver {
 	 *
 	 * Called by the user via ioctl.
 	 *
+	 * The default implementation is drm_gem_dumb_destroy(). GEM based drivers
+	 * must not overwrite this.
+	 *
 	 * Returns:
 	 *
 	 * Zero on success, negative errno on failure.
Signature · 6 lines
2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Daniel Vetter

Noticed while reviewing a patch from Eric. Also add a todo for the dumb_map_offset callbacks (it should be simple to do, but piles of work). Plus fix up vbox, because vbox.

Quoted 10 lines
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Nicholas Mc Guire <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Fabio Rafael da Rosa <[email protected]>

Maxime

Signature · 3 lines
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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