Commit 5a93db42 authored by Juergen Gross's avatar Juergen Gross Committed by Bartlomiej Zolnierkiewicz

xen, fbfront: add support for specifying size via xenstore

Today xen-fbfront supports specifying the display size via module
parameters only. Add support for specifying the size via Xenstore in
order to enable doing this easily via the domain's Xen configuration.

Add an error message in case the configured display size conflicts
with video memory size.
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent 9a1c779e
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
* frame buffer. * frame buffer.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/console.h> #include <linux/console.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h> #include <linux/errno.h>
...@@ -380,10 +382,18 @@ static int xenfb_probe(struct xenbus_device *dev, ...@@ -380,10 +382,18 @@ static int xenfb_probe(struct xenbus_device *dev,
video[KPARAM_MEM] = val; video[KPARAM_MEM] = val;
} }
video[KPARAM_WIDTH] = xenbus_read_unsigned(dev->otherend, "width",
video[KPARAM_WIDTH]);
video[KPARAM_HEIGHT] = xenbus_read_unsigned(dev->otherend, "height",
video[KPARAM_HEIGHT]);
/* If requested res does not fit in available memory, use default */ /* If requested res does not fit in available memory, use default */
fb_size = video[KPARAM_MEM] * 1024 * 1024; fb_size = video[KPARAM_MEM] * 1024 * 1024;
if (video[KPARAM_WIDTH] * video[KPARAM_HEIGHT] * XENFB_DEPTH / 8 if (video[KPARAM_WIDTH] * video[KPARAM_HEIGHT] * XENFB_DEPTH / 8
> fb_size) { > fb_size) {
pr_warn("display parameters %d,%d,%d invalid, use defaults\n",
video[KPARAM_MEM], video[KPARAM_WIDTH],
video[KPARAM_HEIGHT]);
video[KPARAM_WIDTH] = XENFB_WIDTH; video[KPARAM_WIDTH] = XENFB_WIDTH;
video[KPARAM_HEIGHT] = XENFB_HEIGHT; video[KPARAM_HEIGHT] = XENFB_HEIGHT;
fb_size = XENFB_DEFAULT_FB_LEN; fb_size = XENFB_DEFAULT_FB_LEN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment