Skip to contentSkip to conversation

Add VGA acceleration support for cirrus logic device model

Xen-changelog Hollis Blanchard 1 participant 1 message Sep 23, 2005 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

I didn't review the whole patch, but some comments from a quick skim:

Quoted 14 lines · Xen patchbot -unstable

# HG changeset patch
# User [email protected]
# Node ID 8a757f283fb8013e220bd89848d78fdbd2362195 # Parent 94c6fc048d8ed548b552be415f23c68162f30ab0 Add VGA acceleration support for cirrus logic device model

diff -r 94c6fc048d8e -r 8a757f283fb8 tools/ioemu/hw/cirrus_vga.c

tools/ioemu/hw/cirrus_vga.c line 2456

Quoted 8 lines
tools/ioemu/hw/cirrus_vga.c +3 -0
@@ -2447,6 +2449,10 @@
 {
     unsigned mode;
 
+    extern void unset_vram_mapping(unsigned long addr, unsigned long 
 end);
+    extern void set_vram_mapping(unsigned long addr, unsigned long 
 end);
+    extern int vga_accelerate;

It would be better style to move this stuff into a header. All too often function prototypes are changed without finding and updating all the local declarations.

Quoted 13 lines
tools/ioemu/hw/cirrus_vga.c +0 -6
     if ((s->sr[0x17] & 0x44) == 0x44) {
         goto generic_io;
     } else if (s->cirrus_srcptr != s->cirrus_srcptr_end) {
@@ -2454,17 +2460,21 @@
     } else {
 	if ((s->gr[0x0B] & 0x14) == 0x14) {
             goto generic_io;
-	} else if (s->gr[0x0B] & 0x02) {
-            goto generic_io;
-        }
-
-	mode = s->gr[0x05] & 0x7;
-	if (mode < 4 || mode > 5 || ((s->gr[0x0B] & 0x4) == 0)) {

tools/ioemu/hw/cirrus_vga.c line 2472

Quoted 10 lines
tools/ioemu/hw/cirrus_vga.c +8 -0
+    } else if (s->gr[0x0B] & 0x02) {
+        goto generic_io;
+    }
+
+    mode = s->gr[0x05] & 0x7;
+    if (mode < 4 || mode > 5 || ((s->gr[0x0B] & 0x4) == 0)) {
+            if (vga_accelerate && s->cirrus_lfb_addr && 
 s->cirrus_lfb_end)
+                set_vram_mapping(s->cirrus_lfb_addr, 
 s->cirrus_lfb_end);

That's an awful lot of magic numbers. Some #defines please?

tools/ioemu/hw/vga.c line 1575

Quoted 12 lines

diff -r 94c6fc048d8e -r 8a757f283fb8 tools/ioemu/hw/vga.c

tools/ioemu/hw/vga.c +2 -0
@@ -1568,6 +1568,8 @@
             s->graphic_mode = graphic_mode;
             full_update = 1;
         }
+
+        full_update = 1;
         switch(graphic_mode) {
         case GMODE_TEXT:
             vga_draw_text(s, full_update);

That "full_update" stuff should be removed entirely, and vga_draw_*() functions updated to match. It's worthless code now.

tools/ioemu/hw/vga.c line 1856

Quoted 8 lines
tools/ioemu/hw/vga.c +1 -0
@@ -1848,6 +1850,7 @@
                      unsigned long vga_ram_offset, int vga_ram_size)
 {
     int i, j, v, b;
+    extern void* shared_vram;
 
     for(i = 0;i < 256; i++) {
         v = 0;

Again, belongs in a header file...

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center