sdl patch queue.
Hi,
Misc stuff in the basket: sdl bugfixes, some preparing patches for the upcoming opengl support in sdl2, x11 build improvement.
v2 fixes the clang build failure.
v3 (hopefully) fixes the osx build failure too.
please pull,
Gerd
The following changes since commit ee74801035b0b5f1fdfd4e31d3a53f511f91c804:
Merge remote-tracking branch 'remotes/lalrae/tags/mips-20150311' into staging (2015-03-11 18:22:15 +0000)
are available in the git repository at:
git://git.kraxel.org/qemu tags/pull-sdl-20150312-2
for you to fetch changes up to 43db7c3d484943f62019434d919367c9e3e4402a:
pixman: add a bunch of PIXMAN_BE_* defines for 32bpp (2015-03-12 15:50:11 +0100)
----------------------------------------------------------------
misc ui patches, mostly sdl related.
----------------------------------------------------------------
Benjamin Herrenschmidt (2):
sdl: Refresh debug statements
sdl: Fix crash when calling sdl_switch() with NULL surface
Gerd Hoffmann (2):
configure: opengl overhaul
pixman: add a bunch of PIXMAN_BE_* defines for 32bpp
Jeremy White (1):
Allow the use of X11 from a non standard location.
configure | 59 +++++++++++++++++++++++----------------- default-configs/lm32-softmmu.mak | 2 +- hw/display/Makefile.objs | 3 +- hw/lm32/milkymist-hw.h | 4 +-- include/sysemu/sysemu.h | 1 + include/ui/qemu-pixman.h | 16 +++++++++++ ui/sdl.c | 27 ++++++++++++++++-- vl.c | 1 + 8 files changed, 81 insertions(+), 32 deletions(-)
[Qemu-devel] [PULL v3 1/5] sdl: Refresh debug statements
From: Benjamin Herrenschmidt <[email protected]>
Put them under a #define similar to the VGA model and make them actually compile. Add a couple too.
--- ui/sdl.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
ui/sdl.c +22 -2
@@ -61,16 +61,24 @@ static SDL_PixelFormat host_format;static int scaling_active =0 ;static Notifier mouse_mode_notifier; +#if 0 +#define DEBUG_SDL +#endif +static void sdl_update (DisplayChangeListener *dcl,int x,int y,int w,int h) { -// printf("updating x=%d y=%d w=%d h=%d\n", x, y, w, h); SDL_Rect rec; rec.x = x; rec.y = y; rec.w = w; rec.h = h; +#ifdef DEBUG_SDL +printf ("SDL: Updating x=%d y=%d w=%d h=%d (scaling: %d)\n" , + x, y, w, h, scaling_active); +#endif +if (guest_screen) {if (!scaling_active) {SDL_BlitSurface (guest_screen, &rec, real_screen, &rec);
@@ -89,7 +97,9 @@ static void do_sdl_resize(int width, int height, int bpp)int flags;SDL_Surface *tmp_screen; -// printf("resizing to %d %d\n", w, h); +#ifdef DEBUG_SDL +printf ("SDL: Resizing to %dx%d bpp %d\n" , width, height, bpp); +#endif flags =SDL_HWSURFACE |SDL_ASYNCBLIT |SDL_HWACCEL ;if (gui_fullscreen) {
@@ -143,6 +153,12 @@ static void sdl_switch(DisplayChangeListener *dcl,if (guest_screen !=NULL ) {SDL_FreeSurface (guest_screen); } + +#ifdef DEBUG_SDL +printf ("SDL: Creating surface with masks: %08x %08x %08x %08x\n" , + pf.rmask, pf.gmask, pf.bmask, pf.amask); +#endif + guest_screen = SDL_CreateRGBSurfaceFrom (surface_data(surface), surface_width(surface), surface_height(surface),
@@ -486,6 +502,10 @@ static void sdl_scale(int width, int height) {int bpp = real_screen->format->BitsPerPixel; +#ifdef DEBUG_SDL +printf ("SDL: Scaling to %dx%d bpp %d\n" , width, height, bpp); +#endif +if (bpp !=16 && bpp !=32 ) { bpp =32 ; }
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL v3 3/5] configure: opengl overhaul
In reply to Gerd HoffmannRename config option from "glx" to "opengl", glx will not be the only option for opengl in near future. Also switch over to pkg-config for opengl support detection.
--- configure | 39 +++++++++++++++++---------------------- default-configs/lm32-softmmu.mak | 2 +- hw/display/Makefile.objs | 2 +- hw/lm32/milkymist-hw.h | 4 ++-- include/sysemu/sysemu.h | 1 + vl.c | 1 + 6 files changed, 23 insertions(+), 26 deletions(-)
configure +17 -22
@@ -309,7 +309,7 @@ rbd="" smartcard_nss="" libusb="" usb_redir="" -glx="" +opengl="" zlib="yes" lzo="" snappy=""
@@ -1027,9 +1027,9 @@ for opt do ;; --enable-vhost-scsi) vhost_scsi="yes" ;; - --disable-glx) glx="no" + --disable-opengl) opengl="no" ;; - --enable-glx) glx="yes" + --enable-opengl) opengl="yes" ;; --disable-rbd) rbd="no" ;;
@@ -3107,23 +3107,18 @@ fi libs_softmmu="$libs_softmmu $fdt_libs" ########################################## -# GLX probe, used by milkymist-tmu2 -if test "$glx" != "no" ; then - glx_libs="-lGL -lX11" - cat > $TMPC << EOF -#include <X11/Xlib.h> -#include <GL/gl.h> -#include <GL/glx.h> -int main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; } -EOF - if compile_prog "" "-lGL -lX11" ; then - glx=yes +# opengl probe (for sdl2, milkymist-tmu2) +if test "$opengl" != "no" ; then + opengl_pkgs="gl glx" + if $pkg_config $opengl_pkgs; then + opengl_libs="$($pkg_config --libs $opengl_pkgs) -lX11" + opengl=yes else - if test "$glx" = "yes" ; then - feature_not_found "glx" "Install GL devel (e.g. MESA)" + if test "$opengl" = "yes" ; then + feature_not_found "opengl" "Install GL devel (e.g. MESA)" fi - glx_libs= - glx=no + opengl_libs="" + opengl=no fi fi
@@ -4390,7 +4385,7 @@ echo "xfsctl support $xfs" echo "nss used $smartcard_nss" echo "libusb $libusb" echo "usb net redir $usb_redir" -echo "GLX support $glx" +echo "OpenGL support $opengl" echo "libiscsi support $libiscsi" echo "libnfs support $libnfs" echo "build guest agent $guest_agent"
@@ -4756,9 +4751,9 @@ if test "$usb_redir" = "yes" ; then echo "CONFIG_USB_REDIR=y" >> $config_host_mak fi -if test "$glx" = "yes" ; then - echo "CONFIG_GLX=y" >> $config_host_mak - echo "GLX_LIBS=$glx_libs" >> $config_host_mak +if test "$opengl" = "yes" ; then + echo "CONFIG_OPENGL=y" >> $config_host_mak + echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak fi if test "$lzo" = "yes" ; then
default-configs/lm32-softmmu.mak +1 -1
@@ -2,7 +2,7 @@ CONFIG_LM32=y CONFIG_MILKYMIST=y -CONFIG_MILKYMIST_TMU2=$(CONFIG_GLX) +CONFIG_MILKYMIST_TMU2=$(CONFIG_OPENGL) CONFIG_FRAMEBUFFER=y CONFIG_PTIMER=y CONFIG_PFLASH_CFI01=y
hw/display/Makefile.objs +1 -1
@@ -20,7 +20,7 @@ common-obj-$(CONFIG_ZAURUS) += tc6393xb.o ifeq ($(CONFIG_MILKYMIST_TMU2),y) common-obj-y += milkymist-tmu2.o -libs_softmmu += $(GLX_LIBS) +libs_softmmu += $(OPENGL_LIBS) endif obj-$(CONFIG_OMAP) += omap_dss.o
hw/lm32/milkymist-hw.h +2 -2
@@ -86,7 +86,7 @@ static inline DeviceState *milkymist_pfpu_create(hwaddr base,return dev; } -#ifdef CONFIG_GLX +#ifdef CONFIG_OPENGL #include <X11/Xlib.h> #include <GL/glx.h> static const int glx_fbconfig_attr[] = {
@@ -100,7 +100,7 @@ static const int glx_fbconfig_attr[] = {static inline DeviceState *milkymist_tmu2_create (hwaddr base,qemu_irq irq) { -#ifdef CONFIG_GLX +#ifdef CONFIG_OPENGL DeviceState *dev;Display *d;GLXFBConfig *configs;
include/sysemu/sysemu.h +1 -0
@@ -114,6 +114,7 @@ extern int graphic_width;extern int graphic_height;extern int graphic_depth;extern DisplayType display_type; +extern int display_opengl;extern const char *keyboard_layout;extern int win2k_install_hack;extern int alt_grab;
vl.c +1 -0
@@ -130,6 +130,7 @@ static int data_dir_idx;const char *bios_name =NULL ;enum vga_retrace_method vga_retrace_method =VGA_RETRACE_DUMB ;DisplayType display_type =DT_DEFAULT ; +int display_opengl;static int display_remote;const char * keyboard_layout =NULL ;ram_addr_t ram_size;
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL v3 2/5] sdl: Fix crash when calling sdl_switch() with NULL surface
In reply to Gerd HoffmannFrom: Benjamin Herrenschmidt <[email protected]>
This happens for example when doing ctrl-alt-u and segfaults
--- ui/sdl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
ui/sdl.c +2 -1
@@ -135,12 +135,13 @@ static void do_sdl_resize(int width, int height, int bpp)static void sdl_switch (DisplayChangeListener *dcl,DisplaySurface *new_surface) { -PixelFormat pf =qemu_pixelformat_from_pixman (new_surface->format); +PixelFormat pf;/* temporary hack: allows to call sdl_switch to handle scaling changes */ if (new_surface) { surface = new_surface; } + pf =qemu_pixelformat_from_pixman (surface->format);if (!scaling_active) {do_sdl_resize (surface_width (surface),surface_height (surface),0 );
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL v3 4/5] Allow the use of X11 from a non standard location.
In reply to Gerd HoffmannFrom: Jeremy White <[email protected]>
[ kraxel: solve opengl patch conflicts ]
--- configure | 24 +++++++++++++++++++----- hw/display/Makefile.objs | 1 + 2 files changed, 20 insertions(+), 5 deletions(-)
configure +19 -5
@@ -2085,6 +2085,15 @@ if test "$sparse" != "no" ; then fi ########################################## +# X11 probe +x11_cflags= +x11_libs=-lX11 +if $pkg_config --exists "x11"; then + x11_cflags=`$pkg_config --cflags x11` + x11_libs=`$pkg_config --libs x11` +fi + +########################################## # GTK probe if test "$gtkabi" = ""; then
@@ -2111,7 +2120,8 @@ if test "$gtk" != "no"; then gtk_cflags=`$pkg_config --cflags $gtkpackage` gtk_libs=`$pkg_config --libs $gtkpackage` if $pkg_config --exists "$gtkx11package >= $gtkversion"; then - gtk_libs="$gtk_libs -lX11" + gtk_cflags="$gtk_cflags $x11_cflags" + gtk_libs="$gtk_libs $x11_libs" fi libs_softmmu="$gtk_libs $libs_softmmu" gtk="yes"
@@ -2236,8 +2246,9 @@ if test "$sdl" = "yes" ; then #endif int main(void) { return 0; } EOF - if compile_prog "$sdl_cflags" "$sdl_libs" ; then - sdl_libs="$sdl_libs -lX11" + if compile_prog "$sdl_cflags $x11_cflags" "$sdl_libs $x11_libs" ; then + sdl_cflags="$sdl_cflags $x11_cflags" + sdl_libs="$sdl_libs $x11_libs" fi libs_softmmu="$sdl_libs $libs_softmmu" fi
@@ -3110,13 +3121,15 @@ libs_softmmu="$libs_softmmu $fdt_libs" # opengl probe (for sdl2, milkymist-tmu2) if test "$opengl" != "no" ; then opengl_pkgs="gl glx" - if $pkg_config $opengl_pkgs; then - opengl_libs="$($pkg_config --libs $opengl_pkgs) -lX11" + if $pkg_config $opengl_pkgs x11; then + opengl_cflags="$($pkg_config --cflags $opengl_pkgs) $x11_cflags" + opengl_libs="$($pkg_config --libs $opengl_pkgs) $x11_libs" opengl=yes else if test "$opengl" = "yes" ; then feature_not_found "opengl" "Install GL devel (e.g. MESA)" fi + opengl_cflags="" opengl_libs="" opengl=no fi
@@ -4753,6 +4766,7 @@ fi if test "$opengl" = "yes" ; then echo "CONFIG_OPENGL=y" >> $config_host_mak + echo "OPENGL_CFLAGS=$opengl_cflags" >> $config_host_mak echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak fi
hw/display/Makefile.objs +1 -0
@@ -20,6 +20,7 @@ common-obj-$(CONFIG_ZAURUS) += tc6393xb.o ifeq ($(CONFIG_MILKYMIST_TMU2),y) common-obj-y += milkymist-tmu2.o +milkymist-tmu2.o-cflags := $(OPENGL_CFLAGS) libs_softmmu += $(OPENGL_LIBS) endif
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL v3 5/5] pixman: add a bunch of PIXMAN_BE_* defines for 32bpp
In reply to Gerd Hoffmann--- include/ui/qemu-pixman.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
include/ui/qemu-pixman.h +16 -0
@@ -27,8 +27,24 @@#ifdef HOST_WORDS_BIGENDIAN # define PIXMAN_BE_r8g8b8 PIXMAN_r8g8b8 +# define PIXMAN_BE_x8r8g8b8 PIXMAN_x8r8g8b8 +# define PIXMAN_BE_a8r8g8b8 PIXMAN_a8r8g8b8 +# define PIXMAN_BE_b8g8r8x8 PIXMAN_b8g8r8x8 +# define PIXMAN_BE_b8g8r8a8 PIXMAN_b8g8r8a8 +# define PIXMAN_BE_r8g8b8x8 PIXMAN_r8g8b8x8 +# define PIXMAN_BE_r8g8b8a8 PIXMAN_r8g8b8a8 +# define PIXMAN_BE_x8b8g8r8 PIXMAN_x8b8g8r8 +# define PIXMAN_BE_a8b8g8r8 PIXMAN_a8b8g8r8#else # define PIXMAN_BE_r8g8b8 PIXMAN_b8g8r8 +# define PIXMAN_BE_x8r8g8b8 PIXMAN_b8g8r8x8 +# define PIXMAN_BE_a8r8g8b8 PIXMAN_b8g8r8a8 +# define PIXMAN_BE_b8g8r8x8 PIXMAN_x8r8g8b8 +# define PIXMAN_BE_b8g8r8a8 PIXMAN_a8r8g8b8 +# define PIXMAN_BE_r8g8b8x8 PIXMAN_x8b8g8r8 +# define PIXMAN_BE_r8g8b8a8 PIXMAN_a8b8g8r8 +# define PIXMAN_BE_x8b8g8r8 PIXMAN_r8g8b8x8 +# define PIXMAN_BE_a8b8g8r8 PIXMAN_r8g8b8a8#endif /* -------------------------------------------------------------------- */
Signature · 1 line
1.8.3.1
Peter Maydell
AppliedQuoted 20 lines · Gerd Hoffmann
Hi,
Misc stuff in the basket: sdl bugfixes, some preparing patches for the upcoming opengl support in sdl2, x11 build improvement.
v2 fixes the clang build failure.
v3 (hopefully) fixes the osx build failure too.please pull,
GerdThe following changes since commit
ee74801035b0b5f1fdfd4e31d3a53f511f91c804:Merge remote-tracking branch 'remotes/lalrae/tags/mips-20150311' into staging (2015-03-11 18:22:15 +0000)
are available in the git repository at:
git://git.kraxel.org/qemutags/pull-sdl-20150312-2
Quoted 8 lines
for you to fetch changes up to
43db7c3d484943f62019434d919367c9e3e4402a:pixman: add a bunch of PIXMAN_BE_* defines for 32bpp (2015-03-12 15:50:11 +0100)
----------------------------------------------------------------
misc ui patches, mostly sdl related.----------------------------------------------------------------
Applied, thanks.
-- PMM
Re: [Qemu-devel] [PULL v3 3/5] configure: opengl overhaul
In reply to Gerd HoffmannQuoted 3 lines · Gerd Hoffmann
Rename config option from "glx" to "opengl", glx will not be the only option for opengl in near future. Also switch over to pkg-config for opengl support detection.
I had before this patch enabled --enable-glx
configure fi · line 3112
Quoted 2 lines
configure +2
-0+if test "$opengl" != "no" ; then + opengl_pkgs="gl glx"
I am missing a package or glx is wrong here?
configure fi · line 3114
Quoted 2 lines
configure +2
-0+ if $pkg_config $opengl_pkgs; then + opengl_libs="$($pkg_config --libs $opengl_pkgs) -lX11"
(master *)$ pkg-config --libs gl
-lGL
(master *)$ pkg-config --libs glx
Package glx was not found in the pkg-config search path. Perhaps you should add the directory containing `glx.pc' to the PKG_CONFIG_PATH environment variable
No package 'glx' found
(master *)$
I am not ablet find a glx.pc on fedora. Notice that I have the headre file that was tested before for:
$ ll /usr/include/GL/glx.h -rw-r--r--. 1 root root 19K Jan 24 14:59 /usr/include/GL/glx.h (master *)$ rpm -qf /usr/include/GL/glx.h mesa-libGL-devel-10.4.3-1.20150124.fc21.x86_64
Fedora 21, just if it is not obvious O;-)
Any good ideas?
Thanks, Juan.