From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: tim@xen.org, Ian.Campbell@citrix.com,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH v4 2/7] xen: infrastructure to have cross-platform video drivers
Date: Tue, 8 Jan 2013 20:03:22 +0000 [thread overview]
Message-ID: <1357675408-27949-2-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1301081935090.4981@kaball.uk.xensource.com>
- introduce a new HAS_VIDEO config variable;
- build xen/drivers/video/font* if HAS_VIDEO;
- rename vga_puts to video_puts;
- rename vga_init to video_init;
- rename vga_endboot to video_endboot.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
xen/arch/arm/Rules.mk | 1 +
xen/arch/x86/Rules.mk | 1 +
xen/drivers/Makefile | 2 +-
xen/drivers/char/console.c | 12 ++++++------
xen/drivers/video/Makefile | 10 +++++-----
xen/drivers/video/vesa.c | 4 ++--
xen/drivers/video/vga.c | 12 ++++++------
xen/include/asm-x86/config.h | 1 +
xen/include/xen/vga.h | 9 +--------
xen/include/xen/video.h | 24 ++++++++++++++++++++++++
10 files changed, 48 insertions(+), 28 deletions(-)
create mode 100644 xen/include/xen/video.h
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index a45c654..fa9f9c1 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -7,6 +7,7 @@
#
HAS_DEVICE_TREE := y
+HAS_VIDEO := y
CFLAGS += -fno-builtin -fno-common -Wredundant-decls
CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 963850f..0a9d68d 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -3,6 +3,7 @@
HAS_ACPI := y
HAS_VGA := y
+HAS_VIDEO := y
HAS_CPUFREQ := y
HAS_PCI := y
HAS_PASSTHROUGH := y
diff --git a/xen/drivers/Makefile b/xen/drivers/Makefile
index 7239375..9c70f20 100644
--- a/xen/drivers/Makefile
+++ b/xen/drivers/Makefile
@@ -3,4 +3,4 @@ subdir-$(HAS_CPUFREQ) += cpufreq
subdir-$(HAS_PCI) += pci
subdir-$(HAS_PASSTHROUGH) += passthrough
subdir-$(HAS_ACPI) += acpi
-subdir-$(HAS_VGA) += video
+subdir-$(HAS_VIDEO) += video
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ff360fe..1b7a593 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -21,7 +21,7 @@
#include <xen/delay.h>
#include <xen/guest_access.h>
#include <xen/shutdown.h>
-#include <xen/vga.h>
+#include <xen/video.h>
#include <xen/kexec.h>
#include <asm/debugger.h>
#include <asm/div64.h>
@@ -297,7 +297,7 @@ static void dump_console_ring_key(unsigned char key)
buf[sofar] = '\0';
sercon_puts(buf);
- vga_puts(buf);
+ video_puts(buf);
free_xenheap_pages(buf, order);
}
@@ -383,7 +383,7 @@ static long guest_console_write(XEN_GUEST_HANDLE_PARAM(char) buffer, int count)
spin_lock_irq(&console_lock);
sercon_puts(kbuf);
- vga_puts(kbuf);
+ video_puts(kbuf);
if ( opt_console_to_ring )
{
@@ -464,7 +464,7 @@ static void __putstr(const char *str)
ASSERT(spin_is_locked(&console_lock));
sercon_puts(str);
- vga_puts(str);
+ video_puts(str);
if ( !console_locks_busted )
{
@@ -592,7 +592,7 @@ void __init console_init_preirq(void)
if ( *p == ',' )
p++;
if ( !strncmp(p, "vga", 3) )
- vga_init();
+ video_init();
else if ( !strncmp(p, "none", 4) )
continue;
else if ( (sh = serial_parse_handle(p)) >= 0 )
@@ -694,7 +694,7 @@ void __init console_endboot(void)
printk("\n");
}
- vga_endboot();
+ video_endboot();
/*
* If user specifies so, we fool the switch routine to redirect input
diff --git a/xen/drivers/video/Makefile b/xen/drivers/video/Makefile
index 6c3e5b4..2993c39 100644
--- a/xen/drivers/video/Makefile
+++ b/xen/drivers/video/Makefile
@@ -1,5 +1,5 @@
-obj-y := vga.o
-obj-$(CONFIG_X86) += font_8x14.o
-obj-$(CONFIG_X86) += font_8x16.o
-obj-$(CONFIG_X86) += font_8x8.o
-obj-$(CONFIG_X86) += vesa.o
+obj-$(HAS_VGA) := vga.o
+obj-$(HAS_VIDEO) += font_8x14.o
+obj-$(HAS_VIDEO) += font_8x16.o
+obj-$(HAS_VIDEO) += font_8x8.o
+obj-$(HAS_VGA) += vesa.o
diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index d0a83ff..aaf8b23 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -108,7 +108,7 @@ void __init vesa_init(void)
memset(lfb, 0, vram_remap);
- vga_puts = vesa_redraw_puts;
+ video_puts = vesa_redraw_puts;
printk(XENLOG_INFO "vesafb: framebuffer at %#x, mapped to 0x%p, "
"using %uk, total %uk\n",
@@ -193,7 +193,7 @@ void __init vesa_endboot(bool_t keep)
if ( keep )
{
xpos = 0;
- vga_puts = vesa_scroll_puts;
+ video_puts = vesa_scroll_puts;
}
else
{
diff --git a/xen/drivers/video/vga.c b/xen/drivers/video/vga.c
index a98bd00..40e5963 100644
--- a/xen/drivers/video/vga.c
+++ b/xen/drivers/video/vga.c
@@ -21,7 +21,7 @@ static unsigned char *video;
static void vga_text_puts(const char *s);
static void vga_noop_puts(const char *s) {}
-void (*vga_puts)(const char *) = vga_noop_puts;
+void (*video_puts)(const char *) = vga_noop_puts;
/*
* 'vga=<mode-specifier>[,keep]' where <mode-specifier> is one of:
@@ -62,7 +62,7 @@ void vesa_endboot(bool_t keep);
#define vesa_endboot(x) ((void)0)
#endif
-void __init vga_init(void)
+void __init video_init(void)
{
char *p;
@@ -85,7 +85,7 @@ void __init vga_init(void)
columns = vga_console_info.u.text_mode_3.columns;
lines = vga_console_info.u.text_mode_3.rows;
memset(video, 0, columns * lines * 2);
- vga_puts = vga_text_puts;
+ video_puts = vga_text_puts;
break;
case XEN_VGATYPE_VESA_LFB:
case XEN_VGATYPE_EFI_LFB:
@@ -97,16 +97,16 @@ void __init vga_init(void)
}
}
-void __init vga_endboot(void)
+void __init video_endboot(void)
{
- if ( vga_puts == vga_noop_puts )
+ if ( video_puts == vga_noop_puts )
return;
printk("Xen is %s VGA console.\n",
vgacon_keep ? "keeping" : "relinquishing");
if ( !vgacon_keep )
- vga_puts = vga_noop_puts;
+ video_puts = vga_noop_puts;
else
{
int bus, devfn;
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index 0c4868c..e8da4f7 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -38,6 +38,7 @@
#define CONFIG_ACPI_CSTATE 1
#define CONFIG_VGA 1
+#define CONFIG_VIDEO 1
#define CONFIG_HOTPLUG 1
#define CONFIG_HOTPLUG_CPU 1
diff --git a/xen/include/xen/vga.h b/xen/include/xen/vga.h
index cc690b9..f72b63d 100644
--- a/xen/include/xen/vga.h
+++ b/xen/include/xen/vga.h
@@ -9,17 +9,10 @@
#ifndef _XEN_VGA_H
#define _XEN_VGA_H
-#include <public/xen.h>
+#include <xen/video.h>
#ifdef CONFIG_VGA
extern struct xen_vga_console_info vga_console_info;
-void vga_init(void);
-void vga_endboot(void);
-extern void (*vga_puts)(const char *);
-#else
-#define vga_init() ((void)0)
-#define vga_endboot() ((void)0)
-#define vga_puts(s) ((void)0)
#endif
#endif /* _XEN_VGA_H */
diff --git a/xen/include/xen/video.h b/xen/include/xen/video.h
new file mode 100644
index 0000000..2e897f9
--- /dev/null
+++ b/xen/include/xen/video.h
@@ -0,0 +1,24 @@
+/*
+ * video.h
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file COPYING in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef _XEN_VIDEO_H
+#define _XEN_VIDEO_H
+
+#include <public/xen.h>
+
+#ifdef CONFIG_VIDEO
+void video_init(void);
+extern void (*video_puts)(const char *);
+void video_endboot(void);
+#else
+#define video_init() ((void)0)
+#define video_puts(s) ((void)0)
+#define video_endboot() ((void)0)
+#endif
+
+#endif /* _XEN_VIDEO_H */
--
1.7.2.5
next prev parent reply other threads:[~2013-01-08 20:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 20:02 [PATCH v4 0/7] xen: ARM HDLCD video driver Stefano Stabellini
2013-01-08 20:03 ` [PATCH v4 1/7] xen/arm: introduce early_ioremap Stefano Stabellini
2013-01-10 15:48 ` Ian Campbell
2013-01-14 17:46 ` Stefano Stabellini
2013-01-08 20:03 ` Stefano Stabellini [this message]
2013-01-10 15:49 ` [PATCH v4 2/7] xen: infrastructure to have cross-platform video drivers Ian Campbell
2013-01-10 16:08 ` Jan Beulich
2013-01-10 16:16 ` Ian Campbell
2013-01-10 16:28 ` Keir Fraser
2013-01-21 11:38 ` Ian Campbell
2013-01-10 16:16 ` Ian Campbell
2013-01-08 20:03 ` [PATCH v4 3/7] xen: introduce a generic framebuffer driver Stefano Stabellini
2013-01-09 10:53 ` Jan Beulich
2013-01-09 14:05 ` Stefano Stabellini
2013-01-09 14:45 ` Mats Petersson
2013-01-09 14:51 ` Mats Petersson
2013-01-09 17:17 ` Stefano Stabellini
2013-01-08 20:03 ` [PATCH v4 4/7] xen/arm: move setup_mm right after setup_pagetables Stefano Stabellini
2013-01-10 15:55 ` Ian Campbell
2013-01-14 17:18 ` Stefano Stabellini
2013-01-15 10:29 ` Ian Campbell
2013-01-08 20:03 ` [PATCH v4 5/7] xen/device_tree: introduce find_compatible_node Stefano Stabellini
2013-01-08 20:03 ` [PATCH v4 6/7] xen/arm: introduce vexpress_syscfg Stefano Stabellini
2013-01-10 15:58 ` Ian Campbell
2013-01-14 17:11 ` Stefano Stabellini
2013-01-08 20:03 ` [PATCH v4 7/7] xen/arm: introduce a driver for the ARM HDLCD controller Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1357675408-27949-2-git-send-email-stefano.stabellini@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).