[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] pvfb: Add offset in resize event



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1206540336 0
# Node ID b6d15be09aecc41605db2851c59560aa0d7698b0
# Parent  30e20bb55da5ec1abfc43e7bb5284b6b450158cc
pvfb: Add offset in resize event
Also support depth change.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
---
 tools/ioemu/hw/xenfb.c       |    8 ++++++--
 xen/include/public/io/fbif.h |    1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff -r 30e20bb55da5 -r b6d15be09aec tools/ioemu/hw/xenfb.c
--- a/tools/ioemu/hw/xenfb.c    Wed Mar 26 14:04:21 2008 +0000
+++ b/tools/ioemu/hw/xenfb.c    Wed Mar 26 14:05:36 2008 +0000
@@ -56,6 +56,7 @@ struct xenfb {
        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 @@ static void xenfb_on_fb_event(struct xen
                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 @@ static void xenfb_mouse_event(void *opaq
 #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 @@ static void xenfb_guest_copy(struct xenf
         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 */
diff -r 30e20bb55da5 -r b6d15be09aec xen/include/public/io/fbif.h
--- a/xen/include/public/io/fbif.h      Wed Mar 26 14:04:21 2008 +0000
+++ b/xen/include/public/io/fbif.h      Wed Mar 26 14:05:36 2008 +0000
@@ -63,6 +63,7 @@ struct xenfb_resize
     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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.