Changeset 20eb5e4d in mainline for kernel/genarch/src/fb/fb.c


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.