Skip to contentSkip to conversation

VGA fixes

PATCH In review Juan Quintela 3 participants 6 messages Sep 21, 2009 – Sep 29, 2009

lore
Share & tools
lore
#0 lore raw

cover VGA fixes

Hi

This includes two fixes:
- also write gr0/gr1 on cirrus_vga
this was a bug introduced on my vga_cleanup series
- move dirty_log_functions to vga.c
this is needed by qemu-kvm

Please, apply, Juan.

Juan Quintela (2):
cirrus_vga: also assign gr0/1 when writting shadow_gr0/1
vga: move back dirty_log functions to vga.c

 hw/cirrus_vga.c |    2 ++
 hw/vga-pci.c    |   12 ------------
 hw/vga.c        |   12 ++++++++++++
 3 files changed, 14 insertions(+), 12 deletions(-)
#1 lore raw

PATCH 1/2 cirrus_vga: also assign gr0/1 when writting shadow_gr0/1

This is a regression/bug caused by previous vga_cleanup. This fixes Ubuntu installer reported by:
Pierre Riteau

---
 hw/cirrus_vga.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
hw/cirrus_vga.c +2 -0
index 7e95f10..ae4be82 100644
@@ -1490,9 +1490,11 @@ cirrus_vga_write_gr(CirrusVGAState * s, unsigned reg_index, int reg_value)
 #endif
     switch (reg_index) {
     case 0x00:			// Standard VGA, BGCOLOR 0x000000ff
+	s->vga.gr[reg_index] = reg_value & gr_mask[reg_index];
 	s->cirrus_shadow_gr0 = reg_value;
 	break;
     case 0x01:			// Standard VGA, FGCOLOR 0x000000ff
+	s->vga.gr[reg_index] = reg_value & gr_mask[reg_index];
 	s->cirrus_shadow_gr1 = reg_value;
 	break;
     case 0x02:			// Standard VGA
Signature · 1 line
1.6.2.5
#4 lore raw

PATCH 2/2 vga: move back dirty_log functions to vga.c

In reply to Juan Quintela

They are needed there on qemu-kvm.

---
 hw/vga-pci.c |   12 ------------
 hw/vga.c     |   12 ++++++++++++
 2 files changed, 12 insertions(+), 12 deletions(-)
hw/vga-pci.c +0 -12
index 6038cec..ccc78e5 100644
@@ -28,7 +28,6 @@
 #include "vga_int.h"
 #include "pixel_ops.h"
 #include "qemu-timer.h"
-#include "kvm.h"
 
 typedef struct PCIVGAState {
     PCIDevice dev;
@@ -59,17 +58,6 @@ static int pci_vga_load(QEMUFile *f, void *opaque, int version_id)
     return vga_common_load(f, &s->vga, version_id);
 }
 
-void vga_dirty_log_start(VGACommonState *s)
-{
-    if (kvm_enabled() && s->map_addr)
-        kvm_log_start(s->map_addr, s->map_end - s->map_addr);
-
-    if (kvm_enabled() && s->lfb_vram_mapped) {
-        kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
-        kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
-    }
-}
-
 static void vga_map(PCIDevice *pci_dev, int region_num,
                     uint32_t addr, uint32_t size, int type)
 {
hw/vga.c +12 -0
index 514371c..6cbd3d3 100644
@@ -28,6 +28,7 @@
 #include "vga_int.h"
 #include "pixel_ops.h"
 #include "qemu-timer.h"
+#include "kvm.h"
 
 //#define DEBUG_VGA
 //#define DEBUG_VGA_MEM
@@ -1576,6 +1577,17 @@ static void vga_sync_dirty_bitmap(VGACommonState *s)
     }
 }
 
+void vga_dirty_log_start(VGACommonState *s)
+{
+    if (kvm_enabled() && s->map_addr)
+        kvm_log_start(s->map_addr, s->map_end - s->map_addr);
+
+    if (kvm_enabled() && s->lfb_vram_mapped) {
+        kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
+        kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
+    }
+}
+
 /*
  * graphic modes
  */
Signature · 1 line
1.6.2.5
Acked-by on v1 2/2
#5 lore raw

[Qemu-devel] Re: [PATCH 2/2] vga: move back dirty_log functions to vga.c

Quoted 1 line · Juan Quintela

They are needed there on qemu-kvm.

Well, my real argument still is that they are not PCI-specific, even if they are currently only used by PCI-based adapters.

Thanks,
Jan

Quoted 67 lines
---
 hw/vga-pci.c |   12 ------------
 hw/vga.c     |   12 ++++++++++++
 2 files changed, 12 insertions(+), 12 deletions(-)
hw/vga-pci.c +0 -12
index 6038cec..ccc78e5 100644
@@ -28,7 +28,6 @@
 #include "vga_int.h"
 #include "pixel_ops.h"
 #include "qemu-timer.h"
-#include "kvm.h"
 
 typedef struct PCIVGAState {
     PCIDevice dev;
@@ -59,17 +58,6 @@ static int pci_vga_load(QEMUFile *f, void *opaque, int version_id)
     return vga_common_load(f, &s->vga, version_id);
 }
 
-void vga_dirty_log_start(VGACommonState *s)
-{
-    if (kvm_enabled() && s->map_addr)
-        kvm_log_start(s->map_addr, s->map_end - s->map_addr);
-
-    if (kvm_enabled() && s->lfb_vram_mapped) {
-        kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
-        kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
-    }
-}
-
 static void vga_map(PCIDevice *pci_dev, int region_num,
                     uint32_t addr, uint32_t size, int type)
 {
hw/vga.c +12 -0
index 514371c..6cbd3d3 100644
@@ -28,6 +28,7 @@
 #include "vga_int.h"
 #include "pixel_ops.h"
 #include "qemu-timer.h"
+#include "kvm.h"
 
 //#define DEBUG_VGA
 //#define DEBUG_VGA_MEM
@@ -1576,6 +1577,17 @@ static void vga_sync_dirty_bitmap(VGACommonState *s)
     }
 }
 
+void vga_dirty_log_start(VGACommonState *s)
+{
+    if (kvm_enabled() && s->map_addr)
+        kvm_log_start(s->map_addr, s->map_end - s->map_addr);
+
+    if (kvm_enabled() && s->lfb_vram_mapped) {
+        kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
+        kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
+    }
+}
+
 /*
  * graphic modes
  */
Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] cirrus_vga: also assign gr0/1 when writting shadow_gr0/1

In reply to Juan Quintela
Quoted 5 lines · Juan Quintela

This is a regression/bug caused by previous vga_cleanup. This fixes Ubuntu installer reported by:
Pierre Riteau

Broken in commit 22286bc6. Patch restores old behavior of cirrus_vga_ioport_write() for address 0x3cf.

But what about cirrus_mmio_blt_write() for address CIRRUS_MMIO_BLTBGCOLOR + 0? There we had

    cirrus_hook_write_gr(s, 0x00, value);

which did not update s->vga.gr[0x00]. It does with your patch, doesn't it?

Same for CIRRUS_MMIO_BLTFGCOLOR + 0.

#3 lore raw

[Qemu-devel] Re: [PATCH 1/2] cirrus_vga: also assign gr0/1 when writting shadow_gr0/1

Quoted 14 lines · Markus Armbruster
Quoted 5 lines · Juan Quintela

This is a regression/bug caused by previous vga_cleanup. This fixes Ubuntu installer reported by:
Pierre Riteau

Broken in commit 22286bc6. Patch restores old behavior of cirrus_vga_ioport_write() for address 0x3cf.

But what about cirrus_mmio_blt_write() for address CIRRUS_MMIO_BLTBGCOLOR + 0? There we had

Quoted 6 lines
    cirrus_hook_write_gr(s, 0x00, value);

which did not update s->vga.gr[0x00]. It does with your patch, doesn't it?

Same for CIRRUS_MMIO_BLTFGCOLOR + 0.

Yeap :(
My VGA expertise is inexistent, I don't know what to do here. I will also fix that.

Thanks for the review, Juan.