qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] tc6393xb: non-accelerated FB support


From: Dmitry Baryshkov
Subject: Re: [Qemu-devel] [PATCH] tc6393xb: non-accelerated FB support
Date: Sun, 2 Nov 2008 20:36:19 +0300
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Nov 02, 2008 at 05:31:25PM +0100, andrzej zaborowski wrote:
> 2008/11/2 Dmitry Baryshkov <address@hidden>:
> > Signed-off-by: Dmitry Baryshkov <address@hidden>

> > +#if 0
> > +static void tc6393xb_draw_blank(struct tc6393xb_s *s, int full_update)
> > +{
> > +    int i, w;
> > +    uint8_t *d;
> > +
> > +    if (!full_update)
> > +        return;
> > +
> > +    w = s->scr_width * ((s->ds->depth + 7) >> 3);
> > +    d = s->ds->data;
> > +    for(i = 0; i < s->scr_height; i++) {
> > +        memset(d, 0, w);
> > +        d += s->ds->linesize;
> > +    }
> > +
> > +    dpy_update(s->ds, 0, 0, s->scr_width, s->scr_height);
> > +}
> > +#endif
> 
> This assumes in 24bit mode a pixel occupies only 3 bytes (which iirc
> is correct) and above PIXEL_WIDTH for 24 bits is set to 32.

This is disabled as it's untested. And about 24bit mode... I'm really
not sure. I thought that when used it has 24 bit color, but 32 bit
alignment of colors. Otherwise it will be a nightmare to use.

> > +
> > +static void tc6393xb_update_display(void *opaque)
> > +{
> > +    struct tc6393xb_s *s = opaque;
> > +#if 0
> > +    int full_update, graphic_mode;
> > +#endif
> > +
> > +    if (s->scr_width == 0 || s->scr_height == 0)
> > +        return;
> > +
> > +#if 0
> > +    if (s->ctla & CTLA_FORCE_BLANK)
> > +        graphic_mode = GMODE_BLANK;
> > +    else
> > +        graphic_mode = GMODE_GRAPH;
> > +    full_update = 0;
> > +    if (graphic_mode != s->graphic_mode) {
> > +        s->graphic_mode = graphic_mode;
> > +        full_update = 1;
> > +    }
> > +#endif
> > +    if (s->scr_width != s->ds->width || s->scr_height != s->ds->height) {
> > +        qemu_console_resize(s->console, s->scr_width, s->scr_height);
> > +#if 0
> > +        full_update = 1;
> > +#endif
> > +    }
> > +#if 0
> > +    switch(graphic_mode) {
> > +        case GMODE_GRAPH:
> > +            tc6393xb_draw_graphic(s, full_update);
> > +            break;
> > +        case GMODE_BLANK:
> > +        default:
> > +            tc6393xb_draw_blank(s, full_update);
> > +            break;
> > +    }
> > +#else
> > +            tc6393xb_draw_graphic(s);
> > +#endif
> > +}
> 
> Why's blank mode disabled?

Not Yet Supported.

> 
> IIRC the page size is 0x400 on qemu-system-arm so you could register
> this region as RAM, this sould give a speed-up.  The indentation is
> strange.

Hmm. Nice idea. I'll redo this patch anyway then.

> > +    for(i = 0; i < s->scr_height; i++) {
> > +        dd = data_display;
> > +        for (j = 0; j < s->scr_width; j++, dd += PIXEL_WIDTH / 8, 
> > data_buffer++) {
> > +            uint16_t color = *data_buffer;
> > +            *((glue(glue(uint, PIXEL_WIDTH), _t) *)dd) = 
> > glue(rgb_to_pixel, BITS)(
> > +                           ((color & 0xf800) * 0x108) >> 11,
> > +                           ((color & 0x7e0) * 0x41) >> 9,
> > +                           ((color & 0x1f) * 0x21) >> 2
> > +                           );
> 
> This assumes power of two PIXEL_WIDTH (which is power-of-two but
> possibly wrongly).
> For the RGB565 host case you can possibly use memcpy.

See above about 24-bit mode.
Nice idea for 565 mode :)

-- 
With best wishes
Dmitry





reply via email to

[Prev in Thread] Current Thread [Next in Thread]