From: "Pat Campbell" Subject: [PATCH][IOEMU] Dynamic modes support for PV xenfb (2of2) Date: Sun, 30 Dec 2007 11:45:18 -0700 Message-ID: <47778475.3E48.0018.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part91B7AC2E.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 --=__Part91B7AC2E.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 QEMU=20 xenfb PV backend. Backend indicates it supports resize by setting=20 feature-resize attribute in vfb and vkb devices. =20 Corresponding frontend LINUX patch is required for functionality but=20 this patch is not dependent on it. Change is compatible with older frontend implementations. Please apply to tip of xen-unstable Signed- off- by: Pat Campbell --=__Part91B7AC2E.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 Fri Dec 28 08:19:47 2007 -0700 @@ -264,6 +264,10 @@ 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"); + xenfb_xs_printf(xenfb->xsh, xenfb->kbd.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 +514,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 08:05:42 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 /* @@ -120,6 +138,8 @@ struct xenfb_page * solution is found, but don't leak it to the backend. */ #ifdef __KERNEL__ +#define XENFB_MAX_WIDTH 1024 +#define XENFB_MAX_HEIGHT 768 #define XENFB_WIDTH 800 #define XENFB_HEIGHT 600 #define XENFB_DEPTH 32 --=__Part91B7AC2E.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 --=__Part91B7AC2E.0__=--