On Sun, Apr 18, 2010 at 07:36:10PM -0400, Brad wrote: > Here is an update to SDL 1.2.14.
Here is a second rev of my update. I rolled in some fixes taken from upstream for the i386/amd64 cpuid assembly code and I added support for detection of AltiVec on OpenBSD/powerpc using the sysctl, although AltiVec support is still disabled. Again please test. This is a pretty important bug fix release and this is used in a good number of games and multimedia related software for audio/video output. Index: Makefile =================================================================== RCS file: /cvs/ports/devel/sdl/Makefile,v retrieving revision 1.74 diff -u -p -r1.74 Makefile --- Makefile 12 Jan 2010 11:19:06 -0000 1.74 +++ Makefile 25 Apr 2010 17:36:27 -0000 @@ -2,9 +2,9 @@ COMMENT= cross-platform multimedia library -VERSION= 1.2.13 +VERSION= 1.2.14 DISTNAME= SDL-${VERSION} -PKGNAME= ${DISTNAME:L}p13 +PKGNAME= ${DISTNAME:L} CATEGORIES= devel HOMEPAGE= http://www.libsdl.org/ @@ -18,8 +18,7 @@ PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes WANTLIB= m sndio usbhid -MASTER_SITES= ftp://ftp.fr.freebsd.org/pub/FreeBSD/distfiles/ \ - ${HOMEPAGE}release/ +MASTER_SITES= ${HOMEPAGE}release/ MASTER_SITES0= http://dev.beastie.hu/ \ http://www.beastie.hu/ Index: distinfo =================================================================== RCS file: /cvs/ports/devel/sdl/distinfo,v retrieving revision 1.17 diff -u -p -r1.17 distinfo --- distinfo 3 Jan 2008 17:39:40 -0000 1.17 +++ distinfo 18 Apr 2010 21:52:51 -0000 @@ -1,10 +1,10 @@ -MD5 (SDL-1.2.13.tar.gz) = xmYP7qKmg03hC8cbL45NiA== +MD5 (SDL-1.2.14.tar.gz) = 5SCG0bUI+gt2xS7jC1W+xA== MD5 (patch-libsd1.2.7-libcaca0.9.diff) = 3/bPX8l0lNvgWICGbhUWYA== -RMD160 (SDL-1.2.13.tar.gz) = 7Ygl/Jj0s3Wc+eXPg1fXHFDfmSU= +RMD160 (SDL-1.2.14.tar.gz) = o6mmkfVRDrUyfKFZoDT1WnDLWAE= RMD160 (patch-libsd1.2.7-libcaca0.9.diff) = 50oezoZFd7b9r4UWqeS0AJWOV1s= -SHA1 (SDL-1.2.13.tar.gz) = UfyqPh1cAf2BPqCGiHgPhrGc9Tk= +SHA1 (SDL-1.2.14.tar.gz) = umJbS0BFibl+ktes0WWZLevldt0= SHA1 (patch-libsd1.2.7-libcaca0.9.diff) = Tk0/XwKG5pYODlza0vkMVJl6bAQ= -SHA256 (SDL-1.2.13.tar.gz) = lPmd8dYPKWtX9HQGUKcbZCXaZUBEyjD48M40k0Qp4TI= +SHA256 (SDL-1.2.14.tar.gz) = XZJ+KHA0y2uw68z6OCyx0YXLETyKtRFaB1l5hkLu2bY= SHA256 (patch-libsd1.2.7-libcaca0.9.diff) = fnf1KYlqBfccSHTtjR9npVtt976i2zFrClxN/ejoAS8= -SIZE (SDL-1.2.13.tar.gz) = 3373673 +SIZE (SDL-1.2.14.tar.gz) = 4014154 SIZE (patch-libsd1.2.7-libcaca0.9.diff) = 28259 Index: patches/patch-configure =================================================================== RCS file: /cvs/ports/devel/sdl/patches/patch-configure,v retrieving revision 1.21 diff -u -p -r1.21 patch-configure --- patches/patch-configure 12 Jan 2010 11:19:06 -0000 1.21 +++ patches/patch-configure 18 Apr 2010 21:54:45 -0000 @@ -1,7 +1,7 @@ $OpenBSD: patch-configure,v 1.21 2010/01/12 11:19:06 jakemsr Exp $ ---- configure.orig Sun Dec 30 21:09:39 2007 -+++ configure Tue Jan 12 02:48:55 2010 -@@ -25411,6 +25411,20 @@ _ACEOF +--- configure.orig Sat Oct 17 13:35:13 2009 ++++ configure Sun Apr 18 17:54:36 2010 +@@ -21386,6 +21386,20 @@ _ACEOF fi } @@ -22,7 +22,7 @@ $OpenBSD: patch-configure,v 1.21 2010/01 CheckPulseAudio() { # Check whether --enable-pulseaudio was given. -@@ -26333,9 +26347,6 @@ echo "${ECHO_T}$CompileNASM_ret" >&6; } +@@ -22504,9 +22518,6 @@ $as_echo "$CompileNASM_ret" >&6; } win32) NASMFLAGS="-f win32" ;; @@ -32,7 +32,7 @@ $OpenBSD: patch-configure,v 1.21 2010/01 macosx) NASMFLAGS="-f macho" ;; -@@ -33577,6 +33588,7 @@ _ACEOF +@@ -29983,6 +29994,7 @@ _ACEOF CheckALSA CheckARTSC CheckESD @@ -40,7 +40,7 @@ $OpenBSD: patch-configure,v 1.21 2010/01 CheckPulseAudio CheckNAS CheckX11 -@@ -33610,7 +33622,7 @@ _ACEOF +@@ -30018,7 +30030,7 @@ _ACEOF SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" have_audio=yes ;; Index: patches/patch-sdl_pc_in =================================================================== RCS file: /cvs/ports/devel/sdl/patches/patch-sdl_pc_in,v retrieving revision 1.1 diff -u -p -r1.1 patch-sdl_pc_in --- patches/patch-sdl_pc_in 20 Mar 2008 22:00:15 -0000 1.1 +++ patches/patch-sdl_pc_in 18 Apr 2010 21:58:33 -0000 @@ -1,11 +1,12 @@ $OpenBSD: patch-sdl_pc_in,v 1.1 2008/03/20 22:00:15 pvalchev Exp $ ---- sdl.pc.in.orig Thu Mar 20 07:59:18 2008 -+++ sdl.pc.in Thu Mar 20 07:59:38 2008 -@@ -10,5 +10,5 @@ Description: Simple DirectMedia Layer is a cross-platf +--- sdl.pc.in.orig Mon Oct 12 19:07:20 2009 ++++ sdl.pc.in Sun Apr 18 17:57:02 2010 +@@ -10,6 +10,6 @@ Description: Simple DirectMedia Layer is a cross-platf Version: @SDL_VERSION@ Requires: Conflicts: -Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ --Cflags: -I${includedir}/SDL @SDL_CFLAGS@ +Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @X_LIBS@ + Libs.private: @SDL_STATIC_LIBS@ +-Cflags: -I${includedir}/SDL @SDL_CFLAGS@ +Cflags: -I${includedir}/SDL @SDL_CFLAGS@ @X_CFLAGS@ Index: patches/patch-src_audio_SDL_audio_c =================================================================== RCS file: /cvs/ports/devel/sdl/patches/patch-src_audio_SDL_audio_c,v retrieving revision 1.16 diff -u -p -r1.16 patch-src_audio_SDL_audio_c --- patches/patch-src_audio_SDL_audio_c 24 Jan 2009 10:56:11 -0000 1.16 +++ patches/patch-src_audio_SDL_audio_c 18 Apr 2010 21:54:49 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-src_audio_SDL_audio_c,v 1.16 2009/01/24 10:56:11 jakemsr Exp $ ---- src/audio/SDL_audio.c.orig Sun Dec 30 20:47:59 2007 -+++ src/audio/SDL_audio.c Thu Jan 22 20:40:14 2009 +--- src/audio/SDL_audio.c.orig Tue Oct 13 06:25:35 2009 ++++ src/audio/SDL_audio.c Sun Apr 18 17:54:36 2010 @@ -36,6 +36,9 @@ /* Available audio drivers */ @@ -11,12 +11,3 @@ $OpenBSD: patch-src_audio_SDL_audio_c,v #if SDL_AUDIO_DRIVER_BSD &BSD_AUDIO_bootstrap, #endif -@@ -532,7 +535,7 @@ int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpe - return(-1); - } - if ( audio->convert.needed ) { -- audio->convert.len = (int) ( ((double) desired->size) / -+ audio->convert.len = (int) ( ((double) audio->spec.size) / - audio->convert.len_ratio ); - audio->convert.buf =(Uint8 *)SDL_AllocAudioMem( - audio->convert.len*audio->convert.len_mult); Index: patches/patch-src_cpuinfo_SDL_cpuinfo_c =================================================================== RCS file: patches/patch-src_cpuinfo_SDL_cpuinfo_c diff -N patches/patch-src_cpuinfo_SDL_cpuinfo_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_cpuinfo_SDL_cpuinfo_c 25 Apr 2010 18:39:58 -0000 @@ -0,0 +1,122 @@ +$OpenBSD$ +--- src/cpuinfo/SDL_cpuinfo.c.orig Mon Oct 12 19:07:14 2009 ++++ src/cpuinfo/SDL_cpuinfo.c Sun Apr 25 14:38:54 2010 +@@ -28,6 +28,10 @@ + + #if defined(__MACOSX__) && defined(__ppc__) + #include <sys/sysctl.h> /* For AltiVec check */ ++#elif defined(__OpenBSD__) && defined(__powerpc__) ++#include <sys/param.h> ++#include <sys/sysctl.h> ++#include <machine/cpu.h> + #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP + #include <signal.h> + #include <setjmp.h> +@@ -148,37 +152,41 @@ static __inline__ int CPU_getCPUIDFeatures(void) + int features = 0; + #if defined(__GNUC__) && defined(i386) + __asm__ ( +-" movl %%ebx,%%edi\n" + " xorl %%eax,%%eax # Set up for CPUID instruction \n" ++" pushl %%ebx \n" + " cpuid # Get and save vendor ID \n" ++" popl %%ebx \n" + " cmpl $1,%%eax # Make sure 1 is valid input for CPUID\n" + " jl 1f # We dont have the CPUID instruction\n" + " xorl %%eax,%%eax \n" + " incl %%eax \n" ++" pushl %%ebx \n" + " cpuid # Get family/model/stepping/features\n" ++" popl %%ebx \n" + " movl %%edx,%0 \n" + "1: \n" +-" movl %%edi,%%ebx\n" + : "=m" (features) + : +- : "%eax", "%ecx", "%edx", "%edi" ++ : "%eax", "%ecx", "%edx" + ); + #elif defined(__GNUC__) && defined(__x86_64__) + __asm__ ( +-" movq %%rbx,%%rdi\n" + " xorl %%eax,%%eax # Set up for CPUID instruction \n" ++" pushq %%rbx \n" + " cpuid # Get and save vendor ID \n" ++" popq %%rbx \n" + " cmpl $1,%%eax # Make sure 1 is valid input for CPUID\n" + " jl 1f # We dont have the CPUID instruction\n" + " xorl %%eax,%%eax \n" + " incl %%eax \n" ++" pushq %%rbx \n" + " cpuid # Get family/model/stepping/features\n" ++" popq %%rbx \n" + " movl %%edx,%0 \n" + "1: \n" +-" movq %%rdi,%%rbx\n" + : "=m" (features) + : +- : "%rax", "%rbx", "%rcx", "%rdx", "%rdi" ++ : "%rax", "%rcx", "%rdx" + ); + #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) + __asm { +@@ -218,35 +226,39 @@ static __inline__ int CPU_getCPUIDFeaturesExt(void) + int features = 0; + #if defined(__GNUC__) && defined(i386) + __asm__ ( +-" movl %%ebx,%%edi\n" + " movl $0x80000000,%%eax # Query for extended functions \n" ++" pushl %%ebx \n" + " cpuid # Get extended function limit \n" ++" popl %%ebx \n" + " cmpl $0x80000001,%%eax \n" + " jl 1f # Nope, we dont have function 800000001h\n" + " movl $0x80000001,%%eax # Setup extended function 800000001h\n" ++" pushl %%ebx \n" + " cpuid # and get the information \n" ++" popl %%ebx \n" + " movl %%edx,%0 \n" + "1: \n" +-" movl %%edi,%%ebx\n" + : "=m" (features) + : +- : "%eax", "%ecx", "%edx", "%edi" ++ : "%eax", "%ecx", "%edx" + ); + #elif defined(__GNUC__) && defined (__x86_64__) + __asm__ ( +-" movq %%rbx,%%rdi\n" + " movl $0x80000000,%%eax # Query for extended functions \n" ++" pushq %%rbx \n" + " cpuid # Get extended function limit \n" ++" popq %%rbx \n" + " cmpl $0x80000001,%%eax \n" + " jl 1f # Nope, we dont have function 800000001h\n" + " movl $0x80000001,%%eax # Setup extended function 800000001h\n" ++" pushq %%rbx \n" + " cpuid # and get the information \n" ++" popq %%rbx \n" + " movl %%edx,%0 \n" + "1: \n" +-" movq %%rdi,%%rbx\n" + : "=m" (features) + : +- : "%rax", "%rbx", "%rcx", "%rdx", "%rdi" ++ : "%rax", "%rcx", "%rdx" + ); + #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) + __asm { +@@ -346,6 +358,13 @@ static __inline__ int CPU_haveAltiVec(void) + int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); + if( 0 == error ) + altivec = (hasVectorUnit != 0); ++#elif defined(__OpenBSD__) && defined(__powerpc__) ++ int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC }; ++ int hasVectorUnit = 0; ++ size_t length = sizeof(hasVectorUnit); ++ int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); ++ if( 0 == error ) ++ altivec = (hasVectorUnit != 0); + #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP + void (*handler)(int sig); + handler = signal(SIGILL, illegal_instruction); Index: patches/patch-src_video_x11_SDL_x11modes_c =================================================================== RCS file: patches/patch-src_video_x11_SDL_x11modes_c diff -N patches/patch-src_video_x11_SDL_x11modes_c --- patches/patch-src_video_x11_SDL_x11modes_c 16 Sep 2008 20:43:10 -0000 1.10 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,31 +0,0 @@ -$OpenBSD: patch-src_video_x11_SDL_x11modes_c,v 1.10 2008/09/16 20:43:10 naddy Exp $ ---- src/video/x11/SDL_x11modes.c.orig Mon Dec 31 05:48:13 2007 -+++ src/video/x11/SDL_x11modes.c Mon Sep 15 23:36:02 2008 -@@ -52,8 +52,25 @@ static int cmpmodelist(const void *va, const void *vb) - #if SDL_VIDEO_DRIVER_X11_VIDMODE - Bool SDL_NAME(XF86VidModeGetModeInfo)(Display *dpy, int scr, SDL_NAME(XF86VidModeModeInfo) *info) - { -- SDL_NAME(XF86VidModeModeLine) *l = (SDL_NAME(XF86VidModeModeLine)*)((char*)info + sizeof info->dotclock); -- return SDL_NAME(XF86VidModeGetModeLine)(dpy, scr, (int*)&info->dotclock, l); -+ Bool retval; -+ int dotclock; -+ SDL_NAME(XF86VidModeModeLine) l; -+ SDL_memset(&l, 0, sizeof(l)); -+ retval = SDL_NAME(XF86VidModeGetModeLine)(dpy, scr, &dotclock, &l); -+ info->dotclock = dotclock; -+ info->hdisplay = l.hdisplay; -+ info->hsyncstart = l.hsyncstart; -+ info->hsyncend = l.hsyncend; -+ info->htotal = l.htotal; -+ info->hskew = l.hskew; -+ info->vdisplay = l.vdisplay; -+ info->vsyncstart = l.vsyncstart; -+ info->vsyncend = l.vsyncend; -+ info->vtotal = l.vtotal; -+ info->flags = l.flags; -+ info->privsize = l.privsize; -+ info->private = l.private; -+ return retval; - } - #endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */ - -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.