drm/amdgpu/gmc: use PCI BARs for APUs in passthrough
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Mar 2022 23:02:11 +0000 (18:02 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:34:14 +0000 (09:34 +0200)
commit37bc29a445384f4bdfc734dfe7f763ede604acfe
tree696c660d7cecaef20883ef392f3fe8b78c5be5b4
parent5a3b56a4a1c79111bc4aaa9caba5eb5e9cfaeaeb
drm/amdgpu/gmc: use PCI BARs for APUs in passthrough

[ Upstream commit b818a5d374542ccec73dcfe578a081574029820e ]

If the GPU is passed through to a guest VM, use the PCI
BAR for CPU FB access rather than the physical address of
carve out.  The physical address is not valid in a guest.

v2: Fix HDP handing as suggested by Michel

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c