~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to hw/pxa2xx_lcd.c

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-22 10:13:17 UTC
  • mfrom: (1.2.1 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090322101317-iigjtnu5qil35dtb
Tags: 0.10.1-1
[ Aurelien Jarno ]
* New upstream stable release:
  - patches/80_stable-branch.patch: remove.
* debian/control: 
  - Remove depends on proll.
  - Move depends on device-tree-compiler to build-depends.
  - Bump Standards-Version to 3.8.1 (no changes).
* patches/82_qemu-img_decimal.patch: new patch from upstream to make
  qemu-img accept sizes with decimal values (closes: bug#501400).

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
typedef void (*drawfn)(uint32_t *, uint8_t *, const uint8_t *, int, int);
18
18
 
19
19
struct pxa2xx_lcdc_s {
20
 
    target_phys_addr_t base;
21
20
    qemu_irq irq;
22
21
    int irqlevel;
23
22
 
321
320
{
322
321
    struct pxa2xx_lcdc_s *s = (struct pxa2xx_lcdc_s *) opaque;
323
322
    int ch;
324
 
    offset -= s->base;
325
323
 
326
324
    switch (offset) {
327
325
    case LCCR0:
417
415
{
418
416
    struct pxa2xx_lcdc_s *s = (struct pxa2xx_lcdc_s *) opaque;
419
417
    int ch;
420
 
    offset -= s->base;
421
418
 
422
419
    switch (offset) {
423
420
    case LCCR0:
649
646
            }
650
647
            break;
651
648
        }
652
 
        switch (s->ds->depth) {
 
649
        switch (ds_get_bits_per_pixel(s->ds)) {
653
650
        case 8:
654
651
            *dest = rgb_to_pixel8(r, g, b) | alpha;
655
652
            break;
692
689
    else if (s->bpp > pxa_lcdc_8bpp)
693
690
        src_width *= 2;
694
691
 
695
 
    dest = s->ds->data;
 
692
    dest = ds_get_data(s->ds);
696
693
    dest_width = s->xres * s->dest_width;
697
694
 
698
695
    addr = (ram_addr_t) (fb - phys_ram_base);
699
696
    start = addr + s->yres * src_width;
700
697
    end = addr;
701
 
    dirty[0] = dirty[1] = cpu_physical_memory_get_dirty(start, VGA_DIRTY_FLAG);
 
698
    dirty[0] = dirty[1] = cpu_physical_memory_get_dirty(addr, VGA_DIRTY_FLAG);
702
699
    for (y = 0; y < s->yres; y ++) {
703
700
        new_addr = addr + src_width;
704
701
        for (x = addr + TARGET_PAGE_SIZE; x < new_addr;
749
746
        src_width *= 2;
750
747
 
751
748
    dest_width = s->yres * s->dest_width;
752
 
    dest = s->ds->data + dest_width * (s->xres - 1);
 
749
    dest = ds_get_data(s->ds) + dest_width * (s->xres - 1);
753
750
 
754
751
    addr = (ram_addr_t) (fb - phys_ram_base);
755
752
    start = addr + s->yres * src_width;
756
753
    end = addr;
 
754
    x = addr + TARGET_PAGE_SIZE;
757
755
    dirty[0] = dirty[1] = cpu_physical_memory_get_dirty(start, VGA_DIRTY_FLAG);
758
756
    for (y = 0; y < s->yres; y ++) {
759
757
        new_addr = addr + src_width;
760
 
        for (x = addr + TARGET_PAGE_SIZE; x < new_addr;
761
 
                        x += TARGET_PAGE_SIZE) {
 
758
        for (; x < new_addr; x += TARGET_PAGE_SIZE) {
762
759
            dirty[1] = cpu_physical_memory_get_dirty(x, VGA_DIRTY_FLAG);
763
760
            dirty[0] |= dirty[1];
764
761
        }
794
791
 
795
792
    if (width != s->xres || height != s->yres) {
796
793
        if (s->orientation)
797
 
            dpy_resize(s->ds, height, width);
 
794
            qemu_console_resize(s->ds, height, width);
798
795
        else
799
 
            dpy_resize(s->ds, width, height);
 
796
            qemu_console_resize(s->ds, width, height);
800
797
        s->invalidated = 1;
801
798
        s->xres = width;
802
799
        s->yres = height;
983
980
#define BITS 32
984
981
#include "pxa2xx_template.h"
985
982
 
986
 
struct pxa2xx_lcdc_s *pxa2xx_lcdc_init(target_phys_addr_t base, qemu_irq irq,
987
 
                DisplayState *ds)
 
983
struct pxa2xx_lcdc_s *pxa2xx_lcdc_init(target_phys_addr_t base, qemu_irq irq)
988
984
{
989
985
    int iomemtype;
990
986
    struct pxa2xx_lcdc_s *s;
991
987
 
992
988
    s = (struct pxa2xx_lcdc_s *) qemu_mallocz(sizeof(struct pxa2xx_lcdc_s));
993
 
    s->base = base;
994
989
    s->invalidated = 1;
995
990
    s->irq = irq;
996
 
    s->ds = ds;
997
991
 
998
992
    pxa2xx_lcdc_orientation(s, graphic_rotate);
999
993
 
1001
995
                    pxa2xx_lcdc_writefn, s);
1002
996
    cpu_register_physical_memory(base, 0x00100000, iomemtype);
1003
997
 
1004
 
    graphic_console_init(ds, pxa2xx_update_display,
1005
 
                    pxa2xx_invalidate_display, pxa2xx_screen_dump, s);
 
998
    s->ds = graphic_console_init(pxa2xx_update_display,
 
999
                                 pxa2xx_invalidate_display,
 
1000
                                 pxa2xx_screen_dump, NULL, s);
1006
1001
 
1007
 
    switch (s->ds->depth) {
 
1002
    switch (ds_get_bits_per_pixel(s->ds)) {
1008
1003
    case 0:
1009
1004
        s->dest_width = 0;
1010
1005
        break;