[PATCH 2/2] ati-vga: Update mode on CRTC_PITCH change

BALATON Zoltan posted 2 patches 1 week, 1 day ago
[PATCH 2/2] ati-vga: Update mode on CRTC_PITCH change
Posted by BALATON Zoltan 1 week, 1 day ago
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>
---
 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 3976f5f01c..07c0961b61 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -758,7 +758,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.41.3
Re: [PATCH 2/2] ati-vga: Update mode on CRTC_PITCH change
Posted by Chad Jablonski 5 days, 2 hours ago
Reviewed-by: Chad Jablonski <chad@jablonski.xyz>