ia64/xen-unstable
changeset 11490:d8bceca5f07d
Clean up dom0_vga_console_info structure for v3.0.3.
Signed-off-by: Keir Fraser <keir@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kfraser@localhost.localdomain |
---|---|
date | Mon Sep 18 18:17:54 2006 +0100 (2006-09-18) |
parents | ef3a08ab559f |
children | 9061e1246906 |
files | linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c linux-2.6-xen-sparse/arch/ia64/dig/setup.c linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c linux-2.6-xen-sparse/drivers/xen/console/console.c linux-2.6-xen-sparse/include/xen/xencons.h xen/drivers/video/vga.c xen/include/public/xen.h |
line diff
1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Mon Sep 18 14:25:26 2006 +0100 1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Mon Sep 18 18:17:54 2006 +0100 1.3 @@ -65,6 +65,7 @@ 1.4 #include <xen/interface/physdev.h> 1.5 #include <xen/interface/memory.h> 1.6 #include <xen/features.h> 1.7 +#include <xen/xencons.h> 1.8 #include "setup_arch_pre.h" 1.9 #include <bios_ebda.h> 1.10 1.11 @@ -1665,33 +1666,15 @@ void __init setup_arch(char **cmdline_p) 1.12 screen_info.orig_video_cols = 80; 1.13 screen_info.orig_video_ega_bx = 3; 1.14 screen_info.orig_video_points = 16; 1.15 + screen_info.orig_y = screen_info.orig_video_lines - 1; 1.16 if (xen_start_info->console.dom0.info_size >= 1.17 sizeof(struct dom0_vga_console_info)) { 1.18 const struct dom0_vga_console_info *info = 1.19 (struct dom0_vga_console_info *)( 1.20 (char *)xen_start_info + 1.21 xen_start_info->console.dom0.info_off); 1.22 - screen_info.orig_video_mode = info->txt_mode; 1.23 - screen_info.orig_video_isVGA = info->video_type; 1.24 - screen_info.orig_video_lines = info->video_height; 1.25 - screen_info.orig_video_cols = info->video_width; 1.26 - screen_info.orig_video_points = info->txt_points; 1.27 - screen_info.lfb_width = info->video_width; 1.28 - screen_info.lfb_height = info->video_height; 1.29 - screen_info.lfb_depth = info->lfb_depth; 1.30 - screen_info.lfb_base = info->lfb_base; 1.31 - screen_info.lfb_size = info->lfb_size; 1.32 - screen_info.lfb_linelength = info->lfb_linelen; 1.33 - screen_info.red_size = info->red_size; 1.34 - screen_info.red_pos = info->red_pos; 1.35 - screen_info.green_size = info->green_size; 1.36 - screen_info.green_pos = info->green_pos; 1.37 - screen_info.blue_size = info->blue_size; 1.38 - screen_info.blue_pos = info->blue_pos; 1.39 - screen_info.rsvd_size = info->rsvd_size; 1.40 - screen_info.rsvd_pos = info->rsvd_pos; 1.41 + dom0_init_screen_info(info); 1.42 } 1.43 - screen_info.orig_y = screen_info.orig_video_lines - 1; 1.44 xen_start_info->console.domU.mfn = 0; 1.45 xen_start_info->console.domU.evtchn = 0; 1.46 } else
2.1 --- a/linux-2.6-xen-sparse/arch/ia64/dig/setup.c Mon Sep 18 14:25:26 2006 +0100 2.2 +++ b/linux-2.6-xen-sparse/arch/ia64/dig/setup.c Mon Sep 18 18:17:54 2006 +0100 2.3 @@ -25,6 +25,8 @@ 2.4 #include <asm/machvec.h> 2.5 #include <asm/system.h> 2.6 2.7 +#include <xen/xencons.h> 2.8 + 2.9 void __init 2.10 dig_setup (char **cmdline_p) 2.11 { 2.12 @@ -78,27 +80,8 @@ dig_setup (char **cmdline_p) 2.13 (struct dom0_vga_console_info *)( 2.14 (char *)xen_start_info + 2.15 xen_start_info->console.dom0.info_off); 2.16 - screen_info.orig_video_mode = info->txt_mode; 2.17 - screen_info.orig_video_isVGA = info->video_type; 2.18 - screen_info.orig_video_lines = info->video_height; 2.19 - screen_info.orig_video_cols = info->video_width; 2.20 - screen_info.orig_video_points = info->txt_points; 2.21 - screen_info.lfb_width = info->video_width; 2.22 - screen_info.lfb_height = info->video_height; 2.23 - screen_info.lfb_depth = info->lfb_depth; 2.24 - screen_info.lfb_base = info->lfb_base; 2.25 - screen_info.lfb_size = info->lfb_size; 2.26 - screen_info.lfb_linelength = info->lfb_linelen; 2.27 - screen_info.red_size = info->red_size; 2.28 - screen_info.red_pos = info->red_pos; 2.29 - screen_info.green_size = info->green_size; 2.30 - screen_info.green_pos = info->green_pos; 2.31 - screen_info.blue_size = info->blue_size; 2.32 - screen_info.blue_pos = info->blue_pos; 2.33 - screen_info.rsvd_size = info->rsvd_size; 2.34 - screen_info.rsvd_pos = info->rsvd_pos; 2.35 + dom0_init_screen_info(info); 2.36 } 2.37 - screen_info.orig_y = screen_info.orig_video_lines - 1; 2.38 xen_start_info->console.domU.mfn = 0; 2.39 xen_start_info->console.domU.evtchn = 0; 2.40 #endif
3.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c Mon Sep 18 14:25:26 2006 +0100 3.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c Mon Sep 18 18:17:54 2006 +0100 3.3 @@ -74,6 +74,7 @@ 3.4 #include <asm/hypervisor.h> 3.5 #include <xen/interface/nmi.h> 3.6 #include <xen/features.h> 3.7 +#include <xen/xencons.h> 3.8 #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) 3.9 #define PFN_PHYS(x) ((x) << PAGE_SHIFT) 3.10 #include <asm/mach-xen/setup_arch_post.h> 3.11 @@ -645,33 +646,15 @@ void __init setup_arch(char **cmdline_p) 3.12 screen_info.orig_video_cols = 80; 3.13 screen_info.orig_video_ega_bx = 3; 3.14 screen_info.orig_video_points = 16; 3.15 + screen_info.orig_y = screen_info.orig_video_lines - 1; 3.16 if (xen_start_info->console.dom0.info_size >= 3.17 sizeof(struct dom0_vga_console_info)) { 3.18 const struct dom0_vga_console_info *info = 3.19 (struct dom0_vga_console_info *)( 3.20 (char *)xen_start_info + 3.21 xen_start_info->console.dom0.info_off); 3.22 - screen_info.orig_video_mode = info->txt_mode; 3.23 - screen_info.orig_video_isVGA = info->video_type; 3.24 - screen_info.orig_video_lines = info->video_height; 3.25 - screen_info.orig_video_cols = info->video_width; 3.26 - screen_info.orig_video_points = info->txt_points; 3.27 - screen_info.lfb_width = info->video_width; 3.28 - screen_info.lfb_height = info->video_height; 3.29 - screen_info.lfb_depth = info->lfb_depth; 3.30 - screen_info.lfb_base = info->lfb_base; 3.31 - screen_info.lfb_size = info->lfb_size; 3.32 - screen_info.lfb_linelength = info->lfb_linelen; 3.33 - screen_info.red_size = info->red_size; 3.34 - screen_info.red_pos = info->red_pos; 3.35 - screen_info.green_size = info->green_size; 3.36 - screen_info.green_pos = info->green_pos; 3.37 - screen_info.blue_size = info->blue_size; 3.38 - screen_info.blue_pos = info->blue_pos; 3.39 - screen_info.rsvd_size = info->rsvd_size; 3.40 - screen_info.rsvd_pos = info->rsvd_pos; 3.41 + dom0_init_screen_info(info); 3.42 } 3.43 - screen_info.orig_y = screen_info.orig_video_lines - 1; 3.44 xen_start_info->console.domU.mfn = 0; 3.45 xen_start_info->console.domU.evtchn = 0; 3.46 } else
4.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c Mon Sep 18 14:25:26 2006 +0100 4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c Mon Sep 18 18:17:54 2006 +0100 4.3 @@ -49,6 +49,7 @@ 4.4 #include <linux/console.h> 4.5 #include <linux/bootmem.h> 4.6 #include <linux/sysrq.h> 4.7 +#include <linux/screen_info.h> 4.8 #include <asm/io.h> 4.9 #include <asm/irq.h> 4.10 #include <asm/uaccess.h> 4.11 @@ -266,6 +267,41 @@ void xencons_force_flush(void) 4.12 } 4.13 4.14 4.15 +void dom0_init_screen_info(const struct dom0_vga_console_info *info) 4.16 +{ 4.17 + switch (info->video_type) { 4.18 + case XEN_VGATYPE_TEXT_MODE_3: 4.19 + screen_info.orig_video_mode = 3; 4.20 + screen_info.orig_video_ega_bx = 3; 4.21 + screen_info.orig_video_isVGA = 1; 4.22 + screen_info.orig_video_lines = info->u.text_mode_3.rows; 4.23 + screen_info.orig_video_cols = info->u.text_mode_3.columns; 4.24 + screen_info.orig_x = info->u.text_mode_3.cursor_x; 4.25 + screen_info.orig_y = info->u.text_mode_3.cursor_y; 4.26 + screen_info.orig_video_points = 4.27 + info->u.text_mode_3.font_height; 4.28 + break; 4.29 + case XEN_VGATYPE_VESA_LFB: 4.30 + screen_info.orig_video_isVGA = VIDEO_TYPE_VLFB; 4.31 + screen_info.lfb_width = info->u.vesa_lfb.width; 4.32 + screen_info.lfb_height = info->u.vesa_lfb.height; 4.33 + screen_info.lfb_depth = info->u.vesa_lfb.bits_per_pixel; 4.34 + screen_info.lfb_base = info->u.vesa_lfb.lfb_base; 4.35 + screen_info.lfb_size = info->u.vesa_lfb.lfb_size; 4.36 + screen_info.lfb_linelength = info->u.vesa_lfb.bytes_per_line; 4.37 + screen_info.red_size = info->u.vesa_lfb.red_size; 4.38 + screen_info.red_pos = info->u.vesa_lfb.red_pos; 4.39 + screen_info.green_size = info->u.vesa_lfb.green_size; 4.40 + screen_info.green_pos = info->u.vesa_lfb.green_pos; 4.41 + screen_info.blue_size = info->u.vesa_lfb.blue_size; 4.42 + screen_info.blue_pos = info->u.vesa_lfb.blue_pos; 4.43 + screen_info.rsvd_size = info->u.vesa_lfb.rsvd_size; 4.44 + screen_info.rsvd_pos = info->u.vesa_lfb.rsvd_pos; 4.45 + break; 4.46 + } 4.47 +} 4.48 + 4.49 + 4.50 /******************** User-space console driver (/dev/console) ************/ 4.51 4.52 #define DRV(_d) (_d)
5.1 --- a/linux-2.6-xen-sparse/include/xen/xencons.h Mon Sep 18 14:25:26 2006 +0100 5.2 +++ b/linux-2.6-xen-sparse/include/xen/xencons.h Mon Sep 18 18:17:54 2006 +0100 5.3 @@ -1,6 +1,9 @@ 5.4 #ifndef __ASM_XENCONS_H__ 5.5 #define __ASM_XENCONS_H__ 5.6 5.7 +struct dom0_vga_console_info; 5.8 +void dom0_init_screen_info(const struct dom0_vga_console_info *info); 5.9 + 5.10 void xencons_force_flush(void); 5.11 void xencons_resume(void); 5.12
6.1 --- a/xen/drivers/video/vga.c Mon Sep 18 14:25:26 2006 +0100 6.2 +++ b/xen/drivers/video/vga.c Mon Sep 18 18:17:54 2006 +0100 6.3 @@ -680,11 +680,12 @@ int fill_console_start_info(struct dom0_ 6.4 if ( !vgacon_enabled ) 6.5 return 0; 6.6 6.7 - ci->video_type = 1; 6.8 - ci->video_width = COLUMNS; 6.9 - ci->video_height = LINES; 6.10 - ci->txt_mode = 3; 6.11 - ci->txt_points = font ? font->height : 16; 6.12 + ci->video_type = XEN_VGATYPE_TEXT_MODE_3; 6.13 + ci->u.text_mode_3.rows = LINES; 6.14 + ci->u.text_mode_3.columns = COLUMNS; 6.15 + ci->u.text_mode_3.cursor_x = 0; 6.16 + ci->u.text_mode_3.cursor_y = LINES - 1; 6.17 + ci->u.text_mode_3.font_height = font ? font->height : 16; 6.18 6.19 return 1; 6.20 }
7.1 --- a/xen/include/public/xen.h Mon Sep 18 14:25:26 2006 +0100 7.2 +++ b/xen/include/public/xen.h Mon Sep 18 18:17:54 2006 +0100 7.3 @@ -517,25 +517,37 @@ typedef struct start_info start_info_t; 7.4 #define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */ 7.5 7.6 typedef struct dom0_vga_console_info { 7.7 - uint8_t video_type; 7.8 - uint8_t txt_points; 7.9 - uint16_t txt_mode; 7.10 - uint16_t txt_x; 7.11 - uint16_t txt_y; 7.12 - uint16_t video_width; 7.13 - uint16_t video_height; 7.14 - uint16_t lfb_linelen; 7.15 - uint16_t lfb_depth; 7.16 - unsigned long lfb_base; 7.17 - unsigned long lfb_size; 7.18 - uint8_t red_pos; 7.19 - uint8_t red_size; 7.20 - uint8_t green_pos; 7.21 - uint8_t green_size; 7.22 - uint8_t blue_pos; 7.23 - uint8_t blue_size; 7.24 - uint8_t rsvd_pos; 7.25 - uint8_t rsvd_size; 7.26 + uint8_t video_type; /* DOM0_VGA_CONSOLE_??? */ 7.27 +#define XEN_VGATYPE_TEXT_MODE_3 0x03 7.28 +#define XEN_VGATYPE_VESA_LFB 0x23 7.29 + 7.30 + union { 7.31 + struct { 7.32 + /* Font height, in pixels. */ 7.33 + uint16_t font_height; 7.34 + /* Cursor location (column, row). */ 7.35 + uint16_t cursor_x, cursor_y; 7.36 + /* Number of rows and columns (dimensions in characters). */ 7.37 + uint16_t rows, columns; 7.38 + } text_mode_3; 7.39 + 7.40 + struct { 7.41 + /* Width and height, in pixels. */ 7.42 + uint16_t width, height; 7.43 + /* Bytes per scan line. */ 7.44 + uint16_t bytes_per_line; 7.45 + /* Bits per pixel. */ 7.46 + uint16_t bits_per_pixel; 7.47 + /* LFB physical address, and size (in units of 64kB). */ 7.48 + uint32_t lfb_base; 7.49 + uint32_t lfb_size; 7.50 + /* RGB mask offsets and sizes, as defined by VBE 1.2+ */ 7.51 + uint8_t red_pos, red_size; 7.52 + uint8_t green_pos, green_size; 7.53 + uint8_t blue_pos, blue_size; 7.54 + uint8_t rsvd_pos, rsvd_size; 7.55 + } vesa_lfb; 7.56 + } u; 7.57 } dom0_vga_console_info_t; 7.58 7.59 typedef uint8_t xen_domain_handle_t[16];