Skip to contentSkip to conversation

xen, fbfront: add support for specifying size via xenstore

PATCH In review Juergen Gross 3 participants 7 messages Mar 23, 2017 – Apr 7, 2017 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/video/fbdev/xen-fbfront.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/video/fbdev/xen-fbfront.c +10 -0
index 3ee309c..46f6396 100644
@@ -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;
Signature · 1 line
2.10.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Juergen Gross

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.

#4 lore raw
In reply to Juergen Gross
Quoted 8 lines · Juergen Gross

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.

Bartlomiej, any comments? Can you please take this patch or should I carry it through the Xen tree?

Juergen

Quoted 37 lines
---
 drivers/video/fbdev/xen-fbfront.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/video/fbdev/xen-fbfront.c +10 -0
index 3ee309c..46f6396 100644
@@ -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;
#6 lore raw
In reply to Juergen Gross
Quoted 8 lines · Juergen Gross

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.

Bartlomiej, any comments? Can you please take this patch or should I carry it through the Xen tree?

Juergen

Quoted 27 lines
---
 drivers/video/fbdev/xen-fbfront.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/video/fbdev/xen-fbfront.c +7 -0
index 3ee309c..46f6396 100644
@@ -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]);
+

drivers/video/fbdev/xen-fbfront.c static int xenfb_probe(struct xenbus_device *dev, · line 399

Quoted 10 lines
drivers/video/fbdev/xen-fbfront.c +3 -0
 	/* 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;

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#5 lore raw
In reply to Juergen Gross
Quoted 5 lines · Juergen Gross
Quoted 4 lines · Juergen Gross

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.

Quoted 7 lines
Quoted 4 lines

Add an error message in case the configured display size conflicts with video memory size.

Bartlomiej, any comments? Can you please take this patch or should I carry it through the Xen tree?

Looks fine to me, I will queue it for 4.12 on Friday.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

#2 lore raw
In reply to Boris Ostrovsky

Hi,

Quoted 11 lines · Boris Ostrovsky
Quoted 8 lines · Juergen Gross

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.

Patch queued for 4.12, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

#3 lore raw
In reply to Boris Ostrovsky

Hi,

Quoted 11 lines · Boris Ostrovsky
Quoted 8 lines · Juergen Gross

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.

Patch queued for 4.12, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel