[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 5/8] ati-vga: Fix hardware cursor image offset
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 5/8] ati-vga: Fix hardware cursor image offset |
Date: |
Thu, 22 Aug 2019 10:04:59 +0200 |
From: BALATON Zoltan <address@hidden>
The crtc_offset is not needed, cur_offset is relative to the start of
vram not the start of displayed area. This fixes broken pointer image
with MacOS that uses non-0 crtc_offset.
Signed-off-by: BALATON Zoltan <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/display/ati.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/display/ati.c b/hw/display/ati.c
index d372e346ffd9..ff04f7eb4a2d 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -132,9 +132,8 @@ static void ati_cursor_define(ATIVGAState *s)
return; /* Do not update cursor if locked or rendered by guest */
}
/* FIXME handle cur_hv_offs correctly */
- src = s->vga.vram_ptr + (s->regs.crtc_offset & 0x07ffffff) +
- s->regs.cur_offset - (s->regs.cur_hv_offs >> 16) -
- (s->regs.cur_hv_offs & 0xffff) * 16;
+ src = s->vga.vram_ptr + s->regs.cur_offset -
+ (s->regs.cur_hv_offs >> 16) - (s->regs.cur_hv_offs & 0xffff) * 16;
for (i = 0; i < 64; i++) {
for (j = 0; j < 8; j++, idx++) {
data[idx] = src[i * 16 + j];
@@ -190,8 +189,7 @@ static void ati_cursor_draw_line(VGACommonState *vga,
uint8_t *d, int scr_y)
return;
}
/* FIXME handle cur_hv_offs correctly */
- src = s->vga.vram_ptr + (s->regs.crtc_offset & 0x07ffffff) +
- s->cursor_offset + (scr_y - vga->hw_cursor_y) * 16;
+ src = s->vga.vram_ptr + s->cursor_offset + (scr_y - vga->hw_cursor_y) * 16;
dp = &dp[vga->hw_cursor_x];
h = ((s->regs.crtc_h_total_disp >> 16) + 1) * 8;
for (i = 0; i < 8; i++) {
--
2.18.1
- [Qemu-devel] [PULL 0/8] Vga 20190822 patches, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 1/8] ati-vga: Add registers for getting apertures, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 5/8] ati-vga: Fix hardware cursor image offset,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 3/8] ati-vga: Fix GPIO_MONID register write, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 4/8] ati-vga: Fix cursor color with guest_hwcursor=true, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 2/8] ati-vga: Add some register definitions for debugging, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 7/8] ati-vga: Add limited support for big endian frame buffer aperture, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 8/8] ati-vga: Implement dummy VBlank IRQ, Gerd Hoffmann, 2019/08/22
- [Qemu-devel] [PULL 6/8] ati-vga: Attempt to handle CRTC offset not exact multiple of stride, Gerd Hoffmann, 2019/08/22
- Re: [Qemu-devel] [PULL 0/8] Vga 20190822 patches, Peter Maydell, 2019/08/22