add virtio-gpu
cover add virtio-gpu
Hi,
Initial batch of virtio-gpu patches, covering 2D support.
Patch to the virtio spec has been sent to virtio-dev yesterday, a formated version can be found here:
https://www.kraxel.org/virtio/
What is the virtio 1.0 state btw? Specs are final, do we have qemu/kernel patches somewhere meanwhile?
please review,
Gerd
Gerd Hoffmann (8):
virtio-gpu/2d: add hardware spec include file virtio-gpu/2d: add virtio gpu core code
virtio-gpu-pci: add virtio pci support
virtio-vga: add virtio gpu device with vga compatibility
virtio-vga: add '-vga virtio' support
virtio-vga: add vgabios configuration
virtio-vga: add vgabios binary
virtio-gpu: add to display-vga test
Makefile | 2 +- default-configs/x86_64-softmmu.mak | 3 + hw/display/Makefile.objs | 4 + hw/display/virtio-gpu-pci.c | 80 ++++ hw/display/virtio-gpu.c | 863 +++++++++++++++++++++++++++++++++++++ hw/display/virtio-vga.c | 169 ++++++++ hw/pci/pci.c | 2 + hw/virtio/virtio-pci.h | 15 + include/hw/pci/pci.h | 1 + include/hw/virtio/virtgpu_hw.h | 207 +++++++++ include/hw/virtio/virtio-gpu.h | 147 +++++++ include/sysemu/sysemu.h | 2 +- pc-bios/vgabios-virtio.bin | Bin 0 -> 37376 bytes roms/Makefile | 2 +- roms/config.vga-virtio | 6 + tests/Makefile | 3 + tests/display-vga-test.c | 18 + trace-events | 14 + vl.c | 13 + 19 files changed, 1548 insertions(+), 3 deletions(-) create mode 100644 hw/display/virtio-gpu-pci.c create mode 100644 hw/display/virtio-gpu.c create mode 100644 hw/display/virtio-vga.c create mode 100644 include/hw/virtio/virtgpu_hw.h create mode 100644 include/hw/virtio/virtio-gpu.h create mode 100644 pc-bios/vgabios-virtio.bin create mode 100644 roms/config.vga-virtio
Signature · 1 line
1.8.3.1
PATCH 1/8 virtio-gpu/2d: add hardware spec include file
This patch adds the header file with structs and defines for the virtio based gpu device. Covers 2d operations only.
Written by Dave Airlie and Gerd Hoffmann.
--- include/hw/virtio/virtgpu_hw.h | 207 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 include/hw/virtio/virtgpu_hw.h
include/hw/virtio/virtgpu_hw.h new file +207 -0
@@ -0,0 +1,207 @@ +/* +* Virtio GPU Device +* +* Copyright Red Hat, Inc. 2013-2014 +* +* Authors: +* Dave Airlie <[email protected]> +* Gerd Hoffmann <[email protected]> +* +* This header is BSD licensed so anyone can use the definitions +* to implement compatible drivers/servers: +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* 1. Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* 3. Neither the name of IBM nor the names of its contributors +* may be used to endorse or promote products derived from this software +* without specific prior written permission. +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +* SUCH DAMAGE. +*/ + +#ifndef VIRTIO_GPU_HW_H +#define VIRTIO_GPU_HW_H + +enum virtio_gpu_ctrl_type { +VIRTIO_GPU_UNDEFINED =0 , + +/* 2d commands */ +VIRTIO_GPU_CMD_GET_DISPLAY_INFO =0x0100 , +VIRTIO_GPU_CMD_RESOURCE_CREATE_2D , +VIRTIO_GPU_CMD_RESOURCE_UNREF , +VIRTIO_GPU_CMD_SET_SCANOUT , +VIRTIO_GPU_CMD_RESOURCE_FLUSH , +VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D , +VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING , +VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING , + +/* cursor commands */ +VIRTIO_GPU_CMD_UPDATE_CURSOR =0x0300 , +VIRTIO_GPU_CMD_MOVE_CURSOR , + +/* success responses */ +VIRTIO_GPU_RESP_OK_NODATA =0x1100 , +VIRTIO_GPU_RESP_OK_DISPLAY_INFO , + +/* error responses */ +VIRTIO_GPU_RESP_ERR_UNSPEC =0x1200 , +VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY , +VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID , +VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID , +VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID , +VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER , +}; + +#define VIRTIO_GPU_FLAG_FENCE (1 << 0) + +struct virtio_gpu_ctrl_hdr { +uint32_t type; +uint32_t flags; +uint64_t fence_id; +uint32_t ctx_id; +uint32_t padding; +}; + +/* data passed in the cursor vq */ + +struct virtio_gpu_cursor_pos { +uint32_t scanout_id; +uint32_t x; +uint32_t y; +uint32_t padding; +}; + +/* VIRTIO_GPU_CMD_UPDATE_CURSOR, VIRTIO_GPU_CMD_MOVE_CURSOR */ +struct virtio_gpu_update_cursor { +struct virtio_gpu_ctrl_hdr hdr; +struct virtio_gpu_cursor_pos pos;/* update & move */ +uint32_t resource_id;/* update only */ +uint32_t hot_x;/* update only */ +uint32_t hot_y;/* update only */ +uint32_t padding; +}; + +/* data passed in the control vq, 2d related */ + +/* VIRTIO_GPU_CMD_RESOURCE_UNREF */ +struct virtio_gpu_resource_unref { +struct virtio_gpu_ctrl_hdr hdr; +uint32_t resource_id; +uint32_t padding; +}; + +/* VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: create a 2d resource with a format */ +struct virtio_gpu_resource_create_2d { +struct virtio_gpu_ctrl_hdr hdr; +uint32_t resource_id; +uint32_t format; +uint32_t width; +uint32_t height; +}; + +/* VIRTIO_GPU_CMD_SET_SCANOUT */ +struct virtio_gpu_set_scanout { +struct virtio_gpu_ctrl_hdr hdr; +uint32_t scanout_id; +uint32_t resource_id; +uint32_t width; +uint32_t height; +uint32_t x; +uint32_t y; +}; + +/* VIRTIO_GPU_CMD_RESOURCE_FLUSH */ +struct virtio_gpu_resource_flush { +struct virtio_gpu_ctrl_hdr hdr; +uint32_t resource_id; +uint32_t width; +uint32_t height; +uint32_t x; +uint32_t y; +uint32_t padding; +}; + +/* VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: simple transfer to_host */ +struct virtio_gpu_transfer_to_host_2d { +struct virtio_gpu_ctrl_hdr hdr; +uint32_t resource_id; +uint32_t offset; +uint32_t width; +uint32_t height; +uint32_t x; +uint32_t y; +}; + +struct virtio_gpu_mem_entry { +uint64_t addr; +uint32_t length; +uint32_t pad; +}; + +/* VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING */ +struct virtio_gpu_resource_attach_backing { +struct virtio_gpu_ctrl_hdr hdr; +uint32_t resource_id; +uint32_t nr_entries; +}; + +/* VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING */ +struct virtio_gpu_resource_detach_backing { +struct virtio_gpu_ctrl_hdr hdr; +uint32_t resource_id; +uint32_t padding; +}; + +/* VIRTIO_GPU_RESP_OK_DISPLAY_INFO */ +#define VIRTIO_GPU_MAX_SCANOUTS 16 +struct virtio_gpu_resp_display_info { +struct virtio_gpu_ctrl_hdr hdr; +struct virtio_gpu_display_one { +uint32_t enabled; +uint32_t width; +uint32_t height; +uint32_t x; +uint32_t y; +uint32_t flags; + } pmodes[VIRTIO_GPU_MAX_SCANOUTS ]; +}; + +#define VIRTIO_GPU_EVENT_DISPLAY (1 << 0) + +struct virtio_gpu_config { +uint32_t events_read; +uint32_t events_clear; +uint32_t num_scanouts; +uint32_t reserved; +}; + +/* simple formats for fbcon/X use */ +enum virtio_gpu_formats { +VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM =1 , +VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM =2 , +VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM =3 , +VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM =4 , + +VIRTIO_GPU_FORMAT_B5G5R5A1_UNORM =5 , +VIRTIO_GPU_FORMAT_B5G6R5_UNORM =7 , + +VIRTIO_GPU_FORMAT_R8_UNORM =64 , +}; + +#endif
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file
Hi Dave,
Triggered by the framebuffer endian issues we have with stdvga I've started to check where we stand with virtio-gpu and whenever we have to fix something in the virtio protocol before setting in stone with the upstream merge.
Fixed the protocol. Basically s/uint32_t/__le32/g. No changes on x86_64 obviously.
Fixed the kernel driver to byteswap values when needed. See
https://www.kraxel.org/cgit/linux/log/?h=virtio-gpu-rebase
Result is bigendian guest on little endian host boots fine (without virgl). Colors are wrong though. Other way around still needs a bunch of fixes in qemu so virtio-gpu works correctly on bigendian hosts. To be done.
So, on the color issue: How are these defined exactly?
include/hw/virtio/virtgpu_hw.h line 199
Quoted 4 lines
include/hw/virtio/virtgpu_hw.h new file +4
-0+VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM =1 , +VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM =2 , +VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM =3 , + VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM = 4,
Looking at the code it seems the name defines the byte ordering in memory, i.e. "B8G8R8A8" means blue first, then red, then green, then alpha. Or DRM_FORMAT_ARGB8888 on little endian / DRM_FORMAT_BGRX8888 on big endian. Correct? Easy fix in the guest driver then ...
include/hw/virtio/virtgpu_hw.h line 202
Quoted 2 lines
include/hw/virtio/virtgpu_hw.h new file +2
-0+VIRTIO_GPU_FORMAT_B5G5R5A1_UNORM =5 , + VIRTIO_GPU_FORMAT_B5G6R5_UNORM = 7,
Do we really wanna go down this route? I'm inclined to just zap 16bpp support.
Quoted 1 line
+
VIRTIO_GPU_FORMAT_R8_UNORM= 64,
What is this btw? Looks like gray or alpha, but why "R8" not "G8" or "A8" then? Why the gap in the enumeration?
With the formats being clarified fixed we are settled for 2d mode I think.
What about 3d mode? We are passing blobs between virglrenderer and guest driver: capabilities and gallium 3d command stream. What happens to them in case host and guest endianness don't match? I think at least the capabilities have 32bit values which need to be swapped. Dunno about the gallium commands ...
cheers,
Gerd
Re: [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file
Quoted 4 lines
Triggered by the framebuffer endian issues we have with stdvga I've started to check where we stand with virtio-gpu and whenever we have to fix something in the virtio protocol before setting in stone with the upstream merge.
Let me start by saying its not that I don't care about endianness, but its a mess I had hoped to avoid until someone else care more about it.
We haven't even managed to get endianness fixed for real 3D gpu hardware yet,
We sort of have decent endianness support for the llvmpipe sw driver now, after I spent a week trawling patches and fixing up the results.
So before we try fixing things, we probably need to design something that defines
where all the swapping happens, and what formats the virgl "hw" device supports. The main problem is getting an efficient solution that avoids double swapping of the major items like texture and vertex data if we can in some scenarios.
Currently the virgl "hw" supports little endian defined formats, as per the gallium
interface, i.e. B8G8R8A8 means blue/red/green/alpha,
http://gallium.readthedocs.org/en/latest/format.html
is the documentation.
Quoted 6 lines
include/hw/virtio/virtgpu_hw.h line 202
Quoted 3 lines
include/hw/virtio/virtgpu_hw.h new file +2
-0+VIRTIO_GPU_FORMAT_B5G5R5A1_UNORM =5 , + VIRTIO_GPU_FORMAT_B5G6R5_UNORM = 7,Do we really wanna go down this route? I'm inclined to just zap 16bpp support.
We have to support 16bpp as an OpenGL format no matter what, and this is why endianness sucks, we have lots of strange ass formats we need to send over the wire, that have no nicely defined endianness, like Z24S8.
Quoted 5 lines
Quoted 2 lines
+
VIRTIO_GPU_FORMAT_R8_UNORM= 64,What is this btw? Looks like gray or alpha, but why "R8" not "G8" or "A8" then? Why the gap in the enumeration?
Red 8, the enumeration is taken from the gallium formats list, rather than reinventing our own. Most modern GPU hardware doesn't really have A8 texture support, as it was deprecated in newer OpenGL.
Quoted 6 lines
What about 3d mode? We are passing blobs between virglrenderer and guest driver: capabilities and gallium 3d command stream. What happens to them in case host and guest endianness don't match? I think at least the capabilities have 32bit values which need to be swapped. Dunno about the gallium commands ...
For 3D we probably need to define the gallium command streams to be little endian, however the big problem is the data that is stored inside objects.
Texture and vertex, constants, indices etc. How do we decide to swap these, when do we swap things, on the DMA transfers to the host, do we just swap the formats on the host side etc.
I probably need to spend some time working this out with BenH, but I'm not really sure how we can avoid backing ourselves into a large inefficent hole at some point.
Dave.
Re: [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file
Quoted 7 lines · Dave Airlie
Quoted 4 lines
Triggered by the framebuffer endian issues we have with stdvga I've started to check where we stand with virtio-gpu and whenever we have to fix something in the virtio protocol before setting in stone with the upstream merge.
Let me start by saying its not that I don't care about endianness, but its a mess I had hoped to avoid until someone else care more about it.
Understood. It's a big mess indeed.
Quoted 3 lines
So before we try fixing things, we probably need to design something that defines
where all the swapping happens, and what formats the virgl "hw" device supports.
2D case is easy. Everything is little endian. kernel driver / qemu are doing the byteswaps for the structs sent over the control pipe.
Problem with 3D is that both qemu and kernel driver passing through data where they don't even know what is inside, so they can't do the byteswapping.
Quoted 2 lines
The main problem is getting an efficient solution that avoids double swapping of the major items like texture and vertex data if we can in some scenarios.
Yes.
Quoted 7 lines
Currently the virgl "hw" supports little endian defined formats, as per the gallium
interface, i.e. B8G8R8A8 means blue/red/green/alpha,http://gallium.readthedocs.org/en/latest/format.html
is the documentation.
Thanks.
Quoted 9 lines
Quoted 5 lines
include/hw/virtio/virtgpu_hw.h line 202
Quoted 2 lines
include/hw/virtio/virtgpu_hw.h new file +2
-0+VIRTIO_GPU_FORMAT_B5G5R5A1_UNORM =5 , + VIRTIO_GPU_FORMAT_B5G6R5_UNORM = 7,Do we really wanna go down this route? I'm inclined to just zap 16bpp support.
We have to support 16bpp as an OpenGL format no matter what, and this is why endianness sucks, we have lots of strange ass formats we need to send over the wire, that have no nicely defined endianness, like Z24S8.
Ok. But for 2D we can just not support it, right?
Quoted 13 lines
Quoted 5 lines
What about 3d mode? We are passing blobs between virglrenderer and guest driver: capabilities and gallium 3d command stream. What happens to them in case host and guest endianness don't match? I think at least the capabilities have 32bit values which need to be swapped. Dunno about the gallium commands ...
For 3D we probably need to define the gallium command streams to be little endian, however the big problem is the data that is stored inside objects.
Texture and vertex, constants, indices etc. How do we decide to swap these, when do we swap things, on the DMA transfers to the host, do we just swap the formats on the host side etc.
Quoted 3 lines
I probably need to spend some time working this out with BenH, but I'm not really sure how we can avoid backing ourselves into a large inefficent hole at some point.
I surely don't wanna go down that route, and I think it is reasonable to just not support 3D/virgl mode if we would have to swap data.
So, we could define *two* virgl feature bits. One for little endian, one for bigendian. endianness applies to the gallium command stream and to gallium formats using integers in host endianess.
On the host side we'll go set the feature bit matching host endianness. qemu handles the virtqueue command struct swapping, and virglrenderer should only see native endian.
On the guest side we'll look for the feature bit matching guest endianness, and if it isn't set due to guest + host having different byte order you'll get 2D support only.
The endianness negotiation is a bit iffy, but that way it is possible to have virgl on bigendian without swapping everything twice.
The other reasonable way would be to simply define virgl being little endian. Bigendian guests / hosts would either simply not support 3D then, or implement swapping. But in the bigendian-guest on bigendian-host case we'll swap everything twice then ...
cheers,
Gerd
Re: [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file
In reply to Dave AirlieQuoted 7 lines · Dave Airlie
Quoted 4 lines
Triggered by the framebuffer endian issues we have with stdvga I've started to check where we stand with virtio-gpu and whenever we have to fix something in the virtio protocol before setting in stone with the upstream merge.
Let me start by saying its not that I don't care about endianness, but its a mess I had hoped to avoid until someone else care more about it.
Understood. It's a big mess indeed.
Quoted 3 lines
So before we try fixing things, we probably need to design something that defines
where all the swapping happens, and what formats the virgl "hw" device supports.
2D case is easy. Everything is little endian. kernel driver / qemu are doing the byteswaps for the structs sent over the control pipe.
Problem with 3D is that both qemu and kernel driver passing through data where they don't even know what is inside, so they can't do the byteswapping.
Quoted 2 lines
The main problem is getting an efficient solution that avoids double swapping of the major items like texture and vertex data if we can in some scenarios.
Yes.
Quoted 7 lines
Currently the virgl "hw" supports little endian defined formats, as per the gallium
interface, i.e. B8G8R8A8 means blue/red/green/alpha,http://gallium.readthedocs.org/en/latest/format.html
is the documentation.
Thanks.
Quoted 9 lines
Quoted 5 lines
include/hw/virtio/virtgpu_hw.h line 202
Quoted 2 lines
include/hw/virtio/virtgpu_hw.h new file +2
-0+VIRTIO_GPU_FORMAT_B5G5R5A1_UNORM =5 , + VIRTIO_GPU_FORMAT_B5G6R5_UNORM = 7,Do we really wanna go down this route? I'm inclined to just zap 16bpp support.
We have to support 16bpp as an OpenGL format no matter what, and this is why endianness sucks, we have lots of strange ass formats we need to send over the wire, that have no nicely defined endianness, like Z24S8.
Ok. But for 2D we can just not support it, right?
Quoted 13 lines
Quoted 5 lines
What about 3d mode? We are passing blobs between virglrenderer and guest driver: capabilities and gallium 3d command stream. What happens to them in case host and guest endianness don't match? I think at least the capabilities have 32bit values which need to be swapped. Dunno about the gallium commands ...
For 3D we probably need to define the gallium command streams to be little endian, however the big problem is the data that is stored inside objects.
Texture and vertex, constants, indices etc. How do we decide to swap these, when do we swap things, on the DMA transfers to the host, do we just swap the formats on the host side etc.
Quoted 3 lines
I probably need to spend some time working this out with BenH, but I'm not really sure how we can avoid backing ourselves into a large inefficent hole at some point.
I surely don't wanna go down that route, and I think it is reasonable to just not support 3D/virgl mode if we would have to swap data.
So, we could define *two* virgl feature bits. One for little endian, one for bigendian. endianness applies to the gallium command stream and to gallium formats using integers in host endianess.
On the host side we'll go set the feature bit matching host endianness. qemu handles the virtqueue command struct swapping, and virglrenderer should only see native endian.
On the guest side we'll look for the feature bit matching guest endianness, and if it isn't set due to guest + host having different byte order you'll get 2D support only.
The endianness negotiation is a bit iffy, but that way it is possible to have virgl on bigendian without swapping everything twice.
The other reasonable way would be to simply define virgl being little endian. Bigendian guests / hosts would either simply not support 3D then, or implement swapping. But in the bigendian-guest on bigendian-host case we'll swap everything twice then ...
cheers,
Gerd
Re: [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file
Quoted 41 lines · Gerd Hoffmann
Quoted 7 lines · Dave Airlie
Quoted 4 lines
Triggered by the framebuffer endian issues we have with stdvga I've started to check where we stand with virtio-gpu and whenever we have to fix something in the virtio protocol before setting in stone with the upstream merge.
Let me start by saying its not that I don't care about endianness, but its a mess I had hoped to avoid until someone else care more about it.
Understood. It's a big mess indeed.
Quoted 3 lines
So before we try fixing things, we probably need to design something that defines
where all the swapping happens, and what formats the virgl "hw" device supports.2D case is easy. Everything is little endian. kernel driver / qemu are doing the byteswaps for the structs sent over the control pipe.
Problem with 3D is that both qemu and kernel driver passing through data where they don't even know what is inside, so they can't do the byteswapping.
Quoted 2 lines
The main problem is getting an efficient solution that avoids double swapping of the major items like texture and vertex data if we can in some scenarios.
Yes.
Quoted 7 lines
Currently the virgl "hw" supports little endian defined formats, as per the gallium
interface, i.e. B8G8R8A8 means blue/red/green/alpha,http://gallium.readthedocs.org/en/latest/format.html
is the documentation.Thanks.
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
include/hw/virtio/virtgpu_hw.h new file +2
-0+VIRTIO_GPU_FORMAT_B5G5R5A1_UNORM =5 , + VIRTIO_GPU_FORMAT_B5G6R5_UNORM = 7,
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Do we really wanna go down this route? I'm inclined to just zap 16bpp support.
We have to support 16bpp as an OpenGL format no matter what, and this is why endianness sucks, we have lots of strange ass formats we need to send over the wire, that have no nicely defined endianness, like Z24S8.
Ok. But for 2D we can just not support it, right?
We can, I expect some pushback at some point, people still want to test with 16bpp
for other areas, and it would be nice to know they can. But I don't really care about it personally. I just though we should provide at least a basic number of working
bpps (8,16,32).
Quoted 13 lines
Quoted 13 lines
Quoted 5 lines
What about 3d mode? We are passing blobs between virglrenderer and guest driver: capabilities and gallium 3d command stream. What happens to them in case host and guest endianness don't match? I think at least the capabilities have 32bit values which need to be swapped. Dunno about the gallium commands ...
For 3D we probably need to define the gallium command streams to be little endian, however the big problem is the data that is stored inside objects.
Texture and vertex, constants, indices etc. How do we decide to swap these, when do we swap things, on the DMA transfers to the host, do we just swap the formats on the host side etc.
Quoted 6 lines
Quoted 3 lines
I probably need to spend some time working this out with BenH, but I'm not really sure how we can avoid backing ourselves into a large inefficent hole at some point.
I surely don't wanna go down that route, and I think it is reasonable to just not support 3D/virgl mode if we would have to swap data.
I think initially not support 3D mode is the way to go until we can work it out.
Quoted 14 lines
So, we could define *two* virgl feature bits. One for little endian, one for bigendian. endianness applies to the gallium command stream and to gallium formats using integers in host endianess.
On the host side we'll go set the feature bit matching host endianness. qemu handles the virtqueue command struct swapping, and virglrenderer should only see native endian.
On the guest side we'll look for the feature bit matching guest endianness, and if it isn't set due to guest + host having different byte order you'll get 2D support only.
Quoted 9 lines
The endianness negotiation is a bit iffy, but that way it is possible to have virgl on bigendian without swapping everything twice.
The other reasonable way would be to simply define virgl being little endian. Bigendian guests / hosts would either simply not support 3D then, or implement swapping. But in the bigendian-guest on bigendian-host case we'll swap everything twice then ...
I think we should probably move a few more formats from the 3D side into the 2D side, so we can have the guests just pick the LE format it requires
http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/include/pipe/p_format.h#n354
is what gallium currently does, and we could just provide XRGB, XBGR formats in both endianness
and have the guest pick the one it wants to use.
The 2D pixman code would need updating to provide 2D support for these formats as well.
I suspect I could add an endian cap for the 3D bits that I could pass through from guest to host.
How do you test guests with big endian? Isn't it really slow?
Dave.
Re: [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file
Hi,
Quoted 9 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
include/hw/virtio/virtgpu_hw.h line 202
Quoted 2 lines
include/hw/virtio/virtgpu_hw.h new file +2
-0+VIRTIO_GPU_FORMAT_B5G5R5A1_UNORM =5 , + VIRTIO_GPU_FORMAT_B5G6R5_UNORM = 7,Ok. But for 2D we can just not support it, right?
We can, I expect some pushback at some point, people still want to test with 16bpp for other areas, and it would be nice to know they can. But I don't really care about it personally. I just though we should provide at least a basic number of working bpps (8,16,32).
Lets try to get away with 32bpp only in 2d mode then.
bochsdrm likewise supports 32bpp only and I yet have to see a request for 16bpp or even 8bpp support.
Quoted 9 lines
I think we should probably move a few more formats from the 3D side into the 2D side, so we can have the guests just pick the LE format it requires
http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/include/pipe/p_format.h#n354
is what gallium currently does, and we could just provide XRGB, XBGR formats in both endianness
and have the guest pick the one it wants to use.
PIPE_FORMAT_R8G8B8A8_UNORM = 67,
PIPE_FORMAT_X8B8G8R8_UNORM = 68,
PIPE_FORMAT_A8B8G8R8_UNORM = 121,
PIPE_FORMAT_R8G8B8X8_UNORM = 134,
With the last two ones being in a /* TODO: re-order these */ block. How stable are these numbers?
Quoted 2 lines
The 2D pixman code would need updating to provide 2D support for these formats as well.
Yep. Mapping the 32bpp formats to pixmap formats is easy.
Quoted 2 lines
I suspect I could add an endian cap for the 3D bits that I could pass through from guest to host.
I was thinking about using virtio feature bit. Advantage is that the guest will tell the host which features it'll use.
Initially this doesn't matter much as the host will support only one endianness anyway.
But in case we get the byteswapping work reasonable well some day and the host supports both be and le virgl we'll know that way which endianness the guest is using.
Quoted 1 line
How do you test guests with big endian? Isn't it really slow?
emulated pseries machine with fedora ppc64. Yes, it is slow. Building a kernel with virtio-gpu driver takes a day or so.
cheers,
Gerd
Re: [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file
Quoted 16 lines
Lets try to get away with 32bpp only in 2d mode then.
bochsdrm likewise supports 32bpp only and I yet have to see a request for 16bpp or even 8bpp support.
Quoted 9 lines
I think we should probably move a few more formats from the 3D side into the 2D side, so we can have the guests just pick the LE format it requires
http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/include/pipe/p_format.h#n354
is what gallium currently does, and we could just provide XRGB, XBGR formats in both endianness
and have the guest pick the one it wants to use.
Quoted 8 lines
PIPE_FORMAT_R8G8B8A8_UNORM = 67, PIPE_FORMAT_X8B8G8R8_UNORM = 68, PIPE_FORMAT_A8B8G8R8_UNORM = 121, PIPE_FORMAT_R8G8B8X8_UNORM = 134,With the last two ones being in a /* TODO: re-order these */ block. How stable are these numbers?
In theory the mesa/gallium numbers aren't stable, though I've never seen them change yet,
If they diverge in the future I'll just provide a remapping table inside the guest driver.
So it should be fine to expose these formats for 2D use.
Quoted 11 lines
Initially this doesn't matter much as the host will support only one endianness anyway.
But in case we get the byteswapping work reasonable well some day and the host supports both be and le virgl we'll know that way which endianness the guest is using.
Quoted 1 line
How do you test guests with big endian? Isn't it really slow?
emulated pseries machine with fedora ppc64. Yes, it is slow. Building a kernel with virtio-gpu driver takes a day or so.
I spent a little while trying to get a ppc64 f20 install to complete, just using the F20 qemu ppc64 system package but hit a bug I
think is related to missing SIMD instructions, so I'm not sure how best to move forward with getting a test platform here.
Dave.
Re: [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file
Hi,
Quoted 9 lines
Quoted 1 line
How stable are these numbers?
In theory the mesa/gallium numbers aren't stable, though I've never seen them change yet,
If they diverge in the future I'll just provide a remapping table inside the guest driver.
So it should be fine to expose these formats for 2D use.
Good.
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
How do you test guests with big endian? Isn't it really slow?
emulated pseries machine with fedora ppc64. Yes, it is slow. Building a kernel with virtio-gpu driver takes a day or so.
I spent a little while trying to get a ppc64 f20 install to complete, just using the F20 qemu ppc64 system package but hit a bug I
think is related to missing SIMD instructions, so I'm not sure how best to move forward with getting a test platform here.
I'm using self-compiled qemu 2.1 which works fine, so it looks like this issue has been fixed meanwhile.
If you want something newer without manually building it you can try the virt-preview repo (see
https://fedoraproject.org/wiki/Virtualization_Preview_Repository).
cheers,
Gerd
Re: [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file
In reply to Gerd HoffmannHi,
include/hw/virtio/virtgpu_hw.h line 182
Quoted 12 lines
include/hw/virtio/virtgpu_hw.h new file +12
-0+/* VIRTIO_GPU_RESP_OK_DISPLAY_INFO */ +#define VIRTIO_GPU_MAX_SCANOUTS 16 +struct virtio_gpu_resp_display_info { +struct virtio_gpu_ctrl_hdr hdr; +struct virtio_gpu_display_one { +uint32_t enabled; +uint32_t width; +uint32_t height; +uint32_t x; +uint32_t y; +uint32_t flags; + } pmodes[VIRTIO_GPU_MAX_SCANOUTS ];
One more thing: I think it would be a good idea to add the display resolution here. We start seeing highres displays on desktops, and the guest should know whenever the host display runs at 100 or 300 dpi ...
What do you think?
cheers,
Gerd
Re: [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file
Quoted 19 lines · Gerd Hoffmann
Hi,
include/hw/virtio/virtgpu_hw.h line 182
Quoted 12 lines
include/hw/virtio/virtgpu_hw.h new file +12
-0+/* VIRTIO_GPU_RESP_OK_DISPLAY_INFO */ +#define VIRTIO_GPU_MAX_SCANOUTS 16 +struct virtio_gpu_resp_display_info { +struct virtio_gpu_ctrl_hdr hdr; +struct virtio_gpu_display_one { +uint32_t enabled; +uint32_t width; +uint32_t height; +uint32_t x; +uint32_t y; +uint32_t flags; + } pmodes[VIRTIO_GPU_MAX_SCANOUTS ];One more thing: I think it would be a good idea to add the display resolution here. We start seeing highres displays on desktops, and the guest should know whenever the host display runs at 100 or 300 dpi ...
Quoted 1 line
What do you think?
Passing host display side into the guest isn't going to help, unless you are running in full screen,
I suppose the guest could adjust the numbers, but what happens with viewers, if I connect on a hidpi and move to a lodpi screen.
I think this would require a lot more thought in how it would work in some use-cases.
That said reserving 2 32 bit fields for possible screen measurements might future proof things a little, though most OSes use EDID to detect this sort of thing, so we might not find a great use for it later.
Dave.
PATCH 2/8 virtio-gpu/2d: add virtio gpu core code
In reply to Gerd HoffmannThis patch adds the core code for virtio gpu emulation, covering 2d support.
Written by Dave Airlie and Gerd Hoffmann.
--- default-configs/x86_64-softmmu.mak | 1 + hw/display/Makefile.objs | 2 + hw/display/virtio-gpu.c | 863 +++++++++++++++++++++++++++++++++++++ include/hw/virtio/virtio-gpu.h | 147 +++++++ trace-events | 14 + 5 files changed, 1027 insertions(+) create mode 100644 hw/display/virtio-gpu.c create mode 100644 include/hw/virtio/virtio-gpu.h
default-configs/x86_64-softmmu.mak +1 -0
@@ -9,6 +9,7 @@ CONFIG_VGA_PCI=y CONFIG_VGA_ISA=y CONFIG_VGA_CIRRUS=y CONFIG_VMWARE_VGA=y +CONFIG_VIRTIO_GPU=y CONFIG_VMMOUSE=y CONFIG_SERIAL=y CONFIG_PARALLEL=y
hw/display/Makefile.objs +2 -0
@@ -33,3 +33,5 @@ obj-$(CONFIG_CG3) += cg3.o obj-$(CONFIG_VGA) += vga.o common-obj-$(CONFIG_QXL) += qxl.o qxl-logger.o qxl-render.o + +obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu.o
hw/display/virtio-gpu.c new file +863 -0
863 lines not on this page · raw message
include/hw/virtio/virtio-gpu.h new file +147 -0
147 lines not on this page · raw message
trace-events +14 -0
@@ -1083,6 +1083,20 @@ vmware_scratch_read(uint32_t index, uint32_t value) "index %d, value 0x%x" vmware_scratch_write(uint32_t index, uint32_t value) "index %d, value 0x%x" vmware_setmode(uint32_t w, uint32_t h, uint32_t bpp) "%dx%d @ %d bpp" +# hw/display/virtio-gpu.c +virtio_gpu_cmd_get_display_info(void) "" +virtio_gpu_cmd_get_caps(void) "" +virtio_gpu_cmd_set_scanout(uint32_t id, uint32_t res, uint32_t w, uint32_t h, uint32_t x, uint32_t y) "id %d, res 0x%x, w %d, h %d, x %d, y %d" +virtio_gpu_cmd_res_create_2d(uint32_t res, uint32_t fmt, uint32_t w, uint32_t h) "res 0x%x, fmt 0x%x, w %d, h %d" +virtio_gpu_cmd_res_create_3d(uint32_t res, uint32_t fmt, uint32_t w, uint32_t h, uint32_t d) "res 0x%x, fmt 0x%x, w %d, h %d, d %d" +virtio_gpu_cmd_res_unref(uint32_t res) "res 0x%x" +virtio_gpu_cmd_res_back_attach(uint32_t res) "res 0x%x" +virtio_gpu_cmd_res_back_detach(uint32_t res) "res 0x%x" +virtio_gpu_cmd_res_xfer_toh_2d(uint32_t res) "res 0x%x" +virtio_gpu_cmd_res_flush(uint32_t res, uint32_t w, uint32_t h, uint32_t x, uint32_t y) "res 0x%x, w %d, h %d, x %d, y %d" +virtio_gpu_fence_ctrl(uint64_t fence, uint32_t type) "fence 0x%" PRIx64 ", type 0x%x" +virtio_gpu_fence_resp(uint64_t fence) "fence 0x%" PRIx64 + # savevm.c savevm_section_start(const char *id, unsigned int section_id) "%s, section_id %u" savevm_section_end(const char *id, unsigned int section_id) "%s, section_id %u"
Signature · 1 line
1.8.3.1
PATCH 3/8 virtio-gpu-pci: add virtio pci support
In reply to Gerd HoffmannThis patch adds virtio-gpu-pci, which is the pci proxy for the virtio gpu device. With this patch in place virtio-gpu is functional. You need a linux guest with a virtio-gpu driver though, and output will appear pretty late in boot, once the kernel initialized drm and fbcon.
Written by Dave Airlie and Gerd Hoffmann.
--- default-configs/x86_64-softmmu.mak | 1 + hw/display/Makefile.objs | 1 + hw/display/virtio-gpu-pci.c | 80 ++++++++++++++++++++++++++++++++++++++ hw/virtio/virtio-pci.h | 15 +++++++ include/hw/pci/pci.h | 1 + 5 files changed, 98 insertions(+) create mode 100644 hw/display/virtio-gpu-pci.c
default-configs/x86_64-softmmu.mak +1 -0
@@ -10,6 +10,7 @@ CONFIG_VGA_ISA=y CONFIG_VGA_CIRRUS=y CONFIG_VMWARE_VGA=y CONFIG_VIRTIO_GPU=y +CONFIG_VIRTIO_GPU_PCI=y CONFIG_VMMOUSE=y CONFIG_SERIAL=y CONFIG_PARALLEL=y
hw/display/Makefile.objs +1 -0
@@ -35,3 +35,4 @@ obj-$(CONFIG_VGA) += vga.o common-obj-$(CONFIG_QXL) += qxl.o qxl-logger.o qxl-render.o obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu.o +obj-$(CONFIG_VIRTIO_GPU_PCI) += virtio-gpu-pci.o
hw/display/virtio-gpu-pci.c new file +80 -0
80 lines not on this page · raw message
hw/virtio/virtio-pci.h +15 -0
@@ -24,6 +24,7 @@#include "hw/virtio/virtio-balloon.h" #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-9p.h" +#include "hw/virtio/virtio-gpu.h" #ifdef CONFIG_VIRTFS #include "hw/9pfs/virtio-9p.h" #endif
@@ -39,6 +40,7 @@ typedef struct VirtIOSerialPCI VirtIOSerialPCI;typedef struct VirtIONetPCI VirtIONetPCI ;typedef struct VHostSCSIPCI VHostSCSIPCI ;typedef struct VirtIORngPCI VirtIORngPCI ; +typedef struct VirtIOGPUPCI VirtIOGPUPCI ;/* virtio-pci-bus */
@@ -198,6 +200,19 @@ struct VirtIORngPCI {VirtIORNG vdev; }; +/* +* virtio-gpu-pci: This extends VirtioPCIProxy. +*/ +#define TYPE_VIRTIO_GPU_PCI "virtio-gpu-pci" +#define VIRTIO_GPU_PCI (obj) \ + OBJECT_CHECK(VirtIOGPUPCI, (obj), TYPE_VIRTIO_GPU_PCI) + +struct VirtIOGPUPCI { +VirtIOPCIProxy parent_obj; +VirtIOGPU vdev; +}; + +/* Virtio ABI version, if we increment this, we break the guest driver. */ #define VIRTIO_PCI_ABI_VERSION 0
include/hw/pci/pci.h +1 -0
@@ -81,6 +81,7 @@#define PCI_DEVICE_ID_VIRTIO_SCSI 0x1004#define PCI_DEVICE_ID_VIRTIO_RNG 0x1005#define PCI_DEVICE_ID_VIRTIO_9P 0x1009 +#define PCI_DEVICE_ID_VIRTIO_GPU 0x1010#define PCI_VENDOR_ID_REDHAT 0x1b36#define PCI_DEVICE_ID_REDHAT_BRIDGE 0x0001
Signature · 1 line
1.8.3.1
PATCH 4/8 virtio-vga: add virtio gpu device with vga compatibility
In reply to Gerd HoffmannThis patch adds a virtio-vga device. It is simliar to virtio-gpu-pci, but it also adds in vga compatibility, so guests without native virtio-gpu support can drive the device in vga mode.
Written by Dave Airlie and Gerd Hoffmann.
--- default-configs/x86_64-softmmu.mak | 1 + hw/display/Makefile.objs | 1 + hw/display/virtio-vga.c | 169 +++++++++++++++++++++++++++++++++++++ 3 files changed, 171 insertions(+) create mode 100644 hw/display/virtio-vga.c
default-configs/x86_64-softmmu.mak +1 -0
@@ -11,6 +11,7 @@ CONFIG_VGA_CIRRUS=y CONFIG_VMWARE_VGA=y CONFIG_VIRTIO_GPU=y CONFIG_VIRTIO_GPU_PCI=y +CONFIG_VIRTIO_VGA=y CONFIG_VMMOUSE=y CONFIG_SERIAL=y CONFIG_PARALLEL=y
hw/display/Makefile.objs +1 -0
@@ -36,3 +36,4 @@ common-obj-$(CONFIG_QXL) += qxl.o qxl-logger.o qxl-render.o obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu.o obj-$(CONFIG_VIRTIO_GPU_PCI) += virtio-gpu-pci.o +obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
hw/display/virtio-vga.c new file +169 -0
169 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 5/8 virtio-vga: add '-vga virtio' support
In reply to Gerd HoffmannSome convinience fluff: Add support for '-vga virtio', also add virtio-vga to the list of vga cards so '-device virtio-vga' will turn off the default vga.
Written by Dave Airlie and Gerd Hoffmann.
--- hw/pci/pci.c | 2 ++ include/sysemu/sysemu.h | 2 +- vl.c | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-)
hw/pci/pci.c +2 -0
@@ -1653,6 +1653,8 @@ PCIDevice *pci_vga_init(PCIBus *bus)return pci_create_simple (bus,-1 ,"VGA" );case VGA_VMWARE :return pci_create_simple (bus,-1 ,"vmware-svga" ); +case VGA_VIRTIO : +return pci_create_simple (bus,-1 ,"virtio-vga" );case VGA_NONE :default :/* Other non-PCI types. Checking for unsupported types is already done in vl.c. */
include/sysemu/sysemu.h +1 -1
@@ -107,7 +107,7 @@ extern int autostart;typedef enum {VGA_NONE ,VGA_STD ,VGA_CIRRUS ,VGA_VMWARE ,VGA_XENFB ,VGA_QXL , -VGA_TCX ,VGA_CG3 ,VGA_DEVICE +VGA_TCX ,VGA_CG3 ,VGA_DEVICE ,VGA_VIRTIO , }VGAInterfaceType ;extern int vga_interface_type;
vl.c +13 -0
@@ -249,6 +249,7 @@ static struct { { .driver = "isa-cirrus-vga", .flag = &default_vga }, { .driver = "vmware-svga", .flag = &default_vga }, { .driver = "qxl-vga", .flag = &default_vga }, + { .driver = "virtio-vga", .flag = &default_vga }, }; static QemuOptsList qemu_rtc_opts = {
@@ -2108,6 +2109,11 @@ static bool cg3_vga_available(void)return object_class_by_name ("cgthree" ); } +static bool virtio_vga_available (void ) +{ +return object_class_by_name ("virtio-vga" ); +} +static void select_vgahw (const char *p) {const char *opts;
@@ -2134,6 +2140,13 @@ static void select_vgahw (const char *p)fprintf (stderr,"Error: VMWare SVGA not available\n" );exit (0 ); } + }else if (strstart (p,"virtio" , &opts)) { +if (virtio_vga_available ()) { + vga_interface_type =VGA_VIRTIO ; + }else { +fprintf (stderr,"Error: Virtio VGA not available\n" ); +exit (0 ); + } }else if (strstart (p,"xenfb" , &opts)) { vga_interface_type =VGA_XENFB ; }else if (strstart (p,"qxl" , &opts)) {
Signature · 1 line
1.8.3.1
PATCH 6/8 virtio-vga: add vgabios configuration
In reply to Gerd HoffmannAdd seavgabios configuration for virtio-vga,
hook up the new vgabios in the makefiles.
--- Makefile | 2 +- roms/Makefile | 2 +- roms/config.vga-virtio | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 roms/config.vga-virtio
Makefile +1 -1
@@ -337,7 +337,7 @@ bepo cz ifdef INSTALL_BLOBS BLOBS=bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \ -vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \ +vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \ acpi-dsdt.aml q35-acpi-dsdt.aml \ ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \ pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
roms/Makefile +1 -1
@@ -1,5 +1,5 @@ -vgabios_variants := stdvga cirrus vmware qxl isavga +vgabios_variants := stdvga cirrus vmware qxl isavga virtio vgabios_targets := $(subst -isavga,,$(patsubst %,vgabios-%.bin,$(vgabios_variants))) pxerom_variants := e1000 eepro100 ne2k_pci pcnet rtl8139 virtio pxerom_targets := 8086100e 80861209 10500940 10222000 10ec8139 1af41000
roms/config.vga-virtio new file +6 -0
@@ -0,0 +1,6 @@ +CONFIG_BUILD_VGABIOS=y +CONFIG_VGA_BOCHS=y +CONFIG_VGA_PCI=y +CONFIG_OVERRIDE_PCI_ID=y +CONFIG_VGA_VID=0x1af4 +CONFIG_VGA_DID=0x1010
Signature · 1 line
1.8.3.1
PATCH 7/8 virtio-vga: add vgabios binary
In reply to Gerd HoffmannAdd prebuilt vgabios-virtio.bin binary.
--- pc-bios/vgabios-virtio.bin | Bin 0 -> 37376 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pc-bios/vgabios-virtio.bin
pc-bios/vgabios-virtio.bin new file binary +0 -0
Signature · 1 line
1.8.3.1
PATCH 8/8 virtio-gpu: add to display-vga test
In reply to Gerd Hoffmann--- tests/Makefile | 3 +++ tests/display-vga-test.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+)
tests/Makefile +3 -0
@@ -125,6 +125,9 @@ check-qtest-pci-y += tests/display-vga-test$(EXESUF) gcov-files-pci-y += hw/display/vga.c gcov-files-pci-y += hw/display/cirrus_vga.c gcov-files-pci-y += hw/display/vga-pci.c +gcov-files-pci-y += hw/display/virtio-gpu.c +gcov-files-pci-y += hw/display/virtio-gpu-pci.c +gcov-files-pci-y += hw/display/virtio-vga.c check-qtest-pci-y += tests/intel-hda-test$(EXESUF) gcov-files-pci-y += hw/audio/intel-hda.c hw/audio/hda-codec.c
tests/display-vga-test.c +18 -0
@@ -36,6 +36,20 @@ static void pci_multihead(void)qtest_end (); } +#ifdef CONFIG_VIRTIO_GPU +static void pci_virtio_gpu (void ) +{ +qtest_start ("-vga none -device virtio-gpu-pci" ); +qtest_end (); +} + +static void pci_virtio_vga (void ) +{ +qtest_start ("-vga none -device virtio-vga" ); +qtest_end (); +} +#endif +int main (int argc,char **argv) {int ret;
@@ -46,6 +60,10 @@ int main(int argc, char **argv)qtest_add_func ("/display/pci/stdvga" , pci_stdvga);qtest_add_func ("/display/pci/secondary" , pci_secondary);qtest_add_func ("/display/pci/multihead" , pci_multihead); +#ifdef CONFIG_VIRTIO_GPU +qtest_add_func ("/display/pci/virtio-gpu" , pci_virtio_gpu); +qtest_add_func ("/display/pci/virtio-vga" , pci_virtio_vga); +#endif ret =g_test_run ();return ret;
Signature · 1 line
1.8.3.1