Rev 1313 | Rev 1403 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1313 | Rev 1321 | ||
---|---|---|---|
Line 261... | Line 261... | ||
261 | val = U32(idx + gctx->data_block); |
261 | val = U32(idx + gctx->data_block); |
262 | break; |
262 | break; |
263 | case ATOM_ARG_FB: |
263 | case ATOM_ARG_FB: |
264 | idx = U8(*ptr); |
264 | idx = U8(*ptr); |
265 | (*ptr)++; |
265 | (*ptr)++; |
- | 266 | val = gctx->scratch[((gctx->fb_base + idx) / 4)]; |
|
266 | if (print) |
267 | if (print) |
267 | DEBUG("FB[0x%02X]", idx); |
268 | DEBUG("FB[0x%02X]", idx); |
268 | printk(KERN_INFO "FB access is not implemented.\n"); |
- | |
269 | return 0; |
269 | break; |
270 | case ATOM_ARG_IMM: |
270 | case ATOM_ARG_IMM: |
271 | switch (align) { |
271 | switch (align) { |
272 | case ATOM_SRC_DWORD: |
272 | case ATOM_SRC_DWORD: |
273 | val = U32(*ptr); |
273 | val = U32(*ptr); |
274 | (*ptr) += 4; |
274 | (*ptr) += 4; |
Line 486... | Line 486... | ||
486 | } |
486 | } |
487 | break; |
487 | break; |
488 | case ATOM_ARG_FB: |
488 | case ATOM_ARG_FB: |
489 | idx = U8(*ptr); |
489 | idx = U8(*ptr); |
490 | (*ptr)++; |
490 | (*ptr)++; |
- | 491 | gctx->scratch[((gctx->fb_base + idx) / 4)] = val; |
|
491 | DEBUG("FB[0x%02X]", idx); |
492 | DEBUG("FB[0x%02X]", idx); |
492 | printk(KERN_INFO "FB access is not implemented.\n"); |
- | |
493 | return; |
493 | break; |
494 | case ATOM_ARG_PLL: |
494 | case ATOM_ARG_PLL: |
495 | idx = U8(*ptr); |
495 | idx = U8(*ptr); |
496 | (*ptr)++; |
496 | (*ptr)++; |
497 | DEBUG("PLL[0x%02X]", idx); |
497 | DEBUG("PLL[0x%02X]", idx); |
498 | gctx->card->pll_write(gctx->card, idx, val); |
498 | gctx->card->pll_write(gctx->card, idx, val); |
Line 1212... | Line 1212... | ||
1212 | *frev = CU8(idx + 2); |
1212 | *frev = CU8(idx + 2); |
1213 | if (crev) |
1213 | if (crev) |
1214 | *crev = CU8(idx + 3); |
1214 | *crev = CU8(idx + 3); |
1215 | return; |
1215 | return; |
1216 | }>>\n"); |
1216 | } |
- | 1217 | ||
- | 1218 | int atom_allocate_fb_scratch(struct atom_context *ctx) |
|
- | 1219 | { |
|
- | 1220 | int index = GetIndexIntoMasterTable(DATA, VRAM_UsageByFirmware); |
|
- | 1221 | uint16_t data_offset; |
|
- | 1222 | int usage_bytes; |
|
- | 1223 | struct _ATOM_VRAM_USAGE_BY_FIRMWARE *firmware_usage; |
|
- | 1224 | ||
- | 1225 | atom_parse_data_header(ctx, index, NULL, NULL, NULL, &data_offset); |
|
- | 1226 | ||
- | 1227 | firmware_usage = (struct _ATOM_VRAM_USAGE_BY_FIRMWARE *)(ctx->bios + data_offset); |
|
- | 1228 | ||
- | 1229 | DRM_DEBUG("atom firmware requested %08x %dkb\n", |
|
- | 1230 | firmware_usage->asFirmwareVramReserveInfo[0].ulStartAddrUsedByFirmware, |
|
- | 1231 | firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb); |
|
- | 1232 | ||
- | 1233 | usage_bytes = firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb * 1024; |
|
- | 1234 | if (usage_bytes == 0) |
|
- | 1235 | usage_bytes = 20 * 1024; |
|
- | 1236 | /* allocate some scratch memory */ |
|
- | 1237 | ctx->scratch = kzalloc(usage_bytes, GFP_KERNEL); |
|
- | 1238 | if (!ctx->scratch) |
|
- | 1239 | return -ENOMEM; |
|
- | 1240 | return 0; |
|
- | 1241 | }>>\n"); |