ui/virtio-gpu: add and use qemu_create_displaysurface_pixman
commitca58b45fbee05ef7ed938abc5308548866335937
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 1 Apr 2016 08:27:20 +0000 (1 10:27 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 11 Apr 2016 10:32:01 +0000 (11 12:32 +0200)
tree0ec21105a310f00c14386d00b0434fd17fa25a0a
parent9628af036fade986dcc94f4484bc75c6b1a06d84
ui/virtio-gpu: add and use qemu_create_displaysurface_pixman

Add a the new qemu_create_displaysurface_pixman function, to create
a DisplaySurface backed by an existing pixman image.  In that case
there is no need to create a new pixman image pointing to the same
backing storage.  We can just use the existing image directly.

This does not only simplify things a bit, but most importantly it
gets the reference counting right, so the backing storage for the
pixman image wouldn't be released underneath us.

Use new function in virtio-gpu, where using it actually fixes
use-after-free crashes.

Cc: qemu-stable@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1459499240-742-1-git-send-email-kraxel@redhat.com
hw/display/virtio-gpu.c
include/ui/console.h
trace-events
ui/console.c