x86: propagate VESA capabilities to dom0
authorKeir Fraser <keir@xensource.com>
Fri, 12 Oct 2007 10:55:41 +0000 (11:55 +0100)
committerKeir Fraser <keir@xensource.com>
Fri, 12 Oct 2007 10:55:41 +0000 (11:55 +0100)
Linux has been using the VESA capabilities field for quite a while, so
Xen should also supply it. At once, in case needed in the future, also
propagate the mode attributes field.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/boot/video.S
xen/arch/x86/setup.c
xen/drivers/video/vesa.c
xen/include/public/xen-compat.h
xen/include/public/xen.h

index 1e3c034234c3e428027fa11635b146e2ee4c90cb..d27fb12330ae797408cde627d6fe0d0e341912dc 100644 (file)
@@ -44,6 +44,7 @@
 #define PARAM_LFB_COLORS        0x1c
 #define PARAM_VESAPM_SEG        0x24
 #define PARAM_VESAPM_OFF        0x26
+#define PARAM_VESA_ATTRIB       0x28
 #define _param(param) bootsym(boot_vid_info)+(param)
 
 video:  xorw    %ax, %ax
@@ -129,6 +130,8 @@ mopar_gr:
         movl    %eax, _param(PARAM_LFB_COLORS)
         movl    35(%di), %eax
         movl    %eax, _param(PARAM_LFB_COLORS+4)
+        movw    0(%di), %ax
+        movw    %ax, _param(PARAM_VESA_ATTRIB)
 
 # get video mem size
         leaw    vesa_glob_info, %di
index d58642bbbaacb3d40dfd3653e4b49280abe1352a..f1f161597c46654d1f7cd993218ec56668a703ff 100644 (file)
@@ -308,6 +308,7 @@ struct boot_video_info {
     u8  rsvd_pos;           /* 0x23 */
     u16 vesapm_seg;         /* 0x24 */
     u16 vesapm_off;         /* 0x26 */
+    u16 vesa_attrib;        /* 0x28 */
 };
 
 static void __init parse_video_info(void)
@@ -340,6 +341,8 @@ static void __init parse_video_info(void)
         vga_console_info.u.vesa_lfb.blue_size = bvi->blue_size;
         vga_console_info.u.vesa_lfb.rsvd_pos = bvi->rsvd_pos;
         vga_console_info.u.vesa_lfb.rsvd_size = bvi->rsvd_size;
+        vga_console_info.u.vesa_lfb.gbl_caps = bvi->capabilities;
+        vga_console_info.u.vesa_lfb.mode_attrs = bvi->vesa_attrib;
     }
 }
 
index 8f5b5c690b18efa3ff3ec9616eae83f236aa04ed..04064f786d4dec18537ec81999ff75d989793bf3 100644 (file)
@@ -46,7 +46,7 @@ void __init vesa_early_init(void)
 {
     unsigned int vram_vmode;
 
-    /* XXX vga_compat = !(boot_video_info.capabilities & 2); */
+    vga_compat = !(vesa_lfb_info.capabilities & 2);
 
     if ( (vlfb_info.bits_per_pixel < 8) || (vlfb_info.bits_per_pixel > 32) )
         return;
index 19b0a2c73338e3be9f20f32ed457f93a674fcf5d..77ca51af1a10166168d0e1d6e6a82f2b35bad3bd 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 #define __XEN_PUBLIC_XEN_COMPAT_H__
 
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030205
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030206
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Xen is built with matching headers and implements the latest interface. */
index 3a06ebfe212f4a14a15c1b8fd19d697faaf56205..991128f0ee421afbeddadcf435a5dd7a97f0b700 100644 (file)
@@ -565,6 +565,12 @@ typedef struct dom0_vga_console_info {
             uint8_t  green_pos, green_size;
             uint8_t  blue_pos, blue_size;
             uint8_t  rsvd_pos, rsvd_size;
+#if __XEN_INTERFACE_VERSION__ >= 0x00030206
+            /* VESA capabilities (offset 0xa, VESA command 0x4f00). */
+            uint32_t gbl_caps;
+            /* Mode attributes (offset 0x0, VESA command 0x4f01). */
+            uint16_t mode_attrs;
+#endif
         } vesa_lfb;
     } u;
 } dom0_vga_console_info_t;