static void pxa2xx_lcdc_orientation(void *opaque, int angle) { PXA2xxLCDState *s = (PXA2xxLCDState *) opaque; if (angle) { s->dma_ch[0].redraw = pxa2xx_lcdc_dma0_redraw_vert; } else { s->dma_ch[0].redraw = pxa2xx_lcdc_dma0_redraw_horiz; } s->orientation = angle; s->xres = s->yres = -1; pxa2xx_lcdc_resize(s); }
static void pxa2xx_lcdc_orientation(void *opaque, int angle) { PXA2xxLCDState *s = (PXA2xxLCDState *) opaque; switch (angle) { case 0: s->dma_ch[0].redraw = pxa2xx_lcdc_dma0_redraw_rot0; break; case 90: s->dma_ch[0].redraw = pxa2xx_lcdc_dma0_redraw_rot90; break; case 180: s->dma_ch[0].redraw = pxa2xx_lcdc_dma0_redraw_rot180; break; case 270: s->dma_ch[0].redraw = pxa2xx_lcdc_dma0_redraw_rot270; break; } s->orientation = angle; s->xres = s->yres = -1; pxa2xx_lcdc_resize(s); }
static void pxa2xx_update_display(void *opaque) { PXA2xxLCDState *s = (PXA2xxLCDState *) opaque; hwaddr fbptr; int miny, maxy; int ch; if (!(s->control[0] & LCCR0_ENB)) return; pxa2xx_descriptor_load(s); pxa2xx_lcdc_resize(s); miny = s->yres; maxy = 0; s->transp = s->dma_ch[2].up || s->dma_ch[3].up; /* Note: With overlay planes the order depends on LCCR0 bit 25. */ for (ch = 0; ch < PXA_LCDDMA_CHANS; ch ++) if (s->dma_ch[ch].up) { if (!s->dma_ch[ch].source) { pxa2xx_dma_ber_set(s, ch); continue; } fbptr = s->dma_ch[ch].source; if (!((fbptr >= PXA2XX_SDRAM_BASE && fbptr <= PXA2XX_SDRAM_BASE + ram_size) || (fbptr >= PXA2XX_INTERNAL_BASE && fbptr <= PXA2XX_INTERNAL_BASE + PXA2XX_INTERNAL_SIZE))) { pxa2xx_dma_ber_set(s, ch); continue; } if (s->dma_ch[ch].command & LDCMD_PAL) { cpu_physical_memory_read(fbptr, s->dma_ch[ch].pbuffer, MAX(LDCMD_LENGTH(s->dma_ch[ch].command), sizeof(s->dma_ch[ch].pbuffer))); pxa2xx_palette_parse(s, ch, s->bpp); } else { /* Do we need to reparse palette */ if (LCCR4_PALFOR(s->control[4]) != s->pal_for) pxa2xx_palette_parse(s, ch, s->bpp); /* ACK frame start */ pxa2xx_dma_sof_set(s, ch); s->dma_ch[ch].redraw(s, fbptr, &miny, &maxy); s->invalidated = 0; /* ACK frame completed */ pxa2xx_dma_eof_set(s, ch); } } if (s->control[0] & LCCR0_DIS) { /* ACK last frame completed */ s->control[0] &= ~LCCR0_ENB; s->status[0] |= LCSR0_LDD; } if (miny >= 0) { switch (s->orientation) { case 0: dpy_gfx_update(s->con, 0, miny, s->xres, maxy - miny + 1); break; case 90: dpy_gfx_update(s->con, miny, 0, maxy - miny + 1, s->xres); break; case 180: maxy = s->yres - maxy - 1; miny = s->yres - miny - 1; dpy_gfx_update(s->con, 0, maxy, s->xres, miny - maxy + 1); break; case 270: maxy = s->yres - maxy - 1; miny = s->yres - miny - 1; dpy_gfx_update(s->con, maxy, 0, miny - maxy + 1, s->xres); break; } } pxa2xx_lcdc_int_update(s); qemu_irq_raise(s->vsync_cb); }