mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-08 16:07:39 -06:00
qxl: make sure we continue to run with a shared buffer
The qxl renderer works only with a shared displaysurface. So better make sure we actually have one and restore it when needed. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
0e2487bd6f
commit
a053f1b1fb
1 changed files with 12 additions and 1 deletions
|
@ -76,7 +76,14 @@ void qxl_render_update(PCIQXLDevice *qxl)
|
||||||
VGACommonState *vga = &qxl->vga;
|
VGACommonState *vga = &qxl->vga;
|
||||||
QXLRect dirty[32], update;
|
QXLRect dirty[32], update;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
int i;
|
int i, redraw = 0;
|
||||||
|
|
||||||
|
if (!is_buffer_shared(vga->ds->surface)) {
|
||||||
|
dprint(qxl, 1, "%s: restoring shared displaysurface\n", __func__);
|
||||||
|
qxl->guest_primary.resized++;
|
||||||
|
qxl->guest_primary.commands++;
|
||||||
|
redraw = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (qxl->guest_primary.resized) {
|
if (qxl->guest_primary.resized) {
|
||||||
qxl->guest_primary.resized = 0;
|
qxl->guest_primary.resized = 0;
|
||||||
|
@ -127,6 +134,10 @@ void qxl_render_update(PCIQXLDevice *qxl)
|
||||||
memset(dirty, 0, sizeof(dirty));
|
memset(dirty, 0, sizeof(dirty));
|
||||||
qxl_spice_update_area(qxl, 0, &update,
|
qxl_spice_update_area(qxl, 0, &update,
|
||||||
dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
|
dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
|
||||||
|
if (redraw) {
|
||||||
|
memset(dirty, 0, sizeof(dirty));
|
||||||
|
dirty[0] = update;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(dirty); i++) {
|
for (i = 0; i < ARRAY_SIZE(dirty); i++) {
|
||||||
if (qemu_spice_rect_is_empty(dirty+i)) {
|
if (qemu_spice_rect_is_empty(dirty+i)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue