version 1.1.1.6, 2018/04/24 19:29:19
|
version 1.1.1.7, 2018/04/24 19:49:32
|
Line 22
|
Line 22
|
#include "framebuffer.h" |
#include "framebuffer.h" |
|
|
struct omap_lcd_panel_s { |
struct omap_lcd_panel_s { |
|
MemoryRegion *sysmem; |
|
MemoryRegion iomem; |
qemu_irq irq; |
qemu_irq irq; |
DisplayState *state; |
DisplayState *state; |
|
|
Line 210 static void omap_update_display(void *op
|
Line 212 static void omap_update_display(void *op
|
|
|
step = width * bpp >> 3; |
step = width * bpp >> 3; |
linesize = ds_get_linesize(omap_lcd->state); |
linesize = ds_get_linesize(omap_lcd->state); |
framebuffer_update_display(omap_lcd->state, |
framebuffer_update_display(omap_lcd->state, omap_lcd->sysmem, |
frame_base, width, height, |
frame_base, width, height, |
step, linesize, 0, |
step, linesize, 0, |
omap_lcd->invalidate, |
omap_lcd->invalidate, |
Line 262 static int ppm_save(const char *filename
|
Line 264 static int ppm_save(const char *filename
|
return 0; |
return 0; |
} |
} |
|
|
static void omap_screen_dump(void *opaque, const char *filename) { |
static void omap_screen_dump(void *opaque, const char *filename, bool cswitch) |
|
{ |
struct omap_lcd_panel_s *omap_lcd = opaque; |
struct omap_lcd_panel_s *omap_lcd = opaque; |
|
|
omap_update_display(opaque); |
omap_update_display(opaque); |
if (omap_lcd && ds_get_data(omap_lcd->state)) |
if (omap_lcd && ds_get_data(omap_lcd->state)) |
ppm_save(filename, ds_get_data(omap_lcd->state), |
ppm_save(filename, ds_get_data(omap_lcd->state), |
Line 323 static void omap_lcd_update(struct omap_
|
Line 327 static void omap_lcd_update(struct omap_
|
} |
} |
} |
} |
|
|
static uint32_t omap_lcdc_read(void *opaque, target_phys_addr_t addr) |
static uint64_t omap_lcdc_read(void *opaque, target_phys_addr_t addr, |
|
unsigned size) |
{ |
{ |
struct omap_lcd_panel_s *s = (struct omap_lcd_panel_s *) opaque; |
struct omap_lcd_panel_s *s = (struct omap_lcd_panel_s *) opaque; |
|
|
Line 356 static uint32_t omap_lcdc_read(void *opa
|
Line 361 static uint32_t omap_lcdc_read(void *opa
|
} |
} |
|
|
static void omap_lcdc_write(void *opaque, target_phys_addr_t addr, |
static void omap_lcdc_write(void *opaque, target_phys_addr_t addr, |
uint32_t value) |
uint64_t value, unsigned size) |
{ |
{ |
struct omap_lcd_panel_s *s = (struct omap_lcd_panel_s *) opaque; |
struct omap_lcd_panel_s *s = (struct omap_lcd_panel_s *) opaque; |
|
|
Line 399 static void omap_lcdc_write(void *opaque
|
Line 404 static void omap_lcdc_write(void *opaque
|
} |
} |
} |
} |
|
|
static CPUReadMemoryFunc * const omap_lcdc_readfn[] = { |
static const MemoryRegionOps omap_lcdc_ops = { |
omap_lcdc_read, |
.read = omap_lcdc_read, |
omap_lcdc_read, |
.write = omap_lcdc_write, |
omap_lcdc_read, |
.endianness = DEVICE_NATIVE_ENDIAN, |
}; |
|
|
|
static CPUWriteMemoryFunc * const omap_lcdc_writefn[] = { |
|
omap_lcdc_write, |
|
omap_lcdc_write, |
|
omap_lcdc_write, |
|
}; |
}; |
|
|
void omap_lcdc_reset(struct omap_lcd_panel_s *s) |
void omap_lcdc_reset(struct omap_lcd_panel_s *s) |
Line 433 void omap_lcdc_reset(struct omap_lcd_pan
|
Line 432 void omap_lcdc_reset(struct omap_lcd_pan
|
s->ctrl = 0; |
s->ctrl = 0; |
} |
} |
|
|
struct omap_lcd_panel_s *omap_lcdc_init(target_phys_addr_t base, qemu_irq irq, |
struct omap_lcd_panel_s *omap_lcdc_init(MemoryRegion *sysmem, |
struct omap_dma_lcd_channel_s *dma, omap_clk clk) |
target_phys_addr_t base, |
|
qemu_irq irq, |
|
struct omap_dma_lcd_channel_s *dma, |
|
omap_clk clk) |
{ |
{ |
int iomemtype; |
|
struct omap_lcd_panel_s *s = (struct omap_lcd_panel_s *) |
struct omap_lcd_panel_s *s = (struct omap_lcd_panel_s *) |
g_malloc0(sizeof(struct omap_lcd_panel_s)); |
g_malloc0(sizeof(struct omap_lcd_panel_s)); |
|
|
s->irq = irq; |
s->irq = irq; |
s->dma = dma; |
s->dma = dma; |
|
s->sysmem = sysmem; |
omap_lcdc_reset(s); |
omap_lcdc_reset(s); |
|
|
iomemtype = cpu_register_io_memory(omap_lcdc_readfn, |
memory_region_init_io(&s->iomem, &omap_lcdc_ops, s, "omap.lcdc", 0x100); |
omap_lcdc_writefn, s, DEVICE_NATIVE_ENDIAN); |
memory_region_add_subregion(sysmem, base, &s->iomem); |
cpu_register_physical_memory(base, 0x100, iomemtype); |
|
|
|
s->state = graphic_console_init(omap_update_display, |
s->state = graphic_console_init(omap_update_display, |
omap_invalidate_display, |
omap_invalidate_display, |