Skip to content
Commit c1fe75c9 authored by Piotr Redlewski's avatar Piotr Redlewski Committed by Alex Deucher
Browse files

drm/amd/amdgpu: fix UVD mc offsets



When UVD bo is created, its size is based on the information from firmware
header (ucode_size_bytes). The same value should be be used when programming
UVD mc controller offsets, otherwise it can happen that
(mmUVD_VCPU_CACHE_OFFSET2 + mmUVD_VCPU_CACHE_SIZE2) will point
AMDGPU_GPU_PAGE_SIZE bytes after the UVD bo end.

Second issue is that when programming the mmUVD_VCPU_CACHE_SIZE0 register,
AMDGPU_UVD_FIRMWARE_OFFSET should be taken into account. If it isn't,
(mmUVD_VCPU_CACHE_OFFSET2 + mmUVD_VCPU_CACHE_SIZE2) will always point
AMDGPU_UVD_FIRMWARE_OFFSET bytes after the UVD bo end.

v2: move firmware size calculation into macro definition
v3: align firmware size to the gpu page size

Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarPiotr Redlewski <predlewski@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent fa2123db
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment