summaryrefslogtreecommitdiffstats
path: root/ui/spice-display.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: avoid useless "if (foo) free(foo)" patternDaniel P. Berrange2015-09-111-10/+4
| | | | | | | | | | | | The free() and g_free() functions both happily accept NULL on any platform QEMU builds on. As such putting a conditional 'if (foo)' check before calls to 'free(foo)' merely serves to bloat the lines of code. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* Include monitor/monitor.h exactly where neededMarkus Armbruster2015-06-221-1/+0
| | | | | | | | | In particular, don't include it into headers. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
* spice: ui_info tweaksGerd Hoffmann2015-06-111-9/+8
| | | | | | | Use the new dpy_ui_info_supported function. Clarifies the control flow. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice-display: fix segfault in qemu_spice_create_updateGerd Hoffmann2015-06-111-4/+5
| | | | | | | | | | | | Although it is pretty unusual the stride for the guest image and the mirror image maintained by spice-display can be different. So use separate variables for them. https://bugzilla.redhat.com/show_bug.cgi?id=1163047 Cc: qemu-stable@nongnu.org Reported-by: perrier vincent <clownix@clownix.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* hw/display : remove 'struct' from 'typedef QXL struct'Chih-Min Chao2015-04-301-3/+3
| | | | | | Signed-off-by: Chih-Min Chao <cmchao@gmail.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* ui/console : remove 'struct' from 'typedef struct' typeChih-Min Chao2015-04-301-1/+1
| | | | | | Signed-off-by: Chih-Min Chao <cmchao@gmail.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* spice: learn to hide cursorMarc-André Lureau2015-04-271-3/+6
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: set pointer position on hotspotMarc-André Lureau2015-04-271-4/+6
| | | | | | | 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>
* spice: fix mouse cursor positionMarc-André Lureau2015-04-271-1/+1
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: fix simple display on bigendian hostsGerd Hoffmann2015-04-271-1/+1
| | | | | | | | | 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>
* spice: fix coverity reported defect in display codeGerd Hoffmann2015-01-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Report: 1. Condition surface, taking false branch 406 if (surface && ssd->surface && 407 surface_width(surface) == pixman_image_get_width(ssd->surface) && 408 surface_height(surface) == pixman_image_get_height(ssd->surface)) { 409 /* no-resize fast path: just swap backing store */ ... 10. alias_transfer: Assigning: ssd->ds = surface. 440 ssd->ds = surface; 11. var_deref_op: Dereferencing null pointer ssd->ds. CID 1264334 (#1 of 1): Dereference after null check (FORWARD_NULL) 441 ssd->surface = pixman_image_ref(ssd->ds->image); Fix: Move code block dereferencing ssd->ds into the already existing if (ssd->ds) { ... } block. Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ui/spice: Support shared surface for most pixman formatsGerd Hoffmann2015-01-191-6/+7
| | | | | | Just hook up qemu_pixman_check_format. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: rework mirror allocation, add no-resize fast pathGerd Hoffmann2014-12-161-7/+26
| | | | | | | | | | | | | Add fast path to qemu_spice_display_switch in case old and new displaysurface have identical size (happens with display panning and page flipping). We just swap the backing store then and don't go through the whole process of deleting and creating the primary surface. To simplify the code a bit move mirror surface allocation to qemu_spice_display_switch(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: use bottom half instead of refresh timer for cursor updatesGerd Hoffmann2014-12-161-2/+10
| | | | | | | | | | 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>
* spice: make sure we don't overflow ssd->bufGerd Hoffmann2014-09-051-5/+15
| | | | | | | | | | | | | | | | | | | | | | Related spice-only bug. We have a fixed 16 MB buffer here, being presented to the spice-server as qxl video memory in case spice is used with a non-qxl card. It's also used with qxl in vga mode. When using display resolutions requiring more than 16 MB of memory we are going to overflow that buffer. In theory the guest can write, indirectly via spice-server. The spice-server clears the memory after setting a new video mode though, triggering a segfault in the overflow case, so qemu crashes before the guest has a chance to do something evil. Fix that by switching to dynamic allocation for the buffer. CVE-2014-3615 Cc: qemu-stable@nongnu.org Cc: secalert@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* spice: fix 32bit buildGerd Hoffmann2014-06-201-1/+1
| | | | | | | Tested-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1403244764-8622-1-git-send-email-kraxel@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* spice: add mouse cursor supportGerd Hoffmann2014-06-131-11/+118
| | | | | | | 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>
* spice: monitors_config: check pointer before dereferencingGerd Hoffmann2014-04-071-0/+4
| | | | | Reported-by: Fabio Fantoni <fabio.fantoni@m2r.biz> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: QemuUIInfo windupGerd Hoffmann2014-03-101-3/+22
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: fix simple display surface handlingGerd Hoffmann2014-03-101-4/+8
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: move qemu_spice_display_*() from spice-graphics to spice-coreGerd Hoffmann2013-12-161-17/+0
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: fix multihead supportGerd Hoffmann2013-10-171-3/+20
| | | | | | | | | | | | | | | | | | | | This patch fixes spice display initialization to handle multihead properly. spice-core now keeps track of which QemuConsole has a spice display channel attached to it and which has not. It also manages display channel ids. spice-display looks at all QemuConsoles and will pick up any graphic console not yet bound to a spice channel (which in practice are all non-qxl graphic devices). Result is that (a) you'll get a spice client window for each graphical device now (first only without this patch), and (b) mixing qxl and non-qxl vga cards works properly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice-display: add display channel id to the debug messages.Gerd Hoffmann2013-10-171-13/+14
| | | | | | And s/__FUNCTION__/__func__/ while being at it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: replace use of deprecated APIMarc-André Lureau2013-10-171-5/+5
| | | | | | hose API are deprecated since 0.11, and qemu depends on 0.12 already. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: zap ds arg from register_displaychangelistenerGerd Hoffmann2013-04-251-1/+1
| | | | | | | We don't have multiple DisplayStates any more, so passing it in as argument is not needed. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: allow pinning displaychangelisteners to consolesGerd Hoffmann2013-04-161-5/+6
| | | | | | | | | | | DisplayChangeListener gets a new QemuConsole field, which can be set to non-NULL before registering. This will pin the QemuConsole, so that particular DisplayChangeListener will not follow console switches. spice+gtk (which don't support text console input anyway) are switched over to be pinned to console 0, which usually is the graphical display. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: rename vga_hw_*, add QemuConsole paramGerd Hoffmann2013-04-161-1/+1
| | | | | | | | | | | | Add QemuConsole parameter to vga_hw_*, so the interface allows to update non-active consoles (the actual code can't handle this yet, see next patch). Passing NULL is allowed and updates the active console, like the functions do today. While touching all vga_hw_* calls anyway rename that to the functions to hardware-neutral graphics_hw_* Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: stop using DisplayState in gfx hardware emulationGerd Hoffmann2013-03-181-4/+6
| | | | | | | Use QemuConsole instead. Updates interfaces in console.[ch] and adapts gfx hardware emulation code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: zap displaystate from dcl callbacksGerd Hoffmann2013-03-181-4/+1
| | | | | | | Now that nobody depends on DisplayState in DisplayChangeListener callbacks any more we can remove the parameter from all callbacks. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: stop using DisplayStateGerd Hoffmann2013-03-181-15/+16
| | | | | | | Rework DisplayStateListener callbacks to not use the DisplayState any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: rework DisplaySurface handling [dcl/ui side]Gerd Hoffmann2013-03-181-5/+7
| | | | | | | | Replace the dpy_gfx_resize and dpy_gfx_setdata DisplayChangeListener callbacks with a dpy_gfx_switch callback which notifies the ui code when the framebuffer backing storage changes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: zap sdpy globalGerd Hoffmann2013-03-181-14/+16
| | | | | | | | DisplayChangeListener is passed now to all DisplayChangeListenerOps callbacks, so we can use that to access the spice display state and kill the sdpy global variable. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: fix displaychangelisteners interfaceGerd Hoffmann2013-03-181-6/+13
| | | | | | | | Split callbacks into separate Ops struct. Pass DisplayChangeListener pointer as first argument to all callbacks. Uninline a bunch of display functions and move them from console.h to console.c Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* softmmu: move include files to include/sysemu/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* misc: move include files to include/qemu/Paolo Bonzini2012-12-191-2/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* monitor: move include files to include/monitor/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* ui: move files to ui/ and include/ui/Paolo Bonzini2012-12-191-3/+3
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* spice: add new spice-server callbacks to ui/spice-display.cGerd Hoffmann2012-11-211-0/+35
| | | | | | Otherwise qemu crashes with non-qxl graphics cards. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: fix initialization orderGerd Hoffmann2012-11-051-1/+1
| | | | | | | | | | Register displaychangelistener last, after spice is fully initialized, otherwise we may hit NULL pointer dereferences when qemu starts calling our callbacks. Commit e250d949feb1334828f27f0d145c35f29c4b7639 triggers this bug. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: switch to pixmanGerd Hoffmann2012-11-051-29/+22
| | | | | | | Switch over spice-display.c to use the pixman library instead of the home-grown pflib bits. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: untangle gfx & txt updatesGerd Hoffmann2012-11-011-2/+2
| | | | | | | | | | | | | | | | Stop abusing displaysurface fields for text mode displays. (bpp = 0, width = cols, height = lines). Add flags to displaystate indicating whenever text mode display (curses) or gfx mode displays (sdl, vnc, ...) are present. Add separate displaychangelistener callbacks for text / gfx mode resize & updates. This allows to enable gfx and txt diplays at the same time and also paves the way for more cleanups in the future. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: move set_mouse + cursor_define callbacksGerd Hoffmann2012-11-011-2/+2
| | | | | | | When adding DisplayChangeListeners the set_mouse and cursor_define callbacks have been left in DisplayState for some reason. Fix it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: raise requirement to 0.12Gerd Hoffmann2012-10-081-38/+0
| | | | | | | | | | | | With the next qemu version (1.3) we are going to bump the qxl device revision to 4. The new features available require a recent spice-server version, so raise up the bar. Otherwise we would end up with different qxl revisions depending on the spice-server version installed, which would be a major PITA when it comes to compat properties. Clear out a big bunch of #ifdefs which are not needed any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2012-09-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stefanha/trivial-patches: configure: fix seccomp check arch_init.c: add missing '%' symbols before PRIu64 in debug printfs kvm: Fix warning from static code analysis qapi: Fix enumeration typo error console: Clean up bytes per pixel calculation Fix copy&paste typos in documentation comments linux-user: Remove #if 0'd cpu_get_real_ticks() definition ui: Fix spelling in comment (ressource -> resource) Spelling fixes in comments and macro names (ressource -> resource) Fix spelling (licenced -> licensed) in GPL Spelling fixes in comments and documentation srp: Don't use QEMU_PACKED for single elements of a structured type
| * ui: Fix spelling in comment (ressource -> resource)Stefan Weil2012-09-141-1/+1
| | | | | | | | | | | | | | The function is called interface_release_resource. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | spice: send updates only for changed screen contentGerd Hoffmann2012-09-121-1/+55
| | | | | | | | | | | | | | | | | | | | when creating screen updates go compare the current guest screen against the mirror (which holds the most recent update sent), then only create updates for the screen areas which did actually change. [ v2: drop redundant qemu_spice_create_one_update call ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | spice: add screen mirrorGerd Hoffmann2012-09-121-10/+22
| | | | | | | | | | | | | | Create a screen mirror, keep there a copy of the most recent update passed on to spice-server. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | spice: split qemu_spice_create_updateGerd Hoffmann2012-09-121-13/+18
| | | | | | | | | | | | | | | | | | | | Creating one function which creates a single update for a given rectangle. And one (for now) pretty simple wrapper around it to queue up screen updates for the dirty region. [ v2: also update bounding box ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | spice: switch to queue for vga mode updatesGerd Hoffmann2012-09-121-11/+14
|/ | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* spice: make number of surfaces runtime-configurable.Gerd Hoffmann2012-09-051-1/+4
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
OpenPOWER on IntegriCloud