diff options
author | Mikko Perttunen <mperttunen@nvidia.com> | 2021-06-10 14:04:47 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2021-08-10 14:44:31 +0200 |
commit | f51632cc0ed35b42d5ca1793e364e5942b236ae8 (patch) | |
tree | 533462abb4690ca61d1cf263e8656ef6b238b6a8 /drivers/gpu/drm/tegra/gem.c | |
parent | 0fddaa85d66140466df8e848afcda452b7d7b416 (diff) |
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 <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra/gem.c')
-rw-r--r-- | drivers/gpu/drm/tegra/gem.c | 13 |
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; +} |