Changeset 00aece0 in mainline for kernel/genarch/src/fb/bfb.c
- Timestamp:
- 2012-02-18T16:47:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4449c6c
- Parents:
- bd5f3b7 (diff), f943dd3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/fb/bfb.c
rbd5f3b7 r00aece0 27 27 */ 28 28 29 /** @addtogroup ia3229 /** @addtogroup genarch 30 30 * @{ 31 31 */ 32 32 /** 33 33 * @file 34 * @brief VESA framebuffer driver.34 * @brief Boot framebuffer driver. 35 35 */ 36 36 37 #ifdef CONFIG_FB 37 #include <typedefs.h> 38 #include <genarch/fb/fb.h> 39 #include <genarch/fb/bfb.h> 40 #include <console/console.h> 38 41 39 #include <genarch/fb/fb.h> 40 #include <arch/drivers/vesa.h> 41 #include <console/chardev.h> 42 #include <console/console.h> 43 #include <putchar.h> 44 #include <mm/page.h> 45 #include <mm/frame.h> 46 #include <mm/as.h> 47 #include <arch/mm/page.h> 48 #include <synch/spinlock.h> 49 #include <arch/asm.h> 50 #include <typedefs.h> 51 #include <memstr.h> 52 #include <bitops.h> 42 uintptr_t bfb_addr = 0; 43 uint32_t bfb_width = 0; 44 uint32_t bfb_height = 0; 45 uint16_t bfb_bpp = 0; 46 uint32_t bfb_scanline = 0; 53 47 54 uint32_t vesa_ph_addr; 55 uint16_t vesa_width; 56 uint16_t vesa_height; 57 uint16_t vesa_bpp; 58 uint16_t vesa_scanline; 48 uint8_t bfb_red_pos = 0; 49 uint8_t bfb_red_size = 0; 59 50 60 uint8_t vesa_red_mask;61 uint8_t vesa_red_pos;51 uint8_t bfb_green_pos = 0; 52 uint8_t bfb_green_size = 0; 62 53 63 uint8_t vesa_green_mask;64 uint8_t vesa_green_pos;54 uint8_t bfb_blue_pos = 0; 55 uint8_t bfb_blue_size = 0; 65 56 66 uint8_t vesa_blue_mask; 67 uint8_t vesa_blue_pos; 68 69 bool vesa_init(void) 57 bool bfb_init(void) 70 58 { 71 if ((vesa_width == 0xffffU) || (vesa_height == 0xffffU)) 59 if ((bfb_addr == 0) || (bfb_width == 0) || (bfb_height == 0) || 60 (bfb_bpp == 0) || (bfb_scanline == 0)) 72 61 return false; 73 62 74 visual_t visual; 63 fb_properties_t bfb_props = { 64 .addr = bfb_addr, 65 .offset = 0, 66 .x = bfb_width, 67 .y = bfb_height, 68 .scan = bfb_scanline 69 }; 75 70 76 switch ( vesa_bpp) {71 switch (bfb_bpp) { 77 72 case 8: 78 visual = VISUAL_INDIRECT_8;73 bfb_props.visual = VISUAL_INDIRECT_8; 79 74 break; 80 75 case 16: 81 if (( vesa_red_mask == 5) && (vesa_red_pos == 10)82 && (vesa_green_mask == 5) && (vesa_green_pos == 5)83 && (vesa_blue_mask == 5) && (vesa_blue_pos == 0))84 visual = VISUAL_RGB_5_5_5_LE;76 if ((bfb_red_pos == 10) && (bfb_red_size == 5) && 77 (bfb_green_pos == 5) && (bfb_green_size == 5) && 78 (bfb_blue_pos == 0) && (bfb_blue_size == 5)) 79 bfb_props.visual = VISUAL_RGB_5_5_5_LE; 85 80 else 86 visual = VISUAL_RGB_5_6_5_LE;81 bfb_props.visual = VISUAL_RGB_5_6_5_LE; 87 82 break; 88 83 case 24: 89 visual = VISUAL_BGR_8_8_8;84 bfb_props.visual = VISUAL_BGR_8_8_8; 90 85 break; 91 86 case 32: 92 visual = VISUAL_BGR_8_8_8_0;87 bfb_props.visual = VISUAL_BGR_8_8_8_0; 93 88 break; 94 89 default: … … 97 92 } 98 93 99 fb_properties_t vesa_props = { 100 .addr = vesa_ph_addr, 101 .offset = 0, 102 .x = vesa_width, 103 .y = vesa_height, 104 .scan = vesa_scanline, 105 .visual = visual, 106 }; 107 108 outdev_t *fbdev = fb_init(&vesa_props); 94 outdev_t *fbdev = fb_init(&bfb_props); 109 95 if (!fbdev) 110 96 return false; … … 114 100 } 115 101 116 #endif117 118 102 /** @} 119 103 */
Note:
See TracChangeset
for help on using the changeset viewer.