Skip to contentSkip to conversation

fbif: Add offset in resize event

PATCH In review Samuel Thibault 4 participants 12 messages Mar 26, 2008 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

cover fbif: Add offset in resize event

Hello,

The following two patches add an additional offset part in the FB resize event.

Samuel

#1 lore raw

fbfront: Add offset in resize event
Also support depth change.

tools/ioemu/hw/xenfb.c +6 -2
diff -r 966c04d42e94 tools/ioemu/hw/xenfb.c
@@ -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 */
xen/include/public/io/fbif.h +1 -0
@@ -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
#5 lore raw
In reply to Samuel Thibault

fbfront: Add offset in resize event

drivers/xen/fbfront/xenfb.c +1 -0
diff -r 1327b9dcc63a drivers/xen/fbfront/xenfb.c
@@ -504,6 +504,7 @@ static int xenfb_set_par(struct fb_info 
 	xenfb_info->resize.height = info->var.yres;
 	xenfb_info->resize.stride = info->fix.line_length;
 	xenfb_info->resize.depth = info->var.bits_per_pixel;
+	xenfb_info->resize.offset = 0;
 	xenfb_info->resize_dpy = 1;
 	spin_unlock_irqrestore(&xenfb_info->resize_lock, flags);
 	return 0;
include/xen/interface/io/fbif.h +1 -0
diff -r 1327b9dcc63a include/xen/interface/io/fbif.h
@@ -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
#9 lore raw
Quoted 3 lines · Keir Fraser, le Wed 26 Mar 2008 11:16:55 +0000, a écrit :

Looks like we should slip these in quickly if they are acceptable, as the new field is not backward compatible with the original patchset from Pat Campbell?

Yes.
Actually I thought Pat would have already integrated that his patch.

Samuel

#10 lore raw
Quoted 7 lines · Samuel Thibault
Quoted 3 lines · Keir Fraser, le Wed 26 Mar 2008 11:16:55 +0000, a écrit :

Looks like we should slip these in quickly if they are acceptable, as the new field is not backward compatible with the original patchset from Pat Campbell?

Yes.
Actually I thought Pat would have already integrated that his patch.

A couple of days delay won't matter. I'll wait for ack or comments from Pat and Markus.

-- Keir

#3 lore raw
In reply to Samuel Thibault
Quoted 1 line · Samuel Thibault

fbfront: Add offset in resize event

fbback, as you already noted. However, we've used variations of pvfb:
in changelogs so far, for front- and backend. Best to stick to that.

Quoted 1 line

Also support depth change.

This part arguably fixes a bug in Pat's patch.

Quoted 1 line

Looks good.

#11 lore raw
In reply to Keir Fraser
Quoted 5 lines · Keir Fraser

Looks like we should slip these in quickly if they are acceptable, as the new field is not backward compatible with the original patchset from Pat Campbell?

-- Keir

Correct.

I guess we should zero the complete union xenfb_out_event; it can make compatible extensions easier. I'll do that in the pvops frontend. I don't intend to touch the non-pvops kernel anymore.

#4 lore raw
In reply to Markus Armbruster
Quoted 6 lines · Markus Armbruster
Quoted 2 lines · Samuel Thibault

fbfront: Add offset in resize event

Quoted 10 lines

fbback, as you already noted. However, we've used variations of pvfb:
in changelogs so far, for front- and backend. Best to stick to that.

Quoted 2 lines

Also support depth change.

This part arguably fixes a bug in Pat's patch.

Oops

Quoted 10 lines
Quoted 2 lines

Looks good.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Looks good to me as well.