aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-07-24 15:07:52 -0400
committerDave Airlie <airlied@gmail.com>2013-07-25 06:47:06 -0400
commit0de23977cfeb5b357ec884ba15417ae118ff9e9b (patch)
treebad8f04fc993b778020f6a2f7e9e7d2be8deb293 /drivers/gpu/host1x
parentfe3078fa5c367186c94a6652581ffbe9ccea4640 (diff)
drm/gem: convert to new unified vma manager
Use the new vma manager instead of the old hashtable. Also convert all drivers to use the new convenience helpers. This drops all the (map_list.hash.key << PAGE_SHIFT) non-sense. Locking and access-management is exactly the same as before with an additional lock inside of the vma-manager, which strictly wouldn't be needed for gem. v2: - rebase on drm-next - init nodes via drm_vma_node_reset() in drm_gem.c v3: - fix tegra v4: - remove duplicate if (drm_vma_node_has_offset()) checks - inline now trivial drm_vma_node_offset_addr() calls v5: - skip node-reset on gem-init due to kzalloc() - do not allow mapping gem-objects with offsets (backwards compat) - remove unneccessary casts Cc: Inki Dae <inki.dae@samsung.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@gmail.com>
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r--drivers/gpu/host1x/drm/gem.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/host1x/drm/gem.c b/drivers/gpu/host1x/drm/gem.c
index c5e9a9b494c2..bc323b3dbe4d 100644
--- a/drivers/gpu/host1x/drm/gem.c
+++ b/drivers/gpu/host1x/drm/gem.c
@@ -108,7 +108,7 @@ static void tegra_bo_destroy(struct drm_device *drm, struct tegra_bo *bo)
108 108
109unsigned int tegra_bo_get_mmap_offset(struct tegra_bo *bo) 109unsigned int tegra_bo_get_mmap_offset(struct tegra_bo *bo)
110{ 110{
111 return (unsigned int)bo->gem.map_list.hash.key << PAGE_SHIFT; 111 return (unsigned int)drm_vma_node_offset_addr(&bo->gem.vma_node);
112} 112}
113 113
114struct tegra_bo *tegra_bo_create(struct drm_device *drm, unsigned int size) 114struct tegra_bo *tegra_bo_create(struct drm_device *drm, unsigned int size)
@@ -182,8 +182,7 @@ void tegra_bo_free_object(struct drm_gem_object *gem)
182{ 182{
183 struct tegra_bo *bo = to_tegra_bo(gem); 183 struct tegra_bo *bo = to_tegra_bo(gem);
184 184
185 if (gem->map_list.map) 185 drm_gem_free_mmap_offset(gem);
186 drm_gem_free_mmap_offset(gem);
187 186
188 drm_gem_object_release(gem); 187 drm_gem_object_release(gem);
189 tegra_bo_destroy(gem->dev, bo); 188 tegra_bo_destroy(gem->dev, bo);