drm/amdgpu: fix SI UVD firmware validate resume fail
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix SI UVD firmware validate resume fail
The SI UVD firmware validate key is stored at the end of firmware, which is changed during resume while playing video. So only to get the key at device initialization and save it for later using.
--- drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c +10 -7
@@ -279,13 +279,16 @@ static int uvd_v3_1_fw_validate(struct amdgpu_device *adev) {void *ptr;uint32_t ucode_len, i; -uint32_t keysel; - - ptr = adev->uvd.inst[0 ].cpu_addr; - ptr +=192 +16 ; -memcpy (&ucode_len, ptr,4 ); - ptr += ucode_len; -memcpy (&keysel, ptr,4 ); +static uint32_t keysel =0 ; + +/* Only get the validate key at device initialization*/ +if (!keysel) { + ptr = adev->uvd.inst[0 ].cpu_addr; + ptr +=192 +16 ; +memcpy (&ucode_len, ptr,4 ); + ptr += ucode_len; +memcpy (&keysel, ptr,4 ); + }WREG32 (mmUVD_FW_START, keysel);
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 08.11.20 um 16:09 schrieb Sonny Jiang:
Quoted 15 lines
The SI UVD firmware validate key is stored at the end of firmware, which is changed during resume while playing video. So only to get the key at device initialization and save it for later using.
Signed-off-by Sonny Jiang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c +0
-0@@ -279,13 +279,16 @@ static int uvd_v3_1_fw_validate(struct amdgpu_device *adev) {
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c static int uvd_v3_1_fw_validate(struct amdgpu_device *adev) · line 282
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c +1
-7void *ptr;uint32_t ucode_len, i; -uint32_t keysel; - - ptr = adev->uvd.inst[0 ].cpu_addr; - ptr +=192 +16 ; -memcpy (&ucode_len, ptr,4 ); - ptr += ucode_len; -memcpy (&keysel, ptr,4 ); +static uint32_t keysel =0 ;
Well, that is a really big NAK.
You can't just make a variable static and hope that we don't have multiple instances of the device driver loaded.
If you need to keep the value around put it into adev somehow.
Christian.
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c static int uvd_v3_1_fw_validate(struct amdgpu_device *adev) · line 294
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c +9
-0+ +/* Only get the validate key at device initialization*/ +if (!keysel) { + ptr = adev->uvd.inst[0 ].cpu_addr; + ptr +=192 +16 ; +memcpy (&ucode_len, ptr,4 ); + ptr += ucode_len; +memcpy (&keysel, ptr,4 ); + }WREG32 (mmUVD_FW_START, keysel);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx