All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Deegan <Tim.Deegan@xensource.com>
To: "Yu, Ke" <ke.yu@intel.com>
Cc: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>,
	xen-devel@lists.xensource.com,
	Kaushik Barde <Kaushik_Barde@Phoenix.com>
Subject: Re: [PATCH 0/4] HVM Virtual S3
Date: Thu, 31 May 2007 11:59:21 +0100	[thread overview]
Message-ID: <20070531105921.GA16995@york.uk.xensource.com> (raw)
In-Reply-To: <1104166E0B63A341805FDB977862AAD2408360@pdsmsx414.ccr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]

At 22:17 +0800 on 17 May (1179440232), Yu, Ke wrote:
> Ian Pratt  wrote on 2007??5??17?? 22:15:
> >> In VGA card side, the VESA FB emulation has not been tried yet, but
> >> the cirrus_vga works fine with Windows. Windows has cirrus VGA
> >> driver, which supports S3, So this issue is resolved.
> >> 
> >> Current issue is that Windows is not happy with the standard monitor
> >> driver. And unfortunately, seems there is no monitor emulation code
> >> in QEMU, so there may be no way to change the QEMU monitor type. It
> >> would be better if someone can tell how to change that.

Sorry for joining this thread quite late - I've been away for a few
weeks.

I found that the attached patch to the Cirrus VGA BIOS helps Windows
along (but not quite enough).  It adds some VBE power-management calls
to the BIOS, telling Windows that it's capable of putting the screen to
sleep.  Unfortunately, this just changes the error from the monitor
driver refusing to allow S3 to the Cirrus driver refusing to allow
it. :|

Tracing the BIOS and I/O activity of Windows, the next most likely
culprit is when the Cirrus driver tries to talk DDC2B to the monitor at
start of day (by frobbing the line state manually via Cirrus control
registers) and gets no response.  Since it can't read the monitor's
descriptor tables it can't be sure that it's possible to put it to sleep
properly.

Since implementing a DDC2B state machine and faking out the tables
sounds nasty, I agree with Ian that the VESA/VBE device model is
probably the way forward, in the hope of getting Windows to use BIOS
calls for all this.

Cheers,

Tim.

-- 
Tim Deegan <Tim.Deegan@xensource.com>, XenSource UK Limited
Registered office c/o EC2Y 5EB, UK; company number 05334508

[-- Attachment #2: vbe-pm --]
[-- Type: text/plain, Size: 2726 bytes --]

diff -r dcf5e2a0d370 tools/firmware/vgabios/clext.c
--- a/tools/firmware/vgabios/clext.c	Thu Apr 26 11:48:41 2007 +0100
+++ b/tools/firmware/vgabios/clext.c	Thu Apr 26 11:49:02 2007 +0100
@@ -26,6 +26,7 @@
 #define PM_BIOSMEM_CURRENT_MODE 0x449
 #define PM_BIOSMEM_CRTC_ADDRESS 0x463
 #define PM_BIOSMEM_VBE_MODE 0x4BA
+#define PM_BIOSMEM_VBE_POWER 0x4BC 
 
 typedef struct
 {
@@ -491,7 +492,7 @@ cirrus_vesa:
 #ifdef CIRRUS_DEBUG
   call cirrus_debug_dump
 #endif
-  cmp al, #0x0F
+  cmp al, #0x10
   ja cirrus_vesa_not_handled
   push bx
   xor bx, bx
@@ -682,7 +683,7 @@ c80h_2:
   ret
 
 cirrus_extbios_81h:
-  mov ax, #0x100 ;; XXX
+  mov ax, #0x103 ;; XXX
   ret
 cirrus_extbios_82h:
   push dx
@@ -1175,6 +1176,52 @@ cirrus_vesa_07h_2:
   mov  cx, ax
   pop  dx
   mov  ax, #0x004f
+  ret
+
+cirrus_vesa_10h: ;; Power management functions
+  ;; Set up DS to read stored power info from RAM
+  push ds
+#ifdef CIRRUS_VESA3_PMINFO
+ db 0x2e ;; cs:
+  mov ax, [cirrus_vesa_sel0000_data]
+#else
+  xor ax, ax
+#endif
+  mov  ds, ax
+  ;; Now choose the right function
+  cmp  bl, #0x00
+  ja   cirrus_vesa_10h_01
+  ;;
+  ;; Function 00h: Get capabilities
+  ;;
+  mov  bx, #0x0720 ;; 07: standby/suspend/off, 20: VBE/PM 2.0
+  mov  ax, #0x004f
+  jmp cirrus_vesa_10h_done
+cirrus_vesa_10h_01:
+  cmp  bl, #0x01
+  ja   cirrus_vesa_10h_02
+  ;;
+  ;; Function 01h: Set power state
+  ;; 
+  mov  ax, bx
+  mov  bx, # PM_BIOSMEM_VBE_POWER
+  mov  [bx], ah
+  mov  ax, #0x004f 
+  jmp cirrus_vesa_10h_done
+cirrus_vesa_10h_02:
+  cmp  bl, #0x02
+  ja   cirrus_vesa_10h_unimplemented
+  ;;
+  ;; Function 02h: Get power state
+  ;; 
+  mov  bx, # PM_BIOSMEM_VBE_POWER
+  mov  bh, [bx]
+  mov  ax, #0x004f 
+  jmp cirrus_vesa_10h_done
+cirrus_vesa_10h_unimplemented:
+  mov  ax, #0x014F ;; not implemented
+cirrus_vesa_10h_done:
+  pop ds
   ret
 
 cirrus_vesa_unimplemented:
@@ -1573,9 +1620,9 @@ cirrus_vesa_handlers:
   dw cirrus_vesa_00h
   dw cirrus_vesa_01h
   dw cirrus_vesa_02h
-  dw cirrus_vesa_03h
+  dw cirrus_vesa_unimplemented
   ;; 04h
-  dw cirrus_vesa_unimplemented
+  dw cirrus_vesa_04h
   dw cirrus_vesa_05h
   dw cirrus_vesa_06h
   dw cirrus_vesa_07h
@@ -1589,7 +1636,8 @@ cirrus_vesa_handlers:
   dw cirrus_vesa_unimplemented
   dw cirrus_vesa_unimplemented
   dw cirrus_vesa_unimplemented
-
+  ;; 10h
+  dw cirrus_vesa_10h
 
 
 ASM_END
diff -r dcf5e2a0d370 tools/firmware/vgabios/vgatables.h
--- a/tools/firmware/vgabios/vgatables.h	Thu Apr 26 11:48:41 2007 +0100
+++ b/tools/firmware/vgabios/vgatables.h	Thu Apr 26 11:48:42 2007 +0100
@@ -25,6 +25,7 @@
 #define BIOSMEM_VS_POINTER    0xA8
 #define BIOSMEM_VBE_FLAG      0xB9
 #define BIOSMEM_VBE_MODE      0xBA
+#define BIOSMEM_VBE_POWER     0xBC
 
 
 /*

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2007-05-31 10:59 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-16 16:48 [PATCH 0/4] HVM Virtual S3 Yu, Ke
2007-05-16 21:59 ` Keir Fraser
2007-05-16 22:33   ` Keir Fraser
2007-05-17  2:28     ` Yu, Ke
2007-05-18  2:38     ` Tian, Kevin
2007-05-18  6:43       ` Keir Fraser
2007-05-16 22:29 ` Keir Fraser
2007-05-17  2:32   ` Yu, Ke
2007-05-17  7:41     ` Keir Fraser
2007-05-17 12:39       ` Yu, Ke
2007-05-17 12:50         ` Zhang, Jingke
2007-05-17 13:06         ` Keir Fraser
2007-05-17 13:16           ` Yu, Ke
2007-05-17 13:33             ` Keir Fraser
2007-05-18  2:07               ` Tian, Kevin
2007-05-21  3:10           ` Yu, Ke
2007-05-21  6:25             ` Keir Fraser
2007-05-17 20:24   ` Kaushik Barde
2007-05-18  2:05     ` Yu, Ke
2007-05-18  4:22       ` Kaushik Barde
2007-05-18  4:29         ` Yu, Ke
2007-05-17  3:14 ` Kaushik Barde
2007-05-17  4:20   ` Yu, Ke
2007-05-17  9:54     ` Ian Pratt
2007-05-17 14:08       ` Yu, Ke
2007-05-17 14:14         ` Ian Pratt
2007-05-17 14:17           ` Yu, Ke
2007-05-31 10:59             ` Tim Deegan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-05-08  5:13 Ke, Liping
2008-05-08  7:02 ` James Harper
2008-05-08  7:10   ` Yu, Ke
2008-05-08  7:24   ` Ke, Liping
2008-05-08 12:25 ` Ian Pratt
2008-05-08 14:57   ` Ke, Liping
2008-05-08 15:03     ` Keir Fraser
2008-05-08 15:10     ` Yu, Ke
2008-05-09  9:58       ` Ke, Liping
2008-05-09 10:10         ` Keir Fraser
2008-05-09 11:59         ` Ian Pratt
2008-05-14  9:50           ` Ke, Liping
2008-05-14 12:17             ` Keir Fraser
2008-05-15  1:31               ` Ke, Liping
2008-05-15  7:33                 ` Keir Fraser
2008-05-15 11:45                   ` Ian Pratt
2008-05-15 11:51                     ` Keir Fraser
2008-05-15 12:42                       ` Ian Pratt
2008-05-15 12:58                         ` Keir Fraser
2008-05-16  1:46                           ` Ke, Liping
2008-05-08 15:11     ` Ian Pratt
2008-05-08 15:20       ` Keir Fraser
2008-05-08 15:28         ` Yu, Ke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070531105921.GA16995@york.uk.xensource.com \
    --to=tim.deegan@xensource.com \
    --cc=Ian.Pratt@cl.cam.ac.uk \
    --cc=Kaushik_Barde@Phoenix.com \
    --cc=ke.yu@intel.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.