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

[Xen-devel] Re: [PATCH 0/2] fbif: Add offset in resize event

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: [PATCH 0/2] fbif: Add offset in resize event
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Wed, 26 Mar 2008 11:10:23 +0000
Delivery-date: Wed, 26 Mar 2008 04:11:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080326110940.GA5636@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
References: <20080326110940.GA5636@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
fbfront: Add offset in resize event
Also support depth change.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

diff -r 966c04d42e94 tools/ioemu/hw/xenfb.c
--- a/tools/ioemu/hw/xenfb.c    Wed Mar 26 09:12:57 2008 +0000
+++ b/tools/ioemu/hw/xenfb.c    Wed Mar 26 11:05:07 2008 +0000
@@ -56,6 +56,7 @@
        int depth;              /* colour depth of guest framebuffer */
        int width;              /* pixel width of guest framebuffer */
        int height;             /* pixel height of guest framebuffer */
+       int offset;             /* offset of the framebuffer */
        int abs_pointer_wanted; /* Whether guest supports absolute pointer */
        int button_state;       /* Last seen pointer button state */
        char protocol[64];      /* frontend protocol */
@@ -519,11 +520,13 @@
                case XENFB_TYPE_RESIZE:
                        xenfb->width  = event->resize.width;
                        xenfb->height = event->resize.height;
+                       xenfb->depth = event->resize.depth;
                        xenfb->row_stride = event->resize.stride;
+                       xenfb->offset = event->resize.offset;
                        dpy_colourdepth(xenfb->ds, xenfb->depth);
                        dpy_resize(xenfb->ds, xenfb->width, xenfb->height, 
xenfb->row_stride);
                        if (xenfb->ds->shared_buf)
-                               dpy_setdata(xenfb->ds, xenfb->pixels);
+                               dpy_setdata(xenfb->ds, xenfb->pixels + 
xenfb->offset);
                        xenfb_invalidate(xenfb);
                        break;
                }
@@ -1105,6 +1108,7 @@
 #define BLT(SRC_T,DST_T,RSB,GSB,BSB,RDB,GDB,BDB)                        \
     for (line = y ; line < (y+h) ; line++) {                            \
         SRC_T *src = (SRC_T *)(xenfb->pixels                            \
+                               + xenfb->offset                          \
                                + (line * xenfb->row_stride)             \
                                + (x * xenfb->depth / 8));               \
         DST_T *dst = (DST_T *)(xenfb->ds->data                                 
\
@@ -1147,7 +1151,7 @@
         if (xenfb->depth == xenfb->ds->depth) { /* Perfect match can use fast 
path */
             for (line = y ; line < (y+h) ; line++) {
                 memcpy(xenfb->ds->data + (line * xenfb->ds->linesize) + (x * 
xenfb->ds->depth / 8),
-                        xenfb->pixels + (line * xenfb->row_stride) + (x * 
xenfb->depth / 8),
+                        xenfb->pixels + xenfb->offset + (line * 
xenfb->row_stride) + (x * xenfb->depth / 8),
                         w * xenfb->depth / 8);
             }
         } else { /* Mismatch requires slow pixel munging */
--- a/xen/include/public/io/fbif.h      Wed Mar 26 09:12:57 2008 +0000
+++ b/xen/include/public/io/fbif.h      Wed Mar 26 11:05:08 2008 +0000
@@ -63,6 +63,7 @@
     int32_t height;  /* height in pixels */
     int32_t stride;  /* stride in bytes */
     int32_t depth;   /* depth in bits */
+    int32_t offset;  /* offset of the framebuffer in bytes */
 };
 
 #define XENFB_OUT_EVENT_SIZE 40

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