[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] cirrus: handle wraparound in cirrus_invalidate_region
From: |
Gerd Hoffmann |
Subject: |
Re: [PATCH] cirrus: handle wraparound in cirrus_invalidate_region |
Date: |
Mon, 31 Aug 2020 13:23:22 +0200 |
> > for (y = 0; y < lines; y++) {
> > - off_cur = off_begin;
> > + off_cur = off_begin & s->cirrus_addr_mask;
> > 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);
> > + if (off_cur_end >= off_cur) {
> > + memory_region_set_dirty(&s->vga.vram, off_cur, off_cur_end -
> > off_cur);
> > + } else {
> > + /* wraparound */
> > + memory_region_set_dirty(&s->vga.vram, off_cur,
> > s->cirrus_addr_mask - off_cur);
>
> Should here be 's->cirrus_addr_mask + 1 - off_cur'
Yes (mask != size).
> > + memory_region_set_dirty(&s->vga.vram, 0, off_cur_end);
>
> And here be 'off_cur_end -1'
--verbose please. I think this one is correct.
take care,
Gerd