hw/display/tcx: Avoid clearing dirty bitmap in DeviceReset()
PATCH 1/1 hw/display/tcx: Avoid clearing dirty bitmap in DeviceReset()
Commit 2dd285b5f3 ("tcx: make display updates thread safe") converted this model to use the DirtyBitmapSnapshot API, resetting the dirty bitmap in tcx_update_display(). There is no need to do it again in the DeviceReset handler.
See more details in commit fec5e8c92b ("vga: make display updates thread safe.").
--- hw/display/tcx.c | 2 -- 1 file changed, 2 deletions(-)
hw/display/tcx.c +0 -2
@@ -371,8 +371,6 @@ static void tcx_reset(DeviceState *d) s->r[258 ] = s->g[258 ] = s->b[258 ] =255 ;update_palette_entries (s,0 ,260 );memset (s->vram,0 ,MAXX *MAXY ); -memory_region_reset_dirty (&s->vram_mem,0 ,MAXX *MAXY * (1 +4 +4 ), -DIRTY_MEMORY_VGA ); s->dac_index =0 ; s->dac_state =0 ; s->cursx =0xf000 ;/* Put cursor off screen */
Signature · 1 line
2.34.1
Quoted 18 lines · Philippe Mathieu-Daudé via
Commit
2dd285b5f3("tcx: make display updates thread safe") converted this model to use the DirtyBitmapSnapshot API, resetting the dirty bitmap intcx_update_display(). There is no need to do it again in the DeviceReset handler.See more details in commit
fec5e8c92b("vga: make display updates thread safe.").Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/display/tcx.c | 2 -- 1 file changed, 2 deletions(-)hw/display/tcx.c +0
-0
hw/display/tcx.c static void tcx_reset(DeviceState *d) · line 376
Quoted 8 lines
hw/display/tcx.c +0
-2@@ -371,8 +371,6 @@ static void tcx_reset(DeviceState *d) s->r[258 ] = s->g[258 ] = s->b[258 ] =255 ;update_palette_entries (s,0 ,260 );memset (s->vram,0 ,MAXX *MAXY ); -memory_region_reset_dirty (&s->vram_mem,0 ,MAXX *MAXY * (1 +4 +4 ), -DIRTY_MEMORY_VGA ); s->dac_index =0 ; s->dac_state =0 ; s->cursx =0xf000 ;/* Put cursor off screen */
I think the issue here is that tcx_reset() should be marking the entire VRAM dirty due to the memset() i.e. we should be setting the dirty bitmap rather than resetting it. Perhaps memory_region_reset_dirty() should be replaced with tcx_invalidate_display() instead?
ATB,
Mark.
Quoted 26 lines · Mark Cave-Ayland
Quoted 24 lines · Philippe Mathieu-Daudé via
Commit
2dd285b5f3("tcx: make display updates thread safe") converted this model to use the DirtyBitmapSnapshot API, resetting the dirty bitmap intcx_update_display(). There is no need to do it again in the DeviceReset handler.See more details in commit
fec5e8c92b("vga: make display updates thread safe.").Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
hw/display/tcx.c| 2 --1 file changed, 2 deletions(-)hw/display/tcx.c +0
-2@@ -371,8 +371,6 @@ static void tcx_reset(DeviceState *d) s->r[258] = s->g[258] = s->b[258] = 255; update_palette_entries(s, 0, 260); memset(s->vram, 0, MAXX*MAXY); - memory_region_reset_dirty(&s->vram_mem, 0, MAXX * MAXY * (1 + 4 + 4), - DIRTY_MEMORY_VGA);
Quoted 8 lines
Quoted 3 lines
hw/display/tcx.c +0
-0s->dac_index = 0; s->dac_state = 0;
s->cursx=0xf000; /* Put cursor off screen */I think the issue here is that
tcx_reset()should be marking the entire VRAM dirty due to thememset()i.e. we should be setting the dirty bitmap rather than resetting it. Perhapsmemory_region_reset_dirty()should be replaced withtcx_invalidate_display()instead?
Yeah I was not sure, and your suggestion sounds right. I'll respin.