Rev 1990 | Rev 1993 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1990 | Rev 1991 | ||
---|---|---|---|
Line 356... | Line 356... | ||
356 | * @param align Request alignment for 24bpp mode. |
356 | * @param align Request alignment for 24bpp mode. |
357 | */ |
357 | */ |
358 | void fb_init(uintptr_t addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan, bool align) |
358 | void fb_init(uintptr_t addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan, bool align) |
359 | { |
359 | { |
360 | switch (bpp) { |
360 | switch (bpp) { |
361 | case 8: |
361 | case 8: |
362 | rgb2scr = rgb_1byte; |
362 | rgb2scr = rgb_1byte; |
363 | scr2rgb = byte1_rgb; |
363 | scr2rgb = byte1_rgb; |
364 | pixelbytes = 1; |
364 | pixelbytes = 1; |
365 | break; |
365 | break; |
366 | case 16: |
366 | case 16: |
367 | rgb2scr = rgb_2byte; |
367 | rgb2scr = rgb_2byte; |
368 | scr2rgb = byte2_rgb; |
368 | scr2rgb = byte2_rgb; |
369 | pixelbytes = 2; |
369 | pixelbytes = 2; |
370 | break; |
370 | break; |
371 | case 24: |
371 | case 24: |
372 | rgb2scr = rgb_3byte; |
372 | rgb2scr = rgb_3byte; |
373 | scr2rgb = byte3_rgb; |
373 | scr2rgb = byte3_rgb; |
374 | if (align) |
374 | if (align) |
375 | pixelbytes = 4; |
- | |
376 | else |
- | |
377 | pixelbytes = 3; |
- | |
378 | break; |
- | |
379 | case 32: |
- | |
380 | rgb2scr = rgb_4byte; |
- | |
381 | scr2rgb = byte4_rgb; |
- | |
382 | pixelbytes = 4; |
375 | pixelbytes = 4; |
- | 376 | else |
|
- | 377 | pixelbytes = 3; |
|
383 | break; |
378 | break; |
- | 379 | case 32: |
|
- | 380 | rgb2scr = rgb_4byte; |
|
- | 381 | scr2rgb = byte4_rgb; |
|
- | 382 | pixelbytes = 4; |
|
- | 383 | break; |
|
384 | default: |
384 | default: |
385 | panic("Unsupported bpp.\n"); |
385 | panic("Unsupported bpp.\n"); |
386 | } |
386 | } |
387 | 387 | ||
388 | unsigned int fbsize = scan * y; |
388 | unsigned int fbsize = scan * y; |
389 | 389 | ||
390 | /* Map the framebuffer */ |
390 | /* Map the framebuffer */ |