|
ginnOS
The reference: libc, the libraries and the kernel
|
the virtio-gpu display (QEMU -vga virtio, or -device virtio-gpu). More...
#include "virtio_gpu.h"#include "common/fb/fb_ioctl.h"#include "common/memory.h"#include "drivers/pci/pci_irq.h"#include "drivers/video/display.h"#include "drivers/video/fb/fb.h"#include "drivers/virtio/virtio.h"#include "kernel/klog/klog.h"#include "kernel/memory/mmio.h"#include "kernel/memory/page.h"#include "kernel/memory/phys.h"#include "kernel/memory/pmm.h"Data Structures | |
| struct | __attribute__ |
| ELF32 file header. More... | |
Macros | |
| #define | DEVICE_ID 0x1050 |
| #define | MAX_WIDTH 3840 |
| #define | MAX_HEIGHT 2400 |
| #define | CMD_GET_DISPLAY_INFO 0x0100 |
| #define | CMD_RESOURCE_CREATE_2D 0x0101 |
| #define | CMD_RESOURCE_UNREF 0x0102 |
| #define | CMD_SET_SCANOUT 0x0103 |
| #define | CMD_RESOURCE_FLUSH 0x0104 |
| #define | CMD_TRANSFER_TO_HOST_2D 0x0105 |
| #define | CMD_RESOURCE_ATTACH_BACKING 0x0106 |
| #define | CMD_UPDATE_CURSOR 0x0300 |
| #define | CMD_MOVE_CURSOR 0x0301 |
| #define | RESP_OK_NODATA 0x1100 |
| #define | RESP_OK_DISPLAY_INFO 0x1101 |
| #define | FORMAT_B8G8R8A8 1 |
| #define | FORMAT_B8G8R8X8 2 |
| #define | MAX_SCANOUTS 16 |
| #define | EVENT_DISPLAY 1 |
| #define | CONFIG_EVENTS_READ 0 |
| #define | CONFIG_EVENTS_CLEAR 4 |
Functions | |
| bool | virtio_gpu_init (void) |
| find a virtio-gpu, take over the screen from the boot framebuffer and set the size the screen wants. | |
the virtio-gpu display (QEMU -vga virtio, or -device virtio-gpu).
2D only. a mode is a resource in guest RAM (contiguous frames) shown on scanout 0; the host sees changes after a transfer and a flush, which the display layer asks for (display_driver_t.flush). the size the screen wants is the QEMU window: the device says when it changes with a configuration interrupt. the pointer is the device's own cursor (a 64 x 64 resource on the cursor queue), so moving it draws nothing.
| #define DEVICE_ID 0x1050 |
| #define MAX_WIDTH 3840 |
| #define MAX_HEIGHT 2400 |
| #define CMD_GET_DISPLAY_INFO 0x0100 |
| #define CMD_RESOURCE_CREATE_2D 0x0101 |
| #define CMD_RESOURCE_UNREF 0x0102 |
| #define CMD_SET_SCANOUT 0x0103 |
| #define CMD_RESOURCE_FLUSH 0x0104 |
| #define CMD_TRANSFER_TO_HOST_2D 0x0105 |
| #define CMD_RESOURCE_ATTACH_BACKING 0x0106 |
| #define CMD_UPDATE_CURSOR 0x0300 |
| #define CMD_MOVE_CURSOR 0x0301 |
| #define RESP_OK_NODATA 0x1100 |
| #define RESP_OK_DISPLAY_INFO 0x1101 |
| #define FORMAT_B8G8R8A8 1 |
| #define FORMAT_B8G8R8X8 2 |
| #define MAX_SCANOUTS 16 |
| #define EVENT_DISPLAY 1 |
| #define CONFIG_EVENTS_READ 0 |
| #define CONFIG_EVENTS_CLEAR 4 |
| bool virtio_gpu_init | ( | void | ) |
find a virtio-gpu, take over the screen from the boot framebuffer and set the size the screen wants.
call after fb_init and display_init.