diff options
-rw-r--r-- | cayman_test.c | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/cayman_test.c b/cayman_test.c new file mode 100644 index 0000000..754f881 --- /dev/null +++ b/cayman_test.c @@ -0,0 +1,89 @@ +#include "radeondemo.h" + +int cayman_run_test1(struct radeon *radeon) +{ + struct r600_accel_object test1 = {0}; + int size, i; + + test1.pitch = 1408; + test1.width = 1366; + test1.height = 768; + test1.bpp = 32; + test1.domain = RADEON_GEM_DOMAIN_VRAM; + test1.tiling_flags = 0; + + size = test1.pitch*test1.height*(test1.bpp / 8); + test1.bo = radeon_bo_open(radeon->bufmgr, 0, size, 4096, RADEON_GEM_DOMAIN_VRAM, 0); + if (!test1.bo) + return -1; + + radeon_bo_map(test1.bo, 1); + { + uint32_t *data = test1.bo->ptr; + data[0] = 0xdeadbeef; + } + radeon_bo_unmap(test1.bo); + + do_solid_fill_prepare(radeon, &test1, 0xffff0000); + evergreen_solid(radeon, 0, 0, test1.width, test1.height); + evergreen_finish_op(radeon, 8); + + radeon_cs_flush_indirect(radeon); + + radeon_bo_map(test1.bo, 0); + + { + uint32_t *data = test1.bo->ptr; + for (i = 0; i < 32; i++) { + fprintf(stderr,"%08x ", data[i]); + } + fprintf(stderr,"\n"); + +// fprintf(stderr,"bo1 %08x %08x\n", data[0], data[1]); + } + radeon_bo_unmap(test1.bo); +} + +int cayman_run_test2(struct radeon *radeon) +{ + struct r600_accel_object test1 = {0}; + int size, i; + + test1.pitch = 1408; + test1.width = 1366; + test1.height = 768; + test1.bpp = 32; + test1.domain = RADEON_GEM_DOMAIN_GTT; + test1.tiling_flags = 0; + + size = test1.pitch*test1.height*(test1.bpp / 8); + test1.bo = radeon_bo_open(radeon->bufmgr, 0, size, 4096, RADEON_GEM_DOMAIN_GTT, 0); + if (!test1.bo) + return -1; + + radeon_bo_map(test1.bo, 1); + { + uint32_t *data = test1.bo->ptr; + data[0] = 0xdeadbeef; + } + radeon_bo_unmap(test1.bo); + + do_solid_fill_prepare(radeon, &test1, 0xffff0000); + evergreen_solid(radeon, 0, 0, test1.width, test1.height); + evergreen_finish_op(radeon, 8); + + radeon_cs_flush_indirect(radeon); + + radeon_bo_map(test1.bo, 0); + + { + uint32_t *data = test1.bo->ptr; + for (i = 0; i < 32; i++) { + fprintf(stderr,"%08x ", data[i]); + } + fprintf(stderr,"\n"); + +// fprintf(stderr,"bo1 %08x %08x\n", data[0], data[1]); + } + radeon_bo_unmap(test1.bo); +} |