aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorDaniel Vetter <[email protected]>2019-07-25 15:26:54 +0200
committerDaniel Vetter <[email protected]>2019-07-31 10:19:23 +0200
commitb2ad978fd00467e8109918849a817018aaaeed19 (patch)
tree544da550c3d7c2b6eb69f046cbfb23ada421c1f5 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parentaa77e7f6d5d1e8e22907370fdbfe7a3431b16bac (diff)
drm/amdgpu: Fill out gem_object->resv
That way we can ditch our gem_prime_res_obj implementation. Since ttm absolutely needs the right reservation object all the boilerplate is already there and we just have to wire it up correctly. Note that gem/prime doesn't care when we do this, as long as we do it before the bo is registered and someone can call the handle2fd ioctl on it. Aside: ttm_buffer_object.ttm_resv could probably be ditched in favour of always passing a non-NULL resv to ttm_bo_init(). At least for gem drivers that would avoid having two of these, on in ttm_buffer_object and the other in drm_gem_object, one just there for confusion. Acked-by: Gerd Hoffmann <[email protected]> Cc: Gerd Hoffmann <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Alex Deucher <[email protected]> Cc: "Christian König" <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: "Michel Dänzer" <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Huang Rui <[email protected]> Cc: Felix Kuehling <[email protected]> Cc: Andrey Grodzovsky <[email protected]> Cc: Evan Quan <[email protected]> Cc: Sonny Jiang <[email protected]> Cc: Amber Lin <[email protected]> Cc: "Michał Mirosław" <[email protected]> Cc: Junwei Zhang <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Samuel Li <[email protected]> Reviewed-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index bea6f298dfdc..19ec775b7aa8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -509,6 +509,8 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
if (unlikely(r != 0))
return r;
+ bo->gem_base.resv = bo->tbo.resv;
+
if (!amdgpu_gmc_vram_full_visible(&adev->gmc) &&
bo->tbo.mem.mem_type == TTM_PL_VRAM &&
bo->tbo.mem.start < adev->gmc.visible_vram_size >> PAGE_SHIFT)