drm/amdgpu: Reserve discovery TMR only if needed

For legacy SOCs, discovery binary is sideloaded. Instead of checking for
binary blob, use a flag to determine if discovery region needs to be
reserved.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Lijo Lazar
2025-10-10 17:23:33 +05:30
committed by Alex Deucher
parent 80e462c5b1
commit 071bba9624
3 changed files with 19 additions and 14 deletions

View File

@@ -298,10 +298,15 @@ static int amdgpu_discovery_read_binary_from_mem(struct amdgpu_device *adev,
else
vram_size <<= 20;
/*
* If in VRAM, discovery TMR is marked for reservation. If it is in system mem,
* then it is not required to be reserved.
*/
if (sz_valid) {
uint64_t pos = vram_size - DISCOVERY_TMR_OFFSET;
amdgpu_device_vram_access(adev, pos, (uint32_t *)binary,
adev->discovery.size, false);
adev->discovery.reserve_tmr = true;
} else {
ret = amdgpu_discovery_read_binary_from_sysmem(adev, binary);
}
@@ -418,8 +423,11 @@ static int amdgpu_discovery_verify_npsinfo(struct amdgpu_device *adev,
static const char *amdgpu_discovery_get_fw_name(struct amdgpu_device *adev)
{
if (amdgpu_discovery == 2)
if (amdgpu_discovery == 2) {
/* Assume there is valid discovery TMR in VRAM even if binary is sideloaded */
adev->discovery.reserve_tmr = true;
return "amdgpu/ip_discovery.bin";
}
switch (adev->asic_type) {
case CHIP_VEGA10: