ia64/xen-unstable

changeset 17693:b58e95aee14f

vgabios: Support VESA power management extensions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed May 21 11:19:41 2008 +0100 (2008-05-21)
parents 70ca37d22895
children 36d9c5943b46
files tools/firmware/vgabios/clext.c tools/firmware/vgabios/vgatables.h
line diff
     1.1 --- a/tools/firmware/vgabios/clext.c	Wed May 21 11:07:23 2008 +0100
     1.2 +++ b/tools/firmware/vgabios/clext.c	Wed May 21 11:19:41 2008 +0100
     1.3 @@ -26,6 +26,7 @@
     1.4  #define PM_BIOSMEM_CURRENT_MODE 0x449
     1.5  #define PM_BIOSMEM_CRTC_ADDRESS 0x463
     1.6  #define PM_BIOSMEM_VBE_MODE 0x4BA
     1.7 +#define PM_BIOSMEM_VBE_POWER 0x4BC 
     1.8  
     1.9  typedef struct
    1.10  {
    1.11 @@ -491,7 +492,7 @@ cirrus_vesa:
    1.12  #ifdef CIRRUS_DEBUG
    1.13    call cirrus_debug_dump
    1.14  #endif
    1.15 -  cmp al, #0x0F
    1.16 +  cmp al, #0x10
    1.17    ja cirrus_vesa_not_handled
    1.18    push bx
    1.19    xor bx, bx
    1.20 @@ -682,7 +683,7 @@ c80h_2:
    1.21    ret
    1.22  
    1.23  cirrus_extbios_81h:
    1.24 -  mov ax, #0x100 ;; XXX
    1.25 +  mov ax, #0x103 ;; XXX
    1.26    ret
    1.27  cirrus_extbios_82h:
    1.28    push dx
    1.29 @@ -1177,6 +1178,52 @@ cirrus_vesa_07h_2:
    1.30    mov  ax, #0x004f
    1.31    ret
    1.32  
    1.33 +cirrus_vesa_10h: ;; Power management functions
    1.34 +  ;; Set up DS to read stored power info from RAM
    1.35 +  push ds
    1.36 +#ifdef CIRRUS_VESA3_PMINFO
    1.37 + db 0x2e ;; cs:
    1.38 +  mov ax, [cirrus_vesa_sel0000_data]
    1.39 +#else
    1.40 +  xor ax, ax
    1.41 +#endif
    1.42 +  mov  ds, ax
    1.43 +  ;; Now choose the right function
    1.44 +  cmp  bl, #0x00
    1.45 +  ja   cirrus_vesa_10h_01
    1.46 +  ;;
    1.47 +  ;; Function 00h: Get capabilities
    1.48 +  ;;
    1.49 +  mov  bx, #0x0720 ;; 07: standby/suspend/off, 20: VBE/PM 2.0
    1.50 +  mov  ax, #0x004f
    1.51 +  jmp cirrus_vesa_10h_done
    1.52 +cirrus_vesa_10h_01:
    1.53 +  cmp  bl, #0x01
    1.54 +  ja   cirrus_vesa_10h_02
    1.55 +  ;;
    1.56 +  ;; Function 01h: Set power state
    1.57 +  ;; 
    1.58 +  mov  ax, bx
    1.59 +  mov  bx, # PM_BIOSMEM_VBE_POWER
    1.60 +  mov  [bx], ah
    1.61 +  mov  ax, #0x004f 
    1.62 +  jmp cirrus_vesa_10h_done
    1.63 +cirrus_vesa_10h_02:
    1.64 +  cmp  bl, #0x02
    1.65 +  ja   cirrus_vesa_10h_unimplemented
    1.66 +  ;;
    1.67 +  ;; Function 02h: Get power state
    1.68 +  ;; 
    1.69 +  mov  bx, # PM_BIOSMEM_VBE_POWER
    1.70 +  mov  bh, [bx]
    1.71 +  mov  ax, #0x004f 
    1.72 +  jmp cirrus_vesa_10h_done
    1.73 +cirrus_vesa_10h_unimplemented:
    1.74 +  mov  ax, #0x014F ;; not implemented
    1.75 +cirrus_vesa_10h_done:
    1.76 +  pop ds
    1.77 +  ret
    1.78 +
    1.79  cirrus_vesa_unimplemented:
    1.80    mov ax, #0x014F ;; not implemented
    1.81    ret
    1.82 @@ -1601,7 +1648,8 @@ cirrus_vesa_handlers:
    1.83    dw cirrus_vesa_unimplemented
    1.84    dw cirrus_vesa_unimplemented
    1.85    dw cirrus_vesa_unimplemented
    1.86 -
    1.87 +  ;; 10h
    1.88 +  dw cirrus_vesa_10h
    1.89  
    1.90  
    1.91  ASM_END
     2.1 --- a/tools/firmware/vgabios/vgatables.h	Wed May 21 11:07:23 2008 +0100
     2.2 +++ b/tools/firmware/vgabios/vgatables.h	Wed May 21 11:19:41 2008 +0100
     2.3 @@ -25,6 +25,7 @@
     2.4  #define BIOSMEM_VS_POINTER    0xA8
     2.5  #define BIOSMEM_VBE_FLAG      0xB9
     2.6  #define BIOSMEM_VBE_MODE      0xBA
     2.7 +#define BIOSMEM_VBE_POWER     0xBC
     2.8  
     2.9  
    2.10  /*