* [Qemu-devel] [PATCH 3/3] vga: compile cirrus_vga in hwlib
@ 2011-10-09 10:24 Blue Swirl
2011-10-09 16:19 ` Avi Kivity
0 siblings, 1 reply; 3+ messages in thread
From: Blue Swirl @ 2011-10-09 10:24 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2107 bytes --]
Remove target dependencies and compile Cirrus VGA in hwlib.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
Makefile.objs | 1 +
Makefile.target | 1 -
hw/cirrus_vga.c | 9 ++++++---
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index c849e51..df2c888 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -284,6 +284,7 @@ hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o
hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
hw-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
hw-obj-$(CONFIG_VMMOUSE) += vmmouse.o
+hw-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
hw-obj-$(CONFIG_RC4030) += rc4030.o
hw-obj-$(CONFIG_DP8393X) += dp8393x.o
diff --git a/Makefile.target b/Makefile.target
index 8eeda65..0ca0fe5 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -195,7 +195,6 @@ obj-$(CONFIG_KVM) += kvm.o kvm-all.o
obj-$(CONFIG_NO_KVM) += kvm-stub.o
obj-y += memory.o
obj-$(CONFIG_VGA) += vga.o
-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
LIBS+=-lz
QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index aa8a0e6..ee05fd4 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -173,6 +173,9 @@
#define CIRRUS_PNPMMIO_SIZE 0x1000
+#define CIRRUS_PAGE_SIZE 4096
+#define CIRRUS_PAGE_MASK (CIRRUS_PAGE_SIZE - 1)
+
#define BLTUNSAFE(s) \
( \
( /* check dst is within bounds */ \
@@ -618,10 +621,10 @@ static void
cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
for (y = 0; y < lines; y++) {
off_cur = off_begin;
off_cur_end = (off_cur + bytesperline) & s->cirrus_addr_mask;
- off_cur &= TARGET_PAGE_MASK;
+ off_cur &= CIRRUS_PAGE_MASK;
while (off_cur < off_cur_end) {
memory_region_set_dirty(&s->vga.vram, off_cur);
- off_cur += TARGET_PAGE_SIZE;
+ off_cur += CIRRUS_PAGE_SIZE;
}
off_begin += off_pitch;
}
@@ -1900,7 +1903,7 @@ static void cirrus_mmio_blt_write(CirrusVGAState
* s, unsigned address,
*
* write mode 4/5
*
- * assume TARGET_PAGE_SIZE >= 16
+ * assume CIRRUS_PAGE_SIZE >= 16
*
***************************************/
--
1.6.2.4
[-- Attachment #2: 0003-vga-compile-cirrus_vga-in-hwlib.patch --]
[-- Type: text/x-diff, Size: 2590 bytes --]
From c753f44923bb53a9a80443ae5a93313d33d63efc Mon Sep 17 00:00:00 2001
Message-Id: <c753f44923bb53a9a80443ae5a93313d33d63efc.1318155718.git.blauwirbel@gmail.com>
In-Reply-To: <10ffb6a14f287979003c8f1b520e7d25bd5b1df5.1318155718.git.blauwirbel@gmail.com>
References: <10ffb6a14f287979003c8f1b520e7d25bd5b1df5.1318155718.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
Date: Sun, 9 Oct 2011 09:58:00 +0000
Subject: [PATCH 3/3] vga: compile cirrus_vga in hwlib
Remove target dependencies and compile Cirrus VGA in hwlib.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
Makefile.objs | 1 +
Makefile.target | 1 -
hw/cirrus_vga.c | 9 ++++++---
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index c849e51..df2c888 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -284,6 +284,7 @@ hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o
hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
hw-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
hw-obj-$(CONFIG_VMMOUSE) += vmmouse.o
+hw-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
hw-obj-$(CONFIG_RC4030) += rc4030.o
hw-obj-$(CONFIG_DP8393X) += dp8393x.o
diff --git a/Makefile.target b/Makefile.target
index 8eeda65..0ca0fe5 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -195,7 +195,6 @@ obj-$(CONFIG_KVM) += kvm.o kvm-all.o
obj-$(CONFIG_NO_KVM) += kvm-stub.o
obj-y += memory.o
obj-$(CONFIG_VGA) += vga.o
-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
LIBS+=-lz
QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index aa8a0e6..ee05fd4 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -173,6 +173,9 @@
#define CIRRUS_PNPMMIO_SIZE 0x1000
+#define CIRRUS_PAGE_SIZE 4096
+#define CIRRUS_PAGE_MASK (CIRRUS_PAGE_SIZE - 1)
+
#define BLTUNSAFE(s) \
( \
( /* check dst is within bounds */ \
@@ -618,10 +621,10 @@ static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
for (y = 0; y < lines; y++) {
off_cur = off_begin;
off_cur_end = (off_cur + bytesperline) & s->cirrus_addr_mask;
- off_cur &= TARGET_PAGE_MASK;
+ off_cur &= CIRRUS_PAGE_MASK;
while (off_cur < off_cur_end) {
memory_region_set_dirty(&s->vga.vram, off_cur);
- off_cur += TARGET_PAGE_SIZE;
+ off_cur += CIRRUS_PAGE_SIZE;
}
off_begin += off_pitch;
}
@@ -1900,7 +1903,7 @@ static void cirrus_mmio_blt_write(CirrusVGAState * s, unsigned address,
*
* write mode 4/5
*
- * assume TARGET_PAGE_SIZE >= 16
+ * assume CIRRUS_PAGE_SIZE >= 16
*
***************************************/
--
1.7.2.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 3/3] vga: compile cirrus_vga in hwlib
2011-10-09 10:24 [Qemu-devel] [PATCH 3/3] vga: compile cirrus_vga in hwlib Blue Swirl
@ 2011-10-09 16:19 ` Avi Kivity
0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2011-10-09 16:19 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel
On 10/09/2011 12:24 PM, Blue Swirl wrote:
> Remove target dependencies and compile Cirrus VGA in hwlib.
> @@ -618,10 +621,10 @@ static void
> cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
> for (y = 0; y< lines; y++) {
> off_cur = off_begin;
> off_cur_end = (off_cur + bytesperline)& s->cirrus_addr_mask;
> - off_cur&= TARGET_PAGE_MASK;
> + off_cur&= CIRRUS_PAGE_MASK;
> while (off_cur< off_cur_end) {
> memory_region_set_dirty(&s->vga.vram, off_cur);
> - off_cur += TARGET_PAGE_SIZE;
> + off_cur += CIRRUS_PAGE_SIZE;
> }
> off_begin += off_pitch;
> }
>
Won't that miss some pages, if CIRRUS_PAGE_SIZE > TARGET_PAGE_SIZE?
We probably need to change memory_region_set_dirty() to take a range, or
add a new API that accepts a range. The only time you can assume you
only modify a single page is when you write an aligned natural type; not
general DMA.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 3/3] vga: compile cirrus_vga in hwlib
@ 2012-01-22 13:07 Blue Swirl
0 siblings, 0 replies; 3+ messages in thread
From: Blue Swirl @ 2012-01-22 13:07 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1877 bytes --]
Remove target dependencies and compile Cirrus VGA in hwlib.
Address masking can be removed since memory API handles that now.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
Makefile.objs | 1 +
Makefile.target | 1 -
hw/cirrus_vga.c | 3 ---
3 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index f94c881..d404e30 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -287,6 +287,7 @@ hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o
hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
hw-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
hw-obj-$(CONFIG_VMMOUSE) += vmmouse.o
+hw-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
hw-obj-$(CONFIG_RC4030) += rc4030.o
hw-obj-$(CONFIG_DP8393X) += dp8393x.o
diff --git a/Makefile.target b/Makefile.target
index bb18d72..309d761 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -197,7 +197,6 @@ obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p-device.o
obj-$(CONFIG_KVM) += kvm.o kvm-all.o
obj-$(CONFIG_NO_KVM) += kvm-stub.o
obj-$(CONFIG_VGA) += vga.o
-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
obj-y += memory.o savevm.o
LIBS+=-lz
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index a031079..7ce35ec 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -618,7 +618,6 @@ static void
cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
for (y = 0; y < lines; y++) {
off_cur = off_begin;
off_cur_end = (off_cur + bytesperline) & s->cirrus_addr_mask;
- off_cur &= TARGET_PAGE_MASK;
memory_region_set_dirty(&s->vga.vram, off_cur, off_cur_end - off_cur);
off_begin += off_pitch;
}
@@ -1897,8 +1896,6 @@ static void cirrus_mmio_blt_write(CirrusVGAState
* s, unsigned address,
*
* write mode 4/5
*
- * assume TARGET_PAGE_SIZE >= 16
- *
***************************************/
static void cirrus_mem_writeb_mode4and5_8bpp(CirrusVGAState * s,
--
1.7.9.rc0
[-- Attachment #2: 0003-vga-compile-cirrus_vga-in-hwlib.patch --]
[-- Type: text/x-diff, Size: 2356 bytes --]
From 47e5a9f8e0c43fbf2c2b0cb1edd12763bc91706d Mon Sep 17 00:00:00 2001
Message-Id: <47e5a9f8e0c43fbf2c2b0cb1edd12763bc91706d.1327237042.git.blauwirbel@gmail.com>
In-Reply-To: <41f0624d559ef63f1f3c97f4d4ecb3e310935eb9.1327237042.git.blauwirbel@gmail.com>
References: <41f0624d559ef63f1f3c97f4d4ecb3e310935eb9.1327237042.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
Date: Sun, 9 Oct 2011 09:58:00 +0000
Subject: [PATCH 3/3] vga: compile cirrus_vga in hwlib
Remove target dependencies and compile Cirrus VGA in hwlib.
Address masking can be removed since memory API handles that now.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
Makefile.objs | 1 +
Makefile.target | 1 -
hw/cirrus_vga.c | 3 ---
3 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index f94c881..d404e30 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -287,6 +287,7 @@ hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o
hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
hw-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
hw-obj-$(CONFIG_VMMOUSE) += vmmouse.o
+hw-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
hw-obj-$(CONFIG_RC4030) += rc4030.o
hw-obj-$(CONFIG_DP8393X) += dp8393x.o
diff --git a/Makefile.target b/Makefile.target
index bb18d72..309d761 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -197,7 +197,6 @@ obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p-device.o
obj-$(CONFIG_KVM) += kvm.o kvm-all.o
obj-$(CONFIG_NO_KVM) += kvm-stub.o
obj-$(CONFIG_VGA) += vga.o
-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
obj-y += memory.o savevm.o
LIBS+=-lz
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index a031079..7ce35ec 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -618,7 +618,6 @@ static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
for (y = 0; y < lines; y++) {
off_cur = off_begin;
off_cur_end = (off_cur + bytesperline) & s->cirrus_addr_mask;
- off_cur &= TARGET_PAGE_MASK;
memory_region_set_dirty(&s->vga.vram, off_cur, off_cur_end - off_cur);
off_begin += off_pitch;
}
@@ -1897,8 +1896,6 @@ static void cirrus_mmio_blt_write(CirrusVGAState * s, unsigned address,
*
* write mode 4/5
*
- * assume TARGET_PAGE_SIZE >= 16
- *
***************************************/
static void cirrus_mem_writeb_mode4and5_8bpp(CirrusVGAState * s,
--
1.7.2.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-22 13:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-09 10:24 [Qemu-devel] [PATCH 3/3] vga: compile cirrus_vga in hwlib Blue Swirl
2011-10-09 16:19 ` Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2012-01-22 13:07 Blue Swirl
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).