On Wed, Dec 10, 2003 at 08:48:33PM -0500, David Dawes wrote: >On Thu, Dec 11, 2003 at 12:54:10AM +0000, Alan Hourihane wrote: >>Actually, >> >>I've just examined the code for reading on alpha, and regardless of >>a Jensen or other type of alpha it's always the same for a 32bit read. >> >>So can you reverse your patch and try this.... >> >>Alan. >> >>Index: r200_screen.c >>=================================================================== >>RCS file: /X11R6/x-cvs/xc/lib/GL/mesa/src/drv/r200/r200_screen.c,v >>retrieving revision 1.6 >>diff -u -r1.6 r200_screen.c >>--- r200_screen.c 2 Dec 2003 13:02:39 -0000 1.6 >>+++ r200_screen.c 11 Dec 2003 00:53:47 -0000 >>@@ -65,6 +65,18 @@ >> #define PCI_CHIP_RV200_QW 0x5157 /* Radeon 7500 - not an R200 at all */ >> #endif >> >>+#ifdef __alpha__ >>+ >>+#define mem_barrier() __asm__ __volatile__("mb" : : : "memory") >>+ >>+int >>+xf86ReadMmio32(pointer Base, register unsigned long Offset) >>+{ >>+ mem_barrier(); >>+ return *(volatile CARD32*)((unsigned long)Base+(Offset)); >>+} >>+#endif >>+ >> static r200ScreenPtr __r200Screen; >> >> static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); >> > >xf86ReadMmio32 is declared in compiler.h as a function pointer, >not a function. Can someone give the attached patch a try? David -- David Dawes X-Oz Technologies www.XFree86.org/~dawes www.x-oz.com
Index: programs/Xserver/hw/xfree86/common/compiler.h =================================================================== RCS file: /home/x-cvs/xc/programs/Xserver/hw/xfree86/common/compiler.h,v retrieving revision 3.104 diff -u -r3.104 compiler.h --- programs/Xserver/hw/xfree86/common/compiler.h 3 Nov 2003 05:11:01 -0000 3.104 +++ programs/Xserver/hw/xfree86/common/compiler.h 18 Dec 2003 21:32:18 -0000 @@ -1613,7 +1613,17 @@ /* entry points for Mmio memory access routines */ extern int (*xf86ReadMmio8)(void *, unsigned long); extern int (*xf86ReadMmio16)(void *, unsigned long); +# ifndef STANDALONE_MMIO extern int (*xf86ReadMmio32)(void *, unsigned long); +# else +/* Some DRI 3D drivers need MMIO_IN32. */ +static __inline__ int +xf86ReadMmio32(void *Base, unsigned long Offset) +{ + __asm__ __volatile__("mb" : : : "memory"); + return *(volatile CARD32*)((unsigned long)Base+(Offset)); +} +# endif extern void (*xf86WriteMmio8)(int, void *, unsigned long); extern void (*xf86WriteMmio16)(int, void *, unsigned long); extern void (*xf86WriteMmio32)(int, void *, unsigned long); @@ -1629,7 +1639,11 @@ /* Changed to kill noise generated by gcc's -Wcast-align */ # define MMIO_IN8(base, offset) (*xf86ReadMmio8)(base, offset) # define MMIO_IN16(base, offset) (*xf86ReadMmio16)(base, offset) -# define MMIO_IN32(base, offset) (*xf86ReadMmio32)(base, offset) +# ifndef STANDALONE_MMIO +# define MMIO_IN32(base, offset) (*xf86ReadMmio32)(base, offset) +# else +# define MMIO_IN32(base, offset) xf86ReadMmio32(base, offset) +# endif # if defined (JENSEN_SUPPORT) # define MMIO_OUT32(base, offset, val) \ Index: lib/GL/mesa/src/drv/r128/r128_ioctl.c =================================================================== RCS file: /home/x-cvs/xc/lib/GL/mesa/src/drv/r128/r128_ioctl.c,v retrieving revision 1.11 diff -u -r1.11 r128_ioctl.c --- lib/GL/mesa/src/drv/r128/r128_ioctl.c 28 Sep 2003 20:15:20 -0000 1.11 +++ lib/GL/mesa/src/drv/r128/r128_ioctl.c 18 Dec 2003 21:25:31 -0000 @@ -32,6 +32,7 @@ * */ +#define STANDALONE_MMIO #include "r128_context.h" #include "r128_state.h" #include "r128_ioctl.h" Index: lib/GL/mesa/src/drv/r200/r200_screen.c =================================================================== RCS file: /home/x-cvs/xc/lib/GL/mesa/src/drv/r200/r200_screen.c,v retrieving revision 1.6 diff -u -r1.6 r200_screen.c --- lib/GL/mesa/src/drv/r200/r200_screen.c 2 Dec 2003 13:02:39 -0000 1.6 +++ lib/GL/mesa/src/drv/r200/r200_screen.c 18 Dec 2003 21:24:55 -0000 @@ -39,6 +39,7 @@ #include "imports.h" #include "context.h" +#define STANDALONE_MMIO #include "r200_screen.h" #include "r200_context.h" #include "r200_ioctl.h" Index: lib/GL/mesa/src/drv/radeon/radeon_ioctl.c =================================================================== RCS file: /home/x-cvs/xc/lib/GL/mesa/src/drv/radeon/radeon_ioctl.c,v retrieving revision 1.13 diff -u -r1.13 radeon_ioctl.c --- lib/GL/mesa/src/drv/radeon/radeon_ioctl.c 2 Dec 2003 13:02:39 -0000 1.13 +++ lib/GL/mesa/src/drv/radeon/radeon_ioctl.c 18 Dec 2003 21:26:14 -0000 @@ -46,6 +46,7 @@ #include "radeon_tcl.h" #include "radeon_sanity.h" +#define STANDALONE_MMIO #include "radeon_macros.h" /* for INREG() */ #include "vblank.h" @@ -715,12 +716,10 @@ else ret = -EINVAL; -#ifndef __alpha__ if ( ret == -EINVAL ) { frame = INREG( RADEON_LAST_FRAME_REG ); ret = 0; } -#endif if ( ret ) { fprintf( stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, ret ); exit(1); @@ -1008,12 +1007,10 @@ } else ret = -EINVAL; -#ifndef __alpha__ if ( ret == -EINVAL ) { clear = INREG( RADEON_LAST_CLEAR_REG ); ret = 0; } -#endif if ( ret ) { fprintf( stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, ret ); exit(1); Index: lib/GL/mesa/src/drv/radeon/radeon_screen.c =================================================================== RCS file: /home/x-cvs/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c,v retrieving revision 1.9 diff -u -r1.9 radeon_screen.c --- lib/GL/mesa/src/drv/radeon/radeon_screen.c 2 Dec 2003 13:02:39 -0000 1.9 +++ lib/GL/mesa/src/drv/radeon/radeon_screen.c 18 Dec 2003 21:26:26 -0000 @@ -38,6 +38,7 @@ #include "glheader.h" #include "imports.h" +#define STANDALONE_MMIO #include "radeon_context.h" #include "radeon_screen.h" #include "radeon_macros.h"