filename | test/testta.c |
changeset | 212:8b77a7e6b6f0 |
prev | 193:31151fcc3cb7 |
next | 561:533f6b478071 |
author | nkeynes |
date | Tue Feb 13 08:34:27 2007 +0000 (17 years ago) |
permissions | -rw-r--r-- |
last change | Add tests for FLOAT and FTRC Comment out user-mode exception test (broken) |
file | annotate | diff | log | raw |
1.1 --- a/test/testta.c Fri Aug 04 01:38:30 2006 +00001.2 +++ b/test/testta.c Tue Feb 13 08:34:27 2007 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: testta.c,v 1.3 2006-08-04 01:38:30 nkeynes Exp $1.6 + * $Id: testta.c,v 1.4 2006-08-18 09:32:32 nkeynes Exp $1.7 *1.8 * Tile Accelerator test cases1.9 *1.10 @@ -74,6 +74,18 @@1.11 return memcmp( expect, tile_ptrs[tile_type]+(offset*tile_sizes[tile_type]), tile_size );1.12 }1.14 +/**1.15 + * Copy from vram, wrapping appropriately1.16 + */1.17 +int memcpy_from_vram( char *dest, char *src, int len )1.18 +{1.19 + while( len > 0 ) {1.20 + *dest++ = *src++;1.21 + src = (char *)( ((unsigned int)src) & 0xFF7FFFFF );1.22 + len--;1.23 + }1.24 +}1.25 +1.26 int test_ta( test_data_t test_case )1.27 {1.28 char buf[1024];1.29 @@ -83,8 +95,6 @@1.30 int checkedTile[5] = {0,0,0,0,0};1.31 int i;1.32 int hsegs,vsegs;1.33 - char *result = (char *)(PVR_VRAM_BASE+OBJ_START);1.34 - char *tilematrix = (char *)(PVR_VRAM_BASE+TILE_START+TILE_LENGTH);1.35 char *tile_ptrs[5];1.37 asic_clear();1.38 @@ -100,6 +110,9 @@1.39 }1.40 config = (struct ta_config *)config_data->data;1.41 }1.42 + char *result = (char *)(PVR_VRAM_BASE+config->obj_start);1.43 + char *tilematrix = (char *)(PVR_VRAM_BASE+config->tile_start);1.44 +1.45 ta_init(config);1.46 for( i=0; i<5; i++ ) {1.47 tile_sizes[i] = TILE_SIZE(config,i);1.48 @@ -114,6 +127,7 @@1.51 test_data_block_t input = get_test_data(test_case, "input");1.52 + test_data_block_t input2 = get_test_data(test_case, "input2");1.53 test_data_block_t output = get_test_data(test_case, "output");1.54 test_data_block_t error = get_test_data(test_case, "error");1.55 if( input == NULL || output == NULL ) {1.56 @@ -125,6 +139,12 @@1.57 return -1;1.58 }1.60 + if( input2 != NULL ) {1.61 + ta_reinit();1.62 + pvr_dma_write( 0x10000000, input2->data, input2->length, 0 );1.63 + }1.64 +1.65 +1.66 if( error != NULL ) {1.67 for( i=0; i<error->length; i++ ) {1.68 if( asic_wait( error->data[i] ) == -1 ) {1.69 @@ -200,9 +220,11 @@1.71 /* Vertex buffer */1.72 int result_length = pvr_get_objbuf_size();1.73 - if( test_block_compare( output, result, result_length ) != 0 ) {1.74 + char tmp[result_length];1.75 + memcpy_from_vram( tmp, result, result_length );1.76 + if( test_block_compare( output, tmp, result_length ) != 0 ) {1.77 fprintf( stderr, "Test %s: Failed (Vertex buffer). ", test_case->test_name );1.78 - fwrite_diff32( stderr, output->data, output->length, result, result_length );1.79 + fwrite_diff32( stderr, output->data, output->length, tmp, result_length );1.80 haveFailure = 1;1.81 }
.