From: "Pat Campbell" Subject: [PATCH][IOEMU] Dynamic modes support for PV xenfb Date: Fri, 28 Dec 2007 11:57:40 -0700 Message-ID: <4774E45D.3E48.0018.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part290F1634.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=__Part290F1634.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Attached patch adds multiple frame buffer size support to the xenfb PV=20 backend QEMU xenfb. Backend sets feature-resize and handles the resize frame buffer event. Corresponding frontend LINUX patch is required for functionality but this patch is not dependent on it, preserving backwards compatibility. Please apply to tip of xen-unstable Signed- off- by: Pat Campbell --=__Part290F1634.0__= Content-Type: text/plain; name="xen-fbback-resize.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xen-fbback-resize.patch" diff -r 1f4b29eaf7f4 tools/ioemu/hw/xenfb.c --- a/tools/ioemu/hw/xenfb.c Thu Dec 20 17:30:27 2007 +0000 +++ b/tools/ioemu/hw/xenfb.c Thu Dec 27 13:30:33 2007 -0700 @@ -264,6 +264,9 @@ struct xenfb *xenfb_new(int domid, Displ xenfb->ds =3D ds; xenfb_device_set_domain(&xenfb->fb, domid); xenfb_device_set_domain(&xenfb->kbd, domid); + + /* Indicate we have the frame buffer resize feature */ + xenfb_xs_printf(xenfb->xsh, xenfb->fb.nodename, "feature-resize", = "1"); =20 fprintf(stderr, "FB: Waiting for KBD backend creation\n"); xenfb_wait_for_backend(&xenfb->kbd, xenfb_backend_created_kbd); @@ -510,6 +513,13 @@ static void xenfb_on_fb_event(struct xen } xenfb_guest_copy(xenfb, x, y, w, h); break; + case XENFB_TYPE_RESIZE: + w =3D event->resize.width; + h =3D event->resize.height; + xenfb->width =3D w; + xenfb->height =3D h; + dpy_resize(xenfb->ds, xenfb->width, xenfb->height);= + break; } } mb(); /* ensure we're done with ring contents */ diff -r 1f4b29eaf7f4 xen/include/public/io/fbif.h --- a/xen/include/public/io/fbif.h Thu Dec 20 17:30:27 2007 +0000 +++ b/xen/include/public/io/fbif.h Fri Dec 28 03:45:02 2007 -0700 @@ -50,12 +50,26 @@ struct xenfb_update int32_t height; /* rect height */ }; =20 +/* + * Framebuffer resize notification event + * Capable backend sets feature-resize in xenstore. + */ +#define XENFB_TYPE_RESIZE 3 + +struct xenfb_resize +{ + uint8_t type; /* XENFB_TYPE_RESIZE */ + int32_t width; /* xres */ + int32_t height; /* yres */ +}; + #define XENFB_OUT_EVENT_SIZE 40 =20 union xenfb_out_event { uint8_t type; struct xenfb_update update; + struct xenfb_resize resize; char pad[XENFB_OUT_EVENT_SIZE]; }; =20 @@ -111,8 +125,12 @@ struct xenfb_page * PAGE_SIZE / sizeof(*pd) bytes. With PAGE_SIZE =3D=3D 4096 and * sizeof(unsigned long) =3D=3D 4, that's 4 Megs. Two directory * pages should be enough for a while. + * + * Increased to 3 to support 1280x1024 resolution on a 64bit system + * (1280*1024*4)/PAGE_SIZE =3D 1280 pages required + * PAGE_SIZE/64bit long =3D 512 pages per page directory */ - unsigned long pd[2]; + unsigned long pd[3]; }; =20 /* --=__Part290F1634.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part290F1634.0__=--