/trunk/kernel/arch/sparc64/src/drivers/scr.c |
---|
35,6 → 35,7 |
#include <arch/drivers/scr.h> |
#include <genarch/ofw/ofw_tree.h> |
#include <genarch/fb/fb.h> |
#include <genarch/fb/visuals.h> |
#include <arch/types.h> |
#include <typedefs.h> |
#include <func.h> |
75,6 → 76,7 |
uint32_t fb_depth = 0; |
uint32_t fb_linebytes = 0; |
uint32_t fb_scanline = 0; |
unsigned int visual; |
prop = ofw_tree_getprop(node, "width"); |
if (prop && prop->value) |
115,16 → 117,33 |
printf("Failed to determine screen address.\n"); |
return; |
} |
if (fb_depth == 24) |
switch (fb_depth) { |
case 8: |
fb_scanline = fb_linebytes * (fb_depth >> 3); |
visual = VISUAL_INDIRECT_8; |
break; |
case 16: |
fb_scanline = fb_linebytes * (fb_depth >> 3); |
visual = VISUAL_RGB_5_6_5; |
break; |
case 24: |
fb_scanline = fb_linebytes * 4; |
else |
visual = VISUAL_RGB_8_8_8_0; |
break; |
case 32: |
fb_scanline = fb_linebytes * (fb_depth >> 3); |
visual = VISUAL_RGB_0_8_8_8; |
break; |
default: |
printf("Unsupported bits per pixel.\n"); |
return; |
} |
break; |
case SCR_FFB: |
fb_depth = 32; |
fb_scanline = 8192; |
visual = VISUAL_RGB_0_8_8_8; |
ofw_upa_reg_t *reg = &((ofw_upa_reg_t *) prop->value)[FFB_REG_24BPP]; |
if (!ofw_upa_apply_ranges(node->parent, reg, &fb_addr)) { |
137,7 → 156,7 |
panic("Unexpected type.\n"); |
} |
fb_init(fb_addr, fb_width, fb_height, fb_depth, fb_scanline, true); |
fb_init(fb_addr, fb_width, fb_height, fb_scanline, visual); |
} |
/** @} |
/trunk/kernel/arch/ppc32/src/ppc32.c |
---|
38,6 → 38,7 |
#include <arch/mm/memory_init.h> |
#include <arch/interrupt.h> |
#include <genarch/fb/fb.h> |
#include <genarch/fb/visuals.h> |
#include <userspace.h> |
#include <proc/uarg.h> |
#include <console/console.h> |
75,8 → 76,26 |
{ |
if (config.cpu_active == 1) { |
/* Initialize framebuffer */ |
fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline, false); |
unsigned int visual; |
switch (bootinfo.screen.bpp) { |
case 8: |
visual = VISUAL_INDIRECT_8; |
break; |
case 16: |
visual = VISUAL_RGB_5_5_5; |
break; |
case 24: |
visual = VISUAL_RGB_8_8_8; |
break; |
case 32: |
visual = VISUAL_RGB_0_8_8_8; |
break; |
default: |
panic("Unsupported bits per pixel"); |
} |
fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.scanline, visual); |
/* Initialize IRQ routing */ |
irq_init(IRQ_COUNT, IRQ_COUNT); |
/trunk/kernel/arch/ppc64/src/ppc64.c |
---|
37,6 → 37,7 |
#include <arch/mm/memory_init.h> |
#include <arch/interrupt.h> |
#include <genarch/fb/fb.h> |
#include <genarch/fb/visuals.h> |
#include <userspace.h> |
#include <proc/uarg.h> |
#include <console/console.h> |
68,7 → 69,27 |
void arch_post_mm_init(void) |
{ |
if (config.cpu_active == 1) { |
fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline, false); |
/* Initialize framebuffer */ |
unsigned int visual; |
switch (bootinfo.screen.bpp) { |
case 8: |
visual = VISUAL_INDIRECT_8; |
break; |
case 16: |
visual = VISUAL_RGB_5_5_5; |
break; |
case 24: |
visual = VISUAL_RGB_8_8_8; |
break; |
case 32: |
visual = VISUAL_RGB_0_8_8_8; |
break; |
default: |
panic("Unsupported bits per pixel"); |
} |
fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.scanline, visual); |
/* Merge all zones to 1 big zone */ |
zone_merge_all(); |
/trunk/kernel/arch/mips32/src/mips32.c |
---|
53,6 → 53,7 |
#include <console/chardev.h> |
#include <arch/debugger.h> |
#include <genarch/fb/fb.h> |
#include <genarch/fb/visuals.h> |
#include <macros.h> |
#include <ddi/device.h> |
122,7 → 123,7 |
interrupt_init(); |
console_init(device_assign_devno()); |
#ifdef CONFIG_FB |
fb_init(0x12000000, 640, 480, 24, 1920, false); // gxemul framebuffer |
fb_init(0x12000000, 640, 480, 1920, VISUAL_RGB_8_8_8); // gxemul framebuffer |
#endif |
sysinfo_set_item_val("machine." STRING(MACHINE), NULL, 1); |
} |
/trunk/kernel/arch/ia32/src/drivers/vesa.c |
---|
37,6 → 37,7 |
#ifdef CONFIG_FB |
#include <genarch/fb/fb.h> |
#include <genarch/fb/visuals.h> |
#include <arch/drivers/vesa.h> |
#include <putchar.h> |
#include <mm/page.h> |
67,7 → 68,26 |
void vesa_init(void) |
{ |
fb_init(vesa_ph_addr, vesa_width, vesa_height, vesa_bpp, vesa_scanline, false); |
unsigned int visual; |
switch (vesa_bpp) { |
case 8: |
visual = VISUAL_INDIRECT_8; |
break; |
case 16: |
visual = VISUAL_RGB_5_6_5; |
break; |
case 24: |
visual = VISUAL_RGB_8_8_8; |
break; |
case 32: |
visual = VISUAL_RGB_0_8_8_8; |
break; |
default: |
panic("Unsupported bits per pixel"); |
} |
fb_init(vesa_ph_addr, vesa_width, vesa_height, vesa_scanline, visual); |
} |
#endif |