[Openchrome-devel] xf86-video-openchrome: 2 commits - src/via_driver.h src/via_memcpy.c

Xavier Bachelot xavierb at kemper.freedesktop.org
Mon Jun 3 11:54:10 PDT 2013


 src/via_driver.h |   11 +++++++++++
 src/via_memcpy.c |   12 ------------
 2 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit 237233d14346604488785a9899f01df044245949
Author: Jared McNeill <jmcneill at NetBSD.org>
Date:   Mon Jun 3 20:52:47 2013 +0200

    Remove a couple '#ifdef linux's to let the driver use optimized memcpy
    functions on NetBSD for video copy. Gives nearly 2x performance on my
    test system (previously "kernel" memcpy was always used):
    
    CHROME(0): Benchmarking video copy.  Less time is better.
    CHROME(0): Timed   libc YUV420 copy... 3000272. Throughput: 315.6 MiB/s.
    CHROME(0): Timed kernel YUV420 copy... 3024946. Throughput: 313.0 MiB/s.
    CHROME(0): Timed    SSE YUV420 copy... 1591352. Throughput: 595.0 MiB/s.
    CHROME(0): Timed    MMX YUV420 copy... 2566279. Throughput: 369.0 MiB/s.
    CHROME(0): Ditching 3DNow! YUV420 copy. Not supported by CPU.
    CHROME(0): Timed   MMX2 YUV420 copy... 1696662. Throughput: 558.1 MiB/s.
    CHROME(0): Using SSE YUV42X copy for video.

diff --git a/src/via_memcpy.c b/src/via_memcpy.c
index d4eb804..8ef0e9f 100644
--- a/src/via_memcpy.c
+++ b/src/via_memcpy.c
@@ -309,8 +309,6 @@
     }
 
 
-#if !defined(__i386__) || (defined(linux) && defined(__i386__))
-
 static void
 libc_YUV42X(unsigned char *dst, const unsigned char *src,
             int dstPitch, int w, int h, int yuv422)
@@ -348,8 +346,6 @@ libc_YUV42X(unsigned char *dst, const unsigned char *src,
         }
     }
 }
-#endif
-
 
 #ifdef __i386__
 
@@ -415,7 +411,6 @@ kernel_YUV42X(unsigned char *dst, const unsigned char *src,
     }
 }
 
-#ifdef linux
 PREFETCH_FUNC(sse, SSE, SSE,, FENCE)
 PREFETCH_FUNC(mmxext, MMXEXT, SSE, EMMS, FENCEMMS)
 PREFETCH_FUNC(now, MMX, NOW, FEMMS, FEMMS)
@@ -515,7 +510,6 @@ cpuValid(const char *cpuinfo, char **flags)
     }
     return 0;
 }
-#endif /* linux */
 
 /*
  * Benchmark the video copy routines and choose the fastest.
@@ -525,7 +519,6 @@ viaVidCopyInit(char *copyType, ScreenPtr pScreen)
 {
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
 
-#ifdef linux
     char buf[BSIZ];
     unsigned char *buf1, *buf2, *buf3;
     char *tmpBuf, *endBuf;
@@ -641,11 +634,6 @@ viaVidCopyInit(char *copyType, ScreenPtr pScreen)
                "Using %s YUV42X copy for %s.\n",
                mcFunctions[bestSoFar].mName, copyType);
     return mcFunctions[bestSoFar].mFunc;
-#else
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-               "Using Linux kernel memcpy for video.\n");
-    return kernel_YUV42X;
-#endif /* linux */
 }
 
 #else
commit 78b9f43ca8d04383a83659619d70f61688568366
Author: Christos Zoulas <christos at NetBSD.org>
Date:   Mon Jun 3 20:50:45 2013 +0200

    Add missing prototypes

diff --git a/src/via_driver.h b/src/via_driver.h
index f82fdda..dfe91fc 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -519,4 +519,15 @@ Bool VIADRIBufferInit(ScrnInfoPtr pScrn);
 
 #endif /* HAVE_DRI */
 
+int viaOffScreenLinear(struct buffer_object *obj, ScrnInfoPtr pScrn, unsigned long size);
+void viaShowCursor(ScrnInfoPtr pScrn);
+void viaHideCursor(ScrnInfoPtr pScrn);
+Bool viaHWCursorInit(ScreenPtr pScreen);
+void ViaDisplaySetStreamOnCRT(ScrnInfoPtr pScrn, Bool primary);
+void ViaDisplaySetStreamOnDFP(ScrnInfoPtr pScrn, Bool primary);
+void ViaDisplaySetStreamOnDVO(ScrnInfoPtr pScrn, int port, Bool primary);
+void ViaDisplayEnableSimultaneous(ScrnInfoPtr pScrn);
+void ViaDisplayEnableCRT(ScrnInfoPtr pScrn);
+void ViaDisplayEnableDVO(ScrnInfoPtr pScrn, int port);
+
 #endif /* _VIA_DRIVER_H_ */


More information about the Openchrome-devel mailing list