summaryrefslogtreecommitdiff
path: root/hw/omap_lcdc.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-24 19:29:13 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-24 19:29:13 +0000
commit0e1f5a0c495dd7a5c72c9321a29541bdde8f423a (patch)
tree374c5da7054c16f764a1cb2b5079d612cf417dac /hw/omap_lcdc.c
parentcab3bee2d6f1d6eb6ad74006b8a63562cda9ba4d (diff)
downloadqemu-0e1f5a0c495dd7a5c72c9321a29541bdde8f423a.tar.gz
Introduce accessors for DisplayState (Stefano Stabellini)
Introducing some accessors: ds_get_linesize ds_get_bits_per_pixel ds_get_width ds_get_height ds_get_data Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5789 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/omap_lcdc.c')
-rw-r--r--hw/omap_lcdc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/hw/omap_lcdc.c b/hw/omap_lcdc.c
index 99e8b4fa44..66cc8dfe23 100644
--- a/hw/omap_lcdc.c
+++ b/hw/omap_lcdc.c
@@ -125,7 +125,7 @@ static void omap_update_display(void *opaque)
uint8_t *s, *d;
if (!omap_lcd || omap_lcd->plm == 1 ||
- !omap_lcd->enable || !omap_lcd->state->depth)
+ !omap_lcd->enable || !ds_get_bits_per_pixel(omap_lcd->state))
return;
frame_offset = 0;
@@ -145,25 +145,25 @@ static void omap_update_display(void *opaque)
/* Colour depth */
switch ((omap_lcd->palette[0] >> 12) & 7) {
case 1:
- draw_line = draw_line_table2[omap_lcd->state->depth];
+ draw_line = draw_line_table2[ds_get_bits_per_pixel(omap_lcd->state)];
bpp = 2;
break;
case 2:
- draw_line = draw_line_table4[omap_lcd->state->depth];
+ draw_line = draw_line_table4[ds_get_bits_per_pixel(omap_lcd->state)];
bpp = 4;
break;
case 3:
- draw_line = draw_line_table8[omap_lcd->state->depth];
+ draw_line = draw_line_table8[ds_get_bits_per_pixel(omap_lcd->state)];
bpp = 8;
break;
case 4 ... 7:
if (!omap_lcd->tft)
- draw_line = draw_line_table12[omap_lcd->state->depth];
+ draw_line = draw_line_table12[ds_get_bits_per_pixel(omap_lcd->state)];
else
- draw_line = draw_line_table16[omap_lcd->state->depth];
+ draw_line = draw_line_table16[ds_get_bits_per_pixel(omap_lcd->state)];
bpp = 16;
break;
@@ -174,8 +174,8 @@ static void omap_update_display(void *opaque)
/* Resolution */
width = omap_lcd->width;
- if (width != omap_lcd->state->width ||
- omap_lcd->height != omap_lcd->state->height) {
+ if (width != ds_get_width(omap_lcd->state) ||
+ omap_lcd->height != ds_get_height(omap_lcd->state)) {
qemu_console_resize(omap_lcd->console,
omap_lcd->width, omap_lcd->height);
omap_lcd->invalidate = 1;
@@ -202,7 +202,7 @@ static void omap_update_display(void *opaque)
if (omap_lcd->dma->dual)
omap_lcd->dma->current_frame ^= 1;
- if (!omap_lcd->state->depth)
+ if (!ds_get_bits_per_pixel(omap_lcd->state))
return;
line = 0;
@@ -217,8 +217,8 @@ static void omap_update_display(void *opaque)
step = width * bpp >> 3;
scanline = frame_base + step * line;
s = (uint8_t *) (phys_ram_base + scanline);
- d = omap_lcd->state->data;
- linesize = omap_lcd->state->linesize;
+ d = ds_get_data(omap_lcd->state);
+ linesize = ds_get_linesize(omap_lcd->state);
dirty[0] = dirty[1] =
cpu_physical_memory_get_dirty(scanline, VGA_DIRTY_FLAG);
@@ -293,10 +293,10 @@ static int ppm_save(const char *filename, uint8_t *data,
static void omap_screen_dump(void *opaque, const char *filename) {
struct omap_lcd_panel_s *omap_lcd = opaque;
omap_update_display(opaque);
- if (omap_lcd && omap_lcd->state->data)
- ppm_save(filename, omap_lcd->state->data,
+ if (omap_lcd && ds_get_data(omap_lcd->state))
+ ppm_save(filename, ds_get_data(omap_lcd->state),
omap_lcd->width, omap_lcd->height,
- omap_lcd->state->linesize);
+ ds_get_linesize(omap_lcd->state));
}
static void omap_invalidate_display(void *opaque) {