summaryrefslogtreecommitdiffstats
path: root/ui/console.c
Commit message (Collapse)AuthorAgeFilesLines
* ui/console: remove dpy_gfx_update_dirtyPaolo Bonzini2015-06-051-61/+0
| | | | | | | | | | | | | | | | dpy_gfx_update_dirty expects DIRTY_MEMORY_VGA logging to be always on, but that will not be the case soon. Because it computes the memory region on the fly for every update (with memory_region_find), it cannot enable/disable logging by itself. We could always treat updates as invalidations if dirty logging is not enabled, assuming that the board will enable logging on the RAM region that includes the framebuffer. However, the function is unused, so just drop it. Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* console: add dpy_ui_info_supportedGerd Hoffmann2015-05-061-1/+6
| | | | | | | Allow ui code to check whenever the emulated display supports display change notifications. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: delayed ui_info guest notificationGerd Hoffmann2015-05-061-3/+19
| | | | | | | So we don't flood the guest with display change notifications while the user resizes the window. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ui/console : remove 'struct' from 'typedef struct' typeChih-Min Chao2015-04-301-2/+2
| | | | | | 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>
* console/gtk: add qemu_console_get_labelGerd Hoffmann2015-04-221-0/+15
| | | | | | | 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>
* ui/console: fix OVERFLOW_BEFORE_WIDENGonglei2015-03-121-2/+2
| | | | | Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ui: Removed unused functionsThomas Huth2015-03-101-12/+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>
* ui: Add dpy_gfx_check_format() to check backend shared surface supportBenjamin Herrenschmidt2015-01-191-0/+25
| | | | | | | | | | | | | 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>
* console: add graphic_console_set_hwopsGerd Hoffmann2014-09-291-2/+9
| | | | | | | | | | 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>
* qemu-char: Rename register_char_driver_qapi() to register_char_driver()Peter Maydell2014-09-161-2/+1
| | | | | | | | | Now we have removed the legacy register_char_driver() we can rename register_char_driver_qapi() to the more obvious and shorter name. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1409653457-27863-6-git-send-email-peter.maydell@linaro.org
* console: Remove unused QEMU_BIG_ENDIAN_FLAGBenjamin Herrenschmidt2014-09-051-7/+0
| | | | | | | | | 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>
* console: add dpy_gfx_update_dirtyGerd Hoffmann2014-09-051-0/+61
| | | | | | | | 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>
* console: add qemu_create_displaysurface_guestmemGerd Hoffmann2014-09-051-0/+37
| | | | | | | | | 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>
* console: stop using PixelFormatGerd Hoffmann2014-09-051-23/+10
| | | | | | | | | | | | | | | | | 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>
* console: reimplement qemu_default_pixelformatGerd Hoffmann2014-09-051-113/+4
| | | | | | | | Use the new qemu_pixelformat_from_pixman and qemu_default_pixman_format functions to reimplement qemu_default_pixelformat (qemu_different_endianness_pixelformat too). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qemu-char: introduce qemu_chr_allocPaolo Bonzini2014-06-231-1/+1
| | | | | | | | | The next patch will modify this function to initialize state that is common to all backends. Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* console: fix -vga none -sdl crashGerd Hoffmann2014-06-101-4/+1
| | | | | | | Call get_alloc_displaystate() for proper initialization instead of allocating with g_new(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: kill MAX_CONSOLES, alloc consoles dynamicallyGerd Hoffmann2014-06-101-9/+4
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: add kbd_put_string_consoleGerd Hoffmann2014-06-021-0/+9
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: add kbd_put_qcode_consoleGerd Hoffmann2014-06-021-0/+24
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: add kbd_put_keysym_consoleGerd Hoffmann2014-05-261-3/+6
| | | | | | So you can send keysyms to a specific (text terminal) console. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: rework text terminal cursor logicGerd Hoffmann2014-05-261-18/+32
| | | | | | | | | | Have a global timer. Update all visible terminal windows syncronously. Right now this can be the active_console only, but that will change soon. The global timer will disable itself if not needed, so we only have to care start it if needed. Which might be at console switch time or when a new displaychangelistener is registered. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: update text terminal surface unconditionallyGerd Hoffmann2014-05-261-71/+56
| | | | | | | These days each QemuConsole has its own private DisplaySurface, so we can simply render updates all the time. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: nicer initial screenGerd Hoffmann2014-05-261-8/+11
| | | | | | | | | | | | | | | Now that we have a function to create a fancy DisplaySurface with a message for the user, to handle non-existing graphics hardware, we can make it more generic and use it for other things too. This patch adds a text line to the in initial DisplaySurface, notifying the user that the display isn't initialized yet by the guest. You can see this in action when starting qemu with '-S'. Also when booting ovmf in qemu (which needs a few moments to initialize itself before it initializes the vga). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: Abort on property access errorsKirill Batuzov2014-05-261-17/+13
| | | | | | | | | | | | | | | All defined properties of QemuConsole are mandatory and no access to them should fail. Nevertheless not checking returned errors is bad because in case of unexpected failure it will hide the bug and cause a memory leak. Abort in case of unexpected property access errors. This change exposed a bug where an attempt was made to write to a read-only property "head". Set "head" property's value at creation time and do not attempt to change it later. This fixes the bug mentioned above. Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ui: Add missing 'static' attributeStefan Weil2014-05-071-1/+1
| | | | | | | | | | There was already a forward declaration using 'static', but the attribute was missing in the implementation. This fixes a warning from the static code analysis (smatch). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* qom: Add check() argument to object_property_add_link()Stefan Hajnoczi2014-03-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | There are currently three types of object_property_add_link() callers: 1. The link property may be set at any time. 2. The link property of a DeviceState instance may only be set before realize. 3. The link property may never be set, it is read-only. Something similar can already be achieved with object_property_add_str()'s set() argument. Follow its example and add a check() argument to object_property_add_link(). Also provide default check() functions for case #1 and #2. Case #3 is covered by passing a NULL function pointer. Cc: Peter Crosthwaite <peter.crosthwaite@petalogix.com> Cc: Alexander Graf <agraf@suse.de> Cc: Anthony Liguori <aliguori@amazon.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> [AF: Tweaked documentation comment] Signed-off-by: Andreas Färber <afaerber@suse.de>
* qom: Make QOM link property unref optionalStefan Hajnoczi2014-03-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some object_property_add_link() callers expect property deletion to unref the link property object. Other callers expect to manage the refcount themselves. The former are currently broken and therefore leak the link property object. This patch adds a flags argument to object_property_add_link() so the caller can specify which refcount behavior they require. The new OBJ_PROP_LINK_UNREF_ON_RELEASE flag causes the link pointer to be unreferenced when the property is deleted. This fixes refcount leaks in qdev.c, xilinx_axidma.c, xilinx_axienet.c, s390-virtio-bus.c, virtio-pci.c, virtio-rng.c, and ui/console.c. Rationale for refcount behavior: * hw/core/qdev.c - bus children are explicitly unreferenced, don't interfere - parent_bus is essentially a read-only property that doesn't hold a refcount, don't unref - hotplug_handler is leaked, do unref * hw/dma/xilinx_axidma.c - rx stream "dma" links are set using set_link, therefore they need unref - tx streams are set using set_link, therefore they need unref * hw/net/xilinx_axienet.c - same reasoning as hw/dma/xilinx_axidma.c * hw/pcmcia/pxa2xx.c - pxa2xx bypasses set_link and therefore does not use refcounts * hw/s390x/s390-virtio-bus.c * hw/virtio/virtio-pci.c * hw/virtio/virtio-rng.c * ui/console.c - set_link is used and there is no explicit unref, do unref Cc: Peter Crosthwaite <peter.crosthwaite@petalogix.com> Cc: Alexander Graf <agraf@suse.de> Cc: Anthony Liguori <aliguori@amazon.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* console: add QemuUIInfoGerd Hoffmann2014-03-051-0/+17
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: add head to index to qemu consoles.Gerd Hoffmann2014-03-051-4/+24
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: export QemuConsole index,width,heightGerd Hoffmann2014-03-051-0/+24
| | | | | | Add functions to query QemuConsole properties. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* misc: Replace 'struct QEMUTimer' by 'QEMUTimer'Stefan Weil2013-12-021-1/+1
| | | | | | | | Most code already used QEMUTimer without the redundant 'struct' keyword. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* console: Replace conditional debug messages by trace methodsStefan Weil2013-12-021-8/+3
| | | | | | Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* trace: Remove trace.h from console.h (less dependencies)Stefan Weil2013-12-021-0/+1
| | | | | | | | This reduces the dependencies on trace.h. Only two source files which need console.h also need trace.h. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* console: Remove unused debug codeStefan Weil2013-11-131-33/+0
| | | | | | | | | The local function console_print_text_attributes is no longer used since commit 7d6ba01c3741bc32ae252bf64a5fd3f930c2df4f. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* aio / timers: Switch entire codebase to the new timer APIAlex Bligh2013-08-221-15/+15
| | | | | | | | | | | This is an autogenerated patch using scripts/switch-timer-api. Switch the entire code base to using the new timer API. Note this patch may introduce some line length issues. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* console: Hook QemuConsoles into qom treeGerd Hoffmann2013-06-281-0/+10
| | | | | | | | | Put them named "console[$index]" below "/backend", so you can list & inspect them via QMP. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1372150171-8707-1-git-send-email-kraxel@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu-char: don't issue CHR_EVENT_OPEN in a BHMichael Roth2013-06-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CHR_EVENT_OPENED was initially added, it was CHR_EVENT_RESET, and it was issued as a bottom-half: 86e94dea5b740dad65446c857f6959eae43e0ba6 Which we basically used to print out a greeting/prompt for the monitor. AFAICT the only reason this was ever done in a BH was because in some cases we'd modify the chr_write handler for a new chardev backend *after* the site where we issued the reset (see: 86e94d:qemu_chr_open_stdio()) At some point this event was renamed to CHR_EVENT_OPENED, and we've maintained the use of this BH ever since. However, due to 9f939df955a4152aad69a19a77e0898631bb2c18, we schedule the BH via g_idle_add(), which is causing events to sometimes be delivered after we've already begun processing data from backends, leading to: known bugs: QMP: session negotation resets with OPENED event, in some cases this is causing new sessions to get sporadically reset potential bugs: hw/usb/redirect.c: can_read handler checks for dev->parser != NULL, which may be true if CLOSED BH has not been executed yet. In the past, OPENED quiesced outstanding CLOSED events prior to us reading client data. If it's delayed, our check may allow reads to occur even though we haven't processed the OPENED event yet, and when we do finally get the OPENED event, our state may get reset. qtest.c: can begin session before OPENED event is processed, leading to a spurious reset of the system and irq_levels gdbstub.c: may start a gdb session prior to the machine being paused To fix these, let's just drop the BH. Since the initial reasoning for using it still applies to an extent, work around that by deferring the delivery of CHR_EVENT_OPENED until after the chardevs have been fully initialized, toward the end of qmp_chardev_add() (or some cases, qemu_chr_new_from_opts()). This defers delivery long enough that we can be assured a CharDriverState is fully initialized before CHR_EVENT_OPENED is sent. Also, rather than requiring each chardev to do an explicit open, do it automatically, and allow the small few who don't desire such behavior to suppress the OPENED-on-init behavior by setting a 'explicit_be_open' flag. We additionally add missing OPENED events for stdio backends on w32, which were previously not being issued, causing us to not recieve the banner and initial prompts for qmp/hmp. Reported-by: Stefan Priebe <s.priebe@profihost.ag> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Message-id: 1370636393-21044-1-git-send-email-mdroth@linux.vnet.ibm.com Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* console: add dummy surface for guests without graphic cardGerd Hoffmann2013-04-251-2/+32
| | | | | | So users get a notification instead of a crash. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: zap ds arg from register_displaychangelistenerGerd Hoffmann2013-04-251-5/+5
| | | | | | | 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: switch ppm_save to qemu_openGerd Hoffmann2013-04-251-2/+4
| | | | | | ... so it works with fdset. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: add qemu_console_lookup_by_deviceGerd Hoffmann2013-04-251-0/+19
| | | | | | Look up the QemuConsole for a given device, using the new link. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: add device link to QemuConsolesGerd Hoffmann2013-04-251-1/+14
| | | | | | So it is possible to figure which qemu console displays which device. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: qom-ify QemuConsoleGerd Hoffmann2013-04-251-1/+14
| | | | | | Just the minimal bits to turn QemuConsoles into Objects. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: allow pinning displaychangelisteners to consolesGerd Hoffmann2013-04-161-30/+73
| | | | | | | | | | | 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: add qemu_console_is_*Gerd Hoffmann2013-04-161-26/+33
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xen: re-enable refresh interval reporting for xenfbGerd Hoffmann2013-04-161-0/+6
| | | | | | | | | xenfb informs the guest about the gui refresh interval so it can avoid pointless work. That logic was temporarely disabled for the DisplayState reorganization. Restore it now, with a proper interface for it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: gui timer fixesGerd Hoffmann2013-04-161-5/+29
| | | | | | | | | Make gui update rate adaption code in gui_update() actually work. Sprinkle in a tracepoint so you can see the code at work. Remove the update rate adaption code in vnc and make vnc simply use the generic bits instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: add GraphicHwOpsGerd Hoffmann2013-04-161-17/+16
| | | | | | | Pass a single GraphicHwOps struct pointer to graphic_console_init, instead of a bunch of function pointers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* console: make DisplayState private to console.cGerd Hoffmann2013-04-161-0/+8
| | | | | | | With gui_* being moved to console.c nobody outside console.c needs access to DisplayState fields any more. Make the struct private. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
OpenPOWER on IntegriCloud