diff options
Diffstat (limited to 'tags/2.6.22-2/20079_xenfb-module-param.patch1')
-rw-r--r-- | tags/2.6.22-2/20079_xenfb-module-param.patch1 | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/tags/2.6.22-2/20079_xenfb-module-param.patch1 b/tags/2.6.22-2/20079_xenfb-module-param.patch1 new file mode 100644 index 0000000..e83ae6e --- /dev/null +++ b/tags/2.6.22-2/20079_xenfb-module-param.patch1 @@ -0,0 +1,108 @@ +From: Derek Murray <Derek.Murray@cl.cam.ac.uk> +Subject: Re: Patching Xen virtual framebuffer +Date: Thu, 06 Dec 2007 12:12:42 +0000 + +[...] +the attached patch replaces the compile-time constants with kernel +command-line parameters. + + From what I can tell in the kernel docs, you would add the following to +your kernel cmdline: + +xenfb.fb_width=1024 xenfb.fb_height=768 xenfb.fb_depth=32 + +[...] +It's based on http://xenbits.xensource.com/linux-2.6.18-xen.hg, [...] + +# HG changeset patch +# User dgm36@ise.cl.cam.ac.uk +# Date 1196942777 0 +# Node ID 4ccc3f6b544aa40f8fa24fd45b81bcc5c01ef4dd +# Parent df7d0555ec3847bd5915063d8ee79123d6ebc67a +Added command-line parameters for PVFB height, width and depth. + +Signed-off-by: Derek Murray <Derek.Murray@cl.cam.ac.uk> +Acked-by: Torsten Duwe <duwe@suse.de> + +Index: 10.3-2008-02-05/drivers/xen/fbfront/xenfb.c +=================================================================== +--- 10.3-2008-02-05.orig/drivers/xen/fbfront/xenfb.c 2008-02-05 14:02:26.000000000 +0100 ++++ 10.3-2008-02-05/drivers/xen/fbfront/xenfb.c 2008-02-05 14:03:16.000000000 +0100 +@@ -33,6 +33,21 @@ + #include <xen/xenbus.h> + #include <linux/kthread.h> + ++ ++ ++/* Kernel cmdline parameters for resolution. */ ++int fb_width = XENFB_WIDTH; ++module_param(fb_width, int, 0); ++#undef XENFB_WIDTH ++EXPORT_SYMBOL_GPL(fb_width); ++int fb_height = XENFB_HEIGHT; ++module_param(fb_height, int, 0); ++#undef XENFB_HEIGHT ++EXPORT_SYMBOL_GPL(fb_height); ++int fb_depth = XENFB_DEPTH; ++module_param(fb_depth, int, 0); ++#undef XENFB_DEPTH ++ + struct xenfb_mapping + { + struct list_head link; +@@ -132,7 +147,7 @@ struct xenfb_info + */ + + static int xenfb_fps = 20; +-static unsigned long xenfb_mem_len = XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8; ++static unsigned long xenfb_mem_len = -1; + + static int xenfb_remove(struct xenbus_device *); + static void xenfb_init_shared_page(struct xenfb_info *); +@@ -447,6 +462,8 @@ static int __devinit xenfb_probe(struct + struct fb_info *fb_info; + int ret; + ++ xenfb_mem_len = fb_width * fb_height * fb_depth / 8; ++ + info = kzalloc(sizeof(*info), GFP_KERNEL); + if (info == NULL) { + xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); +@@ -604,9 +621,9 @@ static void xenfb_init_shared_page(struc + + info->page->pd[0] = vmalloc_to_mfn(info->mfns); + info->page->pd[1] = 0; +- info->page->width = XENFB_WIDTH; +- info->page->height = XENFB_HEIGHT; +- info->page->depth = XENFB_DEPTH; ++ info->page->width = fb_width; ++ info->page->height = fb_height; ++ info->page->depth = fb_depth; + info->page->line_length = (info->page->depth / 8) * info->page->width; + info->page->mem_length = xenfb_mem_len; + info->page->in_cons = info->page->in_prod = 0; +Index: 10.3-2008-02-05/drivers/xen/fbfront/xenkbd.c +=================================================================== +--- 10.3-2008-02-05.orig/drivers/xen/fbfront/xenkbd.c 2008-02-05 14:02:26.000000000 +0100 ++++ 10.3-2008-02-05/drivers/xen/fbfront/xenkbd.c 2008-02-05 14:00:50.000000000 +0100 +@@ -27,6 +27,9 @@ + #include <xen/interface/io/kbdif.h> + #include <xen/xenbus.h> + ++extern unsigned int fb_height; ++extern unsigned int fb_width; ++ + struct xenkbd_info + { + struct input_dev *kbd; +@@ -153,8 +156,8 @@ int __devinit xenkbd_probe(struct xenbus + for (i = BTN_LEFT; i <= BTN_TASK; i++) + set_bit(i, ptr->keybit); + ptr->relbit[0] = BIT(REL_X) | BIT(REL_Y); +- input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0); +- input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0); ++ input_set_abs_params(ptr, ABS_X, 0, fb_width, 0, 0); ++ input_set_abs_params(ptr, ABS_Y, 0, fb_height, 0, 0); + + ret = input_register_device(ptr); + if (ret) { |