mirror of https://gitee.com/openkylin/qemu.git
virtio-gpu and vmsvga fixes.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJX17V0AAoJEEy22O7T6HE4eUwP/16ZMubqufAJjlp6YQQq3tex dbKfMMXwgAeMP0cXhsSTUCWhOJK8b6iuMefDmVEcOQoiTycH6REG8TcaiHpDmf0T 3FSphwbwfo6iBPXWnML7Maye9j8XH7Pn6UboSa/H4GzJysTWyOBc4KZCZ2wP3/Lk 4fwdZPfFkqy1zgY9N/yqR3PrmkOoDTL85y84YPVyPvYl/I06I60bmapU0+gxahiK kA7i3pSyoE3mggAWKCjffmBv0FTd15mcJSlmH0Zkc+rbY8mCBKZvT3YDzRWFPm38 m0q2kkDOxBTzA+f6cIM3AsLP44BIZZfOql+LntFSgk+JdTreOvqxHk6t9Acq8SWj 74Zfls6V9mB9xbcbA+gKU/hBkssGzPmHq5FKxipCwTUXx5XwJHBhxGT1hkOZ6J4L AjloGUVmXKG2IyruK8qqqeD8Egy8EMn3f6lm8ctVnv0cSoOS78nN5fR76jd102/u ZE6TW4EqfjEZ9OMcN9HN5hIqQo+mAIjOuasYX5KDE/u09v0dmRqBc/v2QL9l1CvJ 2rklEV7CiUbjkw1VNTYZfdZcJr6QjOBavZulPFFLWRiYbPg/jm5HzT/42e1f+Br6 iSGwZvGert1vD/pSbGmO6KCHDj0Kk04lAHSA6ImWaB6TkvPKN4b3JcvQIfclFRRq 5RTh6WrvfYWbDXbw9DZY =d+f6 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20160913-1' into staging virtio-gpu and vmsvga fixes. # gpg: Signature made Tue 13 Sep 2016 09:14:44 BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/pull-vga-20160913-1: virtio-vga: adapt to page-per-vq=off virtio-gpu-pci: tag as not hotpluggable vmsvga: correct bitmap and pixmap size checks Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
fa97012409
|
@ -48,6 +48,7 @@ static void virtio_gpu_pci_class_init(ObjectClass *klass, void *data)
|
|||
|
||||
set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
|
||||
dc->props = virtio_gpu_pci_properties;
|
||||
dc->hotpluggable = false;
|
||||
k->realize = virtio_gpu_pci_realize;
|
||||
pcidev_k->class_id = PCI_CLASS_DISPLAY_OTHER;
|
||||
}
|
||||
|
|
|
@ -122,6 +122,17 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
|
|||
*/
|
||||
vpci_dev->modern_mem_bar = 2;
|
||||
vpci_dev->msix_bar = 4;
|
||||
|
||||
if (!(vpci_dev->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ)) {
|
||||
/*
|
||||
* with page-per-vq=off there is no padding space we can use
|
||||
* for the stdvga registers. Make the common and isr regions
|
||||
* smaller then.
|
||||
*/
|
||||
vpci_dev->common.size /= 2;
|
||||
vpci_dev->isr.size /= 2;
|
||||
}
|
||||
|
||||
offset = memory_region_size(&vpci_dev->modern_bar);
|
||||
offset -= vpci_dev->notify.size;
|
||||
vpci_dev->notify.offset = offset;
|
||||
|
|
|
@ -676,11 +676,13 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
|
|||
cursor.bpp = vmsvga_fifo_read(s);
|
||||
|
||||
args = SVGA_BITMAP_SIZE(x, y) + SVGA_PIXMAP_SIZE(x, y, cursor.bpp);
|
||||
if (cursor.width > 256 ||
|
||||
cursor.height > 256 ||
|
||||
cursor.bpp > 32 ||
|
||||
SVGA_BITMAP_SIZE(x, y) > sizeof cursor.mask ||
|
||||
SVGA_PIXMAP_SIZE(x, y, cursor.bpp) > sizeof cursor.image) {
|
||||
if (cursor.width > 256
|
||||
|| cursor.height > 256
|
||||
|| cursor.bpp > 32
|
||||
|| SVGA_BITMAP_SIZE(x, y)
|
||||
> sizeof(cursor.mask) / sizeof(cursor.mask[0])
|
||||
|| SVGA_PIXMAP_SIZE(x, y, cursor.bpp)
|
||||
> sizeof(cursor.image) / sizeof(cursor.image[0])) {
|
||||
goto badcmd;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue