[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/8] console: add information retrival wrappers
From: |
Dave Airlie |
Subject: |
[Qemu-devel] [PATCH 3/8] console: add information retrival wrappers |
Date: |
Wed, 20 Nov 2013 15:52:36 +1000 |
From: Dave Airlie <address@hidden>
We need to know how many graphics consoles are registered in the UI
code so it knows how many windows it should prepare for etc, also
so that it could potentially warn for cases it can't handle.
We also need to know the console index so we can add it to the list.
(maybe we don't).
Signed-off-by: Dave Airlie <address@hidden>
---
include/ui/console.h | 3 +++
ui/console.c | 12 ++++++++++++
2 files changed, 15 insertions(+)
diff --git a/include/ui/console.h b/include/ui/console.h
index 5731081..be304fe 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -306,6 +306,9 @@ void qemu_console_copy(QemuConsole *con, int src_x, int
src_y,
DisplaySurface *qemu_console_surface(QemuConsole *con);
DisplayState *qemu_console_displaystate(QemuConsole *console);
+int qemu_get_console_index(QemuConsole *con);
+int qemu_get_number_graphical_consoles(void);
+
typedef CharDriverState *(VcHandler)(ChardevVC *vc);
CharDriverState *vc_init(ChardevVC *vc);
diff --git a/ui/console.c b/ui/console.c
index c20e336..4248a6f 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -175,6 +175,7 @@ static DisplayState *display_state;
static QemuConsole *active_console;
static QemuConsole *consoles[MAX_CONSOLES];
static int nb_consoles = 0;
+static int nb_graphics_consoles = 0;
static void text_console_do_init(CharDriverState *chr, DisplayState *ds);
static void dpy_refresh(DisplayState *s);
@@ -1247,6 +1248,7 @@ static QemuConsole *new_console(DisplayState *ds,
console_type_t console_type)
s->index = i;
consoles[i] = s;
nb_consoles++;
+ nb_graphics_consoles++;
}
return s;
}
@@ -1873,6 +1875,16 @@ DisplayState *qemu_console_displaystate(QemuConsole
*console)
return console->ds;
}
+int qemu_get_console_index(QemuConsole *console)
+{
+ return console->index;
+}
+
+int qemu_get_number_graphical_consoles(void)
+{
+ return nb_graphics_consoles;
+}
+
PixelFormat qemu_different_endianness_pixelformat(int bpp)
{
PixelFormat pf;
--
1.8.3.1
- [Qemu-devel] [RFC] virtio-gpu and sdl2 so far, Dave Airlie, 2013/11/20
- [Qemu-devel] [PATCH 1/8] ui/sdl2 : initial port to SDL 2.0 (v1.2), Dave Airlie, 2013/11/20
- [Qemu-devel] [PATCH 2/8] console: add state notifiers for ui<->display, Dave Airlie, 2013/11/20
- [Qemu-devel] [PATCH 4/8] console: add ability to wrap a console., Dave Airlie, 2013/11/20
- [Qemu-devel] [PATCH 3/8] console: add information retrival wrappers,
Dave Airlie <=
- [Qemu-devel] [PATCH 5/8] sdl2: update for multihead support., Dave Airlie, 2013/11/20
- [Qemu-devel] [PATCH 6/8] virtio-gpu: v0.1 of the virtio based GPU code., Dave Airlie, 2013/11/20
- [Qemu-devel] [PATCH 7/8] virtio-vga: v1, Dave Airlie, 2013/11/20
- [Qemu-devel] [PATCH 8/8] HACK: just to make things start easier with libvirt, Dave Airlie, 2013/11/20