[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw: cirrus_vga: mask 'off_begin' in cirrus_invalidate_region
From: |
Gerd Hoffmann |
Subject: |
Re: [PATCH] hw: cirrus_vga: mask 'off_begin' in cirrus_invalidate_region() |
Date: |
Fri, 21 Aug 2020 10:23:14 +0200 |
> This patch fixes this.
> --- a/hw/display/cirrus_vga.c
> +++ b/hw/display/cirrus_vga.c
> @@ -644,7 +644,7 @@ static void cirrus_invalidate_region(CirrusVGAState * s,
> int off_begin,
> off_cur_end = ((off_cur + bytesperline - 1) & s->cirrus_addr_mask) +
> 1;
> assert(off_cur_end >= off_cur);
> memory_region_set_dirty(&s->vga.vram, off_cur, off_cur_end -
> off_cur);
> - off_begin += off_pitch;
> + off_begin = (off_begin + off_pitch) & s->cirrus_addr_mask;
> }
Well. Only in case the wraparound doesn't split a scanline ...
take care,
Gerd