Skip to contentSkip to conversation

spice patch queue

GIT PULL New Gerd Hoffmann 1 participant 5 messages Sep 19, 2013

lore
Share & tools
lore
#0 lore raw

Hi,

Here comes the spice patch queue. It elimitates qxl dependency on TARGET_PAGE_SIZE, so qemu can enter the "compile-once" pool.

please pull,
Gerd

The following changes since commit 6c2679fc19560699679200fb42ab4659bcbe7f79:

Merge remote-tracking branch 'kiszka/queues/slirp' into staging (2013-09-17 10:01:24 -0500)

are available in the git repository at:

git://anongit.freedesktop.org/spice/qemu spice.v74

for you to fetch changes up to 521e759cf1ca05fc59a8653e48f18f830edbda7e:

qxl: compile only once (2013-09-18 11:13:29 +0200)

----------------------------------------------------------------
Gerd Hoffmann (4):
qxl: define qxl operating on 4k pages
qxl: simplify qxl_rom_size
qxl: simplify page dirtying
qxl: compile only once

 hw/display/Makefile.objs |  3 +--
 hw/display/qxl.c         | 12 +++++-------
 hw/display/qxl.h         |  3 +++
 3 files changed, 9 insertions(+), 9 deletions(-)
#1 lore raw

PATCH 1/4 qxl: define qxl operating on 4k pages

---
 hw/display/qxl.c | 5 +++--
 hw/display/qxl.h | 3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)
hw/display/qxl.c +3 -2
index c50e285..f0bfd2c 100644
@@ -364,7 +364,7 @@ static void init_qxl_rom(PCIQXLDevice *d)
     num_pages          = d->vga.vram_size;
     num_pages         -= ram_header_size;
     num_pages         -= surface0_area_size;
-    num_pages          = num_pages / TARGET_PAGE_SIZE;
+    num_pages          = num_pages / QXL_PAGE_SIZE;
 
     rom->draw_area_offset   = cpu_to_le32(0);
     rom->surface0_area_size = cpu_to_le32(surface0_area_size);
@@ -528,7 +528,8 @@ static void interface_get_init_info(QXLInstance *sin, QXLDevInitInfo *info)
     info->num_memslots = NUM_MEMSLOTS;
     info->num_memslots_groups = NUM_MEMSLOTS_GROUPS;
     info->internal_groupslot_id = 0;
-    info->qxl_ram_size = le32_to_cpu(qxl->shadow_rom.num_pages) << TARGET_PAGE_BITS;
+    info->qxl_ram_size =
+        le32_to_cpu(qxl->shadow_rom.num_pages) << QXL_PAGE_BITS;
     info->n_surfaces = qxl->ssd.num_surfaces;
 }
 
hw/display/qxl.h +3 -0
index 8e9b0c2..84f0182 100644
@@ -27,6 +27,9 @@ enum qxl_mode {
 
 #define QXL_NUM_DIRTY_RECTS 64
 
+#define QXL_PAGE_BITS 12
+#define QXL_PAGE_SIZE (1 << QXL_PAGE_BITS);
+
 typedef struct PCIQXLDevice {
     PCIDevice          pci;
     SimpleSpiceDisplay ssd;
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/4 qxl: simplify qxl_rom_size

In reply to Gerd Hoffmann

Nowdays rom size is fixed at 8192 for live migration compat reasons. So we can ditch the pointless math trying to calculate the size needed. Also make the size sanity check fail at compile time not runtime.

---
 hw/display/qxl.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
hw/display/qxl.c +1 -3
index f0bfd2c..bcbf97a 100644
@@ -313,9 +313,7 @@ static ram_addr_t qxl_rom_size(void)
                                  sizeof(qxl_modes);
     uint32_t rom_size = 8192; /* two pages */
 
-    required_rom_size = MAX(required_rom_size, TARGET_PAGE_SIZE);
-    required_rom_size = msb_mask(required_rom_size * 2 - 1);
-    assert(required_rom_size <= rom_size);
+    QEMU_BUILD_BUG_ON(required_rom_size > rom_size);
     return rom_size;
 }
 
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH 3/4 qxl: simplify page dirtying

In reply to Gerd Hoffmann

No need to do target page size calculations here,
memory_region_set_dirty will care for us.

---
 hw/display/qxl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
hw/display/qxl.c +1 -2
index bcbf97a..ee2db0d 100644
@@ -414,9 +414,8 @@ static void qxl_ram_set_dirty(PCIQXLDevice *qxl, void *ptr)
     intptr_t offset;
 
     offset = ptr - base;
-    offset &= ~(TARGET_PAGE_SIZE-1);
     assert(offset < qxl->vga.vram_size);
-    qxl_set_dirty(&qxl->vga.vram, offset, offset + TARGET_PAGE_SIZE);
+    qxl_set_dirty(&qxl->vga.vram, offset, offset + 3);
 }
 
 /* can be called from spice server thread context */
Signature · 1 line
1.8.3.1
#4 lore raw

PATCH 4/4 qxl: compile only once

In reply to Gerd Hoffmann
---
 hw/display/Makefile.objs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
hw/display/Makefile.objs +1 -2
index 6e9fb3b..540df82 100644
@@ -31,5 +31,4 @@ obj-$(CONFIG_TCX) += tcx.o
 
 obj-$(CONFIG_VGA) += vga.o
 
-common-obj-$(CONFIG_QXL) += qxl-logger.o qxl-render.o
-obj-$(CONFIG_QXL) += qxl.o
+common-obj-$(CONFIG_QXL) += qxl.o qxl-logger.o qxl-render.o
Signature · 1 line
1.8.3.1