Commit f4813f444a for qemu.org
commit f4813f444abf77ba8dd0a2c57f42fbc122a760f7
Author: BALATON Zoltan <balaton@eik.bme.hu>
Date: Fri Apr 3 16:59:28 2026 +0200
ati-vga: Update mode on CRTC_PITCH change
When changing line length we need to update display parameters so call
mode change when changing CRTC_PITCH if the value has changed.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Chad Jablonski <chad@jablonski.xyz>
Message-ID: <3f54ff54a873a8f8a0cc5f14660703b4025a69e2.1775228029.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff --git a/hw/display/ati.c b/hw/display/ati.c
index a283afbfff..7bb57c44d9 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -743,7 +743,11 @@ static void ati_mm_write(void *opaque, hwaddr addr,
s->regs.crtc_offset_cntl = data; /* FIXME */
break;
case CRTC_PITCH:
- s->regs.crtc_pitch = data & 0x07ff07ff;
+ data &= 0x07ff07ff;
+ if (s->regs.crtc_pitch != data) {
+ s->regs.crtc_pitch = data;
+ ati_vga_switch_mode(s);
+ }
break;
case 0xf00 ... 0xfff:
/* read-only copy of PCI config space so ignore writes */