aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tegra/gem.c
diff options
context:
space:
mode:
authorMikko Perttunen <[email protected]>2021-06-10 11:04:47 +0000
committerThierry Reding <[email protected]>2021-08-10 12:44:31 +0000
commitf51632cc0ed35b42d5ca1793e364e5942b236ae8 (patch)
tree533462abb4690ca61d1cf263e8656ef6b238b6a8 /drivers/gpu/drm/tegra/gem.c
parentgpu: host1x: Add option to skip firewall for a job (diff)
downloadkernel-f51632cc0ed35b42d5ca1793e364e5942b236ae8.tar.gz
kernel-f51632cc0ed35b42d5ca1793e364e5942b236ae8.zip
drm/tegra: Extract tegra_gem_lookup()
The static function host1x_bo_lookup() in drm.c is also useful elsewhere. Extract it as tegra_gem_lookup() in gem.c. Signed-off-by: Mikko Perttunen <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/tegra/gem.c')
-rw-r--r--drivers/gpu/drm/tegra/gem.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 26af8daa9a16..6ec598f5d5b3 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -707,3 +707,16 @@ struct drm_gem_object *tegra_gem_prime_import(struct drm_device *drm,
return &bo->gem;
}
+
+struct host1x_bo *tegra_gem_lookup(struct drm_file *file, u32 handle)
+{
+ struct drm_gem_object *gem;
+ struct tegra_bo *bo;
+
+ gem = drm_gem_object_lookup(file, handle);
+ if (!gem)
+ return NULL;
+
+ bo = to_tegra_bo(gem);
+ return &bo->base;
+}