drm/amdgpu: Move to gtt before cpu accesses dma buf.
authorSamuel Li <Samuel.Li@amd.com>
Fri, 8 Dec 2017 21:18:59 +0000 (16:18 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Feb 2018 19:17:41 +0000 (14:17 -0500)
commit09052fc3769c98e1ce1c4f3398da8201548fc449
tree3e0458c399b494996ed5268fc2969bb36419b8c7
parent6e227308a91db544c6f91edcf37c56764db2ae47
drm/amdgpu: Move to gtt before cpu accesses dma buf.

To improve cpu read performance. This is implemented for APUs currently.

v2: Adapt to change https://lists.freedesktop.org/archives/amd-gfx/2017-October/015174.html
v3: Adapt to change "forward begin_cpu_access callback to drivers"
v4: Instead of v3, reuse drm_gem dmabuf_ops here. Also some minor fixes as suggested.
v5: only set dma_buf ops when it is valid (Samuel)

Signed-off-by: Samuel Li <Samuel.Li@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c