From: jsg Date: Wed, 15 Mar 2023 08:36:33 +0000 (+0000) Subject: drm/amdgpu/vcn: Disable indirect SRAM on Vangogh broken BIOSes X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a401c30c2f52490d5e155aa9c21079ec467d4ac7;p=openbsd 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 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 --- 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 #include +#include #include #include #include @@ -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);