diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/atom.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/atom.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c index 81c60a277eeb..d69aa2e179bb 100644 --- a/drivers/gpu/drm/amd/amdgpu/atom.c +++ b/drivers/gpu/drm/amd/amdgpu/atom.c | |||
@@ -1417,29 +1417,3 @@ bool amdgpu_atom_parse_cmd_header(struct atom_context *ctx, int index, uint8_t * | |||
1417 | return true; | 1417 | return true; |
1418 | } | 1418 | } |
1419 | 1419 | ||
1420 | int amdgpu_atom_allocate_fb_scratch(struct atom_context *ctx) | ||
1421 | { | ||
1422 | int index = GetIndexIntoMasterTable(DATA, VRAM_UsageByFirmware); | ||
1423 | uint16_t data_offset; | ||
1424 | int usage_bytes = 0; | ||
1425 | struct _ATOM_VRAM_USAGE_BY_FIRMWARE *firmware_usage; | ||
1426 | |||
1427 | if (amdgpu_atom_parse_data_header(ctx, index, NULL, NULL, NULL, &data_offset)) { | ||
1428 | firmware_usage = (struct _ATOM_VRAM_USAGE_BY_FIRMWARE *)(ctx->bios + data_offset); | ||
1429 | |||
1430 | DRM_DEBUG("atom firmware requested %08x %dkb\n", | ||
1431 | le32_to_cpu(firmware_usage->asFirmwareVramReserveInfo[0].ulStartAddrUsedByFirmware), | ||
1432 | le16_to_cpu(firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb)); | ||
1433 | |||
1434 | usage_bytes = le16_to_cpu(firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb) * 1024; | ||
1435 | } | ||
1436 | ctx->scratch_size_bytes = 0; | ||
1437 | if (usage_bytes == 0) | ||
1438 | usage_bytes = 20 * 1024; | ||
1439 | /* allocate some scratch memory */ | ||
1440 | ctx->scratch = kzalloc(usage_bytes, GFP_KERNEL); | ||
1441 | if (!ctx->scratch) | ||
1442 | return -ENOMEM; | ||
1443 | ctx->scratch_size_bytes = usage_bytes; | ||
1444 | return 0; | ||
1445 | } | ||