From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG8Py-0006sN-9K for qemu-devel@nongnu.org; Mon, 24 Sep 2012 09:09:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TG8Ps-0002aJ-5n for qemu-devel@nongnu.org; Mon, 24 Sep 2012 09:09:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG8Pr-0002a6-SU for qemu-devel@nongnu.org; Mon, 24 Sep 2012 09:09:40 -0400 Message-ID: <50605B8B.8000905@redhat.com> Date: Mon, 24 Sep 2012 15:09:31 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1348053341-29212-1-git-send-email-kraxel@redhat.com> <1348053341-29212-5-git-send-email-kraxel@redhat.com> <505C5D72.8050005@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/9] fbdev: add linux framebuffer display driver. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: "qemu-devel@nongnu.org" 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-, 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