Skip to content

Commit f8794f3

Browse files
committed
drm/amdgpu: there is no vbios fb on devices with no display hw (v2)
If we enable virtual display functionality on parts with no display hardware we can end up trying to check for and reserve the vbios FB area on devices where it doesn't exist. Check if display hardware is actually present on the hardware before trying to reserve the memory. v2: move the check into common code Acked-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 6f9eea4 commit f8794f3

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,7 @@ void amdgpu_device_pcie_port_wreg(struct amdgpu_device *adev,
12931293
u32 reg, u32 v);
12941294
struct dma_fence *amdgpu_device_switch_gang(struct amdgpu_device *adev,
12951295
struct dma_fence *gang);
1296+
bool amdgpu_device_has_display_hardware(struct amdgpu_device *adev);
12961297

12971298
/* atpx handler */
12981299
#if defined(CONFIG_VGA_SWITCHEROO)

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6044,3 +6044,44 @@ struct dma_fence *amdgpu_device_switch_gang(struct amdgpu_device *adev,
60446044
dma_fence_put(old);
60456045
return NULL;
60466046
}
6047+
6048+
bool amdgpu_device_has_display_hardware(struct amdgpu_device *adev)
6049+
{
6050+
switch (adev->asic_type) {
6051+
#ifdef CONFIG_DRM_AMDGPU_SI
6052+
case CHIP_HAINAN:
6053+
#endif
6054+
case CHIP_TOPAZ:
6055+
/* chips with no display hardware */
6056+
return false;
6057+
#ifdef CONFIG_DRM_AMDGPU_SI
6058+
case CHIP_TAHITI:
6059+
case CHIP_PITCAIRN:
6060+
case CHIP_VERDE:
6061+
case CHIP_OLAND:
6062+
#endif
6063+
#ifdef CONFIG_DRM_AMDGPU_CIK
6064+
case CHIP_BONAIRE:
6065+
case CHIP_HAWAII:
6066+
case CHIP_KAVERI:
6067+
case CHIP_KABINI:
6068+
case CHIP_MULLINS:
6069+
#endif
6070+
case CHIP_TONGA:
6071+
case CHIP_FIJI:
6072+
case CHIP_POLARIS10:
6073+
case CHIP_POLARIS11:
6074+
case CHIP_POLARIS12:
6075+
case CHIP_VEGAM:
6076+
case CHIP_CARRIZO:
6077+
case CHIP_STONEY:
6078+
/* chips with display hardware */
6079+
return true;
6080+
default:
6081+
/* IP discovery */
6082+
if (!adev->ip_versions[DCE_HWIP][0] ||
6083+
(adev->harvest_ip_mask & AMD_HARVEST_IP_DMU_MASK))
6084+
return false;
6085+
return true;
6086+
}
6087+
}

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
656656
}
657657

658658
if (amdgpu_sriov_vf(adev) ||
659-
!amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE)) {
659+
!amdgpu_device_has_display_hardware(adev)) {
660660
size = 0;
661661
} else {
662662
size = amdgpu_gmc_get_vbios_fb_size(adev);

0 commit comments

Comments
 (0)