aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tegra/gem.c
diff options
context:
space:
mode:
authorThomas Zimmermann <[email protected]>2020-09-23 10:21:52 +0000
committerThomas Zimmermann <[email protected]>2020-09-25 07:21:23 +0000
commitdd311c6fe8af1b176165b828a35553af16f9710c (patch)
tree19c5d12aa4219da92474561bd22c8941ffbb3ad2 /drivers/gpu/drm/tegra/gem.c
parentdrm/rockchip: Convert to drm_gem_object_funcs (diff)
downloadkernel-dd311c6fe8af1b176165b828a35553af16f9710c.tar.gz
kernel-dd311c6fe8af1b176165b828a35553af16f9710c.zip
drm/tegra: 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 tegra. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Thierry Reding <[email protected]> Acked-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/tegra/gem.c')
-rw-r--r--drivers/gpu/drm/tegra/gem.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 47e2935b8c68..d481dea4738d 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -231,6 +231,12 @@ static int tegra_bo_iommu_unmap(struct tegra_drm *tegra, struct tegra_bo *bo)
return 0;
}
+static const struct drm_gem_object_funcs tegra_gem_object_funcs = {
+ .free = tegra_bo_free_object,
+ .export = tegra_gem_prime_export,
+ .vm_ops = &tegra_bo_vm_ops,
+};
+
static struct tegra_bo *tegra_bo_alloc_object(struct drm_device *drm,
size_t size)
{
@@ -241,6 +247,8 @@ static struct tegra_bo *tegra_bo_alloc_object(struct drm_device *drm,
if (!bo)
return ERR_PTR(-ENOMEM);
+ bo->gem.funcs = &tegra_gem_object_funcs;
+
host1x_bo_init(&bo->base, &tegra_bo_ops);
size = round_up(size, PAGE_SIZE);