[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/16] vga: optimize horizontal pel panning in 256-color modes
From: |
Paolo Bonzini |
Subject: |
[PULL 05/16] vga: optimize horizontal pel panning in 256-color modes |
Date: |
Thu, 18 Jan 2024 13:24:05 +0100 |
Do not go through the panning buffer unless the address wraps in the middle
of the line.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/display/vga-helpers.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/display/vga-helpers.h b/hw/display/vga-helpers.h
index 29933562c45..2029b61791b 100644
--- a/hw/display/vga-helpers.h
+++ b/hw/display/vga-helpers.h
@@ -265,6 +265,18 @@ static void *vga_draw_line8d2(VGACommonState *vga, uint8_t
*d,
palette = vga->last_palette;
hpel = (hpel >> 1) & 3;
+
+ /* For 256 color modes, we can adjust the source address and write directly
+ * to the destination, even if horizontal pel panning is active. However,
+ * the loop below assumes that the address does not wrap in the middle of a
+ * plane. If that happens...
+ */
+ if (addr + (width >> 3) * 4 < VGA_VRAM_SIZE) {
+ addr += hpel * 4;
+ hpel = 0;
+ }
+
+ /* ... use the panning buffer as in planar modes. */
if (hpel) {
width += 8;
d = vga->panning_buf;
--
2.43.0
- [PULL 00/16] VGA, x86 TCG, misc changes for 2024-01-18, Paolo Bonzini, 2024/01/18
- [PULL 01/16] vga: use common endian swap macros, Paolo Bonzini, 2024/01/18
- [PULL 02/16] vga: introduce VGADisplayParams, Paolo Bonzini, 2024/01/18
- [PULL 03/16] vga: mask addresses in non-VESA modes to 256k, Paolo Bonzini, 2024/01/18
- [PULL 06/16] vga: reindent memory access code, Paolo Bonzini, 2024/01/18
- [PULL 07/16] vga: use latches in odd/even mode too, Paolo Bonzini, 2024/01/18
- [PULL 05/16] vga: optimize horizontal pel panning in 256-color modes,
Paolo Bonzini <=
- [PULL 09/16] Add class property to configure KVM device node to use, Paolo Bonzini, 2024/01/18
- [PULL 10/16] io_uring: move LuringState typedef to block/aio.h, Paolo Bonzini, 2024/01/18
- [PULL 13/16] target/i386: pcrel: store low bits of physical address in data[0], Paolo Bonzini, 2024/01/18
- [PULL 11/16] target/i386: Do not re-compute new pc with CF_PCREL, Paolo Bonzini, 2024/01/18
- [PULL 15/16] qemu/osdep: Add huge page aligned support on LoongArch platform, Paolo Bonzini, 2024/01/18
- [PULL 16/16] tests/tcg: Don't #include <inttypes.h> in aarch64/system/vtimer.c, Paolo Bonzini, 2024/01/18
- [PULL 12/16] target/i386: fix incorrect EIP in PC-relative translation blocks, Paolo Bonzini, 2024/01/18
- [PULL 08/16] vga: sort-of implement word and double-word access modes, Paolo Bonzini, 2024/01/18
- [PULL 14/16] remove unnecessary casts from uintptr_t, Paolo Bonzini, 2024/01/18
- [PULL 04/16] vga: implement horizontal pel panning in graphics modes, Paolo Bonzini, 2024/01/18