]> git.itanic.dy.fi Git - linux-stable/commit
drm/amdgpu: fix AGP addressing when GART is not at 0
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 10 Nov 2023 14:39:18 +0000 (09:39 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 Nov 2023 21:49:22 +0000 (16:49 -0500)
commitca0b006939f9701ab2e14a08ed9ef77a8014d2c5
tree0d3dbecab6d21ca11a7b946d6c842d866bb4d477
parentbcdbd6f607bacb51743ac73f13f40d015cb9de53
drm/amdgpu: fix AGP addressing when GART is not at 0

This worked by luck if the GART aperture ended up at 0.  When
we ended up moving GART on some chips, the GART aperture ended
up offsetting the AGP address since the resource->start is
a GART offset, not an MC address.  Fix this by moving the AGP
address setup into amdgpu_bo_gpu_offset_no_check().

v2: check mem_type before checking agp
v3: check if the ttm bo has a ttm_tt allocated yet

Fixes: 67318cb84341 ("drm/amdgpu/gmc11: set gart placement GC11")
Tested-by: Mario Limonciello <mario.limonciello@amd.com>
Reported-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reported-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: christian.koenig@amd.com
Cc: mario.limonciello@amd.com
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c