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] [xen-unstable] Clean up dom0_vga_console_info structure

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Clean up dom0_vga_console_info structure for v3.0.3.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Sep 2006 18:50:11 +0000
Delivery-date: Mon, 18 Sep 2006 11:50:49 -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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID d8bceca5f07d4510a8c4a7d9c13cae2af571aa30
# Parent  ef3a08ab559fe385305b4dfd63122d26767ee870
Clean up dom0_vga_console_info structure for v3.0.3.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c   |   25 +---------
 linux-2.6-xen-sparse/arch/ia64/dig/setup.c          |   23 +--------
 linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c |   25 +---------
 linux-2.6-xen-sparse/drivers/xen/console/console.c  |   36 ++++++++++++++
 linux-2.6-xen-sparse/include/xen/xencons.h          |    3 +
 xen/drivers/video/vga.c                             |   11 ++--
 xen/include/public/xen.h                            |   50 ++++++++++++--------
 7 files changed, 87 insertions(+), 86 deletions(-)

diff -r ef3a08ab559f -r d8bceca5f07d 
linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Mon Sep 18 14:25:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Mon Sep 18 18:17:54 
2006 +0100
@@ -65,6 +65,7 @@
 #include <xen/interface/physdev.h>
 #include <xen/interface/memory.h>
 #include <xen/features.h>
+#include <xen/xencons.h>
 #include "setup_arch_pre.h"
 #include <bios_ebda.h>
 
@@ -1665,33 +1666,15 @@ void __init setup_arch(char **cmdline_p)
                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);
-                       screen_info.orig_video_mode = info->txt_mode;
-                       screen_info.orig_video_isVGA = info->video_type;
-                       screen_info.orig_video_lines = info->video_height;
-                       screen_info.orig_video_cols = info->video_width;
-                       screen_info.orig_video_points = info->txt_points;
-                       screen_info.lfb_width = info->video_width;
-                       screen_info.lfb_height = info->video_height;
-                       screen_info.lfb_depth = info->lfb_depth;
-                       screen_info.lfb_base = info->lfb_base;
-                       screen_info.lfb_size = info->lfb_size;
-                       screen_info.lfb_linelength = info->lfb_linelen;
-                       screen_info.red_size = info->red_size;
-                       screen_info.red_pos = info->red_pos;
-                       screen_info.green_size = info->green_size;
-                       screen_info.green_pos = info->green_pos;
-                       screen_info.blue_size = info->blue_size;
-                       screen_info.blue_pos = info->blue_pos;
-                       screen_info.rsvd_size = info->rsvd_size;
-                       screen_info.rsvd_pos = info->rsvd_pos;
-               }
-               screen_info.orig_y = screen_info.orig_video_lines - 1;
+                       dom0_init_screen_info(info);
+               }
                xen_start_info->console.domU.mfn = 0;
                xen_start_info->console.domU.evtchn = 0;
        } else
diff -r ef3a08ab559f -r d8bceca5f07d linux-2.6-xen-sparse/arch/ia64/dig/setup.c
--- a/linux-2.6-xen-sparse/arch/ia64/dig/setup.c        Mon Sep 18 14:25:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/ia64/dig/setup.c        Mon Sep 18 18:17:54 
2006 +0100
@@ -24,6 +24,8 @@
 #include <asm/io.h>
 #include <asm/machvec.h>
 #include <asm/system.h>
+
+#include <xen/xencons.h>
 
 void __init
 dig_setup (char **cmdline_p)
@@ -78,27 +80,8 @@ dig_setup (char **cmdline_p)
                        (struct dom0_vga_console_info *)(
                                (char *)xen_start_info +
                                xen_start_info->console.dom0.info_off);
-               screen_info.orig_video_mode = info->txt_mode;
-               screen_info.orig_video_isVGA = info->video_type;
-               screen_info.orig_video_lines = info->video_height;
-               screen_info.orig_video_cols = info->video_width;
-               screen_info.orig_video_points = info->txt_points;
-               screen_info.lfb_width = info->video_width;
-               screen_info.lfb_height = info->video_height;
-               screen_info.lfb_depth = info->lfb_depth;
-               screen_info.lfb_base = info->lfb_base;
-               screen_info.lfb_size = info->lfb_size;
-               screen_info.lfb_linelength = info->lfb_linelen;
-               screen_info.red_size = info->red_size;
-               screen_info.red_pos = info->red_pos;
-               screen_info.green_size = info->green_size;
-               screen_info.green_pos = info->green_pos;
-               screen_info.blue_size = info->blue_size;
-               screen_info.blue_pos = info->blue_pos;
-               screen_info.rsvd_size = info->rsvd_size;
-               screen_info.rsvd_pos = info->rsvd_pos;
+               dom0_init_screen_info(info);
        }
-       screen_info.orig_y = screen_info.orig_video_lines - 1;
        xen_start_info->console.domU.mfn = 0;
        xen_start_info->console.domU.evtchn = 0;
 #endif
diff -r ef3a08ab559f -r d8bceca5f07d 
linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c       Mon Sep 18 
14:25:26 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c       Mon Sep 18 
18:17:54 2006 +0100
@@ -74,6 +74,7 @@
 #include <asm/hypervisor.h>
 #include <xen/interface/nmi.h>
 #include <xen/features.h>
+#include <xen/xencons.h>
 #define PFN_UP(x)       (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
 #define PFN_PHYS(x)     ((x) << PAGE_SHIFT)
 #include <asm/mach-xen/setup_arch_post.h>
@@ -645,33 +646,15 @@ void __init setup_arch(char **cmdline_p)
                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);
-                       screen_info.orig_video_mode = info->txt_mode;
-                       screen_info.orig_video_isVGA = info->video_type;
-                       screen_info.orig_video_lines = info->video_height;
-                       screen_info.orig_video_cols = info->video_width;
-                       screen_info.orig_video_points = info->txt_points;
-                       screen_info.lfb_width = info->video_width;
-                       screen_info.lfb_height = info->video_height;
-                       screen_info.lfb_depth = info->lfb_depth;
-                       screen_info.lfb_base = info->lfb_base;
-                       screen_info.lfb_size = info->lfb_size;
-                       screen_info.lfb_linelength = info->lfb_linelen;
-                       screen_info.red_size = info->red_size;
-                       screen_info.red_pos = info->red_pos;
-                       screen_info.green_size = info->green_size;
-                       screen_info.green_pos = info->green_pos;
-                       screen_info.blue_size = info->blue_size;
-                       screen_info.blue_pos = info->blue_pos;
-                       screen_info.rsvd_size = info->rsvd_size;
-                       screen_info.rsvd_pos = info->rsvd_pos;
-               }
-               screen_info.orig_y = screen_info.orig_video_lines - 1;
+                       dom0_init_screen_info(info);
+               }
                xen_start_info->console.domU.mfn = 0;
                xen_start_info->console.domU.evtchn = 0;
        } else
diff -r ef3a08ab559f -r d8bceca5f07d 
linux-2.6-xen-sparse/drivers/xen/console/console.c
--- a/linux-2.6-xen-sparse/drivers/xen/console/console.c        Mon Sep 18 
14:25:26 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c        Mon Sep 18 
18:17:54 2006 +0100
@@ -49,6 +49,7 @@
 #include <linux/console.h>
 #include <linux/bootmem.h>
 #include <linux/sysrq.h>
+#include <linux/screen_info.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/uaccess.h>
@@ -262,6 +263,41 @@ void xencons_force_flush(void)
                sent = xencons_ring_send(&wbuf[WBUF_MASK(wc)], sz);
                if (sent > 0)
                        wc += sent;
+       }
+}
+
+
+void dom0_init_screen_info(const struct dom0_vga_console_info *info)
+{
+       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;
+               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;
+               screen_info.orig_y = info->u.text_mode_3.cursor_y;
+               screen_info.orig_video_points =
+                       info->u.text_mode_3.font_height;
+               break;
+       case XEN_VGATYPE_VESA_LFB:
+               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;
+               screen_info.lfb_depth = info->u.vesa_lfb.bits_per_pixel;
+               screen_info.lfb_base = info->u.vesa_lfb.lfb_base;
+               screen_info.lfb_size = info->u.vesa_lfb.lfb_size;
+               screen_info.lfb_linelength = info->u.vesa_lfb.bytes_per_line;
+               screen_info.red_size = info->u.vesa_lfb.red_size;
+               screen_info.red_pos = info->u.vesa_lfb.red_pos;
+               screen_info.green_size = info->u.vesa_lfb.green_size;
+               screen_info.green_pos = info->u.vesa_lfb.green_pos;
+               screen_info.blue_size = info->u.vesa_lfb.blue_size;
+               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;
+               break;
        }
 }
 
diff -r ef3a08ab559f -r d8bceca5f07d linux-2.6-xen-sparse/include/xen/xencons.h
--- a/linux-2.6-xen-sparse/include/xen/xencons.h        Mon Sep 18 14:25:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/include/xen/xencons.h        Mon Sep 18 18:17:54 
2006 +0100
@@ -1,5 +1,8 @@
 #ifndef __ASM_XENCONS_H__
 #define __ASM_XENCONS_H__
+
+struct dom0_vga_console_info;
+void dom0_init_screen_info(const struct dom0_vga_console_info *info);
 
 void xencons_force_flush(void);
 void xencons_resume(void);
diff -r ef3a08ab559f -r d8bceca5f07d xen/drivers/video/vga.c
--- a/xen/drivers/video/vga.c   Mon Sep 18 14:25:26 2006 +0100
+++ b/xen/drivers/video/vga.c   Mon Sep 18 18:17:54 2006 +0100
@@ -680,11 +680,12 @@ int fill_console_start_info(struct dom0_
     if ( !vgacon_enabled )
         return 0;
 
-    ci->video_type   = 1;
-    ci->video_width  = COLUMNS;
-    ci->video_height = LINES;
-    ci->txt_mode     = 3;
-    ci->txt_points   = font ? font->height : 16;
+    ci->video_type = XEN_VGATYPE_TEXT_MODE_3;
+    ci->u.text_mode_3.rows     = LINES;
+    ci->u.text_mode_3.columns  = COLUMNS;
+    ci->u.text_mode_3.cursor_x = 0;
+    ci->u.text_mode_3.cursor_y = LINES - 1;
+    ci->u.text_mode_3.font_height = font ? font->height : 16;
 
     return 1;
 }
diff -r ef3a08ab559f -r d8bceca5f07d xen/include/public/xen.h
--- a/xen/include/public/xen.h  Mon Sep 18 14:25:26 2006 +0100
+++ b/xen/include/public/xen.h  Mon Sep 18 18:17:54 2006 +0100
@@ -517,25 +517,37 @@ typedef struct start_info start_info_t;
 #define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
 
 typedef struct dom0_vga_console_info {
-    uint8_t video_type;
-    uint8_t txt_points;
-    uint16_t txt_mode;
-    uint16_t txt_x;
-    uint16_t txt_y;
-    uint16_t video_width;
-    uint16_t video_height;
-    uint16_t lfb_linelen;
-    uint16_t lfb_depth;
-    unsigned long lfb_base;
-    unsigned long lfb_size;
-    uint8_t red_pos;
-    uint8_t red_size;
-    uint8_t green_pos;
-    uint8_t green_size;
-    uint8_t blue_pos;
-    uint8_t blue_size;
-    uint8_t rsvd_pos;
-    uint8_t rsvd_size;
+    uint8_t video_type; /* DOM0_VGA_CONSOLE_??? */
+#define XEN_VGATYPE_TEXT_MODE_3 0x03
+#define XEN_VGATYPE_VESA_LFB    0x23
+
+    union {
+        struct {
+            /* Font height, in pixels. */
+            uint16_t font_height;
+            /* Cursor location (column, row). */
+            uint16_t cursor_x, cursor_y;
+            /* Number of rows and columns (dimensions in characters). */
+            uint16_t rows, columns;
+        } text_mode_3;
+
+        struct {
+            /* Width and height, in pixels. */
+            uint16_t width, height;
+            /* Bytes per scan line. */
+            uint16_t bytes_per_line;
+            /* Bits per pixel. */
+            uint16_t bits_per_pixel;
+            /* LFB physical address, and size (in units of 64kB). */
+            uint32_t lfb_base;
+            uint32_t lfb_size;
+            /* RGB mask offsets and sizes, as defined by VBE 1.2+ */
+            uint8_t  red_pos, red_size;
+            uint8_t  green_pos, green_size;
+            uint8_t  blue_pos, blue_size;
+            uint8_t  rsvd_pos, rsvd_size;
+        } vesa_lfb;
+    } u;
 } dom0_vga_console_info_t;
 
 typedef uint8_t xen_domain_handle_t[16];

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Clean up dom0_vga_console_info structure for v3.0.3., Xen patchbot-unstable <=