From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0HQM-0004Wo-TU for qemu-devel@nongnu.org; Wed, 22 Feb 2012 14:00:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0HQG-0003JZ-QX for qemu-devel@nongnu.org; Wed, 22 Feb 2012 14:00:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0HQG-0003JV-Hn for qemu-devel@nongnu.org; Wed, 22 Feb 2012 14:00:16 -0500 Date: Wed, 22 Feb 2012 21:00:04 +0200 From: Alon Levy Message-ID: <20120222190004.GI8461@garlic> References: <1329860377-6284-1-git-send-email-alevy@redhat.com> <1329860377-6284-7-git-send-email-alevy@redhat.com> <4F44CF1A.6080703@redhat.com> <20120222122835.GC607@garlic.redhat.com> <4F44F705.8050208@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F44F705.8050208@redhat.com> Subject: Re: [Qemu-devel] [RFC v4 6/9] qxl: remove flipped List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: spice-devel@freedesktop.org, yhalperi@redhat.com, qemu-devel@nongnu.org, elmarco@redhat.com On Wed, Feb 22, 2012 at 03:09:09PM +0100, Gerd Hoffmann wrote: > On 02/22/12 13:28, Alon Levy wrote: > > On Wed, Feb 22, 2012 at 12:18:50PM +0100, Gerd Hoffmann wrote: > >> Hi, > >> > >> It's not obvious to me how the non-flipped case (qxl_stride > 0) is > >> handled now. Have you tested this with both windows+linux guests? > > > > It isn't handled. The simplest way is just to if on the stride and do a > > single memcpy instead of individual line memcpy. > > Single memcpy works only for full scanlines. qxl_flip can be extended > to handle both cases (and should probably also renamed then). > > > This of course means we > > are doing a redundant copy, > > No. You can wrap the qxl_flip call into ... > > if (is_shared_buffer()) { ... }. > > ... to skip the copy if it isn't needed. > > > since using our own DisplayAllocator or just > > the existing deallocate + our own allocate of ds->surface->data removes > > one copy. > > I would just do > > if (qxl_stride > 0) { > qemu_free_displaysurface > qemu_create_displaysurface_from > } else { > qemu_resize_displaysurface > } > Ok, this all works fine, thanks, just one note - linux qxl also uses negative stride, so actually there is no user for positive stride (and hence that code path is untested). > cheers, > Gerd >