summaryrefslogtreecommitdiff
path: root/include/ui
AgeCommit message (Collapse)AuthorFilesLines
2015-05-06console: add dpy_ui_info_supportedGerd Hoffmann1-0/+1
Allow ui code to check whenever the emulated display supports display change notifications. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-05sdl2: Fix RGB555Max Reitz1-0/+5
Reproducable with: $ x86_64-softmmu/qemu-system-x86_64 \ -kernel $vmlinuz_of_your_choice \ -append vga=0x313 -sdl Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-05sdl2: add support for display rendering using opengl.Gerd Hoffmann2-0/+12
Add new sdl2-gl.c file, with display rendering functions using opengl. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-05-05sdl2: move SDL_* includes to sdl2.hGerd Hoffmann1-0/+6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-05-05console-gl: add opengl rendering helper functionsGerd Hoffmann2-0/+33
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-05-05opengl: add shader helper functions.Gerd Hoffmann1-0/+9
Helper functions to compile, link and run opengl shader programs. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-04-27Merge remote-tracking branch 'remotes/spice/tags/pull-spice-20150427-1' into ↵Peter Maydell3-6/+6
staging spice: misc fixes. # gpg: Signature made Mon Apr 27 12:03:16 2015 BST using RSA key ID D3E87138 # 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>" * remotes/spice/tags/pull-spice-20150427-1: spice: learn to hide cursor spice: set pointer position on hotspot spice: fix mouse cursor position spice: fix simple display on bigendian hosts monitor: Make client_migrate_info synchronous Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-04-27spice: set pointer position on hotspotMarc-André Lureau1-1/+2
The Spice protocol uses cursor position on hotspot: the client is applying hotspot offset when drawing the cursor. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-04-27spice: fix simple display on bigendian hostsGerd Hoffmann1-0/+2
Denis Kirjanov is busy getting spice run on ppc64 and trapped into this one. Spice wire format is little endian, so we have to explicitly say we want little endian when letting pixman convert the data for us. Reported-by: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-04-27monitor: Make client_migrate_info synchronousMarkus Armbruster1-5/+2
Live migration with spice works like this today: (1) client_migrate_info monitor cmd (2) spice server notifies client, client connects to target host. (3) qemu waits until spice client connect is finished. (4) send over vmstate (i.e. main part of live migration). (5) spice handover to target host. (3) is implemented by making client_migrate_info a async monitor command. This is the only async monitor command we have. The original reason to implement this dance was that qemu did not accept new tcp connections while the incoming migration was running, so (2) and (4) could not be done in parallel. That issue was fixed long ago though. Qemu version 1.3.0 (released Dec 2012) and newer happily accept tcp connects while the incoming migration runs. Time to drop step (3). This patch does exactly that, by making the monitor command synchronous and removing the code needed to handle the async monitor command in ui/spice-core.c Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-04-22console/gtk: add qemu_console_get_labelGerd Hoffmann1-0/+1
Add a new function to get a nice label for a given QemuConsole. Drop the labeling code in gtk.c and use the new function instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-03-12pixman: add a bunch of PIXMAN_BE_* defines for 32bppGerd Hoffmann1-0/+16
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-03-10Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20150310-1' into ↵Peter Maydell1-1/+0
staging vnc bugfixes. # gpg: Signature made Tue Mar 10 10:37:51 2015 GMT using RSA key ID D3E87138 # 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>" * remotes/kraxel/tags/pull-vnc-20150310-1: Fix crash when connecting to VNC through websocket vnc: -readconfig fix vnc: set id at parse time not init time Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-10vnc: set id at parse time not init timeGerd Hoffmann1-1/+0
This way the generated id will be stored in -writeconfig cfg files. Also we can make vnc_auto_assign_id() local to vnc.c. Tested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-03-10ui: Removed unused functionsThomas Huth1-3/+0
Remove qemu_console_displaystate(), qemu_remove_kbd_event_handler(), qemu_different_endianness_pixelformat() and cpkey(), since they are completely unused. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2015-02-25Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-02-18' ↵Peter Maydell2-4/+1
into staging hmp: Normalize HMP command handler names # gpg: Signature made Wed Feb 18 10:59:44 2015 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-monitor-2015-02-18: hmp: Name HMP info handler functions hmp_info_SUBCOMMAND() hmp: Name HMP command handler functions hmp_COMMAND() hmp: Clean up declarations for long-gone info handlers Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-02-18hmp: Name HMP command handler functions hmp_COMMAND()Markus Armbruster1-1/+1
Some are called do_COMMAND() (old ones, usually), some hmp_COMMAND(), and sometimes COMMAND pointlessly differs in spelling. Normalize to hmp_COMMAND(), where COMMAND is exactly the command name with '-' replaced by '_'. Exceptions: * do_device_add() and client_migrate_info() *not* renamed to hmp_device_add(), hmp_client_migrate_info(), because they're also QMP handlers. They still need to be converted to QAPI. * do_memory_dump(), do_physical_memory_dump(), do_ioport_read(), do_ioport_write() renamed do hmp_* instead of hmp_x(), hmp_xp(), hmp_i(), hmp_o(), because those names are too cryptic for my taste. * do_info_help() renamed to hmp_info_help() instead of hmp_info(), because it only covers help. Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-02-18hmp: Clean up declarations for long-gone info handlersMarkus Armbruster1-3/+0
Leftovers from d1f2964 qapi: Convert query-spice 791e7c8 qapi: Convert query-migrate 0fe6a7f slirp: Drop statistic code Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-02-16vnc: introduce an wrapper for auto assign vnc idGonglei1-0/+1
Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-29qmp hmp: Improve error messages when SPICE is not in useMarkus Armbruster1-2/+2
Commit 7572150 adopted QERR_DEVICE_NOT_ACTIVE for the purpose, probably because adding another error seemed cumbersome overkill. Produces "No spice device has been activated", which is awkward. We've since abandoned our quest for "rich" error objects. Time to undo the damage to this error message. Replace it by "SPICE is not in use". Keep the stupid DeviceNotActive ErrorClass for compatibility, even though Libvirt doesn't use it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-29qmp hmp: Factor out common "using spice" testMarkus Armbruster1-0/+10
Into qemu_using_spice(). For want of a better place, put it next the existing monitor command handler dummies in qemu-spice.h. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22vnc: switch to QemuOpts, allow multiple serversGerd Hoffmann1-1/+3
This patch switches vnc over to QemuOpts, and it (more or less as side effect) allows multiple vnc server instances. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22vnc: remove unused DisplayState parameter, add id instead.Gerd Hoffmann1-8/+8
DisplayState isn't used anywhere, drop it. Add the vnc server ID as parameter instead, so it is possible to specify the server instance. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com>
2015-01-19ui/sdl2: Support shared surface for more pixman formatsGerd Hoffmann1-0/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-19ui/pixman: add qemu_pixman_check_formatGerd Hoffmann1-0/+2
Convinience check_format function for UIs using pixman. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-19ui: Add dpy_gfx_check_format() to check backend shared surface supportBenjamin Herrenschmidt1-0/+4
This allows VGA to decide whether to use a shared surface based on whether the UI backend supports the format or not. Backends that don't provide the new callback fallback to native 32 bpp which is equivalent to what was supported before. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [ kraxel: fix console check, allow only 32 bpp as fallback ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-12-21Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-20141219-1' into ↵Peter Maydell1-0/+32
staging sdl2: fixes, cleanups and opengl preparation. # gpg: Signature made Fri 19 Dec 2014 09:06:07 GMT using RSA key ID D3E87138 # 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>" * remotes/kraxel/tags/pull-sdl-20141219-1: sdl2: Work around SDL2 SDL_ShowWindow() bug sdl2: Use correct sdl2_console for window events sdl2: move sdl2_2d_refresh to sdl2-2d.c sdl2: factor out sdl2_poll_events sdl2: add+use sdl2_2d_redraw function. sdl2: move sdl_switch to sdl2-2d.c sdl2: overhaul window size handling sdl2: move sdl_update to new sdl2-2d.c sdl2: turn on keyboard grabs sdl2: move keyboard input code to new sdl2-input.c sdl2: rename sdl2_state to sdl2_console, move to header file sdl: move version logic from source code to makefile Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-12-17sdl2: move sdl2_2d_refresh to sdl2-2d.cGerd Hoffmann1-0/+1
Now that common event handling code is split off, we can move over sdl_refresh to sdl2-2d.c, and rename it to sdl2_2d_refresh. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: factor out sdl2_poll_eventsGerd Hoffmann1-0/+1
Create a new function to poll and handle sdl2 events, which is then just called from the refresh timer. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: add+use sdl2_2d_redraw function.Gerd Hoffmann1-0/+1
Add a new sdl2_2d_redraw function for a complete screen refresh, so we can stop using graphic_hw_invalidate for that. There is no need to bother console / gfx emulation code if we are just going to re-blit the screen after window resizes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: move sdl_switch to sdl2-2d.cGerd Hoffmann1-0/+6
Move sdl_switch to sdl2-2d.c file, rename to sdl2_2d_switch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: move sdl_update to new sdl2-2d.cGerd Hoffmann1-0/+3
Create new sdl2-2d file for 2d display rendering. Move over sdl_update code, and rename to sdl2_2d_update. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: move keyboard input code to new sdl2-input.cGerd Hoffmann1-0/+4
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-17sdl2: rename sdl2_state to sdl2_console, move to header fileGerd Hoffmann1-0/+16
Create sdl2.h header file, in preparation for sdl2 code splitup. Populate it with sdl2_console struct (renamed from sdl2_state). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2014-12-16spice: use bottom half instead of refresh timer for cursor updatesGerd Hoffmann1-1/+2
Calling directly doesn't work due to the qxl-render code running in spice server thread context. Meanwhile bottom half scheduling is thread-safe though, so we can use that to kick a cursor update in main i/o thread context. Cc: Marc-André Lureau <marcandre.lureau@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-09-29console: add graphic_console_set_hwopsGerd Hoffmann1-0/+3
Add a function to allow display emulations to switch the hwops function pointers. This is useful for devices which have two completely different operation modes. Typical case is the vga compatibility mode vs. native mode in qxl and the upcoming virtio-vga device. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-09-05console: Remove unused QEMU_BIG_ENDIAN_FLAGBenjamin Herrenschmidt1-2/+1
If we need to, we should use the pixman formats instead but for now this is unused except in commented out code so take it out to avoid further confusion about surface endianness. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-09-05console: add qemu_pixman_linebuf_copyGerd Hoffmann1-0/+2
Helper function for copying data from linebuf to framebuffer using pixman, possibly converting in case src and dst formats differ. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-09-05console: add dpy_gfx_update_dirtyGerd Hoffmann1-0/+4
Calls dpy_gfx_update for all dirty scanlines. Works for DisplaySurfaces backed by guest memory (i.e. the ones created using qemu_create_displaysurface_guestmem). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-09-05console: add qemu_create_displaysurface_guestmemGerd Hoffmann1-0/+4
This patch adds a qemu_create_displaysurface_guestmem helper function. Works simliar to qemu_create_displaysurface_from, but accepts a guest address instead of a host pointer and it handles cpu_physical_memory_{map,unmap} for you. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-09-05console: stop using PixelFormatGerd Hoffmann1-7/+7
With this patch the qemu console core stops using PixelFormat and pixman format codes side-by-side, pixman format code is the primary way to specify the DisplaySurface format: * DisplaySurface stops carrying a PixelFormat field. * qemu_create_displaysurface_from() expects a pixman format now. Functions to convert PixelFormat to pixman_format_code_t (and back) exist for those who still use PixelFormat. As PixelFormat allows easy access to masks and shifts it will probably continue to exist. [ xenfb added by Benjamin Herrenschmidt ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-09-05console: add qemu_default_pixman_formatGerd Hoffmann1-0/+1
Function returning the default pixman format for a given depth. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-09-05console: add qemu_pixelformat_from_pixmanGerd Hoffmann1-0/+1
Function to convert pixman format codes to qemu PixelFormat. [ Benjamin Herrenschmidt: fix BGRA+RGBA shifts ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-23console: move chardev declarations to sysemu/char.hMichael S. Tsirkin1-5/+0
move generic chardev APIs to sysemu/char.h, to make them available to callers which can not depend on the whole of ui/console.h. This fixes a build error on systems without pixman-devel: ./configure --disable-tools --disable-docs --target-list=arm-linux-user ... pixman none ... make ... In file included from /data/home/nchip/linaro/qemu/include/ui/console.h:4:0, from /data/home/nchip/linaro/qemu/stubs/vc-init.c:2: /data/home/nchip/linaro/qemu/include/ui/qemu-pixman.h:14:20: fatal error: pixman.h: No such file or directory #include <pixman.h> ^ compilation terminated. Reported-by: Riku Voipio <riku.voipio@iki.fi> Tested-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1403508500-32691-1-git-send-email-mst@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-13spice: add mouse cursor supportGerd Hoffmann1-0/+14
So you'll have a mouse pointer when running non-qxl gfx cards with mouse pointer support (virtio-gpu, IIRC vmware too). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-04input: add support for kbd delaysGerd Hoffmann1-0/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-02console: add kbd_put_string_consoleGerd Hoffmann1-0/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-02console: add kbd_put_qcode_consoleGerd Hoffmann1-0/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-28Merge remote-tracking branch 'remotes/kraxel/tags/pull-console-1' into stagingPeter Maydell1-0/+1
console: multiwindow support for text terminal QemuConsoles console: small fixes # gpg: Signature made Mon 26 May 2014 09:17:27 BST using RSA key ID D3E87138 # gpg: Can't check signature: public key not found * remotes/kraxel/tags/pull-console-1: console: add kbd_put_keysym_console console: rework text terminal cursor logic console: update text terminal surface unconditionally console: nicer initial screen console: Abort on property access errors Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-26input: bind devices and input routingGerd Hoffmann1-0/+3
Add function to bind input devices to display devices. Implementing input routing on top of this: Events coming from the display device in question are routed to the input device bound to it (if there is one). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>