* [Qemu-devel] Various VGA / VNC fixes and cleanups to prep for multiheaded graphics
@ 2009-07-30 10:14 Zachary Amsden
2009-07-30 10:14 ` [Qemu-devel] [PATCH 01/14] Add a configure switch to enable / disable all user targets. I felt compelled to do it for symmetry, mostly it is useful to disable user targets when you don't want to build them Zachary Amsden
2009-07-30 10:34 ` [Qemu-devel] Various VGA / VNC fixes and cleanups to prep for multiheaded graphics Daniel P. Berrange
0 siblings, 2 replies; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:14 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
These patches grew from a very strange process, but nonetheless they exist now.
All of the initial patches are robustness / bugfixes / cleanups. The final
result is that we can use multiple Cirrus VGA adapters simultaneously.
Note the last patch is a complete hack. It is not meant to be designed this
way, and is included for demonstration purposes only. You will also need to
know how to hack your xorg.conf file to setup multihead properly, but it does
work, at least under SDL, for me. You can switch using the standard qemu
ctrl-alt-1 / ctrl-alt-2 to switch between both graphic consoles.
I would attach a screenshot to demonstrate this if I could, but the patch mail
program, or my skills at manipulating it are not sufficient to do that.
Not that this is very useful, but it was possible, and a consequence of what
I had been working on, so I felt compelled to release it.
The next step if anyone were to be interested in multiheaded machine simulation
would be to create a console.h abstraction designed to support this; it would
at least require a 'display_state_init' and 'run' callback, and would need
differentiation to determine whether all displays should be multiplexed on
one console; or whether there should be multiple consoles supporting all
displays; or whether there should be a master console with access to all
monitor targets and slave displays for secondary graphics consoles.
Multiple concurrent SDL displays would require a much deeper design, with a
separate process for each display, given the current state of SDL does not
support multiple windows. This may or may not be possible under Cocoa, which
I have access to but have not fully investigated.
This might be more useful when applied to a VNC or other remote display target.
Initial attempts to get multiple simultaneous VNC displays did not work, but
there is no obvious technical obstacle to the progress.
Enjoy. I was going to include a screenshot of 4 simultaneous heads on a
<unspecified name> distro with a giant image of a heavily modified and
ridiculously finned Honda Civic, but sorry, I don't have the patience to
recompile the X server again.
Cheers,
Zach
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 01/14] Add a configure switch to enable / disable all user targets. I felt compelled to do it for symmetry, mostly it is useful to disable user targets when you don't want to build them.
2009-07-30 10:14 [Qemu-devel] Various VGA / VNC fixes and cleanups to prep for multiheaded graphics Zachary Amsden
@ 2009-07-30 10:14 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 02/14] Don't segfault when changing VNC password on an SDL display Zachary Amsden
2009-07-30 10:34 ` [Qemu-devel] Various VGA / VNC fixes and cleanups to prep for multiheaded graphics Daniel P. Berrange
1 sibling, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:14 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
configure | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index 33e3c41..e9b42a8 100755
--- a/configure
+++ b/configure
@@ -449,6 +449,12 @@ for opt do
;;
--enable-system) softmmu="yes"
;;
+ --disable-user)
+ linux_user="no" ;
+ bsd_user="no" ;
+ darwin_user="no"
+ ;;
+ --enable-user) ;;
--disable-linux-user) linux_user="no"
;;
--enable-linux-user) linux_user="yes"
@@ -631,6 +637,8 @@ echo " --disable-kvm disable KVM acceleration support"
echo " --disable-nptl disable usermode NPTL support"
echo " --enable-system enable all system emulation targets"
echo " --disable-system disable all system emulation targets"
+echo " --enable-user enable supported user emulation targets"
+echo " --disable-user disable all user emulation targets"
echo " --enable-linux-user enable all linux usermode emulation targets"
echo " --disable-linux-user disable all linux usermode emulation targets"
echo " --enable-darwin-user enable all darwin usermode emulation targets"
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 02/14] Don't segfault when changing VNC password on an SDL display.
2009-07-30 10:14 ` [Qemu-devel] [PATCH 01/14] Add a configure switch to enable / disable all user targets. I felt compelled to do it for symmetry, mostly it is useful to disable user targets when you don't want to build them Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 03/14] When using stdio monitor and VNC display, one can set or clear a VNC password; this should set or turn off VNC authentication as well Zachary Amsden
0 siblings, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
vnc.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/vnc.c b/vnc.c
index de0ff87..af485a1 100644
--- a/vnc.c
+++ b/vnc.c
@@ -2160,6 +2160,10 @@ int vnc_display_password(DisplayState *ds, const char *password)
{
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
+ if (!vs) {
+ return -1;
+ }
+
if (vs->password) {
qemu_free(vs->password);
vs->password = NULL;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 03/14] When using stdio monitor and VNC display, one can set or clear a VNC password; this should set or turn off VNC authentication as well.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 02/14] Don't segfault when changing VNC password on an SDL display Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 04/14] Clean up VGA type selection; far too many variables being used to track one state leads to confusion if new variables are added Zachary Amsden
0 siblings, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
vnc.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/vnc.c b/vnc.c
index af485a1..19aeed7 100644
--- a/vnc.c
+++ b/vnc.c
@@ -2171,6 +2171,11 @@ int vnc_display_password(DisplayState *ds, const char *password)
if (password && password[0]) {
if (!(vs->password = qemu_strdup(password)))
return -1;
+ if (vs->auth == VNC_AUTH_NONE) {
+ vs->auth = VNC_AUTH_VNC;
+ }
+ } else {
+ vs->auth = VNC_AUTH_NONE;
}
return 0;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 04/14] Clean up VGA type selection; far too many variables being used to track one state leads to confusion if new variables are added.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 03/14] When using stdio monitor and VNC display, one can set or clear a VNC password; this should set or turn off VNC authentication as well Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 05/14] Change cpu_phys mem callback to use [offset, size) bounds instead of [start, end) Zachary Amsden
0 siblings, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
sysemu.h | 15 +++++++++++----
vl.c | 18 ++++++------------
2 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/sysemu.h b/sysemu.h
index d77de09..f0e8d22 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -103,10 +103,17 @@ typedef enum DisplayType
} DisplayType;
extern int bios_size;
-extern int cirrus_vga_enabled;
-extern int std_vga_enabled;
-extern int vmsvga_enabled;
-extern int xenfb_enabled;
+
+typedef enum {
+ VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB
+} VGAInterfaceType;
+
+extern int vga_interface_type;
+#define cirrus_vga_enabled (vga_interface_type == VGA_CIRRUS)
+#define std_vga_enabled (vga_interface_type == VGA_STD)
+#define xenfb_enabled (vga_interface_type == VGA_XENFB)
+#define vmsvga_enabled (vga_interface_type == VGA_VMWARE)
+
extern int graphic_width;
extern int graphic_height;
extern int graphic_depth;
diff --git a/vl.c b/vl.c
index 60a00e1..f9d2da6 100644
--- a/vl.c
+++ b/vl.c
@@ -213,10 +213,7 @@ int vm_running;
static int autostart;
static int rtc_utc = 1;
static int rtc_date_offset = -1; /* -1 means no change */
-int cirrus_vga_enabled = 1;
-int std_vga_enabled = 0;
-int vmsvga_enabled = 0;
-int xenfb_enabled = 0;
+int vga_interface_type = VGA_CIRRUS;
#ifdef TARGET_SPARC
int graphic_width = 1024;
int graphic_height = 768;
@@ -4737,18 +4734,15 @@ static void select_vgahw (const char *p)
{
const char *opts;
- cirrus_vga_enabled = 0;
- std_vga_enabled = 0;
- vmsvga_enabled = 0;
- xenfb_enabled = 0;
+ vga_interface_type = VGA_NONE;
if (strstart(p, "std", &opts)) {
- std_vga_enabled = 1;
+ vga_interface_type = VGA_STD;
} else if (strstart(p, "cirrus", &opts)) {
- cirrus_vga_enabled = 1;
+ vga_interface_type = VGA_CIRRUS;
} else if (strstart(p, "vmware", &opts)) {
- vmsvga_enabled = 1;
+ vga_interface_type = VGA_VMWARE;
} else if (strstart(p, "xenfb", &opts)) {
- xenfb_enabled = 1;
+ vga_interface_type = VGA_XENFB;
} else if (!strstart(p, "none", &opts)) {
invalid_vga:
fprintf(stderr, "Unknown vga type: %s\n", p);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 05/14] Change cpu_phys mem callback to use [offset, size) bounds instead of [start, end).
2009-07-30 10:15 ` [Qemu-devel] [PATCH 04/14] Clean up VGA type selection; far too many variables being used to track one state leads to confusion if new variables are added Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 06/14] Split VGA ioport init into a helper function Zachary Amsden
` (2 more replies)
0 siblings, 3 replies; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
cpu-all.h | 2 +-
exec.c | 4 ++--
hw/cirrus_vga.c | 11 ++++++-----
hw/framebuffer.c | 2 +-
hw/vga.c | 12 ++++++------
hw/vga_int.h | 2 +-
kvm-all.c | 4 ++--
7 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/cpu-all.h b/cpu-all.h
index 97a224d..43bbf18 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -907,7 +907,7 @@ int cpu_physical_memory_set_dirty_tracking(int enable);
int cpu_physical_memory_get_dirty_tracking(void);
int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
- target_phys_addr_t end_addr);
+ ram_addr_t size);
void dump_exec_info(FILE *f,
int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
diff --git a/exec.c b/exec.c
index 688f603..f8bfcd4 100644
--- a/exec.c
+++ b/exec.c
@@ -1921,12 +1921,12 @@ int cpu_physical_memory_get_dirty_tracking(void)
}
int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
- target_phys_addr_t end_addr)
+ ram_addr_t size)
{
int ret = 0;
if (kvm_enabled())
- ret = kvm_physical_sync_dirty_bitmap(start_addr, end_addr);
+ ret = kvm_physical_sync_dirty_bitmap(start_addr, size);
return ret;
}
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 0a12782..2287e94 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1220,7 +1220,7 @@ static void cirrus_update_bank_ptr(CirrusVGAState * s, unsigned bank_index)
* on the current location, otherwise we lose this pointer forever */
if (s->vga.lfb_vram_mapped) {
target_phys_addr_t base_addr = isa_mem_base + 0xa0000 + bank_index * 0x8000;
- cpu_physical_sync_dirty_bitmap(base_addr, base_addr + 0x8000);
+ cpu_physical_sync_dirty_bitmap(base_addr, 0x8000);
}
s->cirrus_bank_base[bank_index] = offset;
s->cirrus_bank_limit[bank_index] = limit;
@@ -2588,8 +2588,9 @@ static void map_linear_vram(CirrusVGAState *s)
{
if (!s->vga.map_addr && s->vga.lfb_addr && s->vga.lfb_end) {
s->vga.map_addr = s->vga.lfb_addr;
- s->vga.map_end = s->vga.lfb_end;
- cpu_register_physical_memory(s->vga.map_addr, s->vga.map_end - s->vga.map_addr, s->vga.vram_offset);
+ s->vga.map_size = s->vga.lfb_end - s->vga.lfb_addr;
+ cpu_register_physical_memory(s->vga.map_addr, s->vga.map_size,
+ s->vga.vram_offset);
}
if (!s->vga.map_addr)
@@ -2620,7 +2621,7 @@ static void map_linear_vram(CirrusVGAState *s)
static void unmap_linear_vram(CirrusVGAState *s)
{
if (s->vga.map_addr && s->vga.lfb_addr && s->vga.lfb_end)
- s->vga.map_addr = s->vga.map_end = 0;
+ s->vga.map_addr = s->vga.map_size = 0;
cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x20000,
s->vga.vga_io_memory);
@@ -3270,7 +3271,7 @@ static void cirrus_pci_lfb_map(PCIDevice *d, int region_num,
cpu_register_physical_memory(addr + 0x1000000, 0x400000,
s->cirrus_linear_bitblt_io_addr);
- s->vga.map_addr = s->vga.map_end = 0;
+ s->vga.map_addr = s->vga.map_size = 0;
s->vga.lfb_addr = addr & TARGET_PAGE_MASK;
s->vga.lfb_end = ((addr + VGA_RAM_SIZE) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK;
/* account for overflow */
diff --git a/hw/framebuffer.c b/hw/framebuffer.c
index 24cdf25..f8efe5b 100644
--- a/hw/framebuffer.c
+++ b/hw/framebuffer.c
@@ -49,7 +49,7 @@ void framebuffer_update_display(
*first_row = -1;
src_len = src_width * rows;
- cpu_physical_sync_dirty_bitmap(base, base + src_len);
+ cpu_physical_sync_dirty_bitmap(base, src_len);
pd = cpu_get_physical_page_desc(base);
pd2 = cpu_get_physical_page_desc(base + src_len - 1);
/* We should reall check that this is a continuous ram region.
diff --git a/hw/vga.c b/hw/vga.c
index 134ad16..ca94a68 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1571,11 +1571,11 @@ void vga_invalidate_scanlines(VGAState *s, int y1, int y2)
static void vga_sync_dirty_bitmap(VGAState *s)
{
if (s->map_addr)
- cpu_physical_sync_dirty_bitmap(s->map_addr, s->map_end);
+ cpu_physical_sync_dirty_bitmap(s->map_addr, s->map_size);
if (s->lfb_vram_mapped) {
- cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa0000, 0xa8000);
- cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa8000, 0xb0000);
+ cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa0000, 0x8000);
+ cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa8000, 0x8000);
}
}
@@ -1878,7 +1878,7 @@ void vga_reset(void *opaque)
s->lfb_addr = 0;
s->lfb_end = 0;
s->map_addr = 0;
- s->map_end = 0;
+ s->map_size = 0;
s->lfb_vram_mapped = 0;
s->bios_offset = 0;
s->bios_size = 0;
@@ -2227,7 +2227,7 @@ typedef struct PCIVGAState {
void vga_dirty_log_start(VGAState *s)
{
if (kvm_enabled() && s->map_addr)
- kvm_log_start(s->map_addr, s->map_end - s->map_addr);
+ kvm_log_start(s->map_addr, s->map_size);
if (kvm_enabled() && s->lfb_vram_mapped) {
kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
@@ -2245,7 +2245,7 @@ static void vga_map(PCIDevice *pci_dev, int region_num,
} else {
cpu_register_physical_memory(addr, s->vram_size, s->vram_offset);
s->map_addr = addr;
- s->map_end = addr + s->vram_size;
+ s->map_size = s->vram_size;
vga_dirty_log_start(s);
}
}
diff --git a/hw/vga_int.h b/hw/vga_int.h
index 631b1b0..83b69ef 100644
--- a/hw/vga_int.h
+++ b/hw/vga_int.h
@@ -105,7 +105,7 @@ typedef struct VGACommonState {
uint32_t lfb_addr;
uint32_t lfb_end;
uint32_t map_addr;
- uint32_t map_end;
+ uint32_t map_size;
uint32_t lfb_vram_mapped; /* whether 0xa0000 is mapped as ram */
unsigned long bios_offset;
unsigned int bios_size;
diff --git a/kvm-all.c b/kvm-all.c
index d843338..2a48b63 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -294,11 +294,11 @@ int kvm_set_migration_log(int enable)
* @end_addr: end of logged region.
*/
int kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
- target_phys_addr_t end_addr)
+ ram_addr_t dirty_size)
{
KVMState *s = kvm_state;
unsigned long size, allocated_size = 0;
- target_phys_addr_t phys_addr;
+ target_phys_addr_t phys_addr, end_addr = start_addr + dirty_size;
ram_addr_t addr;
KVMDirtyLog d;
KVMSlot *mem;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 06/14] Split VGA ioport init into a helper function.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 05/14] Change cpu_phys mem callback to use [offset, size) bounds instead of [start, end) Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 07/14] Code motion; make mm VGA init function more like standard vga init function. Add missing vga_reset hook to vga_mm_init Zachary Amsden
2009-07-30 11:03 ` [Qemu-devel] Re: [PATCH 05/14] Change cpu_phys mem callback to use [offset, size) bounds instead of [start, end) Jan Kiszka
2009-08-10 19:42 ` [Qemu-devel] " Anthony Liguori
2 siblings, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
hw/vga.c | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/hw/vga.c b/hw/vga.c
index ca94a68..33645a0 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2301,14 +2301,8 @@ void vga_common_init(VGAState *s, int vga_ram_size)
vga_reset(s);
}
-/* used by both ISA and PCI */
-void vga_init(VGAState *s)
+static void vga_ioport_init(VGAState *s)
{
- int vga_io_memory;
-
- qemu_register_reset(vga_reset, 0, s);
- register_savevm("vga", 0, 2, vga_save, vga_load, s);
-
register_ioport_write(0x3c0, 16, 1, vga_ioport_write, s);
register_ioport_write(0x3b4, 2, 1, vga_ioport_write, s);
@@ -2322,7 +2316,6 @@ void vga_init(VGAState *s)
register_ioport_read(0x3d4, 2, 1, vga_ioport_read, s);
register_ioport_read(0x3ba, 1, 1, vga_ioport_read, s);
register_ioport_read(0x3da, 1, 1, vga_ioport_read, s);
- s->bank_offset = 0;
#ifdef CONFIG_BOCHS_VBE
#if defined (TARGET_I386)
@@ -2346,6 +2339,19 @@ void vga_init(VGAState *s)
register_ioport_write(0x1d0, 1, 2, vbe_ioport_write_data, s);
#endif
#endif /* CONFIG_BOCHS_VBE */
+}
+
+/* used by both ISA and PCI */
+void vga_init(VGAState *s)
+{
+ int vga_io_memory;
+
+ qemu_register_reset(vga_reset, 0, s);
+ register_savevm("vga", 0, 2, vga_save, vga_load, s);
+
+ s->bank_offset = 0;
+
+ vga_ioport_init(s);
vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000,
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 07/14] Code motion; make mm VGA init function more like standard vga init function. Add missing vga_reset hook to vga_mm_init.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 06/14] Split VGA ioport init into a helper function Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 08/14] Make VGA vram offset passed into vga_mm_init absolute. Since this is a function of the platform, it makes sense to have it be explicitly known in the platform layer rather than hardcoded inside the vga code Zachary Amsden
2009-07-30 11:03 ` [Qemu-devel] Re: [PATCH 07/14] Code motion; make mm VGA init function more like standard vga init function. Add missing vga_reset hook to vga_mm_init Jan Kiszka
0 siblings, 2 replies; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
hw/vga.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/vga.c b/hw/vga.c
index 33645a0..9b50959 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2422,14 +2422,17 @@ static void vga_mm_init(VGAState *s, target_phys_addr_t vram_base,
{
int s_ioport_ctrl, vga_io_memory;
+ qemu_register_reset(vga_reset, 0, s);
+ register_savevm("vga", 0, 2, vga_save, vga_load, s);
+
+ s->bank_offset = 0;
+
s->it_shift = it_shift;
s_ioport_ctrl = cpu_register_io_memory(vga_mm_read_ctrl, vga_mm_write_ctrl, s);
- vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
- register_savevm("vga", 0, 2, vga_save, vga_load, s);
+ vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
cpu_register_physical_memory(ctrl_base, 0x100000, s_ioport_ctrl);
- s->bank_offset = 0;
cpu_register_physical_memory(vram_base + 0x000a0000, 0x20000, vga_io_memory);
qemu_register_coalesced_mmio(vram_base + 0x000a0000, 0x20000);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 08/14] Make VGA vram offset passed into vga_mm_init absolute. Since this is a function of the platform, it makes sense to have it be explicitly known in the platform layer rather than hardcoded inside the vga code.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 07/14] Code motion; make mm VGA init function more like standard vga init function. Add missing vga_reset hook to vga_mm_init Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 09/14] Further transformation: use common vga_init() which allows either I/O port or memory mapped based control Zachary Amsden
2009-07-30 11:03 ` [Qemu-devel] Re: [PATCH 07/14] Code motion; make mm VGA init function more like standard vga init function. Add missing vga_reset hook to vga_mm_init Jan Kiszka
1 sibling, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
hw/mips_jazz.c | 2 +-
hw/vga.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index 2b4e1e0..0470a3f 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -200,7 +200,7 @@ void mips_jazz_init (ram_addr_t ram_size,
g364fb_mm_init(0x40000000, 0x60000000, 0, rc4030[3]);
break;
case JAZZ_PICA61:
- isa_vga_mm_init(0x40000000, 0x60000000, 0);
+ isa_vga_mm_init(0x400a0000, 0x60000000, 0);
break;
default:
break;
diff --git a/hw/vga.c b/hw/vga.c
index 9b50959..52fb1c4 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2433,8 +2433,8 @@ static void vga_mm_init(VGAState *s, target_phys_addr_t vram_base,
vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
cpu_register_physical_memory(ctrl_base, 0x100000, s_ioport_ctrl);
- cpu_register_physical_memory(vram_base + 0x000a0000, 0x20000, vga_io_memory);
- qemu_register_coalesced_mmio(vram_base + 0x000a0000, 0x20000);
+ cpu_register_physical_memory(vram_base, 0x20000, vga_io_memory);
+ qemu_register_coalesced_mmio(vram_base, 0x20000);
}
int isa_vga_init(void)
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 09/14] Further transformation: use common vga_init() which allows either I/O port or memory mapped based control.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 08/14] Make VGA vram offset passed into vga_mm_init absolute. Since this is a function of the platform, it makes sense to have it be explicitly known in the platform layer rather than hardcoded inside the vga code Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 10/14] Stash VGA physical address and use it in KVM callbacks. Stash VGA physical pointer in cirrus vga as well Zachary Amsden
0 siblings, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
hw/vga.c | 40 +++++++++++++---------------------------
hw/vga_int.h | 3 ++-
hw/vmware_vga.c | 2 +-
3 files changed, 16 insertions(+), 29 deletions(-)
diff --git a/hw/vga.c b/hw/vga.c
index 52fb1c4..907cdb7 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2341,24 +2341,6 @@ static void vga_ioport_init(VGAState *s)
#endif /* CONFIG_BOCHS_VBE */
}
-/* used by both ISA and PCI */
-void vga_init(VGAState *s)
-{
- int vga_io_memory;
-
- qemu_register_reset(vga_reset, 0, s);
- register_savevm("vga", 0, 2, vga_save, vga_load, s);
-
- s->bank_offset = 0;
-
- vga_ioport_init(s);
-
- vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
- cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000,
- vga_io_memory);
- qemu_register_coalesced_mmio(isa_mem_base + 0x000a0000, 0x20000);
-}
-
/* Memory mapped interface */
static uint32_t vga_mm_readb (void *opaque, target_phys_addr_t addr)
{
@@ -2417,8 +2399,8 @@ static CPUWriteMemoryFunc *vga_mm_write_ctrl[] = {
&vga_mm_writel,
};
-static void vga_mm_init(VGAState *s, target_phys_addr_t vram_base,
- target_phys_addr_t ctrl_base, int it_shift)
+void vga_init(VGAState *s, target_phys_addr_t vram_base,
+ target_phys_addr_t ctrl_base, int it_shift)
{
int s_ioport_ctrl, vga_io_memory;
@@ -2426,13 +2408,17 @@ static void vga_mm_init(VGAState *s, target_phys_addr_t vram_base,
register_savevm("vga", 0, 2, vga_save, vga_load, s);
s->bank_offset = 0;
-
s->it_shift = it_shift;
- s_ioport_ctrl = cpu_register_io_memory(vga_mm_read_ctrl, vga_mm_write_ctrl, s);
- vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
+ /* Pass ctrl_base to setup memory mapped I/O control */
+ if (ctrl_base) {
+ s_ioport_ctrl = cpu_register_io_memory(vga_mm_read_ctrl, vga_mm_write_ctrl, s);
+ cpu_register_physical_memory(ctrl_base, 0x100000, s_ioport_ctrl);
+ } else {
+ vga_ioport_init(s);
+ }
- cpu_register_physical_memory(ctrl_base, 0x100000, s_ioport_ctrl);
+ vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
cpu_register_physical_memory(vram_base, 0x20000, vga_io_memory);
qemu_register_coalesced_mmio(vram_base, 0x20000);
}
@@ -2444,7 +2430,7 @@ int isa_vga_init(void)
s = qemu_mallocz(sizeof(VGAState));
vga_common_init(s, VGA_RAM_SIZE);
- vga_init(s);
+ vga_init(s, isa_mem_base + 0xa0000, 0, -1);
s->ds = graphic_console_init(s->update, s->invalidate,
s->screen_dump, s->text_update, s);
@@ -2465,7 +2451,7 @@ int isa_vga_mm_init(target_phys_addr_t vram_base,
s = qemu_mallocz(sizeof(VGAState));
vga_common_init(s, VGA_RAM_SIZE);
- vga_mm_init(s, vram_base, ctrl_base, it_shift);
+ vga_init(s, vram_base, ctrl_base, it_shift);
s->ds = graphic_console_init(s->update, s->invalidate,
s->screen_dump, s->text_update, s);
@@ -2504,7 +2490,7 @@ int pci_vga_init(PCIBus *bus,
s = &d->vga_state;
vga_common_init(s, VGA_RAM_SIZE);
- vga_init(s);
+ vga_init(s, isa_mem_base + 0xa0000, 0, -1);
s->ds = graphic_console_init(s->update, s->invalidate,
s->screen_dump, s->text_update, s);
diff --git a/hw/vga_int.h b/hw/vga_int.h
index 83b69ef..f072663 100644
--- a/hw/vga_int.h
+++ b/hw/vga_int.h
@@ -190,7 +190,8 @@ static inline int c6_to_8(int v)
}
void vga_common_init(VGAState *s, int vga_ram_size);
-void vga_init(VGAState *s);
+void vga_init(VGAState *s, target_phys_addr_t vram_base,
+ target_phys_addr_t ctrl_base, int it_shift);
void vga_reset(void *s);
void vga_dirty_log_start(VGAState *s);
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index accdac4..d81d263 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -1130,7 +1130,7 @@ static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size)
#ifdef EMBED_STDVGA
vga_common_init((VGAState *) s, vga_ram_size);
- vga_init((VGAState *) s);
+ vga_init((VGAState *) s, isa_mem_base + 0xa0000, 0, -1);
#else
s->vram_size = vga_ram_size;
s->vram_offset = qemu_ram_alloc(vga_ram_size);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 10/14] Stash VGA physical address and use it in KVM callbacks. Stash VGA physical pointer in cirrus vga as well.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 09/14] Further transformation: use common vga_init() which allows either I/O port or memory mapped based control Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 11/14] Add some defined constants for VGA offsets Zachary Amsden
0 siblings, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
hw/cirrus_vga.c | 18 ++++++++----------
hw/vga.c | 9 +++++----
hw/vga_int.h | 1 +
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 2287e94..60c67fe 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1219,7 +1219,7 @@ static void cirrus_update_bank_ptr(CirrusVGAState * s, unsigned bank_index)
/* Thinking about changing bank base? First, drop the dirty bitmap information
* on the current location, otherwise we lose this pointer forever */
if (s->vga.lfb_vram_mapped) {
- target_phys_addr_t base_addr = isa_mem_base + 0xa0000 + bank_index * 0x8000;
+ target_phys_addr_t base_addr = s->vga.vram_phys + bank_index * 0x8000;
cpu_physical_sync_dirty_bitmap(base_addr, 0x8000);
}
s->cirrus_bank_base[bank_index] = offset;
@@ -2603,16 +2603,15 @@ static void map_linear_vram(CirrusVGAState *s)
&& !((s->vga.gr[0x0B] & 0x14) == 0x14)
&& !(s->vga.gr[0x0B] & 0x02)) {
- cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x8000,
+ cpu_register_physical_memory(s->vga.vram_phys, 0x8000,
(s->vga.vram_offset + s->cirrus_bank_base[0]) | IO_MEM_RAM);
- cpu_register_physical_memory(isa_mem_base + 0xa8000, 0x8000,
+ cpu_register_physical_memory(s->vga.vram_phys + 0x8000, 0x8000,
(s->vga.vram_offset + s->cirrus_bank_base[1]) | IO_MEM_RAM);
s->vga.lfb_vram_mapped = 1;
}
else {
- cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x20000,
- s->vga.vga_io_memory);
+ cpu_register_physical_memory(s->vga.vram_phys, 0x20000, s->vga.vga_io_memory);
}
vga_dirty_log_start(&s->vga);
@@ -2623,8 +2622,7 @@ static void unmap_linear_vram(CirrusVGAState *s)
if (s->vga.map_addr && s->vga.lfb_addr && s->vga.lfb_end)
s->vga.map_addr = s->vga.map_size = 0;
- cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x20000,
- s->vga.vga_io_memory);
+ cpu_register_physical_memory(s->vga.vram_phys, 0x20000, s->vga.vga_io_memory);
}
/* Compute the memory access functions */
@@ -3197,11 +3195,11 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
register_ioport_read(0x3ba, 1, 1, vga_ioport_read, s);
register_ioport_read(0x3da, 1, 1, vga_ioport_read, s);
+ s->vga.vram_phys = isa_mem_base + 0xa0000;
s->vga.vga_io_memory = cpu_register_io_memory(cirrus_vga_mem_read,
cirrus_vga_mem_write, s);
- cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000,
- s->vga.vga_io_memory);
- qemu_register_coalesced_mmio(isa_mem_base + 0x000a0000, 0x20000);
+ cpu_register_physical_memory(s->vga.vram_phys, 0x20000, s->vga.vga_io_memory);
+ qemu_register_coalesced_mmio(s->vga.vram_phys, 0x20000);
/* I/O handler for LFB */
s->cirrus_linear_io_addr =
diff --git a/hw/vga.c b/hw/vga.c
index 907cdb7..0941962 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1574,8 +1574,8 @@ static void vga_sync_dirty_bitmap(VGAState *s)
cpu_physical_sync_dirty_bitmap(s->map_addr, s->map_size);
if (s->lfb_vram_mapped) {
- cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa0000, 0x8000);
- cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa8000, 0x8000);
+ cpu_physical_sync_dirty_bitmap(s->vram_phys, 0x8000);
+ cpu_physical_sync_dirty_bitmap(s->vram_phys + 0x8000, 0x8000);
}
}
@@ -2230,8 +2230,8 @@ void vga_dirty_log_start(VGAState *s)
kvm_log_start(s->map_addr, s->map_size);
if (kvm_enabled() && s->lfb_vram_mapped) {
- kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
- kvm_log_start(isa_mem_base + 0xa8000, 0x8000);
+ kvm_log_start(s->vram_phys, 0x8000);
+ kvm_log_start(s->vram_phys + 0x8000, 0x8000);
}
}
@@ -2409,6 +2409,7 @@ void vga_init(VGAState *s, target_phys_addr_t vram_base,
s->bank_offset = 0;
s->it_shift = it_shift;
+ s->vram_phys = vram_base;
/* Pass ctrl_base to setup memory mapped I/O control */
if (ctrl_base) {
diff --git a/hw/vga_int.h b/hw/vga_int.h
index f072663..bab04c6 100644
--- a/hw/vga_int.h
+++ b/hw/vga_int.h
@@ -102,6 +102,7 @@ typedef struct VGACommonState {
uint8_t *vram_ptr;
ram_addr_t vram_offset;
unsigned int vram_size;
+ target_phys_addr_t vram_phys;
uint32_t lfb_addr;
uint32_t lfb_end;
uint32_t map_addr;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 11/14] Add some defined constants for VGA offsets.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 10/14] Stash VGA physical address and use it in KVM callbacks. Stash VGA physical pointer in cirrus vga as well Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 12/14] Add a PCI BAR for the VGA ROM which is mapped into cirrus_vga. This makes the cirrus device complete under some X servers which require the V_BIOS mapping Zachary Amsden
0 siblings, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
hw/cirrus_vga.c | 14 +++++++-------
hw/vga.c | 12 ++++++------
hw/vga_int.h | 4 ++++
hw/vmware_vga.c | 2 +-
4 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 60c67fe..9623820 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -2002,7 +2002,7 @@ static uint32_t cirrus_vga_mem_readb(void *opaque, target_phys_addr_t addr)
return vga_mem_readb(s, addr);
}
- addr &= 0x1ffff;
+ addr &= VGA_VRAM_MASK;
if (addr < 0x10000) {
/* XXX handle bitblt */
@@ -2078,7 +2078,7 @@ static void cirrus_vga_mem_writeb(void *opaque, target_phys_addr_t addr,
return;
}
- addr &= 0x1ffff;
+ addr &= VGA_VRAM_MASK;
if (addr < 0x10000) {
if (s->cirrus_srcptr != s->cirrus_srcptr_end) {
@@ -2611,7 +2611,7 @@ static void map_linear_vram(CirrusVGAState *s)
s->vga.lfb_vram_mapped = 1;
}
else {
- cpu_register_physical_memory(s->vga.vram_phys, 0x20000, s->vga.vga_io_memory);
+ cpu_register_physical_memory(s->vga.vram_phys, VGA_VRAM_SIZE, s->vga.vga_io_memory);
}
vga_dirty_log_start(&s->vga);
@@ -2622,7 +2622,7 @@ static void unmap_linear_vram(CirrusVGAState *s)
if (s->vga.map_addr && s->vga.lfb_addr && s->vga.lfb_end)
s->vga.map_addr = s->vga.map_size = 0;
- cpu_register_physical_memory(s->vga.vram_phys, 0x20000, s->vga.vga_io_memory);
+ cpu_register_physical_memory(s->vga.vram_phys, VGA_VRAM_SIZE, s->vga.vga_io_memory);
}
/* Compute the memory access functions */
@@ -3195,11 +3195,11 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
register_ioport_read(0x3ba, 1, 1, vga_ioport_read, s);
register_ioport_read(0x3da, 1, 1, vga_ioport_read, s);
- s->vga.vram_phys = isa_mem_base + 0xa0000;
+ s->vga.vram_phys = isa_mem_base + VGA_ISA_ADDRESS;
s->vga.vga_io_memory = cpu_register_io_memory(cirrus_vga_mem_read,
cirrus_vga_mem_write, s);
- cpu_register_physical_memory(s->vga.vram_phys, 0x20000, s->vga.vga_io_memory);
- qemu_register_coalesced_mmio(s->vga.vram_phys, 0x20000);
+ cpu_register_physical_memory(s->vga.vram_phys, VGA_VRAM_SIZE, s->vga.vga_io_memory);
+ qemu_register_coalesced_mmio(s->vga.vram_phys, VGA_VRAM_SIZE);
/* I/O handler for LFB */
s->cirrus_linear_io_addr =
diff --git a/hw/vga.c b/hw/vga.c
index 0941962..9fbb489 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -713,7 +713,7 @@ uint32_t vga_mem_readb(void *opaque, target_phys_addr_t addr)
/* convert to VGA memory offset */
memory_map_mode = (s->gr[6] >> 2) & 3;
- addr &= 0x1ffff;
+ addr &= VGA_VRAM_MASK;
switch(memory_map_mode) {
case 0:
break;
@@ -803,7 +803,7 @@ void vga_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
#endif
/* convert to VGA memory offset */
memory_map_mode = (s->gr[6] >> 2) & 3;
- addr &= 0x1ffff;
+ addr &= VGA_VRAM_MASK;
switch(memory_map_mode) {
case 0:
break;
@@ -2420,8 +2420,8 @@ void vga_init(VGAState *s, target_phys_addr_t vram_base,
}
vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
- cpu_register_physical_memory(vram_base, 0x20000, vga_io_memory);
- qemu_register_coalesced_mmio(vram_base, 0x20000);
+ cpu_register_physical_memory(vram_base, VGA_VRAM_SIZE, vga_io_memory);
+ qemu_register_coalesced_mmio(vram_base, VGA_VRAM_SIZE);
}
int isa_vga_init(void)
@@ -2431,7 +2431,7 @@ int isa_vga_init(void)
s = qemu_mallocz(sizeof(VGAState));
vga_common_init(s, VGA_RAM_SIZE);
- vga_init(s, isa_mem_base + 0xa0000, 0, -1);
+ vga_init(s, isa_mem_base + VGA_ISA_ADDRESS, 0, -1);
s->ds = graphic_console_init(s->update, s->invalidate,
s->screen_dump, s->text_update, s);
@@ -2491,7 +2491,7 @@ int pci_vga_init(PCIBus *bus,
s = &d->vga_state;
vga_common_init(s, VGA_RAM_SIZE);
- vga_init(s, isa_mem_base + 0xa0000, 0, -1);
+ vga_init(s, isa_mem_base + VGA_ISA_ADDRESS, 0, -1);
s->ds = graphic_console_init(s->update, s->invalidate,
s->screen_dump, s->text_update, s);
diff --git a/hw/vga_int.h b/hw/vga_int.h
index bab04c6..d1d0c17 100644
--- a/hw/vga_int.h
+++ b/hw/vga_int.h
@@ -79,6 +79,10 @@
#define CH_ATTR_SIZE (160 * 100)
#define VGA_MAX_HEIGHT 2048
+#define VGA_ISA_ADDRESS 0xa0000
+#define VGA_VRAM_SIZE 0x20000
+#define VGA_VRAM_MASK 0x1ffff
+
struct vga_precise_retrace {
int64_t ticks_per_char;
int64_t total_chars;
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index d81d263..d51fa81 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -1130,7 +1130,7 @@ static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size)
#ifdef EMBED_STDVGA
vga_common_init((VGAState *) s, vga_ram_size);
- vga_init((VGAState *) s, isa_mem_base + 0xa0000, 0, -1);
+ vga_init((VGAState *) s, isa_mem_base + VGA_ISA_ADDRESS, 0, -1);
#else
s->vram_size = vga_ram_size;
s->vram_offset = qemu_ram_alloc(vga_ram_size);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 12/14] Add a PCI BAR for the VGA ROM which is mapped into cirrus_vga. This makes the cirrus device complete under some X servers which require the V_BIOS mapping.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 11/14] Add some defined constants for VGA offsets Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 13/14] Allow cirrus VGA to be initialized multiple times; only the first init takes the ISA memory region and hardware I/O ports Zachary Amsden
0 siblings, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
hw/cirrus_vga.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 9623820..d7874f0 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -3288,6 +3288,12 @@ static void cirrus_pci_mmio_map(PCIDevice *d, int region_num,
s->cirrus_mmio_io_addr);
}
+static void cirrus_pci_rom_map(PCIDevice *d, int region_num,
+ uint32_t addr, uint32_t size, int type)
+{
+ cpu_register_physical_memory(addr, 0x10000, 0xc0000 | IO_MEM_ROM);
+}
+
static void pci_cirrus_write_config(PCIDevice *d,
uint32_t address, uint32_t val, int len)
{
@@ -3341,5 +3347,6 @@ void pci_cirrus_vga_init(PCIBus *bus)
pci_register_bar((PCIDevice *)d, 1, CIRRUS_PNPMMIO_SIZE,
PCI_ADDRESS_SPACE_MEM, cirrus_pci_mmio_map);
}
- /* XXX: ROM BIOS */
+ pci_register_bar((PCIDevice *)d, PCI_ROM_SLOT, 0x10000,
+ PCI_ADDRESS_SPACE_MEM, cirrus_pci_rom_map);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 13/14] Allow cirrus VGA to be initialized multiple times; only the first init takes the ISA memory region and hardware I/O ports.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 12/14] Add a PCI BAR for the VGA ROM which is mapped into cirrus_vga. This makes the cirrus device complete under some X servers which require the V_BIOS mapping Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 14/14] Atrocious and horrendous patch to demonstrate multiple SDL displays. The multiple SDL displays can be seen on one console, using ctrl-alt-1/2 to switch between them Zachary Amsden
0 siblings, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
---
hw/cirrus_vga.c | 37 +++++++++++++++++++++----------------
1 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index d7874f0..c0cf088 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -3153,6 +3153,7 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
{
int i;
static int inited;
+ static int idx = 0;
if (!inited) {
inited = 1;
@@ -3181,25 +3182,28 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
s->bustype = CIRRUS_BUSTYPE_ISA;
}
- register_ioport_write(0x3c0, 16, 1, vga_ioport_write, s);
+ if (idx == 0) {
+ register_ioport_write(0x3c0, 16, 1, vga_ioport_write, s);
- register_ioport_write(0x3b4, 2, 1, vga_ioport_write, s);
- register_ioport_write(0x3d4, 2, 1, vga_ioport_write, s);
- register_ioport_write(0x3ba, 1, 1, vga_ioport_write, s);
- register_ioport_write(0x3da, 1, 1, vga_ioport_write, s);
+ register_ioport_write(0x3b4, 2, 1, vga_ioport_write, s);
+ register_ioport_write(0x3d4, 2, 1, vga_ioport_write, s);
+ register_ioport_write(0x3ba, 1, 1, vga_ioport_write, s);
+ register_ioport_write(0x3da, 1, 1, vga_ioport_write, s);
- register_ioport_read(0x3c0, 16, 1, vga_ioport_read, s);
+ register_ioport_read(0x3c0, 16, 1, vga_ioport_read, s);
- register_ioport_read(0x3b4, 2, 1, vga_ioport_read, s);
- register_ioport_read(0x3d4, 2, 1, vga_ioport_read, s);
- register_ioport_read(0x3ba, 1, 1, vga_ioport_read, s);
- register_ioport_read(0x3da, 1, 1, vga_ioport_read, s);
+ register_ioport_read(0x3b4, 2, 1, vga_ioport_read, s);
+ register_ioport_read(0x3d4, 2, 1, vga_ioport_read, s);
+ register_ioport_read(0x3ba, 1, 1, vga_ioport_read, s);
+ register_ioport_read(0x3da, 1, 1, vga_ioport_read, s);
+ s->vga.vram_phys = isa_mem_base + VGA_ISA_ADDRESS;
- s->vga.vram_phys = isa_mem_base + VGA_ISA_ADDRESS;
- s->vga.vga_io_memory = cpu_register_io_memory(cirrus_vga_mem_read,
- cirrus_vga_mem_write, s);
- cpu_register_physical_memory(s->vga.vram_phys, VGA_VRAM_SIZE, s->vga.vga_io_memory);
- qemu_register_coalesced_mmio(s->vga.vram_phys, VGA_VRAM_SIZE);
+ s->vga.vga_io_memory = cpu_register_io_memory(cirrus_vga_mem_read,
+ cirrus_vga_mem_write, s);
+ cpu_register_physical_memory(s->vga.vram_phys, VGA_VRAM_SIZE,
+ s->vga.vga_io_memory);
+ qemu_register_coalesced_mmio(s->vga.vram_phys, VGA_VRAM_SIZE);
+ }
/* I/O handler for LFB */
s->cirrus_linear_io_addr =
@@ -3229,7 +3233,8 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
qemu_register_reset(cirrus_reset, 0, s);
cirrus_reset(s);
- register_savevm("cirrus_vga", 0, 2, cirrus_vga_save, cirrus_vga_load, s);
+ register_savevm("cirrus_vga", idx, 2, cirrus_vga_save, cirrus_vga_load, s);
+ idx++;
}
/***************************************
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 14/14] Atrocious and horrendous patch to demonstrate multiple SDL displays. The multiple SDL displays can be seen on one console, using ctrl-alt-1/2 to switch between them.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 13/14] Allow cirrus VGA to be initialized multiple times; only the first init takes the ISA memory region and hardware I/O ports Zachary Amsden
@ 2009-07-30 10:15 ` Zachary Amsden
0 siblings, 0 replies; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: zamsden
I will not sign off this patch as it should not be committed!
This is purely for demonstration. The proper way to do this is a
more refined console interface, and a separation of the notion of
display creation and 'running' of the display window interface.
Written-By: Zachary Amsden <zamsden@redhat.com>
---
hw/pc.c | 1 +
vl.c | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index 86e5cfe..91dff1b 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1018,6 +1018,7 @@ static void pc_init1(ram_addr_t ram_size,
if (cirrus_vga_enabled) {
if (pci_enabled) {
pci_cirrus_vga_init(pci_bus);
+ pci_cirrus_vga_init(pci_bus);
} else {
isa_cirrus_vga_init();
}
diff --git a/vl.c b/vl.c
index f9d2da6..3285eed 100644
--- a/vl.c
+++ b/vl.c
@@ -6103,6 +6103,7 @@ int main(int argc, char **argv, char **envp)
#if defined(CONFIG_SDL)
case DT_SDL:
sdl_display_init(ds, full_screen, no_frame);
+ sdl_display_init(ds->next, full_screen, no_frame);
break;
#elif defined(CONFIG_COCOA)
case DT_SDL:
@@ -6111,8 +6112,10 @@ int main(int argc, char **argv, char **envp)
#endif
case DT_VNC:
vnc_display_init(ds);
+ vnc_display_init(ds->next);
if (vnc_display_open(ds, vnc_display) < 0)
exit(1);
+ if (vnc_display_open(ds->next, vnc_display) < 0)
if (show_vnc_port) {
printf("VNC server running on `%s'\n", vnc_display_local_addr(ds));
--
1.6.2.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] Various VGA / VNC fixes and cleanups to prep for multiheaded graphics
2009-07-30 10:14 [Qemu-devel] Various VGA / VNC fixes and cleanups to prep for multiheaded graphics Zachary Amsden
2009-07-30 10:14 ` [Qemu-devel] [PATCH 01/14] Add a configure switch to enable / disable all user targets. I felt compelled to do it for symmetry, mostly it is useful to disable user targets when you don't want to build them Zachary Amsden
@ 2009-07-30 10:34 ` Daniel P. Berrange
2009-07-30 10:35 ` Zachary Amsden
1 sibling, 1 reply; 21+ messages in thread
From: Daniel P. Berrange @ 2009-07-30 10:34 UTC (permalink / raw)
To: Zachary Amsden; +Cc: qemu-devel
On Thu, Jul 30, 2009 at 12:14:58AM -1000, Zachary Amsden wrote:
> These patches grew from a very strange process, but nonetheless they exist now.
> All of the initial patches are robustness / bugfixes / cleanups. The final
> result is that we can use multiple Cirrus VGA adapters simultaneously.
>
> Note the last patch is a complete hack. It is not meant to be designed this
> way, and is included for demonstration purposes only. You will also need to
> know how to hack your xorg.conf file to setup multihead properly, but it does
> work, at least under SDL, for me. You can switch using the standard qemu
> ctrl-alt-1 / ctrl-alt-2 to switch between both graphic consoles.
>
> I would attach a screenshot to demonstrate this if I could, but the patch mail
> program, or my skills at manipulating it are not sufficient to do that.
>
> Not that this is very useful, but it was possible, and a consequence of what
> I had been working on, so I felt compelled to release it.
>
> The next step if anyone were to be interested in multiheaded machine simulation
> would be to create a console.h abstraction designed to support this; it would
> at least require a 'display_state_init' and 'run' callback, and would need
> differentiation to determine whether all displays should be multiplexed on
> one console; or whether there should be multiple consoles supporting all
> displays; or whether there should be a master console with access to all
> monitor targets and slave displays for secondary graphics consoles.
>
> Multiple concurrent SDL displays would require a much deeper design, with a
> separate process for each display, given the current state of SDL does not
> support multiple windows. This may or may not be possible under Cocoa, which
> I have access to but have not fully investigated.
>
> This might be more useful when applied to a VNC or other remote display target.
> Initial attempts to get multiple simultaneous VNC displays did not work, but
> there is no obvious technical obstacle to the progress.
For VNC, there is an documented extension which allows for intelligent
client side handling of multiple displays. Essentially the server VNC
framebuffer represents the combined real estate of all displays (this
lets dumb VNC clients work), and the "ExtendedDesktopSize" extension
allows intelligent clients to query what regions within the framebuffer
correspond to each display. So it would be useful to implement this in
QEMU if we're to allow multiple VGA adapters.
http://tigervnc.sourceforge.net/cgi-bin/rfbproto#extendeddesktopsize-pseudo-encoding
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] Various VGA / VNC fixes and cleanups to prep for multiheaded graphics
2009-07-30 10:34 ` [Qemu-devel] Various VGA / VNC fixes and cleanups to prep for multiheaded graphics Daniel P. Berrange
@ 2009-07-30 10:35 ` Zachary Amsden
2009-07-30 11:33 ` Paul Brook
0 siblings, 1 reply; 21+ messages in thread
From: Zachary Amsden @ 2009-07-30 10:35 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: qemu-devel
Daniel P. Berrange wrote:
> For VNC, there is an documented extension which allows for intelligent
> client side handling of multiple displays. Essentially the server VNC
> framebuffer represents the combined real estate of all displays (this
> lets dumb VNC clients work), and the "ExtendedDesktopSize" extension
> allows intelligent clients to query what regions within the framebuffer
> correspond to each display. So it would be useful to implement this in
> QEMU if we're to allow multiple VGA adapters.
This is true, but in this context, is it useful? If one wants multiple
displays, one can easily double the height or width of the virtual
display and run nested servers inside of them.
I think, perhaps, the more useful thing is to allow multiple remote
clients to connect to individual displays... which this patchset has not
quite achieved, but proved at least plausible.
Zach
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Qemu-devel] Re: [PATCH 05/14] Change cpu_phys mem callback to use [offset, size) bounds instead of [start, end).
2009-07-30 10:15 ` [Qemu-devel] [PATCH 05/14] Change cpu_phys mem callback to use [offset, size) bounds instead of [start, end) Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 06/14] Split VGA ioport init into a helper function Zachary Amsden
@ 2009-07-30 11:03 ` Jan Kiszka
2009-08-10 19:42 ` [Qemu-devel] " Anthony Liguori
2 siblings, 0 replies; 21+ messages in thread
From: Jan Kiszka @ 2009-07-30 11:03 UTC (permalink / raw)
To: Zachary Amsden; +Cc: qemu-devel
Zachary Amsden wrote:
> Signed-off-by: Zachary Amsden <zamsden@redhat.com>
> ---
> cpu-all.h | 2 +-
> exec.c | 4 ++--
> hw/cirrus_vga.c | 11 ++++++-----
> hw/framebuffer.c | 2 +-
> hw/vga.c | 12 ++++++------
> hw/vga_int.h | 2 +-
> kvm-all.c | 4 ++--
> 7 files changed, 19 insertions(+), 18 deletions(-)
>
> diff --git a/cpu-all.h b/cpu-all.h
> index 97a224d..43bbf18 100644
> --- a/cpu-all.h
> +++ b/cpu-all.h
> @@ -907,7 +907,7 @@ int cpu_physical_memory_set_dirty_tracking(int enable);
> int cpu_physical_memory_get_dirty_tracking(void);
>
> int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
> - target_phys_addr_t end_addr);
> + ram_addr_t size);
>
> void dump_exec_info(FILE *f,
> int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
> diff --git a/exec.c b/exec.c
> index 688f603..f8bfcd4 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1921,12 +1921,12 @@ int cpu_physical_memory_get_dirty_tracking(void)
> }
>
> int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
> - target_phys_addr_t end_addr)
> + ram_addr_t size)
> {
> int ret = 0;
>
> if (kvm_enabled())
> - ret = kvm_physical_sync_dirty_bitmap(start_addr, end_addr);
> + ret = kvm_physical_sync_dirty_bitmap(start_addr, size);
> return ret;
> }
>
> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
> index 0a12782..2287e94 100644
> --- a/hw/cirrus_vga.c
> +++ b/hw/cirrus_vga.c
> @@ -1220,7 +1220,7 @@ static void cirrus_update_bank_ptr(CirrusVGAState * s, unsigned bank_index)
> * on the current location, otherwise we lose this pointer forever */
> if (s->vga.lfb_vram_mapped) {
> target_phys_addr_t base_addr = isa_mem_base + 0xa0000 + bank_index * 0x8000;
> - cpu_physical_sync_dirty_bitmap(base_addr, base_addr + 0x8000);
> + cpu_physical_sync_dirty_bitmap(base_addr, 0x8000);
> }
> s->cirrus_bank_base[bank_index] = offset;
> s->cirrus_bank_limit[bank_index] = limit;
> @@ -2588,8 +2588,9 @@ static void map_linear_vram(CirrusVGAState *s)
> {
> if (!s->vga.map_addr && s->vga.lfb_addr && s->vga.lfb_end) {
> s->vga.map_addr = s->vga.lfb_addr;
> - s->vga.map_end = s->vga.lfb_end;
> - cpu_register_physical_memory(s->vga.map_addr, s->vga.map_end - s->vga.map_addr, s->vga.vram_offset);
> + s->vga.map_size = s->vga.lfb_end - s->vga.lfb_addr;
> + cpu_register_physical_memory(s->vga.map_addr, s->vga.map_size,
> + s->vga.vram_offset);
> }
>
> if (!s->vga.map_addr)
> @@ -2620,7 +2621,7 @@ static void map_linear_vram(CirrusVGAState *s)
> static void unmap_linear_vram(CirrusVGAState *s)
> {
> if (s->vga.map_addr && s->vga.lfb_addr && s->vga.lfb_end)
> - s->vga.map_addr = s->vga.map_end = 0;
> + s->vga.map_addr = s->vga.map_size = 0;
>
> cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x20000,
> s->vga.vga_io_memory);
> @@ -3270,7 +3271,7 @@ static void cirrus_pci_lfb_map(PCIDevice *d, int region_num,
> cpu_register_physical_memory(addr + 0x1000000, 0x400000,
> s->cirrus_linear_bitblt_io_addr);
>
> - s->vga.map_addr = s->vga.map_end = 0;
> + s->vga.map_addr = s->vga.map_size = 0;
> s->vga.lfb_addr = addr & TARGET_PAGE_MASK;
> s->vga.lfb_end = ((addr + VGA_RAM_SIZE) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK;
> /* account for overflow */
> diff --git a/hw/framebuffer.c b/hw/framebuffer.c
> index 24cdf25..f8efe5b 100644
> --- a/hw/framebuffer.c
> +++ b/hw/framebuffer.c
> @@ -49,7 +49,7 @@ void framebuffer_update_display(
> *first_row = -1;
> src_len = src_width * rows;
>
> - cpu_physical_sync_dirty_bitmap(base, base + src_len);
> + cpu_physical_sync_dirty_bitmap(base, src_len);
> pd = cpu_get_physical_page_desc(base);
> pd2 = cpu_get_physical_page_desc(base + src_len - 1);
> /* We should reall check that this is a continuous ram region.
> diff --git a/hw/vga.c b/hw/vga.c
> index 134ad16..ca94a68 100644
> --- a/hw/vga.c
> +++ b/hw/vga.c
> @@ -1571,11 +1571,11 @@ void vga_invalidate_scanlines(VGAState *s, int y1, int y2)
> static void vga_sync_dirty_bitmap(VGAState *s)
> {
> if (s->map_addr)
> - cpu_physical_sync_dirty_bitmap(s->map_addr, s->map_end);
> + cpu_physical_sync_dirty_bitmap(s->map_addr, s->map_size);
>
> if (s->lfb_vram_mapped) {
> - cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa0000, 0xa8000);
> - cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa8000, 0xb0000);
> + cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa0000, 0x8000);
> + cpu_physical_sync_dirty_bitmap(isa_mem_base + 0xa8000, 0x8000);
> }
> }
>
> @@ -1878,7 +1878,7 @@ void vga_reset(void *opaque)
> s->lfb_addr = 0;
> s->lfb_end = 0;
> s->map_addr = 0;
> - s->map_end = 0;
> + s->map_size = 0;
> s->lfb_vram_mapped = 0;
> s->bios_offset = 0;
> s->bios_size = 0;
> @@ -2227,7 +2227,7 @@ typedef struct PCIVGAState {
> void vga_dirty_log_start(VGAState *s)
> {
> if (kvm_enabled() && s->map_addr)
> - kvm_log_start(s->map_addr, s->map_end - s->map_addr);
> + kvm_log_start(s->map_addr, s->map_size);
>
> if (kvm_enabled() && s->lfb_vram_mapped) {
> kvm_log_start(isa_mem_base + 0xa0000, 0x8000);
> @@ -2245,7 +2245,7 @@ static void vga_map(PCIDevice *pci_dev, int region_num,
> } else {
> cpu_register_physical_memory(addr, s->vram_size, s->vram_offset);
> s->map_addr = addr;
> - s->map_end = addr + s->vram_size;
> + s->map_size = s->vram_size;
> vga_dirty_log_start(s);
> }
> }
> diff --git a/hw/vga_int.h b/hw/vga_int.h
> index 631b1b0..83b69ef 100644
> --- a/hw/vga_int.h
> +++ b/hw/vga_int.h
> @@ -105,7 +105,7 @@ typedef struct VGACommonState {
> uint32_t lfb_addr;
> uint32_t lfb_end;
> uint32_t map_addr;
> - uint32_t map_end;
> + uint32_t map_size;
> uint32_t lfb_vram_mapped; /* whether 0xa0000 is mapped as ram */
> unsigned long bios_offset;
> unsigned int bios_size;
> diff --git a/kvm-all.c b/kvm-all.c
> index d843338..2a48b63 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -294,11 +294,11 @@ int kvm_set_migration_log(int enable)
> * @end_addr: end of logged region.
> */
> int kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
> - target_phys_addr_t end_addr)
> + ram_addr_t dirty_size)
> {
> KVMState *s = kvm_state;
> unsigned long size, allocated_size = 0;
> - target_phys_addr_t phys_addr;
> + target_phys_addr_t phys_addr, end_addr = start_addr + dirty_size;
I personally prefer adding a separate line for this. But that's a matter
of taste I guess.
> ram_addr_t addr;
> KVMDirtyLog d;
> KVMSlot *mem;
Otherwise, no concerns.
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Qemu-devel] Re: [PATCH 07/14] Code motion; make mm VGA init function more like standard vga init function. Add missing vga_reset hook to vga_mm_init.
2009-07-30 10:15 ` [Qemu-devel] [PATCH 07/14] Code motion; make mm VGA init function more like standard vga init function. Add missing vga_reset hook to vga_mm_init Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 08/14] Make VGA vram offset passed into vga_mm_init absolute. Since this is a function of the platform, it makes sense to have it be explicitly known in the platform layer rather than hardcoded inside the vga code Zachary Amsden
@ 2009-07-30 11:03 ` Jan Kiszka
1 sibling, 0 replies; 21+ messages in thread
From: Jan Kiszka @ 2009-07-30 11:03 UTC (permalink / raw)
To: Zachary Amsden; +Cc: qemu-devel
Zachary Amsden wrote:
> Signed-off-by: Zachary Amsden <zamsden@redhat.com>
> ---
> hw/vga.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/hw/vga.c b/hw/vga.c
> index 33645a0..9b50959 100644
> --- a/hw/vga.c
> +++ b/hw/vga.c
> @@ -2422,14 +2422,17 @@ static void vga_mm_init(VGAState *s, target_phys_addr_t vram_base,
> {
> int s_ioport_ctrl, vga_io_memory;
>
> + qemu_register_reset(vga_reset, 0, s);
vga users like cirrus or vmware invoke reset too. You probably want to
drop those calls now. And did you check that vga_reset is still always
invoked before any vga user reset callback?
> + register_savevm("vga", 0, 2, vga_save, vga_load, s);
> +
> + s->bank_offset = 0;
> +
> s->it_shift = it_shift;
> s_ioport_ctrl = cpu_register_io_memory(vga_mm_read_ctrl, vga_mm_write_ctrl, s);
> - vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
>
> - register_savevm("vga", 0, 2, vga_save, vga_load, s);
> + vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s);
>
> cpu_register_physical_memory(ctrl_base, 0x100000, s_ioport_ctrl);
> - s->bank_offset = 0;
> cpu_register_physical_memory(vram_base + 0x000a0000, 0x20000, vga_io_memory);
> qemu_register_coalesced_mmio(vram_base + 0x000a0000, 0x20000);
> }
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] Various VGA / VNC fixes and cleanups to prep for multiheaded graphics
2009-07-30 10:35 ` Zachary Amsden
@ 2009-07-30 11:33 ` Paul Brook
0 siblings, 0 replies; 21+ messages in thread
From: Paul Brook @ 2009-07-30 11:33 UTC (permalink / raw)
To: qemu-devel; +Cc: Zachary Amsden
On Thursday 30 July 2009, Zachary Amsden wrote:
> Daniel P. Berrange wrote:
> > For VNC, there is an documented extension which allows for intelligent
> > client side handling of multiple displays. Essentially the server VNC
> > framebuffer represents the combined real estate of all displays (this
> > lets dumb VNC clients work), and the "ExtendedDesktopSize" extension
> > allows intelligent clients to query what regions within the framebuffer
> > correspond to each display. So it would be useful to implement this in
> > QEMU if we're to allow multiple VGA adapters.
>
> This is true, but in this context, is it useful? If one wants multiple
> displays, one can easily double the height or width of the virtual
> display and run nested servers inside of them.
If you just want twice as screen real estate on a desktop system then yes, you
can increase the resolution. However in many cases we actually want multiple
independent displays.
Paul
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] [PATCH 05/14] Change cpu_phys mem callback to use [offset, size) bounds instead of [start, end).
2009-07-30 10:15 ` [Qemu-devel] [PATCH 05/14] Change cpu_phys mem callback to use [offset, size) bounds instead of [start, end) Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 06/14] Split VGA ioport init into a helper function Zachary Amsden
2009-07-30 11:03 ` [Qemu-devel] Re: [PATCH 05/14] Change cpu_phys mem callback to use [offset, size) bounds instead of [start, end) Jan Kiszka
@ 2009-08-10 19:42 ` Anthony Liguori
2 siblings, 0 replies; 21+ messages in thread
From: Anthony Liguori @ 2009-08-10 19:42 UTC (permalink / raw)
To: Zachary Amsden; +Cc: qemu-devel
Zachary Amsden wrote:
> Signed-off-by: Zachary Amsden <zamsden@redhat.com>
> ---
> cpu-all.h | 2 +-
> exec.c | 4 ++--
> hw/cirrus_vga.c | 11 ++++++-----
> hw/framebuffer.c | 2 +-
> hw/vga.c | 12 ++++++------
> hw/vga_int.h | 2 +-
> kvm-all.c | 4 ++--
> 7 files changed, 19 insertions(+), 18 deletions(-)
>
> diff --git a/cpu-all.h b/cpu-all.h
> index 97a224d..43bbf18 100644
> --- a/cpu-all.h
> +++ b/cpu-all.h
> @@ -907,7 +907,7 @@ int cpu_physical_memory_set_dirty_tracking(int enable);
> int cpu_physical_memory_get_dirty_tracking(void);
>
> int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
> - target_phys_addr_t end_addr);
> + ram_addr_t size);
>
> void dump_exec_info(FILE *f,
> int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
> diff --git a/exec.c b/exec.c
> index 688f603..f8bfcd4 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1921,12 +1921,12 @@ int cpu_physical_memory_get_dirty_tracking(void)
> }
>
> int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
> - target_phys_addr_t end_addr)
> + ram_addr_t size)
>
This breaks the build for i386-softmmu as ram_addr_t is a uint32_t
there. In vl.c, there's
static int ram_save_live(QEMUFile *f, int stage, void *opaque)
{
ram_addr_t addr;
uint64_t bytes_transferred_last;
double bwidth = 0;
uint64_t expected_time = 0;
if (cpu_physical_sync_dirty_bitmap(0, TARGET_PHYS_ADDR_MAX) != 0) {
And you get a large integer truncation error.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2009-08-10 19:42 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-30 10:14 [Qemu-devel] Various VGA / VNC fixes and cleanups to prep for multiheaded graphics Zachary Amsden
2009-07-30 10:14 ` [Qemu-devel] [PATCH 01/14] Add a configure switch to enable / disable all user targets. I felt compelled to do it for symmetry, mostly it is useful to disable user targets when you don't want to build them Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 02/14] Don't segfault when changing VNC password on an SDL display Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 03/14] When using stdio monitor and VNC display, one can set or clear a VNC password; this should set or turn off VNC authentication as well Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 04/14] Clean up VGA type selection; far too many variables being used to track one state leads to confusion if new variables are added Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 05/14] Change cpu_phys mem callback to use [offset, size) bounds instead of [start, end) Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 06/14] Split VGA ioport init into a helper function Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 07/14] Code motion; make mm VGA init function more like standard vga init function. Add missing vga_reset hook to vga_mm_init Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 08/14] Make VGA vram offset passed into vga_mm_init absolute. Since this is a function of the platform, it makes sense to have it be explicitly known in the platform layer rather than hardcoded inside the vga code Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 09/14] Further transformation: use common vga_init() which allows either I/O port or memory mapped based control Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 10/14] Stash VGA physical address and use it in KVM callbacks. Stash VGA physical pointer in cirrus vga as well Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 11/14] Add some defined constants for VGA offsets Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 12/14] Add a PCI BAR for the VGA ROM which is mapped into cirrus_vga. This makes the cirrus device complete under some X servers which require the V_BIOS mapping Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 13/14] Allow cirrus VGA to be initialized multiple times; only the first init takes the ISA memory region and hardware I/O ports Zachary Amsden
2009-07-30 10:15 ` [Qemu-devel] [PATCH 14/14] Atrocious and horrendous patch to demonstrate multiple SDL displays. The multiple SDL displays can be seen on one console, using ctrl-alt-1/2 to switch between them Zachary Amsden
2009-07-30 11:03 ` [Qemu-devel] Re: [PATCH 07/14] Code motion; make mm VGA init function more like standard vga init function. Add missing vga_reset hook to vga_mm_init Jan Kiszka
2009-07-30 11:03 ` [Qemu-devel] Re: [PATCH 05/14] Change cpu_phys mem callback to use [offset, size) bounds instead of [start, end) Jan Kiszka
2009-08-10 19:42 ` [Qemu-devel] " Anthony Liguori
2009-07-30 10:34 ` [Qemu-devel] Various VGA / VNC fixes and cleanups to prep for multiheaded graphics Daniel P. Berrange
2009-07-30 10:35 ` Zachary Amsden
2009-07-30 11:33 ` Paul Brook
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).