drm/shmem-helper: Pass GEM shmem object in public interfaces
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 8 Nov 2021 09:31:49 +0000 (10:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:19 +0000 (14:23 +0200)
commitff0087df198d9be0e78281d044946185f0fc437e
tree7e4f1ea2d1284a7835ba2772ea9d7275f3648bd6
parent4109ff9e7b95775ca84cbde9745569cfc85b672e
drm/shmem-helper: Pass GEM shmem object in public interfaces

[ Upstream commit a193f3b4e050e35c506a34d0870c838d8e0b0449 ]

Change all GEM SHMEM object functions that receive a GEM object
of type struct drm_gem_object to expect an object of type
struct drm_gem_shmem_object instead.

This change reduces the number of upcasts from struct drm_gem_object
by moving them into callers. The C compiler can now verify that the
GEM SHMEM functions are called with the correct type.

For consistency, the patch also renames drm_gem_shmem_free_object to
drm_gem_shmem_free. It further updates documentation for a number of
functions.

v3:
* fix docs for drm_gem_shmem_object_free()
v2:
* mention _object_ callbacks in docs (Daniel)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20211108093149.7226-4-tzimmermann@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/drm_gem_shmem_helper.c
drivers/gpu/drm/lima/lima_gem.c
drivers/gpu/drm/lima/lima_sched.c
drivers/gpu/drm/panfrost/panfrost_drv.c
drivers/gpu/drm/panfrost/panfrost_gem.c
drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c
drivers/gpu/drm/panfrost/panfrost_mmu.c
drivers/gpu/drm/panfrost/panfrost_perfcnt.c
drivers/gpu/drm/v3d/v3d_bo.c
drivers/gpu/drm/virtio/virtgpu_object.c
include/drm/drm_gem_shmem_helper.h