[PATCH] i128: Make use of hardware byteswap on big-endian platforms.
Fixes 16 and 32 bit-per-pixel modes with a Tech Source Raptor GFX-8M board on OpenBSD/sparc64 (although a few more diffs are needed for a working driver). Signed-off-by: Mark Kettenis mark.kette...@xs4all.nl --- src/i128init.c | 15 ++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/src/i128init.c b/src/i128init.c index d57e295..1504dcd 100644 --- a/src/i128init.c +++ b/src/i128init.c @@ -451,7 +451,20 @@ I128Init(ScrnInfoPtr pScrn, DisplayModePtr mode) pI128-DoubleScan = FALSE; pI128-mem.rbase_g[CRT_ZOOM] = (pI128-DoubleScan ? 0x0001 : 0x); - pI128-mem.rbase_w[MW0_CTRL] = 0x; + switch (pI128-bitsPerPixel) { +#if X_BYTE_ORDER == X_BIG_ENDIAN + case 32: + pI128-mem.rbase_w[MW0_CTRL] = 0x0006; + break; + case 16: + pI128-mem.rbase_w[MW0_CTRL] = 0x0002; + break; +#endif + default: + pI128-mem.rbase_w[MW0_CTRL] = 0x; + break; + } + switch (pI128-MemorySize) { case 2048: pI128-mem.rbase_w[MW0_SZ] = 0x0009; -- 1.6.3.2 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [RFC] DRI2 synchronization and swap bits
On Fri, Oct 30, 2009 at 1:42 PM, Eric Anholt e...@anholt.net wrote: On Fri, 2009-10-30 at 10:59 -0700, Jesse Barnes wrote: I've put up some trees (after learning my lesson about working in the main tree) with the latest DRI2 sync/swap bits: git://git.freedesktop.org/home/jbarnes/xserver master branch git://git.freedesktop.org/home/jbarnes/mesa master branch They includes support for some new DRI2 requests (proto for which is in the dri2-swapbuffers branch of dri2proto), including: DRI2SwapBuffers DRI2GetMSC DRI2WaitMSC and DRI2WaitSBC These allow us to support GLX extensions like SGI_video_sync, OML_swap_control and SGI_swap_interval. There have been a few comments about the protocol so far: 1) DRI2SwapBuffers a) Concern about doing another round trip to fetch new buffers following the swap. I think this is a valid concern, we could potentially respond from the swap with the new buffers, but this would make some memory saving optimizations more difficult (e.g. freeing buffers if no drawing comes in for a short time after the swap). You're doing one round-trip anyway, and if users are concerned about the second one, go use XCB already. (We need to go fix Mesa to do that). DRI2SwapBuffers is a one-way request, but it's required to follow up with a DRI2GetBuffers. So it's only one round trip whether we use XCB or not. cheers, Kristian ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[xserver] add libc as a choice for SHA1 implementation
Hi, As promised here's the patch that probes for SHA1 implementation in libc, as found on BSD systems. From: Matthieu Herrb matthieu.he...@laas.fr Date: Sun, 1 Nov 2009 18:19:27 +0100 Subject: [PATCH] Add a probe for SHA1 functions in libc in *BSD. The interface is the same as the one in libmd. --- configure.ac| 14 +- include/dix-config.h.in |3 +++ os/xsha1.c |3 ++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 7d87b29..9119a03 100644 --- a/configure.ac +++ b/configure.ac @@ -1297,8 +1297,20 @@ CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include' # SHA1 hashing AC_ARG_WITH([sha1], -[AS_HELP_STRING([--with-sha1=libmd|libgcrypt|libcrypto|libsha1], + [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1], [choose SHA1 implementation])]) +AC_CHECK_FUNCS([SHA1Init], [HAVE_LIBC_SHA1=yes]) +if test x$with_sha1 = x test x$HAVE_LIBC_SHA1 = xyes; then + with_sha1=libc +fi +if test x$with_sha1 = xlibc test x$HAVE_LIBC_SHA1 != xyes; then + AC_MSG_ERROR([libc requested but not found]) +fi +if test x$with_sha1 = xlibc; then + AC_DEFINE([HAVE_SHA1_IN_LIBC], [1], + [Use libc SHA1 functions]) + SHA1_LIBS= +fi AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes]) if test x$with_sha1 = x test x$HAVE_LIBMD = xyes; then with_sha1=libmd diff --git a/include/dix-config.h.in b/include/dix-config.h.in index e2bc18e..a57d9b6 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -160,6 +160,9 @@ /* Define to 1 if you have the rpcsvc/dbm.h header file. */ #undef HAVE_RPCSVC_DBM_H +/* Define to use libc SHA1 functions */ +#undef HAVE_SHA1_IN_LIBC + /* Define to use libmd SHA1 functions */ #undef HAVE_SHA1_IN_LIBMD diff --git a/os/xsha1.c b/os/xsha1.c index 94092ca..229ce89 100644 --- a/os/xsha1.c +++ b/os/xsha1.c @@ -5,7 +5,8 @@ #include os.h #include xsha1.h -#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */ +#if defined(HAVE_SHA1_IN_LIBMD) /* Use libmd for SHA1 */ \ + || defined(HAVE_SHA1_IN_LIBC) /* Use libc for SHA1 */ # include sha1.h -- 1.6.5.1 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] Abstract calls to in/out with IN/OUT macros
This will allow us to include sys/io.h and use libc's in/out when available. Also see http://lists.x.org/archives/xorg-devel/2009-October/002853.html Signed-off-by: Matt Turner matts...@gmail.com --- hw/xfree86/common/compiler.h| 201 --- hw/xfree86/common/xf86Helper.c | 11 +- hw/xfree86/int10/helper_exec.c | 36 +++--- hw/xfree86/int10/xf86int10.c| 44 hw/xfree86/os-support/linux/lnx_video.c | 12 +- hw/xfree86/os-support/misc/SlowBcopy.c |8 +- hw/xfree86/vgahw/vgaHW.c| 72 ++-- hw/xfree86/vgahw/vgaHW.h|8 +- 8 files changed, 177 insertions(+), 215 deletions(-) diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index a450bd6..5fe35c7 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -309,78 +309,34 @@ static __inline__ void stw_u(uint16_t val, uint16_t *p) # ifndef NO_INLINE # ifdef __GNUC__ -# if (defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) (defined(__alpha__)) +# if defined __alpha__ #ifdef linux -/* for Linux on Alpha, we use the LIBC _inx/_outx routines */ -/* note that the appropriate setup via ioperm needs to be done */ -/* *before* any inx/outx is done. */ +# include sys/io.h +# define OUTB(port, val) outb((val), (port)) +# define OUTW(port, val) outw((val), (port)) +# define OUTL(port, val) outl((val), (port)) -extern _X_EXPORT void (*_alpha_outb)(char val, unsigned long port); -static __inline__ void -outb(unsigned long port, unsigned char val) -{ -_alpha_outb(val, port); -} - -extern _X_EXPORT void (*_alpha_outw)(short val, unsigned long port); -static __inline__ void -outw(unsigned long port, unsigned short val) -{ -_alpha_outw(val, port); -} - -extern _X_EXPORT void (*_alpha_outl)(int val, unsigned long port); -static __inline__ void -outl(unsigned long port, unsigned int val) -{ -_alpha_outl(val, port); -} - -extern _X_EXPORT unsigned int (*_alpha_inb)(unsigned long port); -static __inline__ unsigned int -inb(unsigned long port) -{ - return _alpha_inb(port); -} - -extern _X_EXPORT unsigned int (*_alpha_inw)(unsigned long port); -static __inline__ unsigned int -inw(unsigned long port) -{ - return _alpha_inw(port); -} - -extern _X_EXPORT unsigned int (*_alpha_inl)(unsigned long port); -static __inline__ unsigned int -inl(unsigned long port) -{ - return _alpha_inl(port); -} - -#endif /* linux */ - -#if (defined(__FreeBSD__) || defined(__OpenBSD__)) \ +#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) \ !defined(DO_PROTOTYPES) -/* for FreeBSD and OpenBSD on Alpha, we use the libio (resp. libalpha) */ -/* inx/outx routines */ -/* note that the appropriate setup via ioperm needs to be done */ -/* *before* any inx/outx is done. */ - -extern _X_EXPORT void outb(unsigned int port, unsigned char val); -extern _X_EXPORT void outw(unsigned int port, unsigned short val); -extern _X_EXPORT void outl(unsigned int port, unsigned int val); -extern _X_EXPORT unsigned char inb(unsigned int port); -extern _X_EXPORT unsigned short inw(unsigned int port); -extern _X_EXPORT unsigned int inl(unsigned int port); - -#endif /* (__FreeBSD__ || __OpenBSD__ ) !DO_PROTOTYPES */ - - -#if defined(__NetBSD__) -#include machine/pio.h -#endif /* __NetBSD__ */ +/* FIXME: #include these instead of manual prototypes */ +extern void outb(unsigned int port, unsigned char val); +extern void outw(unsigned int port, unsigned short val); +extern void outl(unsigned int port, unsigned int val); +extern unsigned char inb(unsigned int port); +extern unsigned short inw(unsigned int port); +extern unsigned int inl(unsigned int port); +# define OUTB(port, val) outb((port), (val)) +# define OUTW(port, val) outw((port), (val)) +# define OUTL(port, val) outl((port), (val)) + +#elif defined(__NetBSD__) +# include machine/pio.h +# define OUTB(port, val) outb((port), (val)) +# define OUTW(port, val) outw((port), (val)) +# define OUTL(port, val) outl((port), (val)) +#endif # elif defined(linux) defined(__ia64__) @@ -388,6 +344,7 @@ extern _X_EXPORT unsigned int inl(unsigned int port); #include sys/io.h +/* FIXME: fix up, declared in hw/xfree86/os-support/shared/ia64Pci.c */ #undef outb #undef outw #undef outl @@ -401,7 +358,13 @@ extern _X_EXPORT unsigned int inb(unsigned long port); extern _X_EXPORT unsigned int inw(unsigned long port); extern _X_EXPORT unsigned int inl(unsigned long port); -# elif (defined(linux) || defined(__FreeBSD__)) defined(__amd64__) +# elif defined __amd64__ +#ifdef linux +# include sys/io.h +# define OUTB(port, val) outb((val), (port)) +# define OUTW(port, val) outw((val), (port)) +# define OUTL(port, val) outl((val), (port)) +#elif defined __FreeBSD__ #include inttypes.h @@ -424,6 +387,10 @@
[PATCH] Make sys.c use unaligned access functions provided in compiler.
Favorite deleted line was definitely /* to cope with broken egcs-1.1.2 :- */ Signed-off-by: Matt Turner matts...@gmail.com --- hw/xfree86/x86emu/Makefile.am |2 +- hw/xfree86/x86emu/sys.c | 181 + 2 files changed, 2 insertions(+), 181 deletions(-) diff --git a/hw/xfree86/x86emu/Makefile.am b/hw/xfree86/x86emu/Makefile.am index 987ea8b..bcacb33 100644 --- a/hw/xfree86/x86emu/Makefile.am +++ b/hw/xfree86/x86emu/Makefile.am @@ -9,7 +9,7 @@ libx86emu_la_SOURCES = debug.c \ sys.c \ x86emu.h -INCLUDES = +INCLUDES = $(XORG_INCS) AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) diff --git a/hw/xfree86/x86emu/sys.c b/hw/xfree86/x86emu/sys.c index e15fb09..2ebf6f1 100644 --- a/hw/xfree86/x86emu/sys.c +++ b/hw/xfree86/x86emu/sys.c @@ -48,168 +48,13 @@ #ifndef NO_SYS_HEADERS #include string.h #endif +#include compiler.h /* for unaligned access functions */ /*- Global Variables --*/ X86EMU_sysEnv _X86EMU_env;/* Global emulator machine state */ X86EMU_intrFuncs _X86EMU_intrTab[256]; /*- Implementation */ -#if defined(__alpha__) || defined(__alpha) -/* to cope with broken egcs-1.1.2 :- */ - -#define ALPHA_UALOADS -/* - * inline functions to do unaligned accesses - * from linux/include/asm-alpha/unaligned.h - */ - -/* - * EGCS 1.1 knows about arbitrary unaligned loads. Define some - * packed structures to talk about such things with. - */ - -#if defined(__GNUC__) -struct __una_u64 { unsigned long x __attribute__((packed)); }; -struct __una_u32 { unsigned int x __attribute__((packed)); }; -struct __una_u16 { unsigned short x __attribute__((packed)); }; -#endif - -static __inline__ unsigned long ldq_u(unsigned long * r11) -{ -#if defined(__GNUC__) - const struct __una_u64 *ptr = (const struct __una_u64 *) r11; - return ptr-x; -#else - unsigned long r1,r2; - __asm__(ldq_u %0,%3\n\t - ldq_u %1,%4\n\t - extql %0,%2,%0\n\t - extqh %1,%2,%1 - :=r (r1), =r (r2) - :r (r11), -m (*r11), -m (*(const unsigned long *)(7+(char *) r11))); - return r1 | r2; -#endif -} - -static __inline__ unsigned long ldl_u(unsigned int * r11) -{ -#if defined(__GNUC__) - const struct __una_u32 *ptr = (const struct __una_u32 *) r11; - return ptr-x; -#else - unsigned long r1,r2; - __asm__(ldq_u %0,%3\n\t - ldq_u %1,%4\n\t - extll %0,%2,%0\n\t - extlh %1,%2,%1 - :=r (r1), =r (r2) - :r (r11), -m (*r11), -m (*(const unsigned long *)(3+(char *) r11))); - return r1 | r2; -#endif -} - -static __inline__ unsigned long ldw_u(unsigned short * r11) -{ -#if defined(__GNUC__) - const struct __una_u16 *ptr = (const struct __una_u16 *) r11; - return ptr-x; -#else - unsigned long r1,r2; - __asm__(ldq_u %0,%3\n\t - ldq_u %1,%4\n\t - extwl %0,%2,%0\n\t - extwh %1,%2,%1 - :=r (r1), =r (r2) - :r (r11), -m (*r11), -m (*(const unsigned long *)(1+(char *) r11))); - return r1 | r2; -#endif -} - -/* - * Elemental unaligned stores - */ - -static __inline__ void stq_u(unsigned long r5, unsigned long * r11) -{ -#if defined(__GNUC__) - struct __una_u64 *ptr = (struct __una_u64 *) r11; - ptr-x = r5; -#else - unsigned long r1,r2,r3,r4; - - __asm__(ldq_u %3,%1\n\t - ldq_u %2,%0\n\t - insqh %6,%7,%5\n\t - insql %6,%7,%4\n\t - mskqh %3,%7,%3\n\t - mskql %2,%7,%2\n\t - bis %3,%5,%3\n\t - bis %2,%4,%2\n\t - stq_u %3,%1\n\t - stq_u %2,%0 - :=m (*r11), -=m (*(unsigned long *)(7+(char *) r11)), -=r (r1), =r (r2), =r (r3), =r (r4) - :r (r5), r (r11)); -#endif -} - -static __inline__ void stl_u(unsigned long r5, unsigned int * r11) -{ -#if defined(__GNUC__) - struct __una_u32 *ptr = (struct __una_u32 *) r11; - ptr-x = r5; -#else - unsigned long r1,r2,r3,r4; - - __asm__(ldq_u %3,%1\n\t - ldq_u %2,%0\n\t - inslh %6,%7,%5\n\t - insll %6,%7,%4\n\t - msklh %3,%7,%3\n\t - mskll %2,%7,%2\n\t - bis %3,%5,%3\n\t - bis %2,%4,%2\n\t - stq_u %3,%1\n\t - stq_u %2,%0 - :=m (*r11), -=m (*(unsigned long *)(3+(char *) r11)), -=r (r1), =r (r2), =r (r3), =r (r4) -
[PATCH 1/4] [alpha] Remove unused code, _dense_* functions, iobase stuff
This code has been unused since the switch to libpciaccess. It really should have been killed by fba700f1f6a8976. Pointed out by Michael Cree. Signed-off-by: Matt Turner matts...@gmail.com --- hw/xfree86/os-support/linux/lnx.h | 31 --- hw/xfree86/os-support/linux/lnx_axp.c | 68 --- hw/xfree86/os-support/linux/lnx_ev56.c | 90 --- hw/xfree86/os-support/linux/lnx_video.c |2 - 4 files changed, 0 insertions(+), 191 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx.h b/hw/xfree86/os-support/linux/lnx.h index 085c942..e9b673c 100644 --- a/hw/xfree86/os-support/linux/lnx.h +++ b/hw/xfree86/os-support/linux/lnx.h @@ -8,37 +8,6 @@ extern unsigned long _bus_base __P ((void)) __attribute__ ((const)); extern unsigned long _bus_base_sparse __P ((void)) __attribute__ ((const)); extern int iopl __P ((int __level)); - -/* new pciconfig_iobase syscall added in 2.2.15 and 2.3.99 */ -# include linux/unistd.h -extern long (*_iobase)(unsigned, int, int, int); - -/* - * _iobase deals with the case the __NR_pciconfig_iobase is either undefined - * or unsupported by the kernel, but we need to make sure that the `which' - * argument symbols are defined. - */ -# ifndef IOBASE_HOSE -# define IOBASE_HOSE 0 -# endif -# ifndef IOBASE_SPARSE_MEM -# define IOBASE_SPARSE_MEM 1 -# endif -# ifndef IOBASE_DENSE_MEM -# define IOBASE_DENSE_MEM2 -# endif -# ifndef IOBASE_SPARSE_IO -# define IOBASE_SPARSE_IO3 -# endif -# ifndef IOBASE_DENSE_IO -# define IOBASE_DENSE_IO 4 -# endif -# ifndef IOBASE_ROOT_BUS -# define IOBASE_ROOT_BUS 5 -# endif -# ifndef IOBASE_FROM_HOSE -# define IOBASE_FROM_HOSE0x1 -# endif # endif /* __alpha__ */ # if defined(DO_OS_FONTRESTORE) diff --git a/hw/xfree86/os-support/linux/lnx_axp.c b/hw/xfree86/os-support/linux/lnx_axp.c index 10b97b0..bc1a374 100644 --- a/hw/xfree86/os-support/linux/lnx_axp.c +++ b/hw/xfree86/os-support/linux/lnx_axp.c @@ -103,13 +103,6 @@ lnxGetAXP(void) } while (1); } -/* - * pciconfig_iobase wrappers and dynamic i/o selection - */ -#include lnx.h -#include unistd.h -#include errno.h - /* glibc versions (single hose only) */ extern void _outb(char val, unsigned long port); extern void _outw(short val, unsigned long port); @@ -118,70 +111,9 @@ extern unsigned int _inb(unsigned long port); extern unsigned int _inw(unsigned long port); extern unsigned int _inl(unsigned long port); -extern void _dense_outb(char, unsigned long); -extern void _dense_outw(short, unsigned long); -extern void _dense_outl(int, unsigned long); -extern unsigned int _dense_inb(unsigned long); -extern unsigned int _dense_inw(unsigned long); -extern unsigned int _dense_inl(unsigned long); - _X_EXPORT void (*_alpha_outb)(char, unsigned long) = _outb; _X_EXPORT void (*_alpha_outw)(short, unsigned long) = _outw; _X_EXPORT void (*_alpha_outl)(int, unsigned long) = _outl; _X_EXPORT unsigned int (*_alpha_inb)(unsigned long) = _inb; _X_EXPORT unsigned int (*_alpha_inw)(unsigned long) = _inw; _X_EXPORT unsigned int (*_alpha_inl)(unsigned long) = _inl; - -static long _alpha_iobase_query(unsigned, int, int, int); -long (*_iobase)(unsigned, int, int, int) = _alpha_iobase_query; - -static long -_alpha_iobase(unsigned flags, int hose, int bus, int devfn) -{ - if (bus 0) { -bus = hose; -flags |= IOBASE_FROM_HOSE; - } - - return syscall(__NR_pciconfig_iobase, flags, bus, devfn); -} - -static long -_alpha_iobase_legacy(unsigned flags, int hose, int bus, int devfn) -{ - if (hose 0) return -ENODEV; - if (flags IOBASE_DENSE_MEM) return _bus_base(); - if (flags IOBASE_SPARSE_MEM) return _bus_base_sparse(); - return 0; -} - -static long -_alpha_iobase_query(unsigned flags, int hose, int bus, int devfn) -{ - /* - * Only use iobase if the syscall is supported *and* it's - * a dense io system - */ - if (_alpha_iobase(IOBASE_DENSE_IO, 0, 0, 0) 0) { -/* - * The syscall worked and it's a dense io system - take over the - * io subsystem - */ -_iobase = _alpha_iobase; - -/* - * Only take over the inx/outx functions if this is a dense I/O - * system *and* addressing domains are being used. The dense I/O - * routines expect I/O to be mapped (as done in xf86MapLegacyIO) - */ -_alpha_outb = _dense_outb; -_alpha_outw = _dense_outw; -_alpha_outl = _dense_outl; -_alpha_inb = _dense_inb; -_alpha_inw = _dense_inw; -_alpha_inl = _dense_inl; - } else _iobase = _alpha_iobase_legacy; - - return _iobase(flags, hose, bus, devfn); -} - diff --git a/hw/xfree86/os-support/linux/lnx_ev56.c b/hw/xfree86/os-support/linux/lnx_ev56.c index c65e1cc..2c27e30 100644 --- a/hw/xfree86/os-support/linux/lnx_ev56.c +++ b/hw/xfree86/os-support/linux/lnx_ev56.c @@ -3,32 +3,6 @@ #include xorg-config.h #endif -#include X11/X.h -#include input.h -#include scrnintstr.h -#include compiler.h - -#include
[PATCH] [alpha] Remove unused code, _dense_* functions, iobase stuff
This code has been unused since the switch to libpciaccess. It really should have been killed by fba700f1f6a8976. Pointed out by Michael Cree. Signed-off-by: Matt Turner matts...@gmail.com --- hw/xfree86/os-support/linux/lnx.h | 36 hw/xfree86/os-support/linux/lnx_axp.c | 86 - hw/xfree86/os-support/linux/lnx_ev56.c | 89 +-- hw/xfree86/os-support/linux/lnx_video.c |2 - 4 files changed, 1 insertions(+), 212 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx.h b/hw/xfree86/os-support/linux/lnx.h index 085c942..3a2391e 100644 --- a/hw/xfree86/os-support/linux/lnx.h +++ b/hw/xfree86/os-support/linux/lnx.h @@ -4,42 +4,6 @@ #endif #ifndef LNX_H_ -# ifdef __alpha__ -extern unsigned long _bus_base __P ((void)) __attribute__ ((const)); -extern unsigned long _bus_base_sparse __P ((void)) __attribute__ ((const)); -extern int iopl __P ((int __level)); - -/* new pciconfig_iobase syscall added in 2.2.15 and 2.3.99 */ -# include linux/unistd.h -extern long (*_iobase)(unsigned, int, int, int); - -/* - * _iobase deals with the case the __NR_pciconfig_iobase is either undefined - * or unsupported by the kernel, but we need to make sure that the `which' - * argument symbols are defined. - */ -# ifndef IOBASE_HOSE -# define IOBASE_HOSE 0 -# endif -# ifndef IOBASE_SPARSE_MEM -# define IOBASE_SPARSE_MEM 1 -# endif -# ifndef IOBASE_DENSE_MEM -# define IOBASE_DENSE_MEM2 -# endif -# ifndef IOBASE_SPARSE_IO -# define IOBASE_SPARSE_IO3 -# endif -# ifndef IOBASE_DENSE_IO -# define IOBASE_DENSE_IO 4 -# endif -# ifndef IOBASE_ROOT_BUS -# define IOBASE_ROOT_BUS 5 -# endif -# ifndef IOBASE_FROM_HOSE -# define IOBASE_FROM_HOSE0x1 -# endif -# endif /* __alpha__ */ # if defined(DO_OS_FONTRESTORE) Bool lnx_savefont(void); diff --git a/hw/xfree86/os-support/linux/lnx_axp.c b/hw/xfree86/os-support/linux/lnx_axp.c index 10b97b0..10fd9e8 100644 --- a/hw/xfree86/os-support/linux/lnx_axp.c +++ b/hw/xfree86/os-support/linux/lnx_axp.c @@ -4,10 +4,7 @@ #endif #include stdio.h -#include X11/X.h -#include os.h #include xf86.h -#include xf86Priv.h #include shared/xf86Axp.h axpDevice lnxGetAXP(void); @@ -102,86 +99,3 @@ lnxGetAXP(void) count++; } while (1); } - -/* - * pciconfig_iobase wrappers and dynamic i/o selection - */ -#include lnx.h -#include unistd.h -#include errno.h - -/* glibc versions (single hose only) */ -extern void _outb(char val, unsigned long port); -extern void _outw(short val, unsigned long port); -extern void _outl(int val, unsigned long port); -extern unsigned int _inb(unsigned long port); -extern unsigned int _inw(unsigned long port); -extern unsigned int _inl(unsigned long port); - -extern void _dense_outb(char, unsigned long); -extern void _dense_outw(short, unsigned long); -extern void _dense_outl(int, unsigned long); -extern unsigned int _dense_inb(unsigned long); -extern unsigned int _dense_inw(unsigned long); -extern unsigned int _dense_inl(unsigned long); - -_X_EXPORT void (*_alpha_outb)(char, unsigned long) = _outb; -_X_EXPORT void (*_alpha_outw)(short, unsigned long) = _outw; -_X_EXPORT void (*_alpha_outl)(int, unsigned long) = _outl; -_X_EXPORT unsigned int (*_alpha_inb)(unsigned long) = _inb; -_X_EXPORT unsigned int (*_alpha_inw)(unsigned long) = _inw; -_X_EXPORT unsigned int (*_alpha_inl)(unsigned long) = _inl; - -static long _alpha_iobase_query(unsigned, int, int, int); -long (*_iobase)(unsigned, int, int, int) = _alpha_iobase_query; - -static long -_alpha_iobase(unsigned flags, int hose, int bus, int devfn) -{ - if (bus 0) { -bus = hose; -flags |= IOBASE_FROM_HOSE; - } - - return syscall(__NR_pciconfig_iobase, flags, bus, devfn); -} - -static long -_alpha_iobase_legacy(unsigned flags, int hose, int bus, int devfn) -{ - if (hose 0) return -ENODEV; - if (flags IOBASE_DENSE_MEM) return _bus_base(); - if (flags IOBASE_SPARSE_MEM) return _bus_base_sparse(); - return 0; -} - -static long -_alpha_iobase_query(unsigned flags, int hose, int bus, int devfn) -{ - /* - * Only use iobase if the syscall is supported *and* it's - * a dense io system - */ - if (_alpha_iobase(IOBASE_DENSE_IO, 0, 0, 0) 0) { -/* - * The syscall worked and it's a dense io system - take over the - * io subsystem - */ -_iobase = _alpha_iobase; - -/* - * Only take over the inx/outx functions if this is a dense I/O - * system *and* addressing domains are being used. The dense I/O - * routines expect I/O to be mapped (as done in xf86MapLegacyIO) - */ -_alpha_outb = _dense_outb; -_alpha_outw = _dense_outw; -_alpha_outl = _dense_outl; -_alpha_inb = _dense_inb; -_alpha_inw = _dense_inw; -_alpha_inl = _dense_inl; - } else _iobase = _alpha_iobase_legacy; - - return _iobase(flags, hose, bus, devfn); -} - diff --git a/hw/xfree86/os-support/linux/lnx_ev56.c
Re: [PATCH] Abstract calls to in/out with IN/OUT macros
Excerpts from Matt Turner's message of Sun Nov 01 11:01:20 -0800 2009: This will allow us to include sys/io.h and use libc's in/out when available. That's a fine goal, but given the ambiguity between Linux and BSD on the outb argument ordering, I've got some suggestions #ifdef linux -/* for Linux on Alpha, we use the LIBC _inx/_outx routines */ -/* note that the appropriate setup via ioperm needs to be done */ -/* *before* any inx/outx is done. */ +# include sys/io.h +# define OUTB(port, val) outb((val), (port)) +# define OUTW(port, val) outw((val), (port)) +# define OUTL(port, val) outl((val), (port)) Please use inline functions instead of macros. Also, please make it obvious that these macros belong to X.org and are not brought from some other package. Further, it would be nice to have them self-documenting as far as argument order somehow, perhaps static inline void xorg_outb_port_val(uint16_t port, uint8_t val) (suggestions welcome here, I just want to make people aware of any ordering change here). What isn't clear is how this affects the current API; ideally, we'd make all existing drivers using whatever old names they've got continue to compile, but with warnings so that developers will know what to do to fix them. -- keith.pack...@intel.com signature.asc Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [RFC] DRI2 synchronization and swap bits
Hello everybody My name is Mario Kleiner and i'm new to this list, so i apologize beforehand should i violate some rules of netiquette, state the totally obvious, or if this post is somehow considered off-topic or way too long. Please tell me if so, and how to do better next time. First some background to why i am posting, then some proposals more to the point of this RFC. I read this RFC and i'm very excited about the prospect of having well working support for the OML_sync_control extension in DRI2 on Linux/X11. I was hoping for this to happen since years, so a big thank you in advance! This is why i hope to provide some input from the perspective of future power-users of functions like glXGetSyncValuesOML(), glXSwapBuffersMscOML(), glXWaitForSbcOML. I'm the co-developer of a popular free-software toolkit (Psychtoolbox) that is used mostly in the neuroscience / cognitive science community by scientist to find out how the different senses (visual, auditory, haptic, ...) work and how they work together. Our requirements to graphics are often much more demanding than what a videogame, typical vr-environment or a mediaplayer has. Our users often have very strict requirements for scheduling frame- accurate and tear-free visual stimulus display, synchronizing bufferswaps across display-heads, and low-latency returns from swap- completion. Often they need swap-completion timestamps which are available with the shortest possible delay after a successfull swap and accurately tied to the vblank at which scanout of a swapped frame started. The need for timestamps with sub-millisecond accuracy is not uncommon. Therefore, well working OML_sync_control support would be basically a dream come true and a very compelling feature for Linux as a platform for cognitive science. I spent the last 12 hours reading the CompositeSwap page at the DRI- Wiki and through Jesse Barnes git-tree and the drivers/gpu/drm/ drm_irq.c file in the linux-next git-tree at kernel org, which i assume (correctly?) is the current state of art wrt. to the DRM, and have some thoughts or wishes. 1. Wrt to 2) DRI2WaitMSC/SBC a) Concern about blocking the client on the server side as opposed to a client side wait. I'm not sure about the extra latency involved by blocking the client on the server side, instead of a client side wait, but i can assure you that for our applications, 1 millisecond extra delay between swap- completion and unblocking can make a significant difference. Quite often certain actions need to be triggered in sync with swap completion. Examples are starting recording equipment for brain activity (fMRI, EEG, MEG, eye-trackers) or other physiological responses, starting sound playback or recording, sending trigger packets over a network, driving special digital/analog I/O boards, driving motion simulators etc. So low-latency unblocking would be much appreciated from our side. 2. On the CompositePage in the DRM Wiki, there is this comment: ...It seems that composited apps should never need to know about real world screen vblank issues, ... When dealing with a redirected window it seems it would be acceptable to come up with an entirely fake number for all existing extensions that care about vblanks.. I don't like this idea about entirely fake numbers and like to vote for a solution that is as close as possible to the non-redirected case. Most of our applications run in non-redirected, full-screen, undecorated, page-flipped windows, ie., without a compositor being involved. I can think of a couple future usage cases though where reasonably well working redirected/composited windows would be very useful for us, but only if we get meaningful timestamps and vblank counts that are tied to the actual display onset. 3. The Wiki also mentions The direct rendered cases outlined in the implementation notes above are complete, but there's a bug in the async glXSwapBuffers that sometimes causes clients to hang after swapping rather than continue. Looking through the code of http:// cgit.freedesktop.org/~jbarnes/xf86-video-intel/tree/src/i830_dri.c? id=a0e2e624c47516273fa3d260b86d8c293e2519e4 i can see that in I830DRI2SetupSwap() and I830DRI2SetupWaitMSC(), in the if (divisor == 0) { ...} path, the functions return after DRM_VBLANK_EVENT submission without assigning *event_frame = vbl.reply.sequence; This looks problematic to me, as the xserver is later submitting event_frame in the call to DRI2AddFrameEvent() inside DRI2SwapBuffers () as a cookie to find the right events for clients to wait on? Could this be a reason for clients hanging after swap? I found a few other spots where i other misunderstood something or there are small bugs. What is the appropriate way to report these? 4. According to spec, the different OML_sync_control functions do return a UST timestamp which is supposed to reflect the exact
Re: [PATCH] [alpha] Remove unused code, _dense_* functions, iobase stuff
From: Matt Turner matts...@gmail.com Date: Sun, 1 Nov 2009 15:05:08 -0500 This code has been unused since the switch to libpciaccess. It really should have been killed by fba700f1f6a8976. Uh, what makes you think so? As far as I can tell, libpciaccess only handles mmio. One could argue that libpciaccess should also handle legacy io, but until that is implemented, and the drivers have been adjusted, I think at least some of this code is still necessary. ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH 1/2] exa: remove some outdated comment
- This comment is still in exa_driver.c and there it makes sense. Signed-off-by: Maarten Maathuis madman2...@gmail.com --- exa/exa_mixed.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c index bc393c7..b29ee35 100644 --- a/exa/exa_mixed.c +++ b/exa/exa_mixed.c @@ -154,10 +154,6 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, if (pExaScr-info-ModifyPixmapHeader pExaPixmap-driverPriv) { ret = pExaScr-info-ModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind, pPixData); - /* For EXA_HANDLES_PIXMAPS, we set pPixData to NULL. -* If pPixmap-devPrivate.ptr is non-NULL, then we've got a non-offscreen pixmap. -* We need to store the pointer, because PrepareAccess won't be called. -*/ if (ret == TRUE) goto out; } -- 1.6.5.1 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] [alpha] Remove unused code, _dense_* functions, iobase stuff
On Sun, Nov 1, 2009 at 4:04 PM, Mark Kettenis mark.kette...@xs4all.nl wrote: From: Matt Turner matts...@gmail.com Date: Sun, 1 Nov 2009 15:05:08 -0500 This code has been unused since the switch to libpciaccess. It really should have been killed by fba700f1f6a8976. Uh, what makes you think so? As far as I can tell, libpciaccess only handles mmio. One could argue that libpciaccess should also handle legacy io, but until that is implemented, and the drivers have been adjusted, I think at least some of this code is still necessary. The only user of _alpha_iobase_query (defined lnx_axp.c:171) was hw/xfree86/os-support/bus/axpPci.c, through _iobase (defined lnx_axp.c:136). From there, the call heirarchy is _alpha_iobase_query | |--- _alpha_iobase_legacy | |--- _alpha_iobase | |--- _alpha_{out,in}{b,w,l} | |--- _dense_{out,in}{b,w,l} I don't have any hardware capable of testing sparse support, but it's either already broken (so killing this code won't hurt anything) or it's working (so killing this unused code won't hurt anything). So... Matt ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Abstract calls to in/out with IN/OUT macros
From: Matt Turner matts...@gmail.com Date: Sun, 1 Nov 2009 14:01:20 -0500 This will allow us to include sys/io.h and use libc's in/out when available. While I sympathise with your attempt to clean up the mess in compiler.h, this will break at least one driver (xf86-video-i128). ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] [alpha] Remove unused code, _dense_* functions, iobase stuff
Date: Sun, 1 Nov 2009 16:15:47 -0500 From: Matt Turner matts...@gmail.com On Sun, Nov 1, 2009 at 4:04 PM, Mark Kettenis mark.kette...@xs4all.nl wrote: From: Matt Turner matts...@gmail.com Date: Sun, 1 Nov 2009 15:05:08 -0500 This code has been unused since the switch to libpciaccess. It really should have been killed by fba700f1f6a8976. Uh, what makes you think so? As far as I can tell, libpciaccess only handles mmio. One could argue that libpciaccess should also handle legacy io, but until that is implemented, and the drivers have been adjusted, I think at least some of this code is still necessary. The only user of _alpha_iobase_query (defined lnx_axp.c:171) was hw/xfree86/os-support/bus/axpPci.c, through _iobase (defined lnx_axp.c:136). From there, the call heirarchy is _alpha_iobase_query | |--- _alpha_iobase_legacy | |--- _alpha_iobase | |--- _alpha_{out,in}{b,w,l} | |--- _dense_{out,in}{b,w,l} I don't have any hardware capable of testing sparse support, but it's either already broken (so killing this code won't hurt anything) or it's working (so killing this unused code won't hurt anything). So... Ah well, if you're not implying that this is now handled by libpciaccess, and if dense support on Linux still works after this change, this should be fine. ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Abstract calls to in/out with IN/OUT macros
On Sun, Nov 1, 2009 at 3:29 PM, keithp kei...@keithp.com wrote: Excerpts from Matt Turner's message of Sun Nov 01 11:01:20 -0800 2009: This will allow us to include sys/io.h and use libc's in/out when available. That's a fine goal, but given the ambiguity between Linux and BSD on the outb argument ordering, I've got some suggestions # ifdef linux -/* for Linux on Alpha, we use the LIBC _inx/_outx routines */ -/* note that the appropriate setup via ioperm needs to be done */ -/* *before* any inx/outx is done. */ +# include sys/io.h +# define OUTB(port, val) outb((val), (port)) +# define OUTW(port, val) outw((val), (port)) +# define OUTL(port, val) outl((val), (port)) Please use inline functions instead of macros. Also, please make it obvious that these macros belong to X.org and are not brought from some other package. Further, it would be nice to have them self-documenting as far as argument order somehow, perhaps static inline void xorg_outb_port_val(uint16_t port, uint8_t val) (suggestions welcome here, I just want to make people aware of any ordering change here). What isn't clear is how this affects the current API; ideally, we'd make all existing drivers using whatever old names they've got continue to compile, but with warnings so that developers will know what to do to fix them. -- keith.pack...@intel.com Please see attached patch. I've made xorg_out{b,w,l}_port_val and xorg_out{b,w,l} static inline functions. There are a couple of FIXMEs, namely o there are a lot of lines like 'extern _X_EXPORT void outb(... '; these shouldn't have to exist. #include the right header instead. o the Linux/IA64 section does funky stuff by including sys/io.h, undef'ing in/out, and then redeclaring them as mentioned previously. o The FreeBSD/AMD64 section defines in/out because I don't know what header FreeBSD uses to define these. Thanks, Matt 0001-Abstract-calls-to-in-out-with-xorg_-in-out-functions.patch Description: Binary data ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
error loading pixmap from HD
Hello, I am currently trying to load an image from disk and splash it on screen using XCopyArea(), and in the following snippet to perform the loading step: res = XReadBitmapFile(display, win, BMP_TILE_BLOCKS, w, h, game-platform-bmpTiles, x_hot, y_hot); switch (res) { case BitmapOpenFailed: printf(bitmap open failed\n); break; case BitmapFileInvalid: printf(bitmap invalid file\n); break; case BitmapNoMemory: printf(bitmap no memory!\n); break; case BitmapSuccess: printf(bitmap success\n); default: printf(other error status\n); break; } I am constantly getting a bitmap invalid file error (case #2 in the above switch control). In the snippet above, the constant BMP_TILE_BLOCKS is a string representing the path to a PBM/XPM/BMP file on disk. However, neither image format works. How should I correctly load the image file from disk? Or I am I scrueing something in the snippet itself? Also, which image formats work correctly with this particular function? I am looking forward to your reply. A many thank you in advance, Sotiris Karavarsamis Computer Science Department, UOI ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [xserver] add libc as a choice for SHA1 implementation
Excerpts from Matthieu Herrb's message of Sun Nov 01 09:34:35 -0800 2009: +AC_CHECK_FUNCS([SHA1Init], [HAVE_LIBC_SHA1=yes]) I'd suggest AC_CHECK_FUNC instead; as far as I can tell, AC_CHECK_FUNCS will also define HAVE_SHA1INIT. Also, can you use HAVE_LIBC_SHA1 consistently rather than having two separate names (HAVE_LIBC_SHA1 and HAVE_SHA1_IN_LIBC)? Yes, I know one is a preprocessor symbol and the other is a cpp shell variable, but I think that will work anyway. -- keith.pack...@intel.com signature.asc Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Remove lnx_font.c and lnx.h
Excerpts from Matt Turner's message of Sun Nov 01 12:22:44 -0800 2009: I couldn't find any version of the X xserver that ever used lnx_font.c so let's delete it. I tried contacting its author, Egbert, multiple times on IRC and email [*] but never got any response. It also hasn't been seriously touched since January 2005. The only reference I've found to this is an ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/105822 which seems to have conflicting reports about what this is good for. I'm of the opinion that the graphics driver should be responsible for returning the card to its original state (and hence the X server shouldn't be doing anything with console fonts). It would be nice to know whether there are drivers which aren't successfully restoring the entire console font though, and for whom a helper function of this sort would be useful. Daniels reportedly commented that this code would break multi-card uses, although I'm not entirely sure why that would be the case, unless that referred to multi-seat instead. -- keith.pack...@intel.com signature.asc Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Abstract calls to in/out with IN/OUT macros
Excerpts from Mark Kettenis's message of Sun Nov 01 13:19:04 -0800 2009: While I sympathise with your attempt to clean up the mess in compiler.h, this will break at least one driver (xf86-video-i128). A fine example of why we want to merge the drivers into the server :-) In any case, for now, I'd rather see an ABI/API compatible change that has the server get at the system io functions through a standard api while still providing the old interfaces so that drivers continue to build unchanged. Having those old interfaces work through the new standard API would be great if possible. Marking those as 'deprecated' so that the compiler emits a warning would be a nice bonus. I should start a wiki page about how we want to change the driver API/ABI... -- keith.pack...@intel.com signature.asc Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Abstract calls to in/out with IN/OUT macros
On Sun, Nov 1, 2009 at 6:13 PM, keithp kei...@keithp.com wrote: Excerpts from Mark Kettenis's message of Sun Nov 01 13:19:04 -0800 2009: While I sympathise with your attempt to clean up the mess in compiler.h, this will break at least one driver (xf86-video-i128). A fine example of why we want to merge the drivers into the server :-) In any case, for now, I'd rather see an ABI/API compatible change that has the server get at the system io functions through a standard api while still providing the old interfaces so that drivers continue to build unchanged. Having those old interfaces work through the new standard API would be great if possible. Marking those as 'deprecated' so that the compiler emits a warning would be a nice bonus. This would be nice, but I'm not sure how it could be possible, since in half the cases of OS/Architecture combinations, the drivers call the libc in/out, so no chance to warn. Then again, this is entirely the problem with the current 'API' if we can even call it that. If you've got ideas, I'm all ears. I don't see any problem with minorly breaking the API (fixable by trivial search-replace patches) to give it some kind of sanity. Anyway, I mailed a patch, but it was too large for xorg-devel. I guess you received it already, Keith? Matt ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] [alpha] Remove unused code, _dense_* functions, iobase stuff
On 2/11/2009, at 12:06 PM, keithp wrote: Excerpts from Mark Kettenis's message of Sun Nov 01 13:26:11 -0800 2009: Ah well, if you're not implying that this is now handled by libpciaccess, and if dense support on Linux still works after this change, this should be fine. Any chance I could get a 'Test-by:' here? I'm not exactly in a position to even build-test alpha at this point (my last alpha box at the CPU when the power supply died). I'm happy to test this, but it may be a couple of days before I can do so. Cheers Michael. ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] [alpha] Remove unused code, _dense_* functions, iobase stuff
Excerpts from Michael Cree's message of Sun Nov 01 15:33:18 -0800 2009: I'm happy to test this, but it may be a couple of days before I can do so. Cool! Send a note when you figure out whether you think this is ready for master, and include a a suitable '-by:' tag for git (either Tested-by or Reviewed-by, or both). -- keith.pack...@intel.com signature.asc Description: PGP signature ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel