@samitouri / QOSamiQemu / commits / f4813f444a

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>

BALATON Zoltan committed Apr 3, 2026 at 16:59 UTC f4813f444abf77ba8dd0a2c57f42fbc122a760f7
1 file changed +5 -1
hw/display/ati.c
+5 -1
@@ -743,7 +743,11 @@ static void ati_mm_write(void *opaque, hwaddr addr,
743 s->regs.crtc_offset_cntl = data; /* FIXME */
744 break;
745 case CRTC_PITCH:
746 - s->regs.crtc_pitch = data & 0x07ff07ff;
746 + data &= 0x07ff07ff;
747 + if (s->regs.crtc_pitch != data) {
748 + s->regs.crtc_pitch = data;
749 + ati_vga_switch_mode(s);
750 + }
751 break;
752 case 0xf00 ... 0xfff:
753 /* read-only copy of PCI config space so ignore writes */