Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180518-pull-re…
Browse files Browse the repository at this point in the history
…quest' into staging

ui: bugfixes, move x11 dependency to modules.

# gpg: Signature made Fri 18 May 2018 08:40:41 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# 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/ui-20180518-pull-request:
  sdl: Move use of surface pointer below check for whether it is NULL
  ui: add x_keymap.o to modules
  console: Avoid segfault in screendump

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed May 18, 2018
2 parents 6812994 + e8dcb8a commit 30d9081
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions hw/display/Makefile.objs
Expand Up @@ -20,6 +20,8 @@ common-obj-$(CONFIG_MILKYMIST) += milkymist-vgafb.o
common-obj-$(CONFIG_ZAURUS) += tc6393xb.o

common-obj-$(CONFIG_MILKYMIST_TMU2) += milkymist-tmu2.o
milkymist-tmu2.o-cflags := $(X11_CFLAGS)
milkymist-tmu2.o-libs := $(X11_LIBS)

obj-$(CONFIG_OMAP) += omap_dss.o
obj-$(CONFIG_OMAP) += omap_lcdc.o
Expand Down
11 changes: 7 additions & 4 deletions ui/Makefile.objs
Expand Up @@ -15,10 +15,6 @@ common-obj-$(CONFIG_COCOA) += cocoa.o
common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
common-obj-$(call lnot,$(CONFIG_VNC)) += vnc-stubs.o

common-obj-$(CONFIG_X11) += x_keymap.o
x_keymap.o-cflags := $(X11_CFLAGS)
x_keymap.o-libs := $(X11_LIBS)

# ui-sdl module
common-obj-$(CONFIG_SDL) += sdl.mo
ifeq ($(CONFIG_SDLABI),1.2)
Expand Down Expand Up @@ -46,6 +42,13 @@ gtk.mo-objs += gtk-gl-area.o
endif
endif

ifeq ($(CONFIG_X11),y)
sdl.mo-objs += x_keymap.o
gtk.mo-objs += x_keymap.o
x_keymap.o-cflags := $(X11_CFLAGS)
x_keymap.o-libs := $(X11_LIBS)
endif

common-obj-$(CONFIG_CURSES) += curses.mo
curses.mo-objs := curses.o
curses.mo-cflags := $(CURSES_CFLAGS)
Expand Down
5 changes: 5 additions & 0 deletions ui/console.c
Expand Up @@ -372,6 +372,11 @@ void qmp_screendump(const char *filename, bool has_device, const char *device,

graphic_hw_update(con);
surface = qemu_console_surface(con);
if (!surface) {
error_setg(errp, "no surface");
return;
}

ppm_save(filename, surface, errp);
}

Expand Down
6 changes: 3 additions & 3 deletions ui/sdl2-2d.c
Expand Up @@ -36,9 +36,7 @@ void sdl2_2d_update(DisplayChangeListener *dcl,
struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl);
DisplaySurface *surf = qemu_console_surface(dcl->con);
SDL_Rect rect;
size_t surface_data_offset = surface_bytes_per_pixel(surf) * x +
surface_stride(surf) * y;

size_t surface_data_offset;
assert(!scon->opengl);

if (!surf) {
Expand All @@ -48,6 +46,8 @@ void sdl2_2d_update(DisplayChangeListener *dcl,
return;
}

surface_data_offset = surface_bytes_per_pixel(surf) * x +
surface_stride(surf) * y;
rect.x = x;
rect.y = y;
rect.w = w;
Expand Down

0 comments on commit 30d9081

Please sign in to comment.