Changeset 925fdd7 in mainline for kernel/genarch/src
- Timestamp:
- 2008-12-10T21:41:22Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bb74e8ab
- Parents:
- 8af9950
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/fb/fb.c
r8af9950 r925fdd7 178 178 } 179 179 180 /** Put pixel - 8-bit depth (color palette/3:2:3 )180 /** Put pixel - 8-bit depth (color palette/3:2:3, inverted) 181 181 * 182 182 * Even though we try 3:2:3 color scheme here, an 8-bit framebuffer … … 185 185 * palette. This could be fixed by supporting custom palette 186 186 * and setting it to simulate the 8-bit truecolor. 187 * 188 * Currently we set the palette on the sparc64 port. 189 * 190 * Note that the byte is being inverted by this function. The reason is 191 * that we would like to use a color palette where the white color code 192 * is 0 and the black color code is 255, as some machines (SunBlade 1500) 193 * use these codes for black and white and prevent to set codes 194 * 0 and 255 to other colors. 187 195 */ 188 196 static void rgb_byte8(void *dst, int rgb) 189 197 { 190 *((uint8_t *) dst) = RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 |191 BLUE(rgb, 3) ;198 *((uint8_t *) dst) = 255 - (RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 | 199 BLUE(rgb, 3)); 192 200 } 193 201 … … 198 206 static int byte8_rgb(void *src) 199 207 { 200 int color = *(uint8_t *)src;208 int color = 255 - (*(uint8_t *)src); 201 209 return (((color >> 5) & 0x7) << (16 + 5)) | 202 210 (((color >> 3) & 0x3) << (8 + 6)) | ((color & 0x7) << 5); … … 484 492 485 493 /* Map the framebuffer */ 486 fbaddress = (uint8_t *) hw_map((uintptr_t) props->addr + props->offset,487 fbsize );494 fbaddress = (uint8_t *) hw_map((uintptr_t) props->addr, 495 fbsize + props->offset); 488 496 fbaddress += props->offset; 489 497 … … 495 503 columns = props->x / COL_WIDTH; 496 504 497 fb_parea.pbase = (uintptr_t) props->addr ;505 fb_parea.pbase = (uintptr_t) props->addr + props->offset; 498 506 fb_parea.vbase = (uintptr_t) fbaddress; 499 507 fb_parea.frames = SIZE2FRAMES(fbsize);
Note:
See TracChangeset
for help on using the changeset viewer.