xserver: stop bcopy from going really slow

The outport is most likely unnecessary on any currently used hardware,
the byte copy is necessary from what I know on IA64 and friends so leave it.

Add a new API entry point which lets a driver select the old behaviour if
such a needs is ever found.

This gives me ~20% speed up on startup on 945 hardware.
This commit is contained in:
Dave Airlie 2007-08-02 10:50:01 +10:00
parent 600ef07113
commit e717eb82dc
3 changed files with 26 additions and 8 deletions

View File

@ -259,6 +259,7 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMFUNC(xf86UDelay)
SYMFUNC(xf86IODelay)
SYMFUNC(xf86SlowBcopy)
SYMFUNC(xf86SetReallySlowBcopy)
#ifdef __alpha__
SYMFUNC(xf86SlowBCopyToBus)
SYMFUNC(xf86SlowBCopyFromBus)

View File

@ -22,22 +22,38 @@
#include "xf86_OSlib.h"
#include "compiler.h"
/* The outb() isn't needed on my machine, but who knows ... -- ost */
static int really_slow_bcopy;
_X_EXPORT void
xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
xf86SetReallySlowBcopy(void)
{
really_slow_bcopy = 1;
}
#if defined(__i386__) || defined(__x86_64__)
static void xf86_really_slow_bcopy(unsigned char *src, unsigned char *dst, int len)
{
while(len--)
{
*dst++ = *src++;
#if !defined(__sparc__) && \
!defined(__powerpc__) && \
!defined(__mips__) && \
!defined(__ia64__) && \
!defined(__arm__)
outb(0x80, 0x00);
#endif
}
}
#endif
/* The outb() isn't needed on my machine, but who knows ... -- ost */
_X_EXPORT void
xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
{
#if defined(__i386__) || defined(__x86_64__)
if (really_slow_bcopy) {
xf86_really_slow_bcopy(src, dst, len);
return;
}
#endif
while(len--)
*dst++ = *src++;
}
#ifdef __alpha__
/*

View File

@ -159,6 +159,7 @@ extern void xf86BusToMem(unsigned char *, unsigned char *, int);
extern void xf86MemToBus(unsigned char *, unsigned char *, int);
extern void xf86IODelay(void);
extern void xf86UDelay(long usec);
extern void xf86SetReallySlowBcopy(void);
extern void xf86SlowBcopy(unsigned char *, unsigned char *, int);
extern int xf86OpenSerial(pointer options);
extern int xf86SetSerial(int fd, pointer options);