Rev 1327 | Rev 1473 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1327 | Rev 1371 | ||
|---|---|---|---|
| Line 56... | Line 56... | ||
| 56 | if (vesa_height != 0xffff) |
56 | if (vesa_height != 0xffff) |
| 57 | return true; |
57 | return true; |
| 58 | return false; |
58 | return false; |
| 59 | } |
59 | } |
| 60 | 60 | ||
| 61 | static count_t vesa_frame_order(void) |
- | |
| 62 | { |
- | |
| 63 | __u32 x = vesa_scanline*vesa_height; |
- | |
| 64 | if (x <= FRAME_SIZE) |
- | |
| 65 | return 0; |
- | |
| 66 | - | ||
| 67 | return (fnzb32(x - 1) + 1) - FRAME_WIDTH; |
- | |
| 68 | } |
- | |
| 69 | - | ||
| 70 | void vesa_init(void) |
61 | void vesa_init(void) |
| 71 | { |
62 | { |
| 72 | int a; |
- | |
| 73 | __address vram_lin_addr; |
- | |
| 74 | - | ||
| 75 | vram_lin_addr = PA2KA(PFN2ADDR(frame_alloc(vesa_frame_order(), FRAME_KA))); |
- | |
| 76 | /* Map videoram */ |
- | |
| 77 | for (a = 0; a < ((vesa_scanline * vesa_height + PAGE_SIZE - 1) >> PAGE_WIDTH); a++) |
- | |
| 78 | page_mapping_insert(AS_KERNEL, vram_lin_addr + a*PAGE_SIZE, vesa_ph_addr + a*FRAME_SIZE, |
- | |
| 79 | PAGE_NOT_CACHEABLE); |
- | |
| 80 | - | ||
| 81 | fb_init(vram_lin_addr, vesa_width, vesa_height, vesa_bpp, vesa_scanline); |
63 | fb_init(vesa_ph_addr, vesa_width, vesa_height, vesa_bpp, vesa_scanline); |
| 82 | - | ||
| 83 | fb_register(); |
- | |
| 84 | sysinfo_set_item_val("fb.address.physical", NULL, vesa_ph_addr); |
- | |
| 85 | } |
64 | } |
| 86 | 65 | ||
| 87 | #endif |
66 | #endif |