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)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 15 Nov 2021 10:46:13 +0000 (11:46 +0100)
commita193f3b4e050e35c506a34d0870c838d8e0b0449
tree62c77f876684db7295560173d6311cd4c708b157
parentc7fbcb7149ff9321bbbcc93c9920de534ea8102c
drm/shmem-helper: Pass GEM shmem object in public interfaces

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
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