pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 1 | #ifndef CONSOLE_H |
| 2 | #define CONSOLE_H |
| 3 | |
Paolo Bonzini | 28ecbae | 2012-11-28 12:06:30 +0100 | [diff] [blame] | 4 | #include "ui/qemu-pixman.h" |
Gerd Hoffmann | 95be066 | 2013-04-17 09:45:10 +0200 | [diff] [blame] | 5 | #include "qom/object.h" |
Paolo Bonzini | 1de7afc | 2012-12-17 18:20:00 +0100 | [diff] [blame] | 6 | #include "qemu/notify.h" |
Markus Armbruster | 9af2398 | 2018-02-11 10:36:01 +0100 | [diff] [blame] | 7 | #include "qapi/qapi-types-ui.h" |
Bilal Elmoussaoui | b659678 | 2023-06-19 11:53:36 +0200 | [diff] [blame] | 8 | #include "ui/input.h" |
Marc-André Lureau | 6d8cd7c | 2023-08-30 13:38:24 +0400 | [diff] [blame] | 9 | #include "ui/surface.h" |
Dongwon Kim | 6e6ae49 | 2024-05-08 10:53:59 -0700 | [diff] [blame] | 10 | #include "ui/dmabuf.h" |
Gerd Hoffmann | cd2bc88 | 2015-01-09 11:40:23 +0100 | [diff] [blame] | 11 | |
Marc-André Lureau | 8c6381d | 2023-08-30 13:38:09 +0400 | [diff] [blame] | 12 | #define TYPE_QEMU_CONSOLE "qemu-console" |
| 13 | OBJECT_DECLARE_TYPE(QemuConsole, QemuConsoleClass, QEMU_CONSOLE) |
| 14 | |
| 15 | #define TYPE_QEMU_GRAPHIC_CONSOLE "qemu-graphic-console" |
| 16 | OBJECT_DECLARE_SIMPLE_TYPE(QemuGraphicConsole, QEMU_GRAPHIC_CONSOLE) |
| 17 | |
| 18 | #define TYPE_QEMU_TEXT_CONSOLE "qemu-text-console" |
| 19 | OBJECT_DECLARE_SIMPLE_TYPE(QemuTextConsole, QEMU_TEXT_CONSOLE) |
| 20 | |
| 21 | #define TYPE_QEMU_FIXED_TEXT_CONSOLE "qemu-fixed-text-console" |
| 22 | OBJECT_DECLARE_SIMPLE_TYPE(QemuFixedTextConsole, QEMU_FIXED_TEXT_CONSOLE) |
| 23 | |
| 24 | #define QEMU_IS_GRAPHIC_CONSOLE(c) \ |
| 25 | object_dynamic_cast(OBJECT(c), TYPE_QEMU_GRAPHIC_CONSOLE) |
| 26 | |
| 27 | #define QEMU_IS_TEXT_CONSOLE(c) \ |
| 28 | object_dynamic_cast(OBJECT(c), TYPE_QEMU_TEXT_CONSOLE) |
| 29 | |
| 30 | #define QEMU_IS_FIXED_TEXT_CONSOLE(c) \ |
| 31 | object_dynamic_cast(OBJECT(c), TYPE_QEMU_FIXED_TEXT_CONSOLE) |
| 32 | |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 33 | /* keyboard/mouse support */ |
| 34 | |
| 35 | #define MOUSE_EVENT_LBUTTON 0x01 |
| 36 | #define MOUSE_EVENT_RBUTTON 0x02 |
| 37 | #define MOUSE_EVENT_MBUTTON 0x04 |
Gerd Hoffmann | 21bae11 | 2013-12-04 14:08:04 +0100 | [diff] [blame] | 38 | #define MOUSE_EVENT_WHEELUP 0x08 |
| 39 | #define MOUSE_EVENT_WHEELDN 0x10 |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 40 | |
Gerd Hoffmann | 03a23a8 | 2010-02-26 17:17:36 +0100 | [diff] [blame] | 41 | /* identical to the ps/2 keyboard bits */ |
| 42 | #define QEMU_SCROLL_LOCK_LED (1 << 0) |
| 43 | #define QEMU_NUM_LOCK_LED (1 << 1) |
| 44 | #define QEMU_CAPS_LOCK_LED (1 << 2) |
| 45 | |
aliguori | 7ed9eba | 2008-08-21 20:12:05 +0000 | [diff] [blame] | 46 | /* in ms */ |
Gerd Hoffmann | 0f7b286 | 2013-03-14 11:56:16 +0100 | [diff] [blame] | 47 | #define GUI_REFRESH_INTERVAL_DEFAULT 30 |
| 48 | #define GUI_REFRESH_INTERVAL_IDLE 3000 |
aliguori | 7ed9eba | 2008-08-21 20:12:05 +0000 | [diff] [blame] | 49 | |
OGAWA Hirofumi | 4083733 | 2015-11-29 22:28:24 +0900 | [diff] [blame] | 50 | /* Color number is match to standard vga palette */ |
| 51 | enum qemu_color_names { |
| 52 | QEMU_COLOR_BLACK = 0, |
| 53 | QEMU_COLOR_BLUE = 1, |
| 54 | QEMU_COLOR_GREEN = 2, |
| 55 | QEMU_COLOR_CYAN = 3, |
| 56 | QEMU_COLOR_RED = 4, |
| 57 | QEMU_COLOR_MAGENTA = 5, |
| 58 | QEMU_COLOR_YELLOW = 6, |
| 59 | QEMU_COLOR_WHITE = 7 |
| 60 | }; |
| 61 | /* Convert to curses char attributes */ |
| 62 | #define ATTR2CHTYPE(c, fg, bg, bold) \ |
| 63 | ((bold) << 21 | (bg) << 11 | (fg) << 8 | (c)) |
| 64 | |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 65 | typedef void QEMUPutKBDEvent(void *opaque, int keycode); |
Gerd Hoffmann | 03a23a8 | 2010-02-26 17:17:36 +0100 | [diff] [blame] | 66 | typedef void QEMUPutLEDEvent(void *opaque, int ledstate); |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 67 | typedef void QEMUPutMouseEvent(void *opaque, int dx, int dy, int dz, int buttons_state); |
| 68 | |
Gerd Hoffmann | 72711ef | 2013-04-24 12:08:37 +0200 | [diff] [blame] | 69 | typedef struct QEMUPutMouseEntry QEMUPutMouseEntry; |
Gerd Hoffmann | 5a37532 | 2013-04-24 12:08:38 +0200 | [diff] [blame] | 70 | typedef struct QEMUPutKbdEntry QEMUPutKbdEntry; |
Gerd Hoffmann | 72711ef | 2013-04-24 12:08:37 +0200 | [diff] [blame] | 71 | typedef struct QEMUPutLEDEntry QEMUPutLEDEntry; |
Gerd Hoffmann | 03a23a8 | 2010-02-26 17:17:36 +0100 | [diff] [blame] | 72 | |
Gerd Hoffmann | 5a37532 | 2013-04-24 12:08:38 +0200 | [diff] [blame] | 73 | QEMUPutKbdEntry *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, |
| 74 | void *opaque); |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 75 | QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func, |
| 76 | void *opaque, int absolute, |
| 77 | const char *name); |
| 78 | void qemu_remove_mouse_event_handler(QEMUPutMouseEntry *entry); |
Anthony Liguori | 6fef28e | 2010-03-09 20:52:22 -0600 | [diff] [blame] | 79 | void qemu_activate_mouse_event_handler(QEMUPutMouseEntry *entry); |
| 80 | |
Gerd Hoffmann | 03a23a8 | 2010-02-26 17:17:36 +0100 | [diff] [blame] | 81 | QEMUPutLEDEntry *qemu_add_led_event_handler(QEMUPutLEDEvent *func, void *opaque); |
| 82 | void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry); |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 83 | |
Gerd Hoffmann | 03a23a8 | 2010-02-26 17:17:36 +0100 | [diff] [blame] | 84 | void kbd_put_ledstate(int ledstate); |
Anthony Liguori | eb2e259 | 2010-03-09 14:26:40 -0600 | [diff] [blame] | 85 | |
Markus Armbruster | ec843b9 | 2023-01-09 20:03:20 +0100 | [diff] [blame] | 86 | bool qemu_mouse_set(int index, Error **errp); |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 87 | |
| 88 | /* keysym is a unicode code except for special keys (see QEMU_KEY_xxx |
| 89 | constants) */ |
| 90 | #define QEMU_KEY_ESC1(c) ((c) | 0xe100) |
Cal Peake | df6322a | 2022-08-11 18:01:38 -0400 | [diff] [blame] | 91 | #define QEMU_KEY_TAB 0x0009 |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 92 | #define QEMU_KEY_BACKSPACE 0x007f |
| 93 | #define QEMU_KEY_UP QEMU_KEY_ESC1('A') |
| 94 | #define QEMU_KEY_DOWN QEMU_KEY_ESC1('B') |
| 95 | #define QEMU_KEY_RIGHT QEMU_KEY_ESC1('C') |
| 96 | #define QEMU_KEY_LEFT QEMU_KEY_ESC1('D') |
| 97 | #define QEMU_KEY_HOME QEMU_KEY_ESC1(1) |
| 98 | #define QEMU_KEY_END QEMU_KEY_ESC1(4) |
| 99 | #define QEMU_KEY_PAGEUP QEMU_KEY_ESC1(5) |
| 100 | #define QEMU_KEY_PAGEDOWN QEMU_KEY_ESC1(6) |
| 101 | #define QEMU_KEY_DELETE QEMU_KEY_ESC1(3) |
| 102 | |
| 103 | #define QEMU_KEY_CTRL_UP 0xe400 |
| 104 | #define QEMU_KEY_CTRL_DOWN 0xe401 |
| 105 | #define QEMU_KEY_CTRL_LEFT 0xe402 |
| 106 | #define QEMU_KEY_CTRL_RIGHT 0xe403 |
| 107 | #define QEMU_KEY_CTRL_HOME 0xe404 |
| 108 | #define QEMU_KEY_CTRL_END 0xe405 |
| 109 | #define QEMU_KEY_CTRL_PAGEUP 0xe406 |
| 110 | #define QEMU_KEY_CTRL_PAGEDOWN 0xe407 |
| 111 | |
Marc-André Lureau | cc6ba2c | 2023-08-30 13:38:20 +0400 | [diff] [blame] | 112 | void qemu_text_console_put_keysym(QemuTextConsole *s, int keysym); |
| 113 | bool qemu_text_console_put_qcode(QemuTextConsole *s, int qcode, bool ctrl); |
| 114 | void qemu_text_console_put_string(QemuTextConsole *s, const char *str, int len); |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 115 | |
Bilal Elmoussaoui | b659678 | 2023-06-19 11:53:36 +0200 | [diff] [blame] | 116 | /* Touch devices */ |
| 117 | typedef struct touch_slot { |
| 118 | int x; |
| 119 | int y; |
| 120 | int tracking_id; |
| 121 | } touch_slot; |
| 122 | |
| 123 | void console_handle_touch_event(QemuConsole *con, |
| 124 | struct touch_slot touch_slots[INPUT_EVENT_SLOTS_MAX], |
| 125 | uint64_t num_slot, |
| 126 | int width, int height, |
| 127 | double x, double y, |
| 128 | InputMultiTouchType type, |
| 129 | Error **errp); |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 130 | /* consoles */ |
| 131 | |
Gerd Hoffmann | 95be066 | 2013-04-17 09:45:10 +0200 | [diff] [blame] | 132 | struct QemuConsoleClass { |
| 133 | ObjectClass parent_class; |
| 134 | }; |
| 135 | |
Marc-André Lureau | ebced09 | 2021-02-20 16:23:03 +0400 | [diff] [blame] | 136 | typedef struct ScanoutTexture { |
| 137 | uint32_t backing_id; |
| 138 | bool backing_y_0_top; |
| 139 | uint32_t backing_width; |
| 140 | uint32_t backing_height; |
| 141 | uint32_t x; |
| 142 | uint32_t y; |
| 143 | uint32_t width; |
| 144 | uint32_t height; |
Marc-André Lureau | bf41ab6 | 2023-06-06 15:56:56 +0400 | [diff] [blame] | 145 | void *d3d_tex2d; |
Marc-André Lureau | ebced09 | 2021-02-20 16:23:03 +0400 | [diff] [blame] | 146 | } ScanoutTexture; |
| 147 | |
Gerd Hoffmann | 6f90f3d | 2014-01-24 17:38:20 +0100 | [diff] [blame] | 148 | typedef struct QemuUIInfo { |
Marc-André Lureau | 9028ab1 | 2020-09-27 18:57:50 +0400 | [diff] [blame] | 149 | /* physical dimension */ |
| 150 | uint16_t width_mm; |
| 151 | uint16_t height_mm; |
Gerd Hoffmann | 6f90f3d | 2014-01-24 17:38:20 +0100 | [diff] [blame] | 152 | /* geometry */ |
| 153 | int xoff; |
| 154 | int yoff; |
| 155 | uint32_t width; |
| 156 | uint32_t height; |
Akihiko Odaki | aeffd07 | 2022-02-26 20:55:15 +0900 | [diff] [blame] | 157 | uint32_t refresh_rate; |
Gerd Hoffmann | 6f90f3d | 2014-01-24 17:38:20 +0100 | [diff] [blame] | 158 | } QemuUIInfo; |
| 159 | |
Gerd Hoffmann | 254e595 | 2010-05-21 11:54:32 +0200 | [diff] [blame] | 160 | /* cursor data format is 32bit RGBA */ |
| 161 | typedef struct QEMUCursor { |
Mauro Matteo Cascella | 4c93ce5 | 2023-05-23 18:30:23 +0200 | [diff] [blame] | 162 | uint16_t width, height; |
Gerd Hoffmann | 254e595 | 2010-05-21 11:54:32 +0200 | [diff] [blame] | 163 | int hot_x, hot_y; |
| 164 | int refcount; |
| 165 | uint32_t data[]; |
| 166 | } QEMUCursor; |
| 167 | |
Mauro Matteo Cascella | 4c93ce5 | 2023-05-23 18:30:23 +0200 | [diff] [blame] | 168 | QEMUCursor *cursor_alloc(uint16_t width, uint16_t height); |
Marc-André Lureau | 2512a02 | 2023-01-17 15:10:13 +0400 | [diff] [blame] | 169 | QEMUCursor *cursor_ref(QEMUCursor *c); |
Marc-André Lureau | f4579e2 | 2023-01-17 15:07:02 +0400 | [diff] [blame] | 170 | void cursor_unref(QEMUCursor *c); |
Gerd Hoffmann | 254e595 | 2010-05-21 11:54:32 +0200 | [diff] [blame] | 171 | QEMUCursor *cursor_builtin_hidden(void); |
| 172 | QEMUCursor *cursor_builtin_left_ptr(void); |
| 173 | void cursor_print_ascii_art(QEMUCursor *c, const char *prefix); |
| 174 | int cursor_get_mono_bpl(QEMUCursor *c); |
| 175 | void cursor_set_mono(QEMUCursor *c, |
| 176 | uint32_t foreground, uint32_t background, uint8_t *image, |
| 177 | int transparent, uint8_t *mask); |
Gerd Hoffmann | 254e595 | 2010-05-21 11:54:32 +0200 | [diff] [blame] | 178 | void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask); |
| 179 | |
Gerd Hoffmann | 06020b9 | 2014-07-11 13:56:51 +0200 | [diff] [blame] | 180 | typedef void *QEMUGLContext; |
| 181 | typedef struct QEMUGLParams QEMUGLParams; |
| 182 | |
| 183 | struct QEMUGLParams { |
| 184 | int major_ver; |
| 185 | int minor_ver; |
| 186 | }; |
| 187 | |
Marc-André Lureau | ebced09 | 2021-02-20 16:23:03 +0400 | [diff] [blame] | 188 | enum display_scanout { |
| 189 | SCANOUT_NONE, |
| 190 | SCANOUT_SURFACE, |
| 191 | SCANOUT_TEXTURE, |
| 192 | SCANOUT_DMABUF, |
| 193 | }; |
| 194 | |
| 195 | typedef struct DisplayScanout { |
| 196 | enum display_scanout kind; |
| 197 | union { |
| 198 | /* DisplaySurface *surface; is kept in QemuConsole */ |
| 199 | ScanoutTexture texture; |
| 200 | QemuDmaBuf *dmabuf; |
| 201 | }; |
| 202 | } DisplayScanout; |
| 203 | |
Philippe Mathieu-Daudé | 7536587 | 2019-01-11 15:08:56 +0100 | [diff] [blame] | 204 | typedef struct DisplayState DisplayState; |
Marc-André Lureau | 5e79d51 | 2021-10-09 23:48:46 +0400 | [diff] [blame] | 205 | typedef struct DisplayGLCtx DisplayGLCtx; |
Philippe Mathieu-Daudé | 7536587 | 2019-01-11 15:08:56 +0100 | [diff] [blame] | 206 | |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 207 | typedef struct DisplayChangeListenerOps { |
| 208 | const char *dpy_name; |
| 209 | |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 210 | /* optional */ |
Gerd Hoffmann | bc2ed97 | 2013-03-01 13:03:04 +0100 | [diff] [blame] | 211 | void (*dpy_refresh)(DisplayChangeListener *dcl); |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 212 | |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 213 | /* optional */ |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 214 | void (*dpy_gfx_update)(DisplayChangeListener *dcl, |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 215 | int x, int y, int w, int h); |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 216 | /* optional */ |
Gerd Hoffmann | c12aeb8 | 2013-02-28 15:03:04 +0100 | [diff] [blame] | 217 | void (*dpy_gfx_switch)(DisplayChangeListener *dcl, |
Gerd Hoffmann | c12aeb8 | 2013-02-28 15:03:04 +0100 | [diff] [blame] | 218 | struct DisplaySurface *new_surface); |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 219 | /* optional */ |
Benjamin Herrenschmidt | 49743df | 2014-07-07 16:39:05 +1000 | [diff] [blame] | 220 | bool (*dpy_gfx_check_format)(DisplayChangeListener *dcl, |
| 221 | pixman_format_code_t format); |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 222 | |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 223 | /* optional */ |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 224 | void (*dpy_text_cursor)(DisplayChangeListener *dcl, |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 225 | int x, int y); |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 226 | /* optional */ |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 227 | void (*dpy_text_resize)(DisplayChangeListener *dcl, |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 228 | int w, int h); |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 229 | /* optional */ |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 230 | void (*dpy_text_update)(DisplayChangeListener *dcl, |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 231 | int x, int y, int w, int h); |
| 232 | |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 233 | /* optional */ |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 234 | void (*dpy_mouse_set)(DisplayChangeListener *dcl, |
Akihiko Odaki | a418e7a | 2024-07-15 14:25:43 +0900 | [diff] [blame] | 235 | int x, int y, bool on); |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 236 | /* optional */ |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 237 | void (*dpy_cursor_define)(DisplayChangeListener *dcl, |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 238 | QEMUCursor *cursor); |
Gerd Hoffmann | 06020b9 | 2014-07-11 13:56:51 +0200 | [diff] [blame] | 239 | |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 240 | /* required if GL */ |
Gerd Hoffmann | eaa92c7 | 2017-02-21 10:37:17 +0100 | [diff] [blame] | 241 | void (*dpy_gl_scanout_disable)(DisplayChangeListener *dcl); |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 242 | /* required if GL */ |
Gerd Hoffmann | f4c36bd | 2017-02-21 10:37:16 +0100 | [diff] [blame] | 243 | void (*dpy_gl_scanout_texture)(DisplayChangeListener *dcl, |
| 244 | uint32_t backing_id, |
| 245 | bool backing_y_0_top, |
| 246 | uint32_t backing_width, |
| 247 | uint32_t backing_height, |
| 248 | uint32_t x, uint32_t y, |
Marc-André Lureau | bf41ab6 | 2023-06-06 15:56:56 +0400 | [diff] [blame] | 249 | uint32_t w, uint32_t h, |
| 250 | void *d3d_tex2d); |
Marc-André Lureau | d0e137b | 2021-02-04 14:52:24 +0400 | [diff] [blame] | 251 | /* optional (default to true if has dpy_gl_scanout_dmabuf) */ |
| 252 | bool (*dpy_has_dmabuf)(DisplayChangeListener *dcl); |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 253 | /* optional */ |
Gerd Hoffmann | 4133fa7 | 2017-10-10 15:54:48 +0200 | [diff] [blame] | 254 | void (*dpy_gl_scanout_dmabuf)(DisplayChangeListener *dcl, |
| 255 | QemuDmaBuf *dmabuf); |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 256 | /* optional */ |
Gerd Hoffmann | 4133fa7 | 2017-10-10 15:54:48 +0200 | [diff] [blame] | 257 | void (*dpy_gl_cursor_dmabuf)(DisplayChangeListener *dcl, |
Gerd Hoffmann | 6e1f2cb | 2018-02-20 12:04:31 +0100 | [diff] [blame] | 258 | QemuDmaBuf *dmabuf, bool have_hot, |
| 259 | uint32_t hot_x, uint32_t hot_y); |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 260 | /* optional */ |
Gerd Hoffmann | 6e1f2cb | 2018-02-20 12:04:31 +0100 | [diff] [blame] | 261 | void (*dpy_gl_cursor_position)(DisplayChangeListener *dcl, |
| 262 | uint32_t pos_x, uint32_t pos_y); |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 263 | /* optional */ |
Gerd Hoffmann | 4133fa7 | 2017-10-10 15:54:48 +0200 | [diff] [blame] | 264 | void (*dpy_gl_release_dmabuf)(DisplayChangeListener *dcl, |
| 265 | QemuDmaBuf *dmabuf); |
Marc-André Lureau | 227d844 | 2021-02-04 14:52:20 +0400 | [diff] [blame] | 266 | /* required if GL */ |
Gerd Hoffmann | 06020b9 | 2014-07-11 13:56:51 +0200 | [diff] [blame] | 267 | void (*dpy_gl_update)(DisplayChangeListener *dcl, |
| 268 | uint32_t x, uint32_t y, uint32_t w, uint32_t h); |
| 269 | |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 270 | } DisplayChangeListenerOps; |
| 271 | |
aliguori | 7d957bd | 2009-01-15 22:14:11 +0000 | [diff] [blame] | 272 | struct DisplayChangeListener { |
Gerd Hoffmann | 0f7b286 | 2013-03-14 11:56:16 +0100 | [diff] [blame] | 273 | uint64_t update_interval; |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 274 | const DisplayChangeListenerOps *ops; |
| 275 | DisplayState *ds; |
Gerd Hoffmann | 284d1c6 | 2013-03-15 15:45:54 +0100 | [diff] [blame] | 276 | QemuConsole *con; |
Gerd Hoffmann | bf2fde7 | 2012-09-12 07:56:45 +0200 | [diff] [blame] | 277 | |
Gerd Hoffmann | 87e487a | 2010-06-04 11:46:35 +0200 | [diff] [blame] | 278 | QLIST_ENTRY(DisplayChangeListener) next; |
aliguori | 7d957bd | 2009-01-15 22:14:11 +0000 | [diff] [blame] | 279 | }; |
| 280 | |
Marc-André Lureau | 5e79d51 | 2021-10-09 23:48:46 +0400 | [diff] [blame] | 281 | typedef struct DisplayGLCtxOps { |
Marc-André Lureau | a62c4a1 | 2022-02-16 19:33:37 +0400 | [diff] [blame] | 282 | bool (*dpy_gl_ctx_is_compatible_dcl)(DisplayGLCtx *dgc, |
| 283 | DisplayChangeListener *dcl); |
Marc-André Lureau | 5e79d51 | 2021-10-09 23:48:46 +0400 | [diff] [blame] | 284 | QEMUGLContext (*dpy_gl_ctx_create)(DisplayGLCtx *dgc, |
| 285 | QEMUGLParams *params); |
| 286 | void (*dpy_gl_ctx_destroy)(DisplayGLCtx *dgc, |
| 287 | QEMUGLContext ctx); |
| 288 | int (*dpy_gl_ctx_make_current)(DisplayGLCtx *dgc, |
| 289 | QEMUGLContext ctx); |
Marc-André Lureau | 589089f | 2022-02-17 15:07:21 +0400 | [diff] [blame] | 290 | void (*dpy_gl_ctx_create_texture)(DisplayGLCtx *dgc, |
| 291 | DisplaySurface *surface); |
| 292 | void (*dpy_gl_ctx_destroy_texture)(DisplayGLCtx *dgc, |
| 293 | DisplaySurface *surface); |
| 294 | void (*dpy_gl_ctx_update_texture)(DisplayGLCtx *dgc, |
| 295 | DisplaySurface *surface, |
| 296 | int x, int y, int w, int h); |
Marc-André Lureau | 5e79d51 | 2021-10-09 23:48:46 +0400 | [diff] [blame] | 297 | } DisplayGLCtxOps; |
| 298 | |
| 299 | struct DisplayGLCtx { |
| 300 | const DisplayGLCtxOps *ops; |
Marc-André Lureau | 589089f | 2022-02-17 15:07:21 +0400 | [diff] [blame] | 301 | #ifdef CONFIG_OPENGL |
| 302 | QemuGLShader *gls; /* optional shared shader */ |
| 303 | #endif |
Marc-André Lureau | 5e79d51 | 2021-10-09 23:48:46 +0400 | [diff] [blame] | 304 | }; |
| 305 | |
Gerd Hoffmann | 64840c6 | 2013-03-07 17:08:29 +0100 | [diff] [blame] | 306 | DisplayState *init_displaystate(void); |
Akihiko Odaki | b5a087b | 2021-02-25 19:13:14 +0900 | [diff] [blame] | 307 | |
Gerd Hoffmann | 5209089 | 2013-04-23 15:44:31 +0200 | [diff] [blame] | 308 | void register_displaychangelistener(DisplayChangeListener *dcl); |
Gerd Hoffmann | 0f7b286 | 2013-03-14 11:56:16 +0100 | [diff] [blame] | 309 | void update_displaychangelistener(DisplayChangeListener *dcl, |
| 310 | uint64_t interval); |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 311 | void unregister_displaychangelistener(DisplayChangeListener *dcl); |
Gerd Hoffmann | 35c9e0a | 2010-06-04 11:51:31 +0200 | [diff] [blame] | 312 | |
Marc-André Lureau | a92e7bb | 2023-09-12 10:13:01 +0400 | [diff] [blame] | 313 | bool dpy_ui_info_supported(const QemuConsole *con); |
Marc-André Lureau | 5eaf1e4 | 2020-09-27 18:57:48 +0400 | [diff] [blame] | 314 | const QemuUIInfo *dpy_get_ui_info(const QemuConsole *con); |
Marc-André Lureau | ca19ef5 | 2021-04-13 20:39:11 +0400 | [diff] [blame] | 315 | int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info, bool delay); |
Gerd Hoffmann | 6f90f3d | 2014-01-24 17:38:20 +0100 | [diff] [blame] | 316 | |
Gerd Hoffmann | c78f713 | 2013-03-05 15:24:14 +0100 | [diff] [blame] | 317 | void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h); |
Tina Zhang | 7cd0afe | 2018-04-27 17:11:05 +0800 | [diff] [blame] | 318 | void dpy_gfx_update_full(QemuConsole *con); |
Gerd Hoffmann | c78f713 | 2013-03-05 15:24:14 +0100 | [diff] [blame] | 319 | void dpy_gfx_replace_surface(QemuConsole *con, |
Gerd Hoffmann | da229ef | 2013-02-28 10:48:02 +0100 | [diff] [blame] | 320 | DisplaySurface *surface); |
Gerd Hoffmann | c78f713 | 2013-03-05 15:24:14 +0100 | [diff] [blame] | 321 | void dpy_text_cursor(QemuConsole *con, int x, int y); |
| 322 | void dpy_text_update(QemuConsole *con, int x, int y, int w, int h); |
| 323 | void dpy_text_resize(QemuConsole *con, int w, int h); |
Akihiko Odaki | a418e7a | 2024-07-15 14:25:43 +0900 | [diff] [blame] | 324 | void dpy_mouse_set(QemuConsole *con, int x, int y, bool on); |
Gerd Hoffmann | c78f713 | 2013-03-05 15:24:14 +0100 | [diff] [blame] | 325 | void dpy_cursor_define(QemuConsole *con, QEMUCursor *cursor); |
Benjamin Herrenschmidt | 49743df | 2014-07-07 16:39:05 +1000 | [diff] [blame] | 326 | bool dpy_gfx_check_format(QemuConsole *con, |
| 327 | pixman_format_code_t format); |
Gerd Hoffmann | bf2fde7 | 2012-09-12 07:56:45 +0200 | [diff] [blame] | 328 | |
Gerd Hoffmann | eaa92c7 | 2017-02-21 10:37:17 +0100 | [diff] [blame] | 329 | void dpy_gl_scanout_disable(QemuConsole *con); |
Gerd Hoffmann | f4c36bd | 2017-02-21 10:37:16 +0100 | [diff] [blame] | 330 | void dpy_gl_scanout_texture(QemuConsole *con, |
| 331 | uint32_t backing_id, bool backing_y_0_top, |
| 332 | uint32_t backing_width, uint32_t backing_height, |
Marc-André Lureau | bf41ab6 | 2023-06-06 15:56:56 +0400 | [diff] [blame] | 333 | uint32_t x, uint32_t y, uint32_t w, uint32_t h, |
| 334 | void *d3d_tex2d); |
Gerd Hoffmann | 4133fa7 | 2017-10-10 15:54:48 +0200 | [diff] [blame] | 335 | void dpy_gl_scanout_dmabuf(QemuConsole *con, |
| 336 | QemuDmaBuf *dmabuf); |
Gerd Hoffmann | 6e1f2cb | 2018-02-20 12:04:31 +0100 | [diff] [blame] | 337 | void dpy_gl_cursor_dmabuf(QemuConsole *con, QemuDmaBuf *dmabuf, |
| 338 | bool have_hot, uint32_t hot_x, uint32_t hot_y); |
| 339 | void dpy_gl_cursor_position(QemuConsole *con, |
| 340 | uint32_t pos_x, uint32_t pos_y); |
Gerd Hoffmann | 4133fa7 | 2017-10-10 15:54:48 +0200 | [diff] [blame] | 341 | void dpy_gl_release_dmabuf(QemuConsole *con, |
| 342 | QemuDmaBuf *dmabuf); |
Gerd Hoffmann | 06020b9 | 2014-07-11 13:56:51 +0200 | [diff] [blame] | 343 | void dpy_gl_update(QemuConsole *con, |
| 344 | uint32_t x, uint32_t y, uint32_t w, uint32_t h); |
| 345 | |
| 346 | QEMUGLContext dpy_gl_ctx_create(QemuConsole *con, |
| 347 | QEMUGLParams *params); |
| 348 | void dpy_gl_ctx_destroy(QemuConsole *con, QEMUGLContext ctx); |
| 349 | int dpy_gl_ctx_make_current(QemuConsole *con, QEMUGLContext ctx); |
Gerd Hoffmann | 06020b9 | 2014-07-11 13:56:51 +0200 | [diff] [blame] | 350 | |
| 351 | bool console_has_gl(QemuConsole *con); |
| 352 | |
Gerd Hoffmann | e2f82e9 | 2017-09-27 12:38:11 +0200 | [diff] [blame] | 353 | typedef uint32_t console_ch_t; |
| 354 | |
Anthony Liguori | c227f09 | 2009-10-01 16:12:16 -0500 | [diff] [blame] | 355 | static inline void console_write_ch(console_ch_t *dest, uint32_t ch) |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 356 | { |
Aurelien Jarno | 9ae19b6 | 2011-01-04 21:58:24 +0100 | [diff] [blame] | 357 | *dest = ch; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 358 | } |
| 359 | |
Marc-André Lureau | a7dfbe2 | 2021-02-04 14:52:23 +0400 | [diff] [blame] | 360 | enum { |
| 361 | GRAPHIC_FLAGS_NONE = 0, |
| 362 | /* require a console/display with GL callbacks */ |
| 363 | GRAPHIC_FLAGS_GL = 1 << 0, |
| 364 | /* require a console/display with DMABUF import */ |
| 365 | GRAPHIC_FLAGS_DMABUF = 1 << 1, |
| 366 | }; |
| 367 | |
Gerd Hoffmann | 380cd05 | 2013-03-13 14:04:18 +0100 | [diff] [blame] | 368 | typedef struct GraphicHwOps { |
Marc-André Lureau | a7dfbe2 | 2021-02-04 14:52:23 +0400 | [diff] [blame] | 369 | int (*get_flags)(void *opaque); /* optional, default 0 */ |
Gerd Hoffmann | 380cd05 | 2013-03-13 14:04:18 +0100 | [diff] [blame] | 370 | void (*invalidate)(void *opaque); |
| 371 | void (*gfx_update)(void *opaque); |
Marc-André Lureau | 4d63162 | 2015-08-24 13:20:49 +0200 | [diff] [blame] | 372 | bool gfx_update_async; /* if true, calls graphic_hw_update_done() */ |
Gerd Hoffmann | 380cd05 | 2013-03-13 14:04:18 +0100 | [diff] [blame] | 373 | void (*text_update)(void *opaque, console_ch_t *text); |
Akihiko Odaki | 362239c | 2022-02-26 20:55:14 +0900 | [diff] [blame] | 374 | void (*ui_info)(void *opaque, uint32_t head, QemuUIInfo *info); |
Gerd Hoffmann | bba19b8 | 2015-12-03 12:34:25 +0100 | [diff] [blame] | 375 | void (*gl_block)(void *opaque, bool block); |
Gerd Hoffmann | 380cd05 | 2013-03-13 14:04:18 +0100 | [diff] [blame] | 376 | } GraphicHwOps; |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 377 | |
Gerd Hoffmann | 5643706 | 2014-01-24 15:35:21 +0100 | [diff] [blame] | 378 | QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head, |
Gerd Hoffmann | aa2beaa | 2013-04-17 10:21:27 +0200 | [diff] [blame] | 379 | const GraphicHwOps *ops, |
Gerd Hoffmann | c78f713 | 2013-03-05 15:24:14 +0100 | [diff] [blame] | 380 | void *opaque); |
Gerd Hoffmann | 1c1f949 | 2014-09-24 17:05:27 +0200 | [diff] [blame] | 381 | void graphic_console_set_hwops(QemuConsole *con, |
| 382 | const GraphicHwOps *hw_ops, |
| 383 | void *opaque); |
Gerd Hoffmann | 9588d67 | 2018-03-13 11:17:29 -0600 | [diff] [blame] | 384 | void graphic_console_close(QemuConsole *con); |
aliguori | 3023f33 | 2009-01-16 19:04:14 +0000 | [diff] [blame] | 385 | |
Gerd Hoffmann | 1dbfa00 | 2013-03-12 13:44:38 +0100 | [diff] [blame] | 386 | void graphic_hw_update(QemuConsole *con); |
Marc-André Lureau | 4d63162 | 2015-08-24 13:20:49 +0200 | [diff] [blame] | 387 | void graphic_hw_update_done(QemuConsole *con); |
Gerd Hoffmann | 1dbfa00 | 2013-03-12 13:44:38 +0100 | [diff] [blame] | 388 | void graphic_hw_invalidate(QemuConsole *con); |
| 389 | void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata); |
Gerd Hoffmann | bba19b8 | 2015-12-03 12:34:25 +0100 | [diff] [blame] | 390 | void graphic_hw_gl_block(QemuConsole *con, bool block); |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 391 | |
Marc-André Lureau | 777357d | 2016-12-07 18:39:10 +0300 | [diff] [blame] | 392 | void qemu_console_early_init(void); |
| 393 | |
Marc-André Lureau | 5e79d51 | 2021-10-09 23:48:46 +0400 | [diff] [blame] | 394 | void qemu_console_set_display_gl_ctx(QemuConsole *con, DisplayGLCtx *ctx); |
Marc-André Lureau | 4f41814 | 2021-01-25 14:53:18 +0400 | [diff] [blame] | 395 | |
Akihiko Odaki | d4c1995 | 2024-03-19 12:08:40 +0900 | [diff] [blame] | 396 | QemuConsole *qemu_console_lookup_default(void); |
Gerd Hoffmann | 284d1c6 | 2013-03-15 15:45:54 +0100 | [diff] [blame] | 397 | QemuConsole *qemu_console_lookup_by_index(unsigned int index); |
Gerd Hoffmann | 5643706 | 2014-01-24 15:35:21 +0100 | [diff] [blame] | 398 | QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head); |
Gerd Hoffmann | f2c1d54 | 2016-01-12 11:45:43 +0100 | [diff] [blame] | 399 | QemuConsole *qemu_console_lookup_by_device_name(const char *device_id, |
| 400 | uint32_t head, Error **errp); |
Marc-André Lureau | 385ac97 | 2023-01-17 15:24:40 +0400 | [diff] [blame] | 401 | QEMUCursor *qemu_console_get_cursor(QemuConsole *con); |
Gerd Hoffmann | 81c0d5a | 2013-03-14 14:27:08 +0100 | [diff] [blame] | 402 | bool qemu_console_is_visible(QemuConsole *con); |
| 403 | bool qemu_console_is_graphic(QemuConsole *con); |
| 404 | bool qemu_console_is_fixedsize(QemuConsole *con); |
Gerd Hoffmann | f607867 | 2016-09-23 09:50:27 +0200 | [diff] [blame] | 405 | bool qemu_console_is_gl_blocked(QemuConsole *con); |
Gerd Hoffmann | 779ce88 | 2015-02-17 10:41:08 +0100 | [diff] [blame] | 406 | char *qemu_console_get_label(QemuConsole *con); |
Gerd Hoffmann | d4c8533 | 2013-11-28 09:58:18 +0100 | [diff] [blame] | 407 | int qemu_console_get_index(QemuConsole *con); |
Gerd Hoffmann | 5643706 | 2014-01-24 15:35:21 +0100 | [diff] [blame] | 408 | uint32_t qemu_console_get_head(QemuConsole *con); |
Gerd Hoffmann | d4c8533 | 2013-11-28 09:58:18 +0100 | [diff] [blame] | 409 | int qemu_console_get_width(QemuConsole *con, int fallback); |
| 410 | int qemu_console_get_height(QemuConsole *con, int fallback); |
Samuel Thibault | b3cb21b | 2016-12-21 01:38:04 +0100 | [diff] [blame] | 411 | /* Return the low-level window id for the console */ |
| 412 | int qemu_console_get_window_id(QemuConsole *con); |
| 413 | /* Set the low-level window id for the console */ |
| 414 | void qemu_console_set_window_id(QemuConsole *con, int window_id); |
Gerd Hoffmann | 81c0d5a | 2013-03-14 14:27:08 +0100 | [diff] [blame] | 415 | |
Gerd Hoffmann | c78f713 | 2013-03-05 15:24:14 +0100 | [diff] [blame] | 416 | void qemu_console_resize(QemuConsole *con, int width, int height); |
Gerd Hoffmann | c78f713 | 2013-03-05 15:24:14 +0100 | [diff] [blame] | 417 | DisplaySurface *qemu_console_surface(QemuConsole *con); |
Marc-André Lureau | 4f2c765 | 2023-08-30 13:37:37 +0400 | [diff] [blame] | 418 | void coroutine_fn qemu_console_co_wait_update(QemuConsole *con); |
Marc-André Lureau | 322dae4 | 2023-08-30 13:38:16 +0400 | [diff] [blame] | 419 | int qemu_invalidate_text_consoles(void); |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 420 | |
Gerd Hoffmann | cd2bc88 | 2015-01-09 11:40:23 +0100 | [diff] [blame] | 421 | /* console-gl.c */ |
Gerd Hoffmann | cd2bc88 | 2015-01-09 11:40:23 +0100 | [diff] [blame] | 422 | #ifdef CONFIG_OPENGL |
Gerd Hoffmann | cd2bc88 | 2015-01-09 11:40:23 +0100 | [diff] [blame] | 423 | bool console_gl_check_format(DisplayChangeListener *dcl, |
| 424 | pixman_format_code_t format); |
Gerd Hoffmann | 46e19e1 | 2017-10-10 15:54:49 +0200 | [diff] [blame] | 425 | void surface_gl_create_texture(QemuGLShader *gls, |
Gerd Hoffmann | cd2bc88 | 2015-01-09 11:40:23 +0100 | [diff] [blame] | 426 | DisplaySurface *surface); |
Gerd Hoffmann | 46e19e1 | 2017-10-10 15:54:49 +0200 | [diff] [blame] | 427 | void surface_gl_update_texture(QemuGLShader *gls, |
Gerd Hoffmann | cd2bc88 | 2015-01-09 11:40:23 +0100 | [diff] [blame] | 428 | DisplaySurface *surface, |
| 429 | int x, int y, int w, int h); |
Gerd Hoffmann | 46e19e1 | 2017-10-10 15:54:49 +0200 | [diff] [blame] | 430 | void surface_gl_render_texture(QemuGLShader *gls, |
Gerd Hoffmann | cd2bc88 | 2015-01-09 11:40:23 +0100 | [diff] [blame] | 431 | DisplaySurface *surface); |
Gerd Hoffmann | 46e19e1 | 2017-10-10 15:54:49 +0200 | [diff] [blame] | 432 | void surface_gl_destroy_texture(QemuGLShader *gls, |
Gerd Hoffmann | cd2bc88 | 2015-01-09 11:40:23 +0100 | [diff] [blame] | 433 | DisplaySurface *surface); |
Gerd Hoffmann | 46e19e1 | 2017-10-10 15:54:49 +0200 | [diff] [blame] | 434 | void surface_gl_setup_viewport(QemuGLShader *gls, |
Gerd Hoffmann | cd2bc88 | 2015-01-09 11:40:23 +0100 | [diff] [blame] | 435 | DisplaySurface *surface, |
| 436 | int ww, int wh); |
| 437 | #endif |
| 438 | |
Gerd Hoffmann | db71589 | 2018-03-01 11:05:35 +0100 | [diff] [blame] | 439 | typedef struct QemuDisplay QemuDisplay; |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 440 | |
Gerd Hoffmann | db71589 | 2018-03-01 11:05:35 +0100 | [diff] [blame] | 441 | struct QemuDisplay { |
| 442 | DisplayType type; |
| 443 | void (*early_init)(DisplayOptions *opts); |
| 444 | void (*init)(DisplayState *ds, DisplayOptions *opts); |
Marc-André Lureau | 1bec1cc | 2023-09-05 23:18:08 +0400 | [diff] [blame] | 445 | const char *vc; |
Gerd Hoffmann | db71589 | 2018-03-01 11:05:35 +0100 | [diff] [blame] | 446 | }; |
| 447 | |
| 448 | void qemu_display_register(QemuDisplay *ui); |
Gerd Hoffmann | 898f9d4 | 2018-03-01 11:05:40 +0100 | [diff] [blame] | 449 | bool qemu_display_find_default(DisplayOptions *opts); |
Gerd Hoffmann | db71589 | 2018-03-01 11:05:35 +0100 | [diff] [blame] | 450 | void qemu_display_early_init(DisplayOptions *opts); |
| 451 | void qemu_display_init(DisplayState *ds, DisplayOptions *opts); |
Marc-André Lureau | 1bec1cc | 2023-09-05 23:18:08 +0400 | [diff] [blame] | 452 | const char *qemu_display_get_vc(DisplayOptions *opts); |
Thomas Huth | c388f40 | 2020-01-08 15:47:02 +0100 | [diff] [blame] | 453 | void qemu_display_help(void); |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 454 | |
| 455 | /* vnc.c */ |
Fei Li | ab4f931 | 2018-10-17 10:26:50 +0200 | [diff] [blame] | 456 | void vnc_display_init(const char *id, Error **errp); |
Gerd Hoffmann | 4db1462 | 2014-09-16 12:33:03 +0200 | [diff] [blame] | 457 | void vnc_display_open(const char *id, Error **errp); |
Gerd Hoffmann | 14f7143 | 2014-07-29 12:24:55 +0200 | [diff] [blame] | 458 | void vnc_display_add_client(const char *id, int csock, bool skipauth); |
Gerd Hoffmann | 14f7143 | 2014-07-29 12:24:55 +0200 | [diff] [blame] | 459 | int vnc_display_password(const char *id, const char *password); |
| 460 | int vnc_display_pw_expire(const char *id, time_t expires); |
Paolo Bonzini | 653c974 | 2021-01-20 15:42:35 +0100 | [diff] [blame] | 461 | void vnc_parse(const char *str); |
Markus Armbruster | 28d0de7 | 2015-03-13 13:35:14 +0100 | [diff] [blame] | 462 | int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp); |
Zihao Chang | 1f08e34 | 2021-03-16 15:58:44 +0800 | [diff] [blame] | 463 | bool vnc_display_reload_certs(const char *id, Error **errp); |
Vladimir Sementsov-Ogievskiy | abea194 | 2022-04-01 17:39:35 +0300 | [diff] [blame] | 464 | bool vnc_display_update(DisplayUpdateOptionsVNC *arg, Error **errp); |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 465 | |
Amos Kong | 1048c88 | 2012-08-31 10:56:25 +0800 | [diff] [blame] | 466 | /* input.c */ |
Wolfgang Bumiller | 64ffbe0 | 2016-01-13 09:09:58 +0100 | [diff] [blame] | 467 | int index_from_key(const char *key, size_t key_length); |
Amos Kong | 1048c88 | 2012-08-31 10:56:25 +0800 | [diff] [blame] | 468 | |
Philippe Mathieu-Daudé | b956577 | 2021-08-23 12:04:54 +0200 | [diff] [blame] | 469 | #ifdef CONFIG_LINUX |
Vivek Kasireddy | 87f1221 | 2021-05-26 16:14:16 -0700 | [diff] [blame] | 470 | /* udmabuf.c */ |
| 471 | int udmabuf_fd(void); |
Philippe Mathieu-Daudé | b956577 | 2021-08-23 12:04:54 +0200 | [diff] [blame] | 472 | #endif |
Vivek Kasireddy | 87f1221 | 2021-05-26 16:14:16 -0700 | [diff] [blame] | 473 | |
Marc-André Lureau | f6ef71b | 2021-02-15 15:10:36 +0400 | [diff] [blame] | 474 | /* util.c */ |
| 475 | bool qemu_console_fill_device_address(QemuConsole *con, |
| 476 | char *device_address, |
| 477 | size_t size, |
| 478 | Error **errp); |
| 479 | |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 480 | #endif |