Changeset ccb0cbc in mainline


Ignore:
Timestamp:
2006-11-22T13:45:05Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
eb353b3
Parents:
2bc137c2
Message:

Add BGR 0888 visual for Ultra 60

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/drivers/scr.c

    r2bc137c2 rccb0cbc  
    144144        case SCR_FFB:   
    145145                fb_scanline = 8192;
    146                 visual = VISUAL_RGB_0_8_8_8;
     146                visual = VISUAL_BGR_0_8_8_8;
    147147
    148148                ofw_upa_reg_t *reg = &((ofw_upa_reg_t *) prop->value)[FFB_REG_24BPP];
  • kernel/genarch/include/fb/visuals.h

    r2bc137c2 rccb0cbc  
    3737
    3838#define VISUAL_INDIRECT_8       0
     39
    3940#define VISUAL_RGB_5_5_5        1
    4041#define VISUAL_RGB_5_6_5        2
     
    4344#define VISUAL_RGB_0_8_8_8      5
    4445
     46#define VISUAL_BGR_0_8_8_8      6
     47
    4548#endif
    4649
  • kernel/genarch/src/fb/fb.c

    r2bc137c2 rccb0cbc  
    106106}
    107107
     108static void bgr_byte0888(void *dst, int rgb)
     109{
     110        *((uint32_t *) dst) = BLUE(rgb, 8) << 16 | GREEN(rgb, 8) << 8 | RED(rgb, 8);
     111}
     112
     113static int byte0888_bgr(void *src)
     114{
     115        int color = *(uint32_t *)(src);
     116        return ((color & 0xff) << 16) | (((color >> 8) & 0xff) << 8) | ((color >> 16) & 0xff);
     117}
     118
    108119static void rgb_byte888(void *dst, int rgb)
    109120{
     
    403414                pixelbytes = 4;
    404415                break;
     416        case VISUAL_BGR_0_8_8_8:
     417                rgb2scr = bgr_byte0888;
     418                scr2rgb = byte0888_bgr;
     419                pixelbytes = 4;
     420                break;
    405421        default:
    406422                panic("Unsupported visual.\n");
  • uspace/fb/fb.c

    r2bc137c2 rccb0cbc  
    160160}
    161161
     162static void bgr_byte0888(void *dst, int rgb)
     163{
     164        *((uint32_t *) dst) = BLUE(rgb, 8) << 16 | GREEN(rgb, 8) << 8 | RED(rgb, 8);
     165}
     166
     167static int byte0888_bgr(void *src)
     168{
     169        int color = *(uint32_t *)(src);
     170        return ((color & 0xff) << 16) | (((color >> 8) & 0xff) << 8) | ((color >> 16) & 0xff);
     171}
     172
    162173static void rgb_byte888(void *dst, int rgb)
    163174{
     
    508519                screen.rgb2scr = rgb_byte0888;
    509520                screen.scr2rgb = byte0888_rgb;
     521                screen.pixelbytes = 4;
     522                break;
     523        case VISUAL_BGR_0_8_8_8:
     524                screen.rgb2scr = bgr_byte0888;
     525                screen.scr2rgb = byte0888_bgr;
    510526                screen.pixelbytes = 4;
    511527                break;
Note: See TracChangeset for help on using the changeset viewer.