]> 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 23:09:00 +0000 (18:09 -0500)
commite222b36e9649404cc0770a6d778d69cf73bcd440
tree4a8c48624f224e5391fc680dd6bedaf0408e49ac
parentc92da0403d373c03ea5c65c0260c7db6762013b0
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