ia64/xen-unstable

changeset 16124:ef4119637f52

x86: propagate VESA capabilities to dom0

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>
author Keir Fraser <keir@xensource.com>
date Fri Oct 12 11:55:41 2007 +0100 (2007-10-12)
parents 723b9837db1b
children a330276d8c90
files 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
line diff
     1.1 --- a/xen/arch/x86/boot/video.S	Fri Oct 12 11:42:56 2007 +0100
     1.2 +++ b/xen/arch/x86/boot/video.S	Fri Oct 12 11:55:41 2007 +0100
     1.3 @@ -44,6 +44,7 @@
     1.4  #define PARAM_LFB_COLORS        0x1c
     1.5  #define PARAM_VESAPM_SEG        0x24
     1.6  #define PARAM_VESAPM_OFF        0x26
     1.7 +#define PARAM_VESA_ATTRIB       0x28
     1.8  #define _param(param) bootsym(boot_vid_info)+(param)
     1.9  
    1.10  video:  xorw    %ax, %ax
    1.11 @@ -129,6 +130,8 @@ mopar_gr:
    1.12          movl    %eax, _param(PARAM_LFB_COLORS)
    1.13          movl    35(%di), %eax
    1.14          movl    %eax, _param(PARAM_LFB_COLORS+4)
    1.15 +        movw    0(%di), %ax
    1.16 +        movw    %ax, _param(PARAM_VESA_ATTRIB)
    1.17  
    1.18  # get video mem size
    1.19          leaw    vesa_glob_info, %di
     2.1 --- a/xen/arch/x86/setup.c	Fri Oct 12 11:42:56 2007 +0100
     2.2 +++ b/xen/arch/x86/setup.c	Fri Oct 12 11:55:41 2007 +0100
     2.3 @@ -308,6 +308,7 @@ struct boot_video_info {
     2.4      u8  rsvd_pos;           /* 0x23 */
     2.5      u16 vesapm_seg;         /* 0x24 */
     2.6      u16 vesapm_off;         /* 0x26 */
     2.7 +    u16 vesa_attrib;        /* 0x28 */
     2.8  };
     2.9  
    2.10  static void __init parse_video_info(void)
    2.11 @@ -340,6 +341,8 @@ static void __init parse_video_info(void
    2.12          vga_console_info.u.vesa_lfb.blue_size = bvi->blue_size;
    2.13          vga_console_info.u.vesa_lfb.rsvd_pos = bvi->rsvd_pos;
    2.14          vga_console_info.u.vesa_lfb.rsvd_size = bvi->rsvd_size;
    2.15 +        vga_console_info.u.vesa_lfb.gbl_caps = bvi->capabilities;
    2.16 +        vga_console_info.u.vesa_lfb.mode_attrs = bvi->vesa_attrib;
    2.17      }
    2.18  }
    2.19  
     3.1 --- a/xen/drivers/video/vesa.c	Fri Oct 12 11:42:56 2007 +0100
     3.2 +++ b/xen/drivers/video/vesa.c	Fri Oct 12 11:55:41 2007 +0100
     3.3 @@ -46,7 +46,7 @@ void __init vesa_early_init(void)
     3.4  {
     3.5      unsigned int vram_vmode;
     3.6  
     3.7 -    /* XXX vga_compat = !(boot_video_info.capabilities & 2); */
     3.8 +    vga_compat = !(vesa_lfb_info.capabilities & 2);
     3.9  
    3.10      if ( (vlfb_info.bits_per_pixel < 8) || (vlfb_info.bits_per_pixel > 32) )
    3.11          return;
     4.1 --- a/xen/include/public/xen-compat.h	Fri Oct 12 11:42:56 2007 +0100
     4.2 +++ b/xen/include/public/xen-compat.h	Fri Oct 12 11:55:41 2007 +0100
     4.3 @@ -27,7 +27,7 @@
     4.4  #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
     4.5  #define __XEN_PUBLIC_XEN_COMPAT_H__
     4.6  
     4.7 -#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030205
     4.8 +#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030206
     4.9  
    4.10  #if defined(__XEN__) || defined(__XEN_TOOLS__)
    4.11  /* Xen is built with matching headers and implements the latest interface. */
     5.1 --- a/xen/include/public/xen.h	Fri Oct 12 11:42:56 2007 +0100
     5.2 +++ b/xen/include/public/xen.h	Fri Oct 12 11:55:41 2007 +0100
     5.3 @@ -565,6 +565,12 @@ typedef struct dom0_vga_console_info {
     5.4              uint8_t  green_pos, green_size;
     5.5              uint8_t  blue_pos, blue_size;
     5.6              uint8_t  rsvd_pos, rsvd_size;
     5.7 +#if __XEN_INTERFACE_VERSION__ >= 0x00030206
     5.8 +            /* VESA capabilities (offset 0xa, VESA command 0x4f00). */
     5.9 +            uint32_t gbl_caps;
    5.10 +            /* Mode attributes (offset 0x0, VESA command 0x4f01). */
    5.11 +            uint16_t mode_attrs;
    5.12 +#endif
    5.13          } vesa_lfb;
    5.14      } u;
    5.15  } dom0_vga_console_info_t;