direct-io.hg

changeset 15408:cf846f4d756f

Add hypercall function for retrieving EDID info
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Jun 20 19:24:08 2007 +0100 (2007-06-20)
parents 6310aebd34a6
children 11bf94b2d51a
files xen/arch/x86/platform_hypercall.c xen/include/public/platform.h
line diff
     1.1 --- a/xen/arch/x86/platform_hypercall.c	Wed Jun 20 19:08:45 2007 +0100
     1.2 +++ b/xen/arch/x86/platform_hypercall.c	Wed Jun 20 19:24:08 2007 +0100
     1.3 @@ -24,6 +24,9 @@
     1.4  #include <asm/mtrr.h>
     1.5  #include "cpu/mtrr/mtrr.h"
     1.6  
     1.7 +extern uint16_t boot_edid_caps;
     1.8 +extern uint8_t boot_edid_info[];
     1.9 +
    1.10  #ifndef COMPAT
    1.11  typedef long ret_t;
    1.12  DEFINE_SPINLOCK(xenpf_lock);
    1.13 @@ -217,6 +220,27 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
    1.14                     ? -EFAULT : 0);
    1.15              break;
    1.16          }
    1.17 +        case XEN_FW_VBEDDC_INFO:
    1.18 +            ret = -ESRCH;
    1.19 +            if ( op->u.firmware_info.index != 0 )
    1.20 +                break;
    1.21 +            if ( *(u32 *)bootsym(boot_edid_info) == 0x13131313 )
    1.22 +                break;
    1.23 +
    1.24 +            op->u.firmware_info.u.ddc_info.capabilities =
    1.25 +                bootsym(boot_edid_caps);
    1.26 +            op->u.firmware_info.u.ddc_info.edid_transfer_time =
    1.27 +                bootsym(boot_edid_caps) >> 8;
    1.28 +
    1.29 +            ret = 0;
    1.30 +            if ( copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
    1.31 +                                     u.ddc_info.capabilities) ||
    1.32 +                 copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
    1.33 +                                     u.ddc_info.edid_transfer_time) ||
    1.34 +                 copy_to_compat(op->u.firmware_info.u.ddc_info.edid,
    1.35 +                                bootsym(boot_edid_info), 128) )
    1.36 +                ret = -EFAULT;
    1.37 +            break;
    1.38          default:
    1.39              ret = -EINVAL;
    1.40              break;
     2.1 --- a/xen/include/public/platform.h	Wed Jun 20 19:08:45 2007 +0100
     2.2 +++ b/xen/include/public/platform.h	Wed Jun 20 19:24:08 2007 +0100
     2.3 @@ -115,8 +115,9 @@ typedef struct xenpf_platform_quirk xenp
     2.4  DEFINE_XEN_GUEST_HANDLE(xenpf_platform_quirk_t);
     2.5  
     2.6  #define XENPF_firmware_info       50
     2.7 -#define XEN_FW_DISK_INFO          1
     2.8 -#define XEN_FW_DISK_MBR_SIGNATURE 2
     2.9 +#define XEN_FW_DISK_INFO          1 /* from int 13 AH=08/41/48 */
    2.10 +#define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */
    2.11 +#define XEN_FW_VBEDDC_INFO        3 /* from int 10 AX=4f15 */
    2.12  struct xenpf_firmware_info {
    2.13      /* IN variables. */
    2.14      uint32_t type;
    2.15 @@ -140,6 +141,13 @@ struct xenpf_firmware_info {
    2.16              uint8_t device;                   /* bios device number  */
    2.17              uint32_t mbr_signature;           /* offset 0x1b8 in mbr */
    2.18          } disk_mbr_signature; /* XEN_FW_DISK_MBR_SIGNATURE */
    2.19 +        struct {
    2.20 +            /* Int10, AX=4F15: Get EDID info. */
    2.21 +            uint8_t capabilities;
    2.22 +            uint8_t edid_transfer_time;
    2.23 +            /* must refer to 128-byte buffer */
    2.24 +            XEN_GUEST_HANDLE(uint8_t) edid;
    2.25 +        } ddc_info; /* XEN_FW_VBEDDC_INFO */
    2.26      } u;
    2.27  };
    2.28  typedef struct xenpf_firmware_info xenpf_firmware_info_t;