Changeset 20eb5e4d in mainline


Ignore:
Timestamp:
2008-12-07T00:41:59Z (16 years ago)
Author:
Pavel Rimsky <rimskyp@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5d9430d7
Parents:
2b1f860
Message:

Added forgotten stuff related to framebuffers with offsets. Got rid of VISUAL_SB1500_PALETTE.

Files:
4 edited

Legend:

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

    r2b1f860 r20eb5e4d  
    7979       
    8080        uintptr_t fb_addr;
     81        unsigned int fb_offset = 0;
    8182        uint32_t fb_width = 0;
    8283        uint32_t fb_height = 0;
     
    168169                }
    169170
     171                fb_offset = 4 * 0x2000;
     172
    170173                switch (fb_depth) {
    171174                case 8:
    172175                        fb_scanline = fb_linebytes * (fb_depth >> 3);
    173                         visual = VISUAL_SB1500_PALETTE;
     176                        visual = VISUAL_INDIRECT_8;
    174177                        break;
    175178                case 16:
     
    226229        fb_properties_t props = {
    227230                .addr = fb_addr,
    228                 .offset = 0,
     231                .offset = fb_offset,
    229232                .x = fb_width,
    230233                .y = fb_height,
  • kernel/genarch/include/fb/visuals.h

    r2b1f860 r20eb5e4d  
    4545
    4646#define VISUAL_BGR_0_8_8_8      6
    47 #define VISUAL_SB1500_PALETTE   7
    4847
    4948#endif
  • kernel/genarch/src/fb/fb.c

    r2b1f860 r20eb5e4d  
    190190        *((uint8_t *) dst) = RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 |
    191191            BLUE(rgb, 3);
    192 }
    193 
    194 static void sb1500rgb_byte8(void *dst, int rgb)
    195 {
    196         if (RED(rgb, 1) && GREEN(rgb, 1) && BLUE(rgb, 1))
    197                 *((uint8_t *) dst) = 255;
    198         else if (RED(rgb, 1) && GREEN(rgb, 1))
    199                 *((uint8_t *) dst) = 150;
    200         else if (GREEN(rgb, 1) && BLUE(rgb, 1))
    201                 *((uint8_t *) dst) = 47;
    202         else if (RED(rgb, 1) && BLUE(rgb, 1))
    203                 *((uint8_t *) dst) = 48;
    204         else if (RED(rgb, 1))
    205                 *((uint8_t *) dst) = 32;
    206         else if (GREEN(rgb, 1))
    207                 *((uint8_t *) dst) = 47;
    208         else if (BLUE(rgb, 1))
    209                 *((uint8_t *) dst) = 2;
    210         else
    211                 *((uint8_t *) dst) = 1;
    212192}
    213193
     
    467447                pixelbytes = 1;
    468448                break;
    469         case VISUAL_SB1500_PALETTE:
    470                 rgb2scr = sb1500rgb_byte8;
    471                 scr2rgb = byte8_rgb;
    472                 pixelbytes = 1;
    473                 break;
    474449        case VISUAL_RGB_5_5_5:
    475450                rgb2scr = rgb_byte555;
     
    506481        }
    507482       
    508         unsigned int fbsize = props->scan * props->y + props->offset;
     483        unsigned int fbsize = props->scan * props->y;
    509484       
    510485        /* Map the framebuffer */
    511         fbaddress = (uint8_t *) hw_map((uintptr_t) props->addr, fbsize);
     486        fbaddress = (uint8_t *) hw_map((uintptr_t) props->addr + props->offset,
     487                fbsize);
    512488        fbaddress += props->offset;
    513489       
     
    532508        sysinfo_set_item_val("fb.visual", NULL, props->visual);
    533509        sysinfo_set_item_val("fb.address.physical", NULL, props->addr);
     510        sysinfo_set_item_val("fb.offset", NULL, props->offset);
    534511        sysinfo_set_item_val("fb.invert-colors", NULL, invert_colors);
    535512
  • uspace/srv/fb/fb.c

    r2b1f860 r20eb5e4d  
    522522 */
    523523static bool
    524 screen_init(void *addr, unsigned int xres, unsigned int yres,
    525         unsigned int scan, unsigned int visual, bool invert_colors)
     524screen_init(void *addr, unsigned int offset, unsigned int xres,
     525        unsigned int yres, unsigned int scan, unsigned int visual,
     526        bool invert_colors)
    526527{
    527528        switch (visual) {
     
    565566        }
    566567
    567         screen.fbaddress = (unsigned char *) addr;
     568        screen.fbaddress = (unsigned char *) (((uintptr_t) addr) + offset);
    568569        screen.xres = xres;
    569570        screen.yres = yres;
     
    13541355        unsigned int fb_scanline;
    13551356        unsigned int fb_visual;
     1357        unsigned int fb_offset;
    13561358        bool fb_invert_colors;
    13571359        void *fb_addr;
     
    13611363
    13621364        fb_ph_addr = (void *) sysinfo_value("fb.address.physical");
     1365        fb_offset = sysinfo_value("fb.offset");
    13631366        fb_width = sysinfo_value("fb.width");
    13641367        fb_height = sysinfo_value("fb.height");
     
    13701373        fb_addr = as_get_mappable_page(asz);
    13711374       
    1372         physmem_map(fb_ph_addr, fb_addr, ALIGN_UP(asz, PAGE_SIZE) >>
     1375        physmem_map(fb_ph_addr + fb_offset, fb_addr, ALIGN_UP(asz, PAGE_SIZE) >>
    13731376            PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE);
    13741377
    1375         if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual,
     1378        if (screen_init(fb_addr, fb_offset, fb_width, fb_height, fb_scanline, fb_visual,
    13761379            fb_invert_colors))
    13771380                return 0;
Note: See TracChangeset for help on using the changeset viewer.