Hi,

           I’m confused when I use memcpy() in pandaboard android. The test code is very simple, as below:

 

#define PER_COPY_SIZE (1024*1024*4)

int main(int argc, char *argv[ ]){

         char *src;

         char *dst;

         char *p;

        

         src=(char *)malloc(PER_COPY_SIZE);

         dst=(char*)malloc(PER_COPY_SIZE);

         p=src;

#if 1 

         for(int i=0; i<PER_COPY_SIZE; i++){

             *p++=i%255;                  

         }

#endif

         for(int j=0; j<1000; j++){

                   memcpy(dst, src, PER_COPY_SIZE);

         }

         free(src);

         free(dst);

         return 0;

}

 

       It copies 4M byte data from source to dest repeatedly and takes 12 seconds.  But when I get rid of the part of code in red color, it takes only 4 seconds.  Why does the writing to source firstly has influence the memcpy( ) time so greatly?

 

 

Thanks & Best Regards!
牟刚
Actions Semiconductor Co.,Ltd     
Tel:     +86-756-3392353 ext.3103  Fax:  +86-756-3392251
Email:   mugang@actions-semi.com  HTTP://www.actions-semi.com


发件人: 牟刚
发送时间: 2012年10月30 16:04
收件人: 'linaro-android@lists.linaro.org'
主题: pandaboard GPU driver

 

Hi

         I want compile pandaboard GPU driver myself and get the library, such as “libEGL_POWERVR_SGX540_120.so”, “libIMGegl.so” and so on. How can I get the GPU driver source code and compile environment?

 

Thanks & Best Regards!
牟刚
Actions Semiconductor Co.,Ltd     
Tel:     +86-756-3392353 ext.3103  Fax:  +86-756-3392251
Email:   mugang@actions-semi.com  HTTP://www.actions-semi.com