Re: [PATCH v3] ati-vga: fix ati_set_dirty address calculation

2026-05-09 Thread Chad Jablonski
Thanks Zoltan for the v3. I was away for a bit there.
Glad to see it queued. Thank you Philippe.



Re: [PATCH v3] ati-vga: fix ati_set_dirty address calculation

2026-05-07 Thread Philippe Mathieu-Daudé

On 6/5/26 17:39, BALATON Zoltan wrote:

From: Chad Jablonski 

This fixes three bugs with the ati_set_dirty address calculation.

First, vbe_start_addr is a word offset. All other values in the
calculation are byte offsets. It must be converted to bytes.

Second, when setting the dirty region with memory_region_set_dirty
the vbe_start_addr is used to calculate the start of the dirty region.
This is a problem because the vbe_start_addr is the offset at which scan out
begins. This puts it in the visible screen coordinate system. The dirty
region however is in the virtual screen coordinate system. This can cause both
overmarking and missed updates. This is removed from the calculation.

Third, when the start address of a blit is outside of the bounds check
the entire blit is missed and not set to dirty. This happens even if the
blit does partially overlap with the visible screen. The fix here is to
find the intersection of the visible screen and the blit and mark only
that region as dirty.

This does not attempt to apply clipping to the blit. So there will be
overmarking in some cases.

Signed-off-by: Chad Jablonski 
[balaton: drop excess parenthesis, use offsets instead of pointers]
Reviewed-by: BALATON Zoltan 
Tested-by: BALATON Zoltan 
Signed-off-by: BALATON Zoltan 
---


Queued, thanks.