~vcs-imports/qemu/git

« back to all changes in this revision

Viewing changes to hw/pxa2xx_lcd.c

  • Committer: ths
  • Date: 2007-09-16 21:08:06 UTC
  • Revision ID: git-v1:5fafdf24ef2c090c164d4dc89684b3f379dbdd87
find -type f | xargs sed -i 's/[\t ]$//g' # on most files


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * This code is licensed under the GPLv2.
8
8
 */
9
9
 
10
 
#include "hw.h"
11
 
#include "console.h"
12
 
#include "pxa.h"
 
10
#include "vl.h"
13
11
#include "pixel_ops.h"
14
 
/* FIXME: For graphic_rotate. Should probably be done in common code.  */
15
 
#include "sysemu.h"
16
12
 
17
13
typedef void (*drawfn)(uint32_t *, uint8_t *, const uint8_t *, int, int);
18
14
 
23
19
 
24
20
    int invalidated;
25
21
    DisplayState *ds;
26
 
    QEMUConsole *console;
27
22
    drawfn *line_fn[2];
28
23
    int dest_width;
29
24
    int xres, yres;
67
62
        uint32_t command;
68
63
    } dma_ch[7];
69
64
 
70
 
    qemu_irq vsync_cb;
 
65
    void (*vsync_cb)(void *opaque);
 
66
    void *opaque;
71
67
    int orientation;
72
68
};
73
69
 
795
791
 
796
792
    if (width != s->xres || height != s->yres) {
797
793
        if (s->orientation)
798
 
            qemu_console_resize(s->console, height, width);
 
794
            dpy_resize(s->ds, height, width);
799
795
        else
800
 
            qemu_console_resize(s->console, width, height);
 
796
            dpy_resize(s->ds, width, height);
801
797
        s->invalidated = 1;
802
798
        s->xres = width;
803
799
        s->yres = height;
869
865
        dpy_update(s->ds, 0, miny, s->xres, maxy);
870
866
    pxa2xx_lcdc_int_update(s);
871
867
 
872
 
    qemu_irq_raise(s->vsync_cb);
 
868
    if (s->vsync_cb)
 
869
        s->vsync_cb(s->opaque);
873
870
}
874
871
 
875
872
static void pxa2xx_invalidate_display(void *opaque)
883
880
    /* TODO */
884
881
}
885
882
 
886
 
static void pxa2xx_lcdc_orientation(void *opaque, int angle)
 
883
void pxa2xx_lcdc_orientation(void *opaque, int angle)
887
884
{
888
885
    struct pxa2xx_lcdc_s *s = (struct pxa2xx_lcdc_s *) opaque;
889
886
 
1002
999
                    pxa2xx_lcdc_writefn, s);
1003
1000
    cpu_register_physical_memory(base, 0x00100000, iomemtype);
1004
1001
 
1005
 
    s->console = graphic_console_init(ds, pxa2xx_update_display,
1006
 
                                      pxa2xx_invalidate_display,
1007
 
                                      pxa2xx_screen_dump, NULL, s);
 
1002
    graphic_console_init(ds, pxa2xx_update_display,
 
1003
                    pxa2xx_invalidate_display, pxa2xx_screen_dump, s);
1008
1004
 
1009
1005
    switch (s->ds->depth) {
1010
1006
    case 0:
1046
1042
    return s;
1047
1043
}
1048
1044
 
1049
 
void pxa2xx_lcd_vsync_notifier(struct pxa2xx_lcdc_s *s, qemu_irq handler)
1050
 
{
1051
 
    s->vsync_cb = handler;
 
1045
void pxa2xx_lcd_vsync_cb(struct pxa2xx_lcdc_s *s,
 
1046
                void (*cb)(void *opaque), void *opaque) {
 
1047
    s->vsync_cb = cb;
 
1048
    s->opaque = opaque;
1052
1049
}