263,10 → 263,10 |
case ATOM_ARG_FB: |
idx = U8(*ptr); |
(*ptr)++; |
val = gctx->scratch[((gctx->fb_base + idx) / 4)]; |
if (print) |
DEBUG("FB[0x%02X]", idx); |
printk(KERN_INFO "FB access is not implemented.\n"); |
return 0; |
break; |
case ATOM_ARG_IMM: |
switch (align) { |
case ATOM_SRC_DWORD: |
488,9 → 488,9 |
case ATOM_ARG_FB: |
idx = U8(*ptr); |
(*ptr)++; |
gctx->scratch[((gctx->fb_base + idx) / 4)] = val; |
DEBUG("FB[0x%02X]", idx); |
printk(KERN_INFO "FB access is not implemented.\n"); |
return; |
break; |
case ATOM_ARG_PLL: |
idx = U8(*ptr); |
(*ptr)++; |
1214,3 → 1214,28 |
*crev = CU8(idx + 3); |
return; |
} |
|
int atom_allocate_fb_scratch(struct atom_context *ctx) |
{ |
int index = GetIndexIntoMasterTable(DATA, VRAM_UsageByFirmware); |
uint16_t data_offset; |
int usage_bytes; |
struct _ATOM_VRAM_USAGE_BY_FIRMWARE *firmware_usage; |
|
atom_parse_data_header(ctx, index, NULL, NULL, NULL, &data_offset); |
|
firmware_usage = (struct _ATOM_VRAM_USAGE_BY_FIRMWARE *)(ctx->bios + data_offset); |
|
DRM_DEBUG("atom firmware requested %08x %dkb\n", |
firmware_usage->asFirmwareVramReserveInfo[0].ulStartAddrUsedByFirmware, |
firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb); |
|
usage_bytes = firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb * 1024; |
if (usage_bytes == 0) |
usage_bytes = 20 * 1024; |
/* allocate some scratch memory */ |
ctx->scratch = kzalloc(usage_bytes, GFP_KERNEL); |
if (!ctx->scratch) |
return -ENOMEM; |
return 0; |
} |