move more drivers to gem_free_object_unlocked
Subsystems (2)
cover move more drivers to gem_free_object_unlocked
Hi all,
Random drive-by crusade against dev->struct_mutex usage. The only two leftover drivers still relying on gem_free_object and the magic lifetime rule that hodling dev->struct_mutex will prevent gem object destruction are msm and gma500. Both actually need this, and don't look like they can be fixed with an easy patch.
But the less this pattern is in the tree the more we can hopefully avoid copypasta-spreading it more.
Cheers, Daniel
Daniel Vetter (6):
drm/tinydrm: Use gem_free_object_unlocked staging/vboxvideo: Use gem_free_object_unlocked drm/rockchip: fixup comment for gem_free_object_unlocked drm/udl: Get rid of dev->struct_mutex usage drm/omapdrm: Fix mm_list locking
drm/omapdrm: Switch to gem_free_object_unlocked
drivers/gpu/drm/omapdrm/omap_debugfs.c | 2 ++ drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++-- drivers/gpu/drm/omapdrm/omap_drv.h | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c | 11 +++++++---- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 4 ++-- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 2 +- drivers/gpu/drm/udl/udl_dmabuf.c | 5 +++-- drivers/gpu/drm/udl/udl_drv.c | 2 +- drivers/gpu/drm/udl/udl_drv.h | 2 ++ drivers/gpu/drm/udl/udl_gem.c | 5 +++-- drivers/gpu/drm/udl/udl_main.c | 2 ++ drivers/staging/vboxvideo/vbox_drv.c | 2 +- include/drm/tinydrm/tinydrm.h | 2 +- 13 files changed, 28 insertions(+), 17 deletions(-)
Signature · 6 lines
2.16.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/6 drm/tinydrm: Use gem_free_object_unlocked
tinydrm doesn't use dev->struct_mutex and therefore has no need to use gem_free_object.
--- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 2 +- include/drm/tinydrm/tinydrm.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tinydrm/core/tinydrm-core.c +1 -1
@@ -91,7 +91,7 @@ EXPORT_SYMBOL(tinydrm_gem_cma_prime_import_sg_table);* GEM object state and frees the memory used to store the object itself using * drm_gem_cma_free_object(). It also handles PRIME buffers which has the kernel * virtual address set by tinydrm_gem_cma_prime_import_sg_table(). Drivers -* can use this as their &drm_driver->gem_free_object callback. +* can use this as their &drm_driver->gem_free_object_unlocked callback. */ void tinydrm_gem_cma_free_object (struct drm_gem_object *gem_obj) {
include/drm/tinydrm/tinydrm.h +1 -1
@@ -41,7 +41,7 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe)* the &drm_driver structure. */ #define TINYDRM_GEM_DRIVER_OPS \ - .gem_free_object = tinydrm_gem_cma_free_object, \ + .gem_free_object_unlocked = tinydrm_gem_cma_free_object, \ .gem_print_info = drm_gem_cma_print_info, \ .gem_vm_ops = &drm_gem_cma_vm_ops, \ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \
Signature · 6 lines
2.16.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/6] drm/tinydrm: Use gem_free_object_unlocked
Den 22.03.2018 11.51, skrev Daniel Vetter:
Quoted 6 lines
tinydrm doesn't use
dev->struct_mutexand therefore has no need to usegem_free_object.Signed-off-by Daniel Vetter <[email protected]>Cc "Noralf Trønnes" <[email protected]>---
Quoted 22 lines
drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 2 +- include/drm/tinydrm/tinydrm.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/tinydrm/core/tinydrm-core.c +1
-1@@ -91,7 +91,7 @@ EXPORT_SYMBOL(tinydrm_gem_cma_prime_import_sg_table);* GEM object state and frees the memory used to store the object itself using * drm_gem_cma_free_object(). It also handles PRIME buffers which has the kernel * virtual address set by tinydrm_gem_cma_prime_import_sg_table(). Drivers -* can use this as their &drm_driver->gem_free_object callback. +* can use this as their &drm_driver->gem_free_object_unlocked callback. */ void tinydrm_gem_cma_free_object (struct drm_gem_object *gem_obj) {include/drm/tinydrm/tinydrm.h +0
-0
include/drm/tinydrm/tinydrm.h pipe_to_tinydrm(struct drm_simple_display_pipe *pipe) · line 47
Quoted 8 lines
include/drm/tinydrm/tinydrm.h +1
-1@@ -41,7 +41,7 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe)* the &drm_driver structure. */ #define TINYDRM_GEM_DRIVER_OPS \ - .gem_free_object = tinydrm_gem_cma_free_object, \ + .gem_free_object_unlocked = tinydrm_gem_cma_free_object, \ .gem_print_info = drm_gem_cma_print_info, \ .gem_vm_ops = &drm_gem_cma_vm_ops, \ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/6] drm/tinydrm: Use gem_free_object_unlocked
Quoted 10 lines · Noralf Trønnes
Den 22.03.2018 11.51, skrev Daniel Vetter:
Quoted 6 lines
tinydrm doesn't use
dev->struct_mutexand therefore has no need to usegem_free_object.Signed-off-by Daniel Vetter <[email protected]>Cc "Noralf Trønnes" <[email protected]>---
Acked-by Noralf Trønnes <[email protected]>
Thanks for your ack, applied. Somehow something is wrong with my mailer and ate the other 5 patches. Even in the resend. I'll try again. -Daniel
Quoted 32 lines
Quoted 31 lines
drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 2 +- include/drm/tinydrm/tinydrm.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/tinydrm/core/tinydrm-core.c +1
-1@@ -91,7 +91,7 @@ EXPORT_SYMBOL(tinydrm_gem_cma_prime_import_sg_table);* GEM object state and frees the memory used to store the object itself using * drm_gem_cma_free_object(). It also handles PRIME buffers which has the kernel * virtual address set by tinydrm_gem_cma_prime_import_sg_table(). Drivers -* can use this as their &drm_driver->gem_free_object callback. +* can use this as their &drm_driver->gem_free_object_unlocked callback. */ void tinydrm_gem_cma_free_object (struct drm_gem_object *gem_obj) {include/drm/tinydrm/tinydrm.h +1
-1@@ -41,7 +41,7 @@ pipe_to_tinydrm(struct drm_simple_display_pipe *pipe)* the &drm_driver structure. */ #define TINYDRM_GEM_DRIVER_OPS \ - .gem_free_object = tinydrm_gem_cma_free_object, \ + .gem_free_object_unlocked = tinydrm_gem_cma_free_object, \ .gem_print_info = drm_gem_cma_print_info, \ .gem_vm_ops = &drm_gem_cma_vm_ops, \ .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \
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