diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-03-15 08:36:34 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-03-15 08:36:34 +0000 |
commit | 05cc9e720c4701481208c0e4e72eea99d477b8cd (patch) | |
tree | 477d29e1b667a5a1634f9f2cac7e9e0079517f4f /sys/dev | |
parent | 294929ae0c0bbb7d5c8b7373787f63fec3476d74 (diff) |
drm/amdgpu/vcn: Disable indirect SRAM on Vangogh broken BIOSes
From Guilherme G. Piccoli in amd-staging-drm-next
https://gitlab.freedesktop.org/drm/amd/-/issues/2385
This fixes amdgpu failing to init on Steam Deck after the drm 6.1 update:
[drm] failed to load ucode VCN0_RAM(0x3A) [drm] psp gfx command LOAD_IP_FW(0x6)
failed and response status is (0xFFFF0000)
[drm] *ERROR* ring vcn_dec_0 test failed (-60)
[drm] *ERROR* hw_init of IP block <vcn_v3_0> failed -60
drm:pid0:amdgpu_device_init *ERROR* amdgpu_device_ip_init failed
drm:pid0:amdgpu_attachhook *ERROR* Fatal error during GPU init
reported and tested by bentley@ on:
bios0: vendor Valve version "F7A0113" date 11/04/2022
bios0: Valve Jupiter
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/amdgpu_vcn.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vcn.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vcn.c index d603b655c17..38de4be59f4 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vcn.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vcn.c @@ -26,6 +26,7 @@ #include <linux/firmware.h> #include <linux/module.h> +#include <linux/dmi.h> #include <linux/pci.h> #include <linux/debugfs.h> #include <drm/drm_drv.h> @@ -222,6 +223,24 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) return r; } + /* + * Some Steam Deck's BIOS versions are incompatible with the + * indirect SRAM mode, leading to amdgpu being unable to get + * properly probed (and even potentially crashing the kernel). + * Hence, check for these versions here - notice this is + * restricted to Vangogh (Deck's APU). + */ + if (adev->ip_versions[UVD_HWIP][0] == IP_VERSION(3, 0, 2)) { + const char *bios_ver = dmi_get_system_info(DMI_BIOS_VERSION); + + if (bios_ver && (!strncmp("F7A0113", bios_ver, 7) || + !strncmp("F7A0114", bios_ver, 7))) { + adev->vcn.indirect_sram = false; + dev_info(adev->dev, + "Steam Deck quirk: indirect SRAM disabled on BIOS %s\n", bios_ver); + } + } + hdr = (const struct common_firmware_header *)adev->vcn.fw->data; adev->vcn.fw_version = le32_to_cpu(hdr->ucode_version); |