summaryrefslogtreecommitdiff
path: root/include/ui
AgeCommit message (Collapse)AuthorFilesLines
2018-02-09Include qapi/error.h exactly where neededMarkus Armbruster1-1/+0
This cleanup makes the number of objects depending on qapi/error.h drop from 1910 (out of 4743) to 1612 in my "build everything" tree. While there, separate #include from file comment with a blank line, and drop a useless comment on why qemu/osdep.h is included first. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-5-armbru@redhat.com> [Semantic conflict with commit 34e304e975 resolved, OSX breakage fixed]
2018-02-09Drop superfluous includes of qapi-types.h and test-qapi-types.hMarkus Armbruster1-1/+0
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-4-armbru@redhat.com>
2018-02-09Clean up includesMarkus Armbruster1-1/+0
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes, with the change to target/s390x/gen-features.c manually reverted, and blank lines around deletions collapsed. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-3-armbru@redhat.com>
2018-02-09vnc: use stubs for CONFIG_VNC=n dummy functionsGerd Hoffmann1-21/+0
Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20180202064546.21746-1-kraxel@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2018-01-29ui: fix alphabetical ordering of keymapsDaniel P. Berrange1-3/+3
The qcode-to-linux keymaps was accidentally added in the wrong place by commit de80d78594b4c3767a12d8d42debcf12cbf85a5b Author: Owen Smith <owen.smith@citrix.com> Date: Fri Nov 3 11:56:28 2017 +0000 ui: generate qcode to linux mappings breaking the alphabetical ordering of keymaps Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180117164118.8510-4-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-01-29hw: convert the escc device to keycodemapdbDaniel P. Berrange1-0/+3
Replace the qcode_to_keycode table with automatically generated tables. Missing entries in qcode_to_keycode now fixed: - Q_KEY_CODE_KP_COMMA -> 0x2d Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20180117164118.8510-3-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-01-29hw: convert ps2 device to keycodemapdbDaniel P. Berrange1-0/+9
Replace the qcode_to_keycode_set1, qcode_to_keycode_set2, and qcode_to_keycode_set3 tables with automatically generated tables. Missing entries in qcode_to_keycode_set1 now fixed: - Q_KEY_CODE_SYSRQ -> 0x54 - Q_KEY_CODE_PRINT -> 0x54 (NB ignored due to special case) - Q_KEY_CODE_AGAIN -> 0xe005 - Q_KEY_CODE_PROPS -> 0xe006 - Q_KEY_CODE_UNDO -> 0xe007 - Q_KEY_CODE_FRONT -> 0xe00c - Q_KEY_CODE_COPY -> 0xe078 - Q_KEY_CODE_OPEN -> 0x64 - Q_KEY_CODE_PASTE -> 0x65 - Q_KEY_CODE_CUT -> 0xe03c - Q_KEY_CODE_LF -> 0x5b - Q_KEY_CODE_HELP -> 0xe075 - Q_KEY_CODE_COMPOSE -> 0xe05d - Q_KEY_CODE_PAUSE -> 0xe046 - Q_KEY_CODE_KP_EQUALS -> 0x59 And some mistakes corrected: - Q_KEY_CODE_HIRAGANA was mapped to 0x70 (Katakanahiragana) instead of of 0x77 (Hirigana) - Q_KEY_CODE_MENU was incorrectly mapped to the compose scancode (0xe05d) and is now mapped to 0xe01e - Q_KEY_CODE_FIND was mapped to 0xe065 (Search) instead of to 0xe041 (Find) - Q_KEY_CODE_POWER, SLEEP & WAKE had 0x0e instead of 0xe0 as the prefix Missing entries in qcode_to_keycode_set2 now fixed: - Q_KEY_CODE_PRINT -> 0x7f (NB ignored due to special case) - Q_KEY_CODE_COMPOSE -> 0xe02f - Q_KEY_CODE_PAUSE -> 0xe077 - Q_KEY_CODE_KP_EQUALS -> 0x0f And some mistakes corrected: - Q_KEY_CODE_HIRAGANA was mapped to 0x13 (Katakanahiragana) instead of of 0x62 (Hirigana) - Q_KEY_CODE_MENU was incorrectly mapped to the compose scancode (0xe02f) and is now not mapped - Q_KEY_CODE_FIND was mapped to 0xe010 (Search) and is now not mapped. - Q_KEY_CODE_POWER, SLEEP & WAKE had 0x0e instead of 0xe0 as the prefix Missing entries in qcode_to_keycode_set3 now fixed: - Q_KEY_CODE_ASTERISK -> 0x7e - Q_KEY_CODE_SYSRQ -> 0x57 - Q_KEY_CODE_LESS -> 0x13 - Q_KEY_CODE_STOP -> 0x0a - Q_KEY_CODE_AGAIN -> 0x0b - Q_KEY_CODE_PROPS -> 0x0c - Q_KEY_CODE_UNDO -> 0x10 - Q_KEY_CODE_COPY -> 0x18 - Q_KEY_CODE_OPEN -> 0x20 - Q_KEY_CODE_PASTE -> 0x28 - Q_KEY_CODE_FIND -> 0x30 - Q_KEY_CODE_CUT -> 0x38 - Q_KEY_CODE_HELP -> 0x09 - Q_KEY_CODE_COMPOSE -> 0x8d - Q_KEY_CODE_AUDIONEXT -> 0x93 - Q_KEY_CODE_AUDIOPREV -> 0x94 - Q_KEY_CODE_AUDIOSTOP -> 0x98 - Q_KEY_CODE_AUDIOMUTE -> 0x9c - Q_KEY_CODE_VOLUMEUP -> 0x95 - Q_KEY_CODE_VOLUMEDOWN -> 0x9d - Q_KEY_CODE_CALCULATOR -> 0xa3 - Q_KEY_CODE_AC_HOME -> 0x97 And some mistakes corrected: - Q_KEY_CODE_MENU was incorrectly mapped to the compose scancode (0x8d) and is now 0x91 Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20180117164118.8510-2-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-01-25sdl: reorganize -no-frame supportGerd Hoffmann1-3/+2
Drop no_frame flag from sdl_display_init argument list, use a global variable instead. This is temporary until -no-frame support is dropped altogether when we remove sdl1 support. Remove any traces of noframe from sdl2 code. It is just dead code as sdl2 doesn't support the SDL_NOFRAME window flag any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20180115154855.30850-3-kraxel@redhat.com
2018-01-25ui: convert GTK and SDL1 frontends to keycodemapdbDaniel P. Berrange1-0/+21
The x_keycode_to_pc_keycode and evdev_keycode_to_pc_keycode tables are replaced with automatically generated tables. In addition the X11 heuristics are improved to detect running on XQuartz and XWin X11 servers, to activate the correct OS-X and Win32 keycode maps. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20180117164717.15855-3-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-01-25ui: convert the SDL2 frontend to keycodemapdbDaniel P. Berrange1-0/+3
The SDL2 scancodes are conveniently identical to the USB scancodes. Replace the sdl2_scancode_to_qcode table with an automatically generated table. Missing entries in sdl2_scancode_to_qcode now fixed: - 0x32 -> Q_KEY_CODE_BACKSLASH - 0x66 -> Q_KEY_CODE_POWER - 0x67 -> Q_KEY_CODE_KP_EQUALS - 0x74 -> Q_KEY_CODE_OPEN - 0x77 -> Q_KEY_CODE_FRONT - 0x7f -> Q_KEY_CODE_AUDIOMUTE - 0x80 -> Q_KEY_CODE_VOLUMEUP - 0x81 -> Q_KEY_CODE_VOLUMEDOWN - 0x85 -> Q_KEY_CODE_KP_COMMA - 0x87 -> Q_KEY_CODE_RO - 0x89 -> Q_KEY_CODE_YEN - 0x8a -> Q_KEY_CODE_HENKAN - 0x93 -> Q_KEY_CODE_HIRAGANA - 0xe8 -> Q_KEY_CODE_AUDIOPLAY - 0xe9 -> Q_KEY_CODE_AUDIOSTOP - 0xea -> Q_KEY_CODE_AUDIOPREV - 0xeb -> Q_KEY_CODE_AUDIONEXT - 0xed -> Q_KEY_CODE_VOLUMEUP - 0xee -> Q_KEY_CODE_VOLUMEDOWN - 0xef -> Q_KEY_CODE_AUDIOMUTE - 0xf1 -> Q_KEY_CODE_AC_BACK - 0xf2 -> Q_KEY_CODE_AC_FORWARD - 0xf3 -> Q_KEY_CODE_STOP - 0xf4 -> Q_KEY_CODE_FIND - 0xf8 -> Q_KEY_CODE_SLEEP - 0xfa -> Q_KEY_CODE_AC_REFRESH - 0xfb -> Q_KEY_CODE_CALCULATOR And some mistakes corrected: - 0x65 -> Q_KEY_CODE_COMPOSE, not duplicating Q_KEY_CODE_MENU Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20180117164717.15855-2-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-01-12sdl2: Ignore UI hotkeys after a focus change when GUI modifier is heldJindrich Makovicka1-0/+1
When SDL2 windows change focus while a key is held, the window that receives the focus also receives a new KeyDown event, without an autorepeat flag. This means that if a WM places the qemu console over the main window after Ctrl-Alt-2, the console closes immediately after opening. Then, the main window receives the KeyDown event again and the whole process repeats. This patch makes the SDL2 UI ignore the KeyDown events on a window that just received the focus, if the GUI modifier was held. The ignore flag is reset on a first KeyUp event. This effectively works around the issue above. Signed-off-by: Jindrich Makovicka <makovick@gmail.com> Message-Id: <20171117112258.5888-4-makovick@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-01-12spice: remove QXLWorker interface fieldFrediano Ziglio1-1/+0
This fields points to an old interface that is no more used in the current code. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Message-id: 20171122135625.16625-1-fziglio@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-12-14ui: generate qcode to linux mappingsOwen Smith1-0/+3
Use keycodedb to generate a qcode to linux mapping Signed-off-by: Owen Smith <owen.smith@citrix.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
2017-10-19Merge remote-tracking branch ↵Peter Maydell6-19/+47
'remotes/kraxel/tags/opengl-20171017-pull-request' into staging ui: opengl updates for dma-buf support. # gpg: Signature made Tue 17 Oct 2017 12:13:36 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/opengl-20171017-pull-request: egl-headless: add dmabuf support egl-helpers: add egl_texture_blit and egl_texture_blend egl-helpers: add dmabuf import support opengl: add flipping vertex shader opengl: move shader init from console-gl.c to shader.c console: add support for dmabufs Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-17egl-helpers: add egl_texture_blit and egl_texture_blendGerd Hoffmann1-0/+4
egl_texture_blit() blits a texture, simliar to egl_fb_blit() but by rendering the texture to the screen instead of using a framebuffer blit. egl_texture_blend() renders a texture with alpha blending, will be used to render the cursor to the screen. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20171010135453.6704-6-kraxel@redhat.com
2017-10-17egl-helpers: add dmabuf import supportGerd Hoffmann1-0/+3
Add helper function to import a dma-buf as opengl texture. Also add a helper to release the texture again. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20171010135453.6704-5-kraxel@redhat.com
2017-10-17opengl: add flipping vertex shaderGerd Hoffmann1-1/+1
Add vertex shader which flips the texture upside down while blitting it. Add argument to qemu_gl_run_texture_blit() to enable flipping. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20171010135453.6704-4-kraxel@redhat.com
2017-10-17opengl: move shader init from console-gl.c to shader.cGerd Hoffmann5-19/+15
With the upcoming dmabuf support in qemu there will be more users of the shaders than just console-gl.c. So rename ConsoleGLState to QemuGLShader, rename some functions too, move code from console-gl.c to shaders.c. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20171010135453.6704-3-kraxel@redhat.com
2017-10-17console: add support for dmabufsGerd Hoffmann1-0/+25
This patch adds support for dma-bufs to the qemu console interfaces. It adds a new "struct QemuDmaBuf" to represent a dmabuf with accociated metatdata (size, format). It adds three functions (and DisplayChangeListenerOps operations) to set a dma-buf as display scanout, as cursor and to release a dmabuf. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20171010135453.6704-2-kraxel@redhat.com
2017-10-16ui: don't export qemu_input_event_new_keyDaniel P. Berrange1-1/+0
All public code should use qemu_input_event_send_key* functions instead of creating an event directly. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170929101201.21039-7-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-10-16ui: convert common input code to keycodemapdbDaniel P. Berrange1-1/+10
Replace the number_to_qcode, qcode_to_number and linux_to_qcode tables with automatically generated tables. Missing entries in linux_to_qcode now fixed: KEY_LINEFEED -> Q_KEY_CODE_LF KEY_KPEQUAL -> Q_KEY_CODE_KP_EQUALS KEY_COMPOSE -> Q_KEY_CODE_COMPOSE KEY_AGAIN -> Q_KEY_CODE_AGAIN KEY_PROPS -> Q_KEY_CODE_PROPS KEY_UNDO -> Q_KEY_CODE_UNDO KEY_FRONT -> Q_KEY_CODE_FRONT KEY_COPY -> Q_KEY_CODE_COPY KEY_OPEN -> Q_KEY_CODE_OPEN KEY_PASTE -> Q_KEY_CODE_PASTE KEY_CUT -> Q_KEY_CODE_CUT KEY_HELP -> Q_KEY_CODE_HELP KEY_MEDIA -> Q_KEY_CODE_MEDIASELECT In addition, some fixes: - KEY_PLAYPAUSE now maps to Q_KEY_CODE_AUDIOPLAY, instead of KEY_PLAYCD. KEY_PLAYPAUSE is defined across almost all scancodes sets, while KEY_PLAYCD only appears in AT set1, so the former is a more useful mapping. Missing entries in qcode_to_number now fixed: Q_KEY_CODE_AGAIN -> 0x85 Q_KEY_CODE_PROPS -> 0x86 Q_KEY_CODE_UNDO -> 0x87 Q_KEY_CODE_FRONT -> 0x8c Q_KEY_CODE_COPY -> 0xf8 Q_KEY_CODE_OPEN -> 0x64 Q_KEY_CODE_PASTE -> 0x65 Q_KEY_CODE_CUT -> 0xbc Q_KEY_CODE_LF -> 0x5b Q_KEY_CODE_HELP -> 0xf5 Q_KEY_CODE_COMPOSE -> 0xdd Q_KEY_CODE_KP_EQUALS -> 0x59 Q_KEY_CODE_MEDIASELECT -> 0xed In addition, some fixes: - Q_KEY_CODE_MENU was incorrectly mapped to the compose scancode (0xdd) and is now mapped to 0x9e - Q_KEY_CODE_FIND was mapped to 0xe065 (Search) instead of to 0xe041 (Find) - Q_KEY_CODE_HIRAGANA was mapped to 0x70 (Katakanahiragana) instead of of 0x77 (Hirigana) - Q_KEY_CODE_PRINT was mapped to 0xb7 which is not a defined scan code in AT set 1, it is now mapped to 0x54 (sysrq) Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170929101201.21039-5-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-09-29egl: misc framebuffer helper improvements.Gerd Hoffmann1-2/+3
Rename the functions to to say "setup" instead of "create" because they support being called multiple times on the same egl framebuffer. Properly delete unused textures, update function interfaces to support this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170927115031.12063-1-kraxel@redhat.com
2017-09-29console: purge curses bits from console.hGerd Hoffmann1-21/+2
Handle the translation from vga chars to curses chars in curses_update() instead of console_write_ch(). Purge any curses support bits from ui/console.h include file. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170927103811.19249-1-kraxel@redhat.com
2017-08-31console: use DIV_ROUND_UPMarc-André Lureau1-1/+1
I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <rth@twiddle.net>
2017-07-27ui: move qemu_input_linux_to_qcode()Gerd Hoffmann1-0/+1
Move from input-linux.c to input-keymap.c and export it, so the function is available elsewhere too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20170726152918.11995-3-kraxel@redhat.com
2017-06-21gtk: use framebuffer helper functions.Gerd Hoffmann1-2/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170614084149.31314-5-kraxel@redhat.com
2017-06-21sdl2: use framebuffer helper functions.Gerd Hoffmann1-2/+6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170614084149.31314-4-kraxel@redhat.com
2017-06-21egl-helpers: add helpers to handle opengl framebuffersGerd Hoffmann1-0/+15
Add a collection of egl_fb_*() helper functions to manage and use opengl framebuffers, which is a common pattern in UI code with opengl support. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170614084149.31314-2-kraxel@redhat.com
2017-06-14spice: don't enter opengl mode in case another UI provides opengl supportGerd Hoffmann1-0/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170606110618.10393-1-kraxel@redhat.com
2017-05-12opengl: add egl-headless displayGerd Hoffmann1-0/+3
Add egl-headless user interface. It doesn't provide a real user interface, it only provides opengl support using drm render nodes. It will copy back the bits rendered by the guest using virgl back to a DisplaySurface and kick the usual display update code paths, so spice and vnc and screendump can pick it up. Use it this way: qemu -display egl-headless -vnc $display qemu -display egl-headless -spice gl=off,$args Note that you should prefer native spice opengl support (-spice gl=on) if possible because that delivers better performance. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170505104101.30589-7-kraxel@redhat.com
2017-05-12egl-helpers: fix display init for x11Gerd Hoffmann1-1/+2
When running on gtk we need X11 platform not mesa platform. Create separate functions for mesa and x11 so we can keep the egl #ifdef mess local to egl-helpers.c Fixes: 0ea1523fb6703aa0dcd65e66b59e96fec028e60a Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170505104101.30589-4-kraxel@redhat.com
2017-05-12egl-helpers: drop support for gles and debug loggingGerd Hoffmann1-1/+1
Leftover from the early opengl days. Unused now, so delete the dead code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20170505104101.30589-3-kraxel@redhat.com
2017-05-11ui: Support non-zero minimum values for absolute input axesPhilippe Voinov1-4/+7
This patch refactors ui/input.c to support absolute axis minimum values other than 0. All dependent calls to qemu_input_queue_abs have been updated to explicitly supply 0 as the axis minimum value. Signed-off-by: Philippe Voinov <philippevoinov@gmail.com> Message-id: 20170505133952.29885-1-philippevoinov@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-03-16cirrus/vnc: zap bitblit support from console code.Gerd Hoffmann1-7/+0
There is a special code path (dpy_gfx_copy) to allow graphic emulation notify user interface code about bitblit operations carryed out by guests. It is supported by cirrus and vnc server. The intended purpose is to optimize display scrolls and just send over the scroll op instead of a full display update. This is rarely used these days though because modern guests simply don't use the cirrus blitter any more. Any linux guest using the cirrus drm driver doesn't. Any windows guest newer than winxp doesn't ship with a cirrus driver any more and thus uses the cirrus as simple framebuffer. So this code tends to bitrot and bugs can go unnoticed for a long time. See for example commit "3e10c3e vnc: fix qemu crash because of SIGSEGV" which fixes a bug lingering in the code for almost a year, added by commit "c7628bf vnc: only alloc server surface with clients connected". Also the vnc server will throttle the frame rate in case it figures the network can't keep up (send buffers are full). This doesn't work with dpy_gfx_copy, for any copy operation sent to the vnc client we have to send all outstanding updates beforehand, otherwise the vnc client might run the client side blit on outdated data and thereby corrupt the display. So this dpy_gfx_copy "optimization" might even make things worse on slow network links. Lets kill it once for all. Oh, and one more reason: Turns out (after writing the patch) we have a security bug in that code path ... Fixes: CVE-2016-9603 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1489494419-14340-1-git-send-email-kraxel@redhat.com
2017-02-27gtk-egl: add scanout_disable supportGerd Hoffmann1-0/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1487669841-13668-7-git-send-email-kraxel@redhat.com
2017-02-27sdl2: add scanout_disable supportGerd Hoffmann1-0/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1487669841-13668-6-git-send-email-kraxel@redhat.com
2017-02-27console: add dpy_gl_scanout_disableGerd Hoffmann1-0/+2
Helper function (and DisplayChangeListenerOps ptr) to disable scanouts. Replaces using dpy_gl_scanout_texture with 0x0 size and no texture specified. Allows cleanups to make the io and gfx emulation code more readable. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1487669841-13668-3-git-send-email-kraxel@redhat.com
2017-02-27console: rename dpy_gl_scanout to dpy_gl_scanout_textureGerd Hoffmann3-23/+32
We'll add a variant which accepts dmabufs soon. Change the name so we can easily disturgish the two variants. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1487669841-13668-2-git-send-email-kraxel@redhat.com
2017-02-20spice: allow to specify drm rendernodeMarc-André Lureau1-2/+1
When multiple GPU are available, picking the first one isn't always the best choice. Learn to specify a device rendernode. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20170212112118.16044-1-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-27chardev: qom-ifyMarc-André Lureau1-0/+2
Turn Chardev into Object. qemu_chr_alloc() is replaced by the qemu_chardev_new() constructor. It will call qemu_char_open() to open/intialize the chardev with the ChardevCommon *backend settings. The CharDriver::create() callback is turned into a ChardevClass::open() which is called from the newly introduced qemu_chardev_open(). "chardev-gdb" and "chardev-hci" are internal chardev and aren't creatable directly with -chardev. Use a new internal flag to disable them. We may want to use TYPE_USER_CREATABLE interface instead, or perhaps allow -chardev usage. Although in general we keep typename and macros private, unless the type is being used by some other file, in this patch, all types and common helper macros for qemu-char.c are in char.h. This is to help transition now (some types must be declared early, while some aren't shared) and when splitting in several units. This is to be improved later. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-01-27char: rename CharDriverState ChardevMarc-André Lureau2-2/+2
Pick a uniform chardev type name. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-01-10curses: Fix compiler warnings (Mingw-w64 redefinition of macro KEY_EVENT)Stefan Weil1-0/+3
For builds with Mingw-w64 as it is included in Cygwin, there are two header files which define KEY_EVENT with different values. This results in lots of compiler warnings like this one: CC vl.o In file included from /qemu/include/ui/console.h:340:0, from /qemu/vl.c:76: /usr/i686-w64-mingw32/sys-root/mingw/include/curses.h:1522:0: warning: "KEY_EVENT" redefined #define KEY_EVENT 0633 /* We were interrupted by an event */ In file included from /usr/share/mingw-w64/include/windows.h:74:0, from /usr/share/mingw-w64/include/winsock2.h:23, from /qemu/include/sysemu/os-win32.h:29, from /qemu/include/qemu/osdep.h:100, from /qemu/vl.c:24: /usr/share/mingw-w64/include/wincon.h:101:0: note: this is the location of the previous definition #define KEY_EVENT 0x1 QEMU only uses the KEY_EVENT macro from wincon.h. Therefore we can undefine the macro coming from curses.h. The explicit include statement for curses.h in ui/curses.c is not needed and was removed. Those two modifications fix the redefinition warnings. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Message-id: 20161119185318.10564-1-sw@weilnetz.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10console: add API to get underlying gui window IDSamuel Thibault1-0/+4
This adds two console functions, qemu_console_set_window_id and qemu_graphic_console_get_window_id, to let graphical backend record the window id in the QemuConsole structure, and let the baum driver read it. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Message-id: 20161221003806.22412-2-samuel.thibault@ens-lyon.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-01-10ui: use evdev keymap when running under waylandDaniel P. Berrange1-0/+4
Wayland always uses evdev as its input source, so QEMU can use the existing evdev keymap data Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Tested-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20161201094117.16407-1-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-09-28spice/gl: render DisplaySurface via openglGerd Hoffmann1-1/+4
This switches over spice (in opengl mode) to render DisplaySurface updates into a opengl texture, using the helper functions in ui/console-gl.c. With this patch applied spice (with gl=on) will stop using qxl rendering ops, it will use dma-buf passing all the time, i.e. for bios/bootloader (before virtio-gpu driver is loaded) too. This should improve performance even using spice (with gl=on) with non-accelerated stdvga because we stop squeezing all display updates through a unix/tcp socket and basically using a shared memory transport instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1474617028-3979-3-git-send-email-kraxel@redhat.com
2016-09-28console: track gl_block state in QemuConsoleGerd Hoffmann1-0/+1
Keep track of gl_block state (added in bba19b8 console: block rendering until client is done) in QemuConsole and allow to query it. This way we can avoid state inconsistencies in case different code paths make use of this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1474617028-3979-2-git-send-email-kraxel@redhat.com
2016-09-15Remove unused function declarationsLadi Prosek3-6/+0
Unused function declarations were found using a simple gcc plugin and manually verified by grepping the sources. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-08-09clang: Fix warning reg. expansion to 'defined'Pranith Kumar1-2/+5
Clang produces the following warning. The warning is detailed here: https://reviews.llvm.org/D15866. Fix the warning. /home/pranith/devops/code/qemu/hw/display/qxl.c:507:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] ^ /home/pranith/devops/code/qemu/include/ui/qemu-spice.h:46:5: note: expanded from macro 'SPICE_NEEDS_SET_MM_TIME' (!defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06)) ^ /home/pranith/devops/code/qemu/hw/display/qxl.c:1074:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] ^ /home/pranith/devops/code/qemu/include/ui/qemu-spice.h:46:5: note: expanded from macro 'SPICE_NEEDS_SET_MM_TIME' (!defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06)) Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-07-11gtk: fix buildGerd Hoffmann1-0/+1
Commit "9d8256e virgl: pass whole GL scanout dimensions" missed the opengl code path for gtk versions >= 3.16. Update that one too and fix the build with recent gtk versions. Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1467876563-1351-1-git-send-email-kraxel@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-07-06virgl: pass whole GL scanout dimensionsMarc-André Lureau3-0/+4
Spice client needs the whole GL texture dimension to be able to show a scanout with a monitor offset (different than +0+0). Furthermore, this fixes a crash when calling surface_{width,height}() after dpy_gfx_replace_surface(con, NULL) was called in virgl_cmd_set_scanout() Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1465911849-30423-4-git-send-email-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>