aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Liguori <anthony@codemonkey.ws>2013-09-20 08:08:18 -0500
committerAnthony Liguori <anthony@codemonkey.ws>2013-09-20 08:08:18 -0500
commit2571f8f5fbaea5dc3bdcd84737f109b459576e90 (patch)
tree3691da9f2f6aa712a0a224aa466ce6d0a2e0a8ad
parentce63e9c258a05e344f81b28f2b995c530909a3f0 (diff)
parent521e759cf1ca05fc59a8653e48f18f830edbda7e (diff)
downloadqemu-2571f8f5fbaea5dc3bdcd84737f109b459576e90.zip
qemu-2571f8f5fbaea5dc3bdcd84737f109b459576e90.tar.gz
qemu-2571f8f5fbaea5dc3bdcd84737f109b459576e90.tar.bz2
Merge remote-tracking branch 'spice/spice.v74' into staging
# By Gerd Hoffmann # Via Gerd Hoffmann * spice/spice.v74: qxl: compile only once qxl: simplify page dirtying qxl: simplify qxl_rom_size qxl: define qxl operating on 4k pages Message-id: 1379583534-7831-1-git-send-email-kraxel@redhat.com
-rw-r--r--hw/display/Makefile.objs3
-rw-r--r--hw/display/qxl.c12
-rw-r--r--hw/display/qxl.h3
3 files changed, 9 insertions, 9 deletions
diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
index 6e9fb3b..540df82 100644
--- a/hw/display/Makefile.objs
+++ b/hw/display/Makefile.objs
@@ -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
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index c50e285..ee2db0d 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -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;
}
@@ -364,7 +362,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);
@@ -416,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 */
@@ -528,7 +525,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;
}
diff --git a/hw/display/qxl.h b/hw/display/qxl.h
index 8e9b0c2..84f0182 100644
--- a/hw/display/qxl.h
+++ b/hw/display/qxl.h
@@ -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;