drm/amdgpu: fix broken debug sdma vram access function
authorJonathan Kim <jonathan.kim@amd.com>
Tue, 18 Jan 2022 15:48:49 +0000 (10:48 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 20 Jan 2022 03:33:03 +0000 (22:33 -0500)
commit590e86fe3462da81f1cbc4fc8d4cbf8b16b4f968
tree1fe0f0d20dcb2d2c1bd022b7995d72f7ac8ffae7
parent1b08dfb889b2c584b444538c9500af24ba0a6dc7
drm/amdgpu: fix broken debug sdma vram access function

Debug VRAM access through SDMA has several broken parts resulting in
silent MMIO fallback.

BO kernel creation takes the location of the cpu addr pointer, not
the pointer itself for address kmap.

drm_dev_enter return true on success so change access check.

The source BO is reserved but not pinned so find the address using the
cursor offset relative to its memory domain start.

Signed-off-by: Jonathan Kim <jonathan.kim@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_ttm.c