qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabrice Bellard <fabrice@bellard.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] qemu/hw vga.c vga_int.h
Date: Tue, 13 Jun 2006 16:37:40 +0000	[thread overview]
Message-ID: <E1FqBtc-0005JV-Ez@savannah.gnu.org> (raw)

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Fabrice Bellard <bellard>	06/06/13 16:37:40

Modified files:
	hw             : vga.c vga_int.h 

Log message:
	support for Bochs VBE GETCAPS call so that -std-vga works again with new VGA BIOSes - added support for modes up to 1600x1200x32 in -std-vga case

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/vga.c?cvsroot=qemu&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/vga_int.h?cvsroot=qemu&r1=1.6&r2=1.7

Patches:
Index: vga.c
===================================================================
RCS file: /sources/qemu/qemu/hw/vga.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- vga.c	10 May 2006 22:17:36 -0000	1.43
+++ vga.c	13 Jun 2006 16:37:40 -0000	1.44
@@ -378,10 +378,29 @@
     VGAState *s = opaque;
     uint32_t val;
 
-    if (s->vbe_index <= VBE_DISPI_INDEX_NB)
+    if (s->vbe_index <= VBE_DISPI_INDEX_NB) {
+        if (s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_GETCAPS) {
+            switch(s->vbe_index) {
+                /* XXX: do not hardcode ? */
+            case VBE_DISPI_INDEX_XRES:
+                val = VBE_DISPI_MAX_XRES;
+                break;
+            case VBE_DISPI_INDEX_YRES:
+                val = VBE_DISPI_MAX_YRES;
+                break;
+            case VBE_DISPI_INDEX_BPP:
+                val = VBE_DISPI_MAX_BPP;
+                break;
+            default:
         val = s->vbe_regs[s->vbe_index];
-    else
+                break;
+            }
+        } else {
+            val = s->vbe_regs[s->vbe_index]; 
+        }
+    } else {
         val = 0;
+    }
 #ifdef DEBUG_BOCHS_VBE
     printf("VBE: read index=0x%x val=0x%x\n", s->vbe_index, val);
 #endif
@@ -434,7 +453,8 @@
             s->bank_offset = (val << 16);
             break;
         case VBE_DISPI_INDEX_ENABLE:
-            if (val & VBE_DISPI_ENABLED) {
+            if ((val & VBE_DISPI_ENABLED) &&
+                !(s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED)) {
                 int h, shift_control;
 
                 s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] = 
@@ -464,7 +484,7 @@
                 s->cr[0x13] = s->vbe_line_offset >> 3;
                 /* width */
                 s->cr[0x01] = (s->vbe_regs[VBE_DISPI_INDEX_XRES] >> 3) - 1;
-                /* height */
+                /* height (only meaningful if < 1024) */
                 h = s->vbe_regs[VBE_DISPI_INDEX_YRES] - 1;
                 s->cr[0x12] = h;
                 s->cr[0x07] = (s->cr[0x07] & ~0x42) | 
@@ -1310,11 +1330,19 @@
 {
     int width, height;
     
+#ifdef CONFIG_BOCHS_VBE
+    if (s->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED) {
+        width = s->vbe_regs[VBE_DISPI_INDEX_XRES];
+        height = s->vbe_regs[VBE_DISPI_INDEX_YRES];
+    } else 
+#endif
+    {
     width = (s->cr[0x01] + 1) * 8;
     height = s->cr[0x12] | 
         ((s->cr[0x07] & 0x02) << 7) | 
         ((s->cr[0x07] & 0x40) << 3);
     height = (height + 1);
+    }
     *pwidth = width;
     *pheight = height;
 }

Index: vga_int.h
===================================================================
RCS file: /sources/qemu/qemu/hw/vga_int.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- vga_int.h	3 Jul 2005 14:00:51 -0000	1.6
+++ vga_int.h	13 Jun 2006 16:37:40 -0000	1.7
@@ -30,8 +30,9 @@
 /* bochs VBE support */
 #define CONFIG_BOCHS_VBE
 
-#define VBE_DISPI_MAX_XRES              1024
-#define VBE_DISPI_MAX_YRES              768
+#define VBE_DISPI_MAX_XRES              1600
+#define VBE_DISPI_MAX_YRES              1200
+#define VBE_DISPI_MAX_BPP               32
 
 #define VBE_DISPI_INDEX_ID              0x0
 #define VBE_DISPI_INDEX_XRES            0x1
@@ -51,6 +52,8 @@
   
 #define VBE_DISPI_DISABLED              0x00
 #define VBE_DISPI_ENABLED               0x01
+#define VBE_DISPI_GETCAPS               0x02
+#define VBE_DISPI_8BIT_DAC              0x20
 #define VBE_DISPI_LFB_ENABLED           0x40
 #define VBE_DISPI_NOCLEARMEM            0x80
   
@@ -72,7 +75,7 @@
 #endif /* !CONFIG_BOCHS_VBE */
 
 #define CH_ATTR_SIZE (160 * 100)
-#define VGA_MAX_HEIGHT 1024
+#define VGA_MAX_HEIGHT 2048
 
 #define VGA_STATE_COMMON                                                \
     uint8_t *vram_ptr;                                                  \

             reply	other threads:[~2006-06-13 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-13 16:37 Fabrice Bellard [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-11-14 17:57 [Qemu-devel] qemu/hw vga.c vga_int.h Fabrice Bellard
2004-11-14 17:55 ` Joe Menola

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=E1FqBtc-0005JV-Ez@savannah.gnu.org \
    --to=fabrice@bellard.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).