diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-05-12 14:45:21 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-05-12 14:45:21 +0100 |
commit | a5ccdccc97d6e0d75282ede5b866cf694e9602b0 (patch) | |
tree | 326271f7177132e4340f4eeb173cb07b4482b1ac /include | |
parent | 4f24f774ba83e4c4a3179929d5f2ee183ce4fd2f (diff) | |
parent | b36eb8860f8f4a9c6f131c3fd380116a3017e022 (diff) | |
download | qemu-a5ccdccc97d6e0d75282ede5b866cf694e9602b0.zip qemu-a5ccdccc97d6e0d75282ede5b866cf694e9602b0.tar.gz qemu-a5ccdccc97d6e0d75282ede5b866cf694e9602b0.tar.bz2 |
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20210510-pull-request' into staging
edid: display id support (for 5k+), bugfixes.
virtio-gpu: iommu fix, device split.
# gpg: Signature made Mon 10 May 2021 14:20:36 BST
# gpg: using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138
* remotes/kraxel/tags/vga-20210510-pull-request: (25 commits)
virtio-gpu: add virtio-vga-gl
modules: add have_vga
virtio-gpu: add virtio-gpu-gl-pci
virtio-gpu: move fields to struct VirtIOGPUGL
virtio-gpu: drop use_virgl_renderer
virtio-gpu: move virtio-gpu-gl-device to separate module
virtio-gpu: drop VIRGL() macro
virtio-gpu: move update_cursor_data
virtio-gpu: move virgl process_cmd
virtio-gpu: move virgl gl_flushed
virtio-gpu: move virgl handle_ctrl
virtio-gpu: use class function for ctrl queue handlers
virtio-gpu: move virgl reset
virtio-gpu: move virgl realize + properties
virtio-gpu: add virtio-gpu-gl-device
virtio-gpu: rename virgl source file.
virtio-gpu: handle partial maps properly
edid: add support for DisplayID extension (5k resolution)
edid: allow arbitrary-length checksums
edid: move timing generation into a separate function
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/display/edid.h | 12 | ||||
-rw-r--r-- | include/hw/display/vga.h | 6 | ||||
-rw-r--r-- | include/hw/virtio/virtio-gpu.h | 34 |
3 files changed, 42 insertions, 10 deletions
diff --git a/include/hw/display/edid.h b/include/hw/display/edid.h index 1f8fc9b..520f8ec 100644 --- a/include/hw/display/edid.h +++ b/include/hw/display/edid.h @@ -11,6 +11,7 @@ typedef struct qemu_edid_info { uint32_t prefy; uint32_t maxx; uint32_t maxy; + uint32_t refresh_rate; } qemu_edid_info; void qemu_edid_generate(uint8_t *edid, size_t size, @@ -21,10 +22,11 @@ void qemu_edid_region_io(MemoryRegion *region, Object *owner, uint32_t qemu_edid_dpi_to_mm(uint32_t dpi, uint32_t res); -#define DEFINE_EDID_PROPERTIES(_state, _edid_info) \ - DEFINE_PROP_UINT32("xres", _state, _edid_info.prefx, 0), \ - DEFINE_PROP_UINT32("yres", _state, _edid_info.prefy, 0), \ - DEFINE_PROP_UINT32("xmax", _state, _edid_info.maxx, 0), \ - DEFINE_PROP_UINT32("ymax", _state, _edid_info.maxy, 0) +#define DEFINE_EDID_PROPERTIES(_state, _edid_info) \ + DEFINE_PROP_UINT32("xres", _state, _edid_info.prefx, 0), \ + DEFINE_PROP_UINT32("yres", _state, _edid_info.prefy, 0), \ + DEFINE_PROP_UINT32("xmax", _state, _edid_info.maxx, 0), \ + DEFINE_PROP_UINT32("ymax", _state, _edid_info.maxy, 0), \ + DEFINE_PROP_UINT32("refresh_rate", _state, _edid_info.refresh_rate, 0) #endif /* EDID_H */ diff --git a/include/hw/display/vga.h b/include/hw/display/vga.h index ca0003d..5f7825e 100644 --- a/include/hw/display/vga.h +++ b/include/hw/display/vga.h @@ -11,6 +11,12 @@ #include "exec/hwaddr.h" +/* + * modules can reference this symbol to avoid being loaded + * into system emulators without vga support + */ +extern bool have_vga; + enum vga_retrace_method { VGA_RETRACE_DUMB, VGA_RETRACE_PRECISE diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index fae1492..8ca2c55 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -29,7 +29,10 @@ OBJECT_DECLARE_TYPE(VirtIOGPUBase, VirtIOGPUBaseClass, VIRTIO_GPU_BASE) #define TYPE_VIRTIO_GPU "virtio-gpu-device" -OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPU, VIRTIO_GPU) +OBJECT_DECLARE_TYPE(VirtIOGPU, VirtIOGPUClass, VIRTIO_GPU) + +#define TYPE_VIRTIO_GPU_GL "virtio-gpu-gl-device" +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPUGL, VIRTIO_GPU_GL) #define TYPE_VHOST_USER_GPU "vhost-user-gpu" OBJECT_DECLARE_SIMPLE_TYPE(VhostUserGPU, VHOST_USER_GPU) @@ -108,7 +111,6 @@ struct VirtIOGPUBase { struct virtio_gpu_config virtio_config; const GraphicHwOps *hw_ops; - bool use_virgl_renderer; int renderer_blocked; int enable; @@ -149,8 +151,6 @@ struct VirtIOGPU { uint64_t hostmem; bool processing_cmdq; - bool renderer_inited; - bool renderer_reset; QEMUTimer *fence_poll; QEMUTimer *print_stats; @@ -163,6 +163,23 @@ struct VirtIOGPU { } stats; }; +struct VirtIOGPUClass { + VirtIOGPUBaseClass parent; + + void (*handle_ctrl)(VirtIODevice *vdev, VirtQueue *vq); + void (*process_cmd)(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd); + void (*update_cursor_data)(VirtIOGPU *g, + struct virtio_gpu_scanout *s, + uint32_t resource_id); +}; + +struct VirtIOGPUGL { + struct VirtIOGPU parent_obj; + + bool renderer_inited; + bool renderer_reset; +}; + struct VhostUserGPU { VirtIOGPUBase parent_obj; @@ -209,10 +226,17 @@ void virtio_gpu_get_edid(VirtIOGPU *g, int virtio_gpu_create_mapping_iov(VirtIOGPU *g, struct virtio_gpu_resource_attach_backing *ab, struct virtio_gpu_ctrl_command *cmd, - uint64_t **addr, struct iovec **iov); + uint64_t **addr, struct iovec **iov, + uint32_t *niov); void virtio_gpu_cleanup_mapping_iov(VirtIOGPU *g, struct iovec *iov, uint32_t count); void virtio_gpu_process_cmdq(VirtIOGPU *g); +void virtio_gpu_device_realize(DeviceState *qdev, Error **errp); +void virtio_gpu_reset(VirtIODevice *vdev); +void virtio_gpu_simple_process_cmd(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd); +void virtio_gpu_update_cursor_data(VirtIOGPU *g, + struct virtio_gpu_scanout *s, + uint32_t resource_id); /* virtio-gpu-3d.c */ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, |