[PATCH-for-11.0 5/6] ati-vga: Update mode on CRTC_PITCH change

Philippe Mathieu-Daudé posted 6 patches 3 days, 20 hours ago
Maintainers: Pierrick Bouvier <pierrick.bouvier@linaro.org>, Peter Maydell <peter.maydell@linaro.org>, Gerd Hoffmann <kraxel@redhat.com>
[PATCH-for-11.0 5/6] ati-vga: Update mode on CRTC_PITCH change
Posted by Philippe Mathieu-Daudé 3 days, 20 hours ago
From: BALATON Zoltan <balaton@eik.bme.hu>

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>
---
 hw/display/ati.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/display/ati.c b/hw/display/ati.c
index a283afbfff5..7bb57c44d95 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 */
-- 
2.53.0