aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLijo Lazar <[email protected]>2021-03-02 16:28:43 +0800
committerAlex Deucher <[email protected]>2021-03-23 23:02:05 -0400
commitf78313fae91c33bf0d0622f5bebe5f72cbbd9d88 (patch)
treec9d28d6665d659416ee953ad530afb1a9f15a226
parenta364782f490d4a1e36be8e26083c774dbb2bafde (diff)
drm/amdgpu: Check if FB BAR is enabled for ROM read
Some configurations don't have FB BAR enabled. Avoid reading ROM image from FB BAR region in such cases. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index efdf639f6593..f454a6bd0ed6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -97,6 +97,10 @@ static bool igp_read_bios_from_vram(struct amdgpu_device *adev)
if (amdgpu_device_need_post(adev))
return false;
+ /* FB BAR not enabled */
+ if (pci_resource_len(adev->pdev, 0) == 0)
+ return false;
+
adev->bios = NULL;
vram_base = pci_resource_start(adev->pdev, 0);
bios = ioremap_wc(vram_base, size);