Skip to content

Commit 542a56e

Browse files
guilhermepiccolialexdeucher
authored andcommitted
drm/amdgpu/vcn: Disable indirect SRAM on Vangogh broken BIOSes
The VCN firmware loading path enables the indirect SRAM mode if it's advertised as supported. We might have some cases of FW issues that prevents this mode to working properly though, ending-up in a failed probe. An example below, observed in the Steam Deck: [...] [drm] failed to load ucode VCN0_RAM(0x3A) [drm] psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF0000) amdgpu 0000:04:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring vcn_dec_0 test failed (-110) [drm:amdgpu_device_init.cold [amdgpu]] *ERROR* hw_init of IP block <vcn_v3_0> failed -110 amdgpu 0000:04:00.0: amdgpu: amdgpu_device_ip_init failed amdgpu 0000:04:00.0: amdgpu: Fatal error during GPU init [...] Disabling the VCN block circumvents this, but it's a very invasive workaround that turns off the entire feature. So, let's add a quirk on VCN loading that checks for known problematic BIOSes on Vangogh, so we can proactively disable the indirect SRAM mode and allow the HW proper probe and VCN IP block to work fine. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2385 Fixes: 82132ec ("drm/amdgpu: enable Vangogh VCN indirect sram mode") Cc: [email protected] Cc: James Zhu <[email protected]> Cc: Leo Liu <[email protected]> Signed-off-by: Guilherme G. Piccoli <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 45aa07f commit 542a56e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <linux/firmware.h>
2828
#include <linux/module.h>
29+
#include <linux/dmi.h>
2930
#include <linux/pci.h>
3031
#include <linux/debugfs.h>
3132
#include <drm/drm_drv.h>
@@ -114,6 +115,24 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
114115
(adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG))
115116
adev->vcn.indirect_sram = true;
116117

118+
/*
119+
* Some Steam Deck's BIOS versions are incompatible with the
120+
* indirect SRAM mode, leading to amdgpu being unable to get
121+
* properly probed (and even potentially crashing the kernel).
122+
* Hence, check for these versions here - notice this is
123+
* restricted to Vangogh (Deck's APU).
124+
*/
125+
if (adev->ip_versions[UVD_HWIP][0] == IP_VERSION(3, 0, 2)) {
126+
const char *bios_ver = dmi_get_system_info(DMI_BIOS_VERSION);
127+
128+
if (bios_ver && (!strncmp("F7A0113", bios_ver, 7) ||
129+
!strncmp("F7A0114", bios_ver, 7))) {
130+
adev->vcn.indirect_sram = false;
131+
dev_info(adev->dev,
132+
"Steam Deck quirk: indirect SRAM disabled on BIOS %s\n", bios_ver);
133+
}
134+
}
135+
117136
hdr = (const struct common_firmware_header *)adev->vcn.fw->data;
118137
adev->vcn.fw_version = le32_to_cpu(hdr->ucode_version);
119138

0 commit comments

Comments
 (0)