On 09/24/12 13:06, Stefano Stabellini wrote: > On Fri, 21 Sep 2012, Gerd Hoffmann wrote: >> Hi, >> >>>> + case FB_ACQ_REQ: >>>> + fbdev_switch_acquire(); >>>> + redraw_screen++; >>> >>> Rather than introducing redraw_screen, I would just call vga_hw_invalidate >>> instead here. It is always a win if we can avoid to introduce one more >>> state machine. >> >> Wouldn't that make the vga emulation do additional work which is simply >> not needed? > > It causes full_update to be set and that causes vga_draw_line to be > called for every line on the screen. > However in the important cases (32bpp and 16bpp) the buffer is shared > and nothing happens. So no more work.
When looking at the code I feel again like this is one relict we should just get rid of ... The reason it exists in the first place seems to be console switching. The qemu-internal one, via Ctrl-Alt-<nr>, to serial / monitor text consoles. In that case the vga emulation must be able to restore the display, and vga_hw_invalidate will handle it. That logic predates the display surfaces though. I think today we could just assign a displaysurface to each qemu console and be done with it. Console switching will just switch display surfaces without any re-rendering needed. Likewise screendumping can stop hoping through all the loops it hops today. Any other vga_hw_invalidate calls creped in over time (ab-)use it to kick a redraw in the ui code. They kick the vga emulation for no reason, there is nothing the vga emulation must redraw. cheers, Gerd