]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen, fbfront: add support for specifying size via xenstore
authorJuergen Gross <jgross@suse.com>
Fri, 7 Apr 2017 15:03:24 +0000 (17:03 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 13 Sep 2017 04:37:56 +0000 (21:37 -0700)
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: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
OraBug: 26662731

(cherry picked from commit 5a93db427ab170c9793d76abf3e4be1ebd09375f)
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
drivers/video/fbdev/xen-fbfront.c

index 26ca7b037268e4d0330b7d1eaab7d6f70b5e66a0..4024d8c3748bd7b3b1aaa65d51a89c20b66eaa06 100644 (file)
@@ -18,6 +18,8 @@
  * frame buffer.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/console.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -380,10 +382,18 @@ static int xenfb_probe(struct xenbus_device *dev,
                        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 */
        fb_size = video[KPARAM_MEM] * 1024 * 1024;
        if (video[KPARAM_WIDTH] * video[KPARAM_HEIGHT] * XENFB_DEPTH / 8
            > 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_HEIGHT] = XENFB_HEIGHT;
                fb_size = XENFB_DEFAULT_FB_LEN;