[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/9] hw/display/pxa2xx_lcd: Remove dest_width state field
From: |
Peter Maydell |
Subject: |
[PATCH 5/9] hw/display/pxa2xx_lcd: Remove dest_width state field |
Date: |
Thu, 11 Feb 2021 14:15:11 +0000 |
Since the dest_width is now always 4 because the output surface is
32bpp, we can replace the dest_width state field with a constant.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/display/pxa2xx_lcd.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c
index 786a777629f..33343832bbc 100644
--- a/hw/display/pxa2xx_lcd.c
+++ b/hw/display/pxa2xx_lcd.c
@@ -187,6 +187,9 @@ typedef struct QEMU_PACKED {
#define LDCMD_SOFINT (1 << 22)
#define LDCMD_PAL (1 << 26)
+/* Size of a pixel in the QEMU UI output surface, in bytes */
+#define DEST_PIXEL_WIDTH 4
+
#define BITS 32
#include "pxa2xx_template.h"
@@ -702,14 +705,14 @@ static void pxa2xx_lcdc_dma0_redraw_rot0(PXA2xxLCDState
*s,
else if (s->bpp > pxa_lcdc_8bpp)
src_width *= 2;
- dest_width = s->xres * s->dest_width;
+ dest_width = s->xres * DEST_PIXEL_WIDTH;
*miny = 0;
if (s->invalidated) {
framebuffer_update_memory_section(&s->fbsection, s->sysmem,
addr, s->yres, src_width);
}
framebuffer_update_display(surface, &s->fbsection, s->xres, s->yres,
- src_width, dest_width, s->dest_width,
+ src_width, dest_width, DEST_PIXEL_WIDTH,
s->invalidated,
fn, s->dma_ch[0].palette, miny, maxy);
}
@@ -731,14 +734,14 @@ static void pxa2xx_lcdc_dma0_redraw_rot90(PXA2xxLCDState
*s,
else if (s->bpp > pxa_lcdc_8bpp)
src_width *= 2;
- dest_width = s->yres * s->dest_width;
+ dest_width = s->yres * DEST_PIXEL_WIDTH;
*miny = 0;
if (s->invalidated) {
framebuffer_update_memory_section(&s->fbsection, s->sysmem,
addr, s->yres, src_width);
}
framebuffer_update_display(surface, &s->fbsection, s->xres, s->yres,
- src_width, s->dest_width, -dest_width,
+ src_width, DEST_PIXEL_WIDTH, -dest_width,
s->invalidated,
fn, s->dma_ch[0].palette,
miny, maxy);
@@ -763,14 +766,14 @@ static void pxa2xx_lcdc_dma0_redraw_rot180(PXA2xxLCDState
*s,
src_width *= 2;
}
- dest_width = s->xres * s->dest_width;
+ dest_width = s->xres * DEST_PIXEL_WIDTH;
*miny = 0;
if (s->invalidated) {
framebuffer_update_memory_section(&s->fbsection, s->sysmem,
addr, s->yres, src_width);
}
framebuffer_update_display(surface, &s->fbsection, s->xres, s->yres,
- src_width, -dest_width, -s->dest_width,
+ src_width, -dest_width, -DEST_PIXEL_WIDTH,
s->invalidated,
fn, s->dma_ch[0].palette, miny, maxy);
}
@@ -794,14 +797,14 @@ static void pxa2xx_lcdc_dma0_redraw_rot270(PXA2xxLCDState
*s,
src_width *= 2;
}
- dest_width = s->yres * s->dest_width;
+ dest_width = s->yres * DEST_PIXEL_WIDTH;
*miny = 0;
if (s->invalidated) {
framebuffer_update_memory_section(&s->fbsection, s->sysmem,
addr, s->yres, src_width);
}
framebuffer_update_display(surface, &s->fbsection, s->xres, s->yres,
- src_width, -s->dest_width, dest_width,
+ src_width, -DEST_PIXEL_WIDTH, dest_width,
s->invalidated,
fn, s->dma_ch[0].palette,
miny, maxy);
@@ -1013,7 +1016,6 @@ PXA2xxLCDState *pxa2xx_lcdc_init(MemoryRegion *sysmem,
memory_region_add_subregion(sysmem, base, &s->iomem);
s->con = graphic_console_init(NULL, 0, &pxa2xx_ops, s);
- s->dest_width = 4;
vmstate_register(NULL, 0, &vmstate_pxa2xx_lcdc, s);
--
2.20.1
- [PATCH 0/9] hw/display/pl110, pxa2xx_lcd: Tidy up template headers, Peter Maydell, 2021/02/11
- [PATCH 1/9] hw/display/pl110: Remove dead code for non-32-bpp surfaces, Peter Maydell, 2021/02/11
- [PATCH 4/9] hw/display/pxa2xx_lcd: Remove dead code for non-32-bpp surfaces, Peter Maydell, 2021/02/11
- [PATCH 2/9] hw/display/pl110: Pull included-once parts of template header into pl110.c, Peter Maydell, 2021/02/11
- [PATCH 5/9] hw/display/pxa2xx_lcd: Remove dest_width state field,
Peter Maydell <=
- [PATCH 3/9] hw/display/pl110: Remove use of BITS from pl110_template.h, Peter Maydell, 2021/02/11
- [PATCH 7/9] hw/display/pxa2xx: Apply brace-related coding style fixes to template header, Peter Maydell, 2021/02/11
- [PATCH 6/9] hw/display/pxa2xx: Remove use of BITS in pxa2xx_template.h, Peter Maydell, 2021/02/11
- [PATCH 9/9] hw/display/pxa2xx: Inline template header, Peter Maydell, 2021/02/11
- [PATCH 8/9] hw/display/pxa2xx: Apply whitespace-only coding style fixes to template header, Peter Maydell, 2021/02/11
- Malfunctionning qemu-system-arm ?, vincent Dupaquis, 2021/02/15