1.1 --- a/test/testta.c Fri Aug 04 01:38:30 2006 +0000
1.2 +++ b/test/testta.c Mon Jan 15 10:41:30 2007 +0000
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.8 * Tile Accelerator test cases
1.11 return memcmp( expect, tile_ptrs[tile_type]+(offset*tile_sizes[tile_type]), tile_size );
1.15 + * Copy from vram, wrapping appropriately
1.17 +int memcpy_from_vram( char *dest, char *src, int len )
1.19 + while( len > 0 ) {
1.21 + src = (char *)( ((unsigned int)src) & 0xFF7FFFFF );
1.26 int test_ta( test_data_t test_case )
1.30 int checkedTile[5] = {0,0,0,0,0};
1.33 - char *result = (char *)(PVR_VRAM_BASE+OBJ_START);
1.34 - char *tilematrix = (char *)(PVR_VRAM_BASE+TILE_START+TILE_LENGTH);
1.40 config = (struct ta_config *)config_data->data;
1.42 + char *result = (char *)(PVR_VRAM_BASE+config->obj_start);
1.43 + char *tilematrix = (char *)(PVR_VRAM_BASE+config->tile_start);
1.46 for( i=0; i<5; i++ ) {
1.47 tile_sizes[i] = TILE_SIZE(config,i);
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.60 + if( input2 != NULL ) {
1.62 + pvr_dma_write( 0x10000000, input2->data, input2->length, 0 );
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.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 );