From e3ad58975be8599ef557988ffd18ca0236dd58ec Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 6 Aug 2007 13:17:38 -0600 Subject: [PATCH] remove timing code --- src/mesa/drivers/dri/i915pipe/intel_tex.c | 65 +---------------------- 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/src/mesa/drivers/dri/i915pipe/intel_tex.c b/src/mesa/drivers/dri/i915pipe/intel_tex.c index 94583cba974..f87d342366b 100644 --- a/src/mesa/drivers/dri/i915pipe/intel_tex.c +++ b/src/mesa/drivers/dri/i915pipe/intel_tex.c @@ -126,64 +126,6 @@ do_memcpy(void *dest, const void *src, size_t n) } -#if DO_DEBUG - -#ifndef __x86_64__ -static unsigned -fastrdtsc(void) -{ - unsigned eax; - __asm__ volatile ("\t" - "pushl %%ebx\n\t" - "cpuid\n\t" ".byte 0x0f, 0x31\n\t" - "popl %%ebx\n":"=a" (eax) - :"0"(0) - :"ecx", "edx", "cc"); - - return eax; -} -#else -static unsigned -fastrdtsc(void) -{ - unsigned eax; - __asm__ volatile ("\t" "cpuid\n\t" ".byte 0x0f, 0x31\n\t":"=a" (eax) - :"0"(0) - :"ecx", "edx", "ebx", "cc"); - - return eax; -} -#endif - -static unsigned -time_diff(unsigned t, unsigned t2) -{ - return ((t < t2) ? t2 - t : 0xFFFFFFFFU - (t - t2 - 1)); -} - - -static void * -timed_memcpy(void *dest, const void *src, size_t n) -{ - void *ret; - unsigned t1, t2; - double rate; - - if ((((unsigned) src) & 63) || (((unsigned) dest) & 63)) - _mesa_printf("Warning - non-aligned texture copy!\n"); - - t1 = fastrdtsc(); - ret = do_memcpy(dest, src, n); - t2 = fastrdtsc(); - - rate = time_diff(t1, t2); - rate /= (double) n; - _mesa_printf("timed_memcpy: %u %u --> %f clocks/byte\n", t1, t2, rate); - return ret; -} -#endif /* DO_DEBUG */ - - void intelInitTextureFuncs(struct dd_function_table *functions) { @@ -211,10 +153,5 @@ intelInitTextureFuncs(struct dd_function_table *functions) functions->UpdateTexturePalette = 0; functions->IsTextureResident = intelIsTextureResident; -#if DO_DEBUG - if (INTEL_DEBUG & DEBUG_BUFMGR) - functions->TextureMemCpy = timed_memcpy; - else -#endif - functions->TextureMemCpy = do_memcpy; + functions->TextureMemCpy = do_memcpy; } -- 2.30.2