@samitouri / QOSamiQemu / commits / b7c0d01719

ati-vga: Fix display updates in non-32 bit modes

The memory_region_set_dirty used to mark changes should use stride value in vram which is normally only the same as surface_stride in 32 bit modes. This caused missed updates in 8 and 16 bit modes. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Chad Jablonski <chad@jablonski.xyz> Message-ID: <6e1b83ef3fe7a1ebc246b474eb2b0c7cd05d5deb.1774110169.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

BALATON Zoltan committed Mar 21, 2026 at 17:30 UTC b7c0d0171950012e366eb046b792f407b749dd2e
1 file changed +3 -2
hw/display/ati_2d.c
+3 -2
@@ -70,6 +70,7 @@ static void ati_set_dirty(VGACommonState *vga, const ATI2DCtx *ctx)
70 {
71 DisplaySurface *ds = qemu_console_surface(vga->con);
72
73 + (void)ds;
74 DPRINTF("%p %u ds: %p %d %d rop: %x\n", vga->vram_ptr, vga->vbe_start_addr,
75 surface_data(ds), surface_stride(ds), surface_bits_per_pixel(ds),
76 ctx->rop3 >> 16);
@@ -78,8 +79,8 @@ static void ati_set_dirty(VGACommonState *vga, const ATI2DCtx *ctx)
79 vga->vbe_regs[VBE_DISPI_INDEX_YRES] * vga->vbe_line_offset) {
80 memory_region_set_dirty(&vga->vram,
81 vga->vbe_start_addr + ctx->dst_offset +
81 - ctx->dst.y * surface_stride(ds),
82 - ctx->dst.height * surface_stride(ds));
82 + ctx->dst.y * ctx->dst_stride,
83 + ctx->dst.height * ctx->dst_stride);
84 }
85 }
86