WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] linux/x86: retrieve VESA capabilities

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] linux/x86: retrieve VESA capabilities in dom0
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 12 Oct 2007 14:30:20 -0700
Delivery-date: Fri, 12 Oct 2007 14:31:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1192187297 -3600
# Node ID d34182a37ba947980e109c94eb77f3f9314e3227
# Parent  d081f7efcb60adf5a82b943f9cc524cfa254e413
linux/x86: retrieve VESA capabilities in dom0
Also, move some more common code to dom0_init_screen_info().
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 arch/i386/kernel/setup-xen.c   |   23 ++++++-----------------
 arch/x86_64/kernel/setup-xen.c |   23 ++++++-----------------
 drivers/xen/Kconfig            |    2 +-
 drivers/xen/console/console.c  |   32 +++++++++++++++++++++++++++-----
 include/xen/xencons.h          |    2 +-
 5 files changed, 41 insertions(+), 41 deletions(-)

diff -r d081f7efcb60 -r d34182a37ba9 arch/i386/kernel/setup-xen.c
--- a/arch/i386/kernel/setup-xen.c      Fri Oct 12 12:07:32 2007 +0100
+++ b/arch/i386/kernel/setup-xen.c      Fri Oct 12 12:08:17 2007 +0100
@@ -1669,23 +1669,12 @@ void __init setup_arch(char **cmdline_p)
        bootloader_type = LOADER_TYPE;
 
        if (is_initial_xendomain()) {
-               /* This is drawn from a dump from vgacon:startup in
-                * standard Linux. */
-               screen_info.orig_video_mode = 3; 
-               screen_info.orig_video_isVGA = 1;
-               screen_info.orig_video_lines = 25;
-               screen_info.orig_video_cols = 80;
-               screen_info.orig_video_ega_bx = 3;
-               screen_info.orig_video_points = 16;
-               screen_info.orig_y = screen_info.orig_video_lines - 1;
-               if (xen_start_info->console.dom0.info_size >=
-                   sizeof(struct dom0_vga_console_info)) {
-                       const struct dom0_vga_console_info *info =
-                               (struct dom0_vga_console_info *)(
-                                       (char *)xen_start_info +
-                                       xen_start_info->console.dom0.info_off);
-                       dom0_init_screen_info(info);
-               }
+               const struct dom0_vga_console_info *info =
+                       (void *)((char *)xen_start_info +
+                                xen_start_info->console.dom0.info_off);
+
+               dom0_init_screen_info(info,
+                                     xen_start_info->console.dom0.info_size);
                xen_start_info->console.domU.mfn = 0;
                xen_start_info->console.domU.evtchn = 0;
        } else
diff -r d081f7efcb60 -r d34182a37ba9 arch/x86_64/kernel/setup-xen.c
--- a/arch/x86_64/kernel/setup-xen.c    Fri Oct 12 12:07:32 2007 +0100
+++ b/arch/x86_64/kernel/setup-xen.c    Fri Oct 12 12:08:17 2007 +0100
@@ -594,23 +594,12 @@ void __init setup_arch(char **cmdline_p)
        screen_info = SCREEN_INFO;
 
        if (is_initial_xendomain()) {
-               /* This is drawn from a dump from vgacon:startup in
-                * standard Linux. */
-               screen_info.orig_video_mode = 3;
-               screen_info.orig_video_isVGA = 1;
-               screen_info.orig_video_lines = 25;
-               screen_info.orig_video_cols = 80;
-               screen_info.orig_video_ega_bx = 3;
-               screen_info.orig_video_points = 16;
-               screen_info.orig_y = screen_info.orig_video_lines - 1;
-               if (xen_start_info->console.dom0.info_size >=
-                   sizeof(struct dom0_vga_console_info)) {
-                       const struct dom0_vga_console_info *info =
-                               (struct dom0_vga_console_info *)(
-                                       (char *)xen_start_info +
-                                       xen_start_info->console.dom0.info_off);
-                       dom0_init_screen_info(info);
-               }
+               const struct dom0_vga_console_info *info =
+                       (void *)((char *)xen_start_info +
+                                xen_start_info->console.dom0.info_off);
+
+               dom0_init_screen_info(info,
+                                     xen_start_info->console.dom0.info_size);
                xen_start_info->console.domU.mfn = 0;
                xen_start_info->console.domU.evtchn = 0;
        } else
diff -r d081f7efcb60 -r d34182a37ba9 drivers/xen/Kconfig
--- a/drivers/xen/Kconfig       Fri Oct 12 12:07:32 2007 +0100
+++ b/drivers/xen/Kconfig       Fri Oct 12 12:08:17 2007 +0100
@@ -13,7 +13,7 @@ if XEN
 if XEN
 config XEN_INTERFACE_VERSION
        hex
-       default 0x00030205
+       default 0x00030206
 
 menu "XEN"
 
diff -r d081f7efcb60 -r d34182a37ba9 drivers/xen/console/console.c
--- a/drivers/xen/console/console.c     Fri Oct 12 12:07:32 2007 +0100
+++ b/drivers/xen/console/console.c     Fri Oct 12 12:08:17 2007 +0100
@@ -276,13 +276,23 @@ void xencons_force_flush(void)
 }
 
 
-void dom0_init_screen_info(const struct dom0_vga_console_info *info)
-{
+void __init dom0_init_screen_info(const struct dom0_vga_console_info *info, 
size_t size)
+{
+       /* This is drawn from a dump from vgacon:startup in
+        * standard Linux. */
+       screen_info.orig_video_mode = 3;
+       screen_info.orig_video_isVGA = 1;
+       screen_info.orig_video_lines = 25;
+       screen_info.orig_video_cols = 80;
+       screen_info.orig_video_ega_bx = 3;
+       screen_info.orig_video_points = 16;
+       screen_info.orig_y = screen_info.orig_video_lines - 1;
+
        switch (info->video_type) {
        case XEN_VGATYPE_TEXT_MODE_3:
-               screen_info.orig_video_mode = 3;
-               screen_info.orig_video_ega_bx = 3;
-               screen_info.orig_video_isVGA = 1;
+               if (size < offsetof(struct dom0_vga_console_info, u.text_mode_3)
+                          + sizeof(info->u.text_mode_3))
+                       break;
                screen_info.orig_video_lines = info->u.text_mode_3.rows;
                screen_info.orig_video_cols = info->u.text_mode_3.columns;
                screen_info.orig_x = info->u.text_mode_3.cursor_x;
@@ -290,7 +300,11 @@ void dom0_init_screen_info(const struct 
                screen_info.orig_video_points =
                        info->u.text_mode_3.font_height;
                break;
+
        case XEN_VGATYPE_VESA_LFB:
+               if (size < offsetof(struct dom0_vga_console_info,
+                                   u.vesa_lfb.gbl_caps))
+                       break;
                screen_info.orig_video_isVGA = VIDEO_TYPE_VLFB;
                screen_info.lfb_width = info->u.vesa_lfb.width;
                screen_info.lfb_height = info->u.vesa_lfb.height;
@@ -306,6 +320,14 @@ void dom0_init_screen_info(const struct 
                screen_info.blue_pos = info->u.vesa_lfb.blue_pos;
                screen_info.rsvd_size = info->u.vesa_lfb.rsvd_size;
                screen_info.rsvd_pos = info->u.vesa_lfb.rsvd_pos;
+               if (size >= offsetof(struct dom0_vga_console_info,
+                                    u.vesa_lfb.gbl_caps)
+                           + sizeof(info->u.vesa_lfb.gbl_caps))
+                       screen_info.capabilities = info->u.vesa_lfb.gbl_caps;
+               if (size >= offsetof(struct dom0_vga_console_info,
+                                    u.vesa_lfb.mode_attrs)
+                           + sizeof(info->u.vesa_lfb.mode_attrs))
+                       screen_info.vesa_attributes = 
info->u.vesa_lfb.mode_attrs;
                break;
        }
 }
diff -r d081f7efcb60 -r d34182a37ba9 include/xen/xencons.h
--- a/include/xen/xencons.h     Fri Oct 12 12:07:32 2007 +0100
+++ b/include/xen/xencons.h     Fri Oct 12 12:08:17 2007 +0100
@@ -2,7 +2,7 @@
 #define __ASM_XENCONS_H__
 
 struct dom0_vga_console_info;
-void dom0_init_screen_info(const struct dom0_vga_console_info *info);
+void dom0_init_screen_info(const struct dom0_vga_console_info *, size_t);
 
 void xencons_force_flush(void);
 void xencons_resume(void);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] linux/x86: retrieve VESA capabilities in dom0, Xen patchbot-linux-2.6.18-xen <=