Changeset b4fa652 in mainline
- Timestamp:
- 2006-08-04T08:21:30Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b006a2c8
- Parents:
- d7e3fa66
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc64/loader/main.c
rd7e3fa66 rb4fa652 32 32 #include "_components.h" 33 33 #include <ofw.h> 34 #include "ofwarch.h" 34 35 #include <align.h> 35 36 … … 60 61 } 61 62 bootinfo.screen.addr = ofw_translate(bootinfo.screen.addr); 63 /* transform scanline to bytes with respect to potential alignment */ 64 bootinfo.screen.scanline = bootinfo.screen.scanline*bpp2align[bootinfo.screen.bpp >> 3]; 62 65 63 66 if (!ofw_keyboard(&bootinfo.keyboard)) 64 67 printf("Error: unable to get keyboard properties\n"); 65 68 66 69 printf("\nDevice statistics\n"); 67 70 printf(" memory: %dM\n", bootinfo.memmap.total>>20); -
boot/arch/sparc64/loader/ofwarch.c
rd7e3fa66 rb4fa652 36 36 #include <printf.h> 37 37 38 int bpp2align[] = { 39 [0] = 0, /** Invalid bpp. */ 40 [1] = 1, /** 8bpp is not aligned. */ 41 [2] = 2, /** 16bpp is naturally aligned. */ 42 [3] = 4, /** 24bpp is aligned on 4 byte boundary. */ 43 [4] = 4, /** 32bpp is naturally aligned. */ 44 }; 45 38 46 void write(const char *str, const int len) 39 47 { -
boot/arch/sparc64/loader/ofwarch.h
rd7e3fa66 rb4fa652 33 33 #define OFW_SIZE_CELLS 2 34 34 35 extern int bpp2align[]; 36 35 37 #endif -
kernel/arch/ia32/src/drivers/vesa.c
rd7e3fa66 rb4fa652 68 68 void vesa_init(void) 69 69 { 70 fb_init(vesa_ph_addr, vesa_width, vesa_height, vesa_bpp, vesa_scanline );70 fb_init(vesa_ph_addr, vesa_width, vesa_height, vesa_bpp, vesa_scanline, false); 71 71 } 72 72 -
kernel/arch/mips32/src/mips32.c
rd7e3fa66 rb4fa652 128 128 { 129 129 #ifdef CONFIG_FB 130 fb_init(0x12000000, 640, 480, 24, 1920 ); // gxemul framebuffer130 fb_init(0x12000000, 640, 480, 24, 1920, false); // gxemul framebuffer 131 131 #endif 132 132 sysinfo_set_item_val("machine." STRING(MACHINE),NULL,1); -
kernel/arch/ppc32/src/ppc32.c
rd7e3fa66 rb4fa652 71 71 { 72 72 if (config.cpu_active == 1) { 73 fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline );73 fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline, false); 74 74 75 75 /* Initialize PIC */ -
kernel/arch/ppc64/src/ppc64.c
rd7e3fa66 rb4fa652 27 27 */ 28 28 29 29 /** @addtogroup ppc64 30 30 * @{ 31 31 */ … … 69 69 { 70 70 if (config.cpu_active == 1) { 71 fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline );71 fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline, false); 72 72 73 73 /* Merge all zones to 1 big zone */ … … 111 111 } 112 112 113 113 /** @} 114 114 */ 115 -
kernel/arch/sparc64/src/console.c
rd7e3fa66 rb4fa652 59 59 60 60 fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, 61 bootinfo.screen.bpp, bootinfo.screen.scanline );61 bootinfo.screen.bpp, bootinfo.screen.scanline, true); 62 62 } 63 63 -
kernel/genarch/include/fb/fb.h
rd7e3fa66 rb4fa652 40 40 41 41 extern spinlock_t fb_lock; 42 void fb_init(uintptr_t addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan );42 void fb_init(uintptr_t addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan, bool align); 43 43 44 44 #endif -
kernel/genarch/src/fb/fb.c
rd7e3fa66 rb4fa652 135 135 } 136 136 137 /** Put pixel - 8-bit depth (3:2:3) */ 137 /** Put pixel - 8-bit depth (color palette/3:2:3) 138 * 139 * Even though we try 3:2:3 color scheme here, an 8-bit framebuffer 140 * will most likely use a color palette. The color appearance 141 * will be pretty random and depend on the default installed 142 * palette. This could be fixed by supporting custom palette 143 * and setting it to simulate the 8-bit truecolor. 144 */ 138 145 static void rgb_1byte(void *dst, int rgb) 139 146 { … … 141 148 } 142 149 143 /** Return pixel color - 8-bit depth (3:2:3) */ 150 /** Return pixel color - 8-bit depth (color palette/3:2:3) 151 * 152 * See the comment for rgb_1byte(). 153 */ 144 154 static int byte1_rgb(void *src) 145 155 { … … 330 340 /** Initialize framebuffer as a chardev output device 331 341 * 332 * @param addr Physical address of the framebuffer333 * @param x Screen width in pixels334 * @param y Screen height in pixels335 * @param bpp Bits per pixel (8, 16, 24, 32)336 * @param scan Bytes per one scanline337 * 338 */ 339 void fb_init(uintptr_t addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan )342 * @param addr Physical address of the framebuffer 343 * @param x Screen width in pixels 344 * @param y Screen height in pixels 345 * @param bpp Bits per pixel (8, 16, 24, 32) 346 * @param scan Bytes per one scanline 347 * @param align Request alignment for 24bpp mode. 348 */ 349 void fb_init(uintptr_t addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan, bool align) 340 350 { 341 351 switch (bpp) { … … 353 363 rgb2scr = rgb_3byte; 354 364 scr2rgb = byte3_rgb; 355 pixelbytes = 3; 365 if (align) 366 pixelbytes = 4; 367 else 368 pixelbytes = 3; 356 369 break; 357 370 case 32:
Note:
See TracChangeset
for help on using the changeset viewer.