summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/armada/armada_gem.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2020-09-23 12:21:39 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2020-09-25 09:20:13 +0200
commitad01dd0376afbd7a39d78da543f5a048d4ae14c9 (patch)
treefb271d99a36e53738d93359203f37dc52bcb7c03 /drivers/gpu/drm/armada/armada_gem.c
parent246cb7e49a70e5c4b71caed5df518693c345bab7 (diff)
downloadlinux-stable-ad01dd0376afbd7a39d78da543f5a048d4ae14c9.tar.gz
linux-stable-ad01dd0376afbd7a39d78da543f5a048d4ae14c9.tar.bz2
linux-stable-ad01dd0376afbd7a39d78da543f5a048d4ae14c9.zip
drm/armada: Introduce GEM object functions
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in armada. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Acked-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200923102159.24084-3-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/armada/armada_gem.c')
-rw-r--r--drivers/gpu/drm/armada/armada_gem.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c
index ecf8a55e93d9..c343fbefe47c 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -25,7 +25,7 @@ static vm_fault_t armada_gem_vm_fault(struct vm_fault *vmf)
return vmf_insert_pfn(vmf->vma, vmf->address, pfn);
}
-const struct vm_operations_struct armada_gem_vm_ops = {
+static const struct vm_operations_struct armada_gem_vm_ops = {
.fault = armada_gem_vm_fault,
.open = drm_gem_vm_open,
.close = drm_gem_vm_close,
@@ -184,6 +184,12 @@ armada_gem_map_object(struct drm_device *dev, struct armada_gem_object *dobj)
return dobj->addr;
}
+static const struct drm_gem_object_funcs armada_gem_object_funcs = {
+ .free = armada_gem_free_object,
+ .export = armada_gem_prime_export,
+ .vm_ops = &armada_gem_vm_ops,
+};
+
struct armada_gem_object *
armada_gem_alloc_private_object(struct drm_device *dev, size_t size)
{
@@ -195,6 +201,8 @@ armada_gem_alloc_private_object(struct drm_device *dev, size_t size)
if (!obj)
return NULL;
+ obj->obj.funcs = &armada_gem_object_funcs;
+
drm_gem_private_object_init(dev, &obj->obj, size);
DRM_DEBUG_DRIVER("alloc private obj %p size %zu\n", obj, size);
@@ -214,6 +222,8 @@ static struct armada_gem_object *armada_gem_alloc_object(struct drm_device *dev,
if (!obj)
return NULL;
+ obj->obj.funcs = &armada_gem_object_funcs;
+
if (drm_gem_object_init(dev, &obj->obj, size)) {
kfree(obj);
return NULL;