WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel][PATCH]qemu-xen: let xenfb_guest_copy() handle depth=32 c

To: Chun Yan Liu <cyliu@xxxxxxxxxx>
Subject: Re: [Xen-devel][PATCH]qemu-xen: let xenfb_guest_copy() handle depth=32 case
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Thu, 21 Oct 2010 15:32:37 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 21 Oct 2010 07:34:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4CBF292202000066000192D9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4CBF292202000066000192D9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Wed, 20 Oct 2010, Chun Yan Liu wrote:
> In hw/xenfb.c, xenfb_guest_copy() function doesn't handle xenfb->depth=32 
> case. When xenfb->depth=32, it will report error
> and won't copy data from the guest framebuffer region into QEMU's 
> displaysurface, thus when enter CTRL+ALT+2 to qemu
> monitor console then CTRL+ALT+1 back to guest X window, the screen cannot be 
> restored.
> 
> This patch adds two things:
> 1. when xenfb->depth equals destination bpp, do not need data translation, 
> simply copy data from guest framebuffer into
> QEMU's displaysurface.
> 2. when xenfb->depth and destination bpp differs, add processing for 
> xenfb->depth=32 case.
> 

The source of the confusion is that in the xenfb protocol depth actually
means bpp (when bpp == 32, depth should be 24).

It would be good to rename xenfb->depth to xenfb->bpp or at least add
a comment in xenfb_configure_fb to explain that depth is actually
bpp in that case.


> Signed-off by Chunyan Liu <cyliu@xxxxxxxxxx>
> ??
> diff -r e4f337bb97f7 tools/ioemu-qemu-xen/hw/xenfb.c
> --- a/hw/xenfb.c??Wed Oct 20 19:39:28 2010 +0800
> +++ b/hw/xenfb.c??Wed Oct 20 21:42:37 2010 +0800
> @@ -612,6 +612,12 @@
> ???????? uint8_t *data = ds_get_data(xenfb->c.ds);
> ??
> ???????? if (!is_buffer_shared(xenfb->c.ds->surface)) {
> +?????????????? if (xenfb->depth == bpp) {
> +?????????????????????????????? for (line = y; line < (y+h); line++) {
> +?????????????????????????????????????????????? memcpy (data + (line * 
> linesize) + (x * bpp / 8), xenfb->pixels + xenfb->offset + (line *
> xenfb->row_stride) + (x * xenfb->depth / 8), w * xenfb->depth / 8);
> +?????????????????????????????? }
> +?????????????? }
> +?????????????? else{

This is not needed because if (xenfb->depth == bpp) the buffer should be
shared.
See xenfb_update and the call to qemu_create_displaysurface_from.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel