Subversion Repositories HelenOS

Rev

Rev 1875 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1875 Rev 1886
Line 464... Line 464...
464
static void
464
static void
465
screen_init(void *addr, unsigned int xres, unsigned int yres, unsigned int bpp, unsigned int scan,
465
screen_init(void *addr, unsigned int xres, unsigned int yres, unsigned int bpp, unsigned int scan,
466
    int align, int invert_colors)
466
    int align, int invert_colors)
467
{
467
{
468
    switch (bpp) {
468
    switch (bpp) {
469
        case 8:
469
    case 8:
470
            screen.rgb2scr = rgb_1byte;
470
        screen.rgb2scr = rgb_1byte;
471
            screen.scr2rgb = byte1_rgb;
471
        screen.scr2rgb = byte1_rgb;
472
            screen.pixelbytes = 1;
472
        screen.pixelbytes = 1;
473
            break;
473
        break;
474
        case 16:
474
    case 16:
475
            screen.rgb2scr = rgb_2byte;
475
        screen.rgb2scr = rgb_2byte;
476
            screen.scr2rgb = byte2_rgb;
476
        screen.scr2rgb = byte2_rgb;
477
            screen.pixelbytes = 2;
477
        screen.pixelbytes = 2;
478
            break;
478
        break;
479
        case 24:
479
    case 24:
480
            screen.rgb2scr = rgb_3byte;
480
        screen.rgb2scr = rgb_3byte;
481
            screen.scr2rgb = byte3_rgb;
481
        screen.scr2rgb = byte3_rgb;
482
            if (!align)
482
        if (!align)
483
                screen.pixelbytes = 3;
483
            screen.pixelbytes = 3;
484
            else
484
        else
485
                screen.pixelbytes = 4;
-
 
486
            break;
-
 
487
        case 32:
-
 
488
            screen.rgb2scr = rgb_4byte;
-
 
489
            screen.scr2rgb = byte4_rgb;
-
 
490
            screen.pixelbytes = 4;
485
            screen.pixelbytes = 4;
491
            break;
486
        break;
-
 
487
    case 32:
-
 
488
        screen.rgb2scr = rgb_4byte;
-
 
489
        screen.scr2rgb = byte4_rgb;
-
 
490
        screen.pixelbytes = 4;
-
 
491
        break;
492
    }
492
    }
493
 
493
 
494
       
-
 
495
    screen.fbaddress = (unsigned char *) addr;
494
    screen.fbaddress = (unsigned char *) addr;
496
    screen.xres = xres;
495
    screen.xres = xres;
497
    screen.yres = yres;
496
    screen.yres = yres;
498
    screen.scanline = scan;
497
    screen.scanline = scan;
499
    screen.invert_colors = invert_colors;
498
    screen.invert_colors = invert_colors;
Line 1234... Line 1233...
1234
    void *fb_addr;
1233
    void *fb_addr;
1235
    size_t asz;
1234
    size_t asz;
1236
 
1235
 
1237
    async_set_client_connection(fb_client_connection);
1236
    async_set_client_connection(fb_client_connection);
1238
 
1237
 
1239
    fb_ph_addr=(void *)sysinfo_value("fb.address.physical");
1238
    fb_ph_addr = (void *) sysinfo_value("fb.address.physical");
1240
    fb_width=sysinfo_value("fb.width");
1239
    fb_width = sysinfo_value("fb.width");
1241
    fb_height=sysinfo_value("fb.height");
1240
    fb_height = sysinfo_value("fb.height");
1242
    fb_bpp=sysinfo_value("fb.bpp");
1241
    fb_bpp = sysinfo_value("fb.bpp");
1243
    fb_bpp_align=sysinfo_value("fb.bpp-align");
1242
    fb_bpp_align = sysinfo_value("fb.bpp-align");
1244
    fb_scanline=sysinfo_value("fb.scanline");
1243
    fb_scanline = sysinfo_value("fb.scanline");
1245
    fb_invert_colors=sysinfo_value("fb.invert-colors");
1244
    fb_invert_colors = sysinfo_value("fb.invert-colors");
1246
 
1245
 
1247
    asz = fb_scanline*fb_height;
1246
    asz = fb_scanline*fb_height;
1248
    fb_addr = as_get_mappable_page(asz);
1247
    fb_addr = as_get_mappable_page(asz);
1249
   
1248
   
1250
    map_physmem(fb_ph_addr, fb_addr, ALIGN_UP(asz,PAGE_SIZE) >>PAGE_WIDTH,
1249
    map_physmem(fb_ph_addr, fb_addr, ALIGN_UP(asz,PAGE_SIZE) >>PAGE_WIDTH,
1251
            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
1250
            AS_AREA_READ | AS_AREA_WRITE);
1252
   
-
 
1253
    screen_init(fb_addr, fb_width, fb_height, fb_bpp, fb_scanline, fb_bpp_align, fb_invert_colors);
-
 
1254
 
1251
 
-
 
1252
    screen_init(fb_addr, fb_width, fb_height, fb_bpp, fb_scanline, fb_bpp_align, fb_invert_colors);
1255
    return 0;
1253
    return 0;
1256
}
1254
}
1257
 
1255
 
1258
 
1256
 
1259
/**
1257
/**