int main(int argc, char **argv) { bool v3dsupported = AllocatorBase::v3d2Supported(); AllocatorBase *allocator; //dispmanxtest(); //return 0; if (v3dsupported) { v3d2_init(); puts("using new v3d2 driver"); allocator = new V3D2Allocator(); } else { puts("using mailbox fallback"); allocator = new MailboxAllocator(); } // map v3d's registers into our address space. v3d = (unsigned *) mapmem(0x20c00000, 0x1000); if(v3d[V3D_IDENT0] != 0x02443356) { // Magic number. printf("Error: V3D pipeline isn't powered up and accessable.\n"); exit(-1); } int mbox = mbox_open(); testTriangle(mbox,allocator); //testBinner(allocator,v3d); return 0; // We now have access to the v3d registers, we should do something. for (int i=12; i<26; i+=1) { NopSled sled(allocator,(1<<i)+0xa); sled.benchmark(v3d); } return 0; }
void startTest() { TCHAR logFileName[1024]; getLogFilename(logFileName); testLogFile = _tfopen(logFileName, _T("w")); if (!testLogFile) return; int pointTestErr = testPoint(); logHLine(); int vectorTestErr = testVector(); logHLine(); int lineTestErr = testLine(); logHLine(); int planeTestErr = testPlane(); logHLine(); int triangleTestErr = testTriangle(); logHLine(); int basisTestErr = testBasis(); logHLine(); int matrixTestErr = testMatrix(); fclose(testLogFile); testLogFile = NULL; }
int main() { uart_init(); uart_puts("-------------------------------------------------\n"); uart_puts("CORE0 READY\n"); uart_puts("-------------------------------------------------\n"); uart_puts(" V3D TEST\n"); uart_puts("-------------------------------------------------\n"); mailbox_qpu_enable(); if( IO_READ(V3D_IDENT0) == 0x02443356) { uart_puts(" OK! BLINK STATUS LED\n"); } else { uart_puts(" NG\n"); } uart_puts("-------------------------------------------------\n"); uint32_t size = mailbox_fb_init(SCREEN_WIDTH, SCREEN_HEIGHT); mailbox_fb *fb = mailbox_fb_getaddr(); if(fb->pointer == 0) { uart_puts(" NG fb->pointer == 0\n"); } uart_puts("GET FRAMEBUFFER\n"); uart_debug_puts("fb->width =\n", fb->width); uart_debug_puts("fb->height =\n", fb->height); uart_debug_puts("fb->size =\n", size); uart_debug_puts("fb->pointer=\n", fb->pointer); IO_WRITE(V3D_L2CACTL, 0x1); uart_debug_puts("V3D_L2CACTL=\n", IO_READ(V3D_L2CACTL)); int count = 0; int x, y; uint32_t *ptr = (uint32_t *)VcToArm(fb->pointer); for(y = 1 ; y < fb->height; y++) { for(x = 1 ; x < fb->width; x++) { if(!(x % 16) || !(y % 16)) ptr[x + y * fb->width] = 0xFF00FFFF; } } count++; testTriangle(fb); return 0; }
int main(int argc, char **argv) { mbox = mbox_open(); // The blob now has this nice handy call which powers up the v3d pipeline. qpu_enable(mbox, 1); // map v3d's registers into our address space. v3d = (unsigned *) mapmem(0x20c00000, 0x1000); if(v3d[V3D_IDENT0] != 0x02443356) { // Magic number. printf("Error: V3D pipeline isn't powered up and accessable.\n"); exit(-1); } // We now have access to the v3d registers, we should do something. testTriangle(); return 0; }
SpatialMarkup RangeConvex::testNode(const SpatialVector & v0, const SpatialVector & v1, const SpatialVector & v2) { // Start with testing the vertices for the QuadNode with this convex. int vsum = testVertex(v0) + testVertex(v1) + testVertex(v2); #ifdef DIAGNOSE char name[10]; SpatialVector v = v0 + v1 + v2; cout << index_->nameById(index_->idByPoint(v),name) << " " << vsum << " " << endl; #endif SpatialMarkup mark = testTriangle( v0, v1, v2, vsum); #ifdef DIAGNOSE cout << ( mark == pARTIAL ? " partial " : ( mark == fULL ? " full " : ( mark == rEJECT ? " reject " : " dontknow " ) ) ) << name << endl; /* << v0 << "," << v1 << "," << v2 << " " << endl; << V(NV(0)) << " , " << V(NV(1)) << " , " << V(NV(2)) << endl << " (" << V(NV(0)).ra() << "," << V(NV(0)).dec() << ")" << " (" << V(NV(1)).ra() << "," << V(NV(1)).dec() << ")" << " (" << V(NV(2)).ra() << "," << V(NV(2)).dec() << ")" << endl; */ #endif // since we cannot play games using the on-the-fly triangles, // substitute dontknow with partial. if (mark == dONTKNOW) mark = pARTIAL; return mark; }
/////////////TESTNODE///////////////////////////////////// // testNode: tests the QuadNodes for intersections. // SpatialMarkup RangeConvex::testNode(uint64 id) //uint64 id) // const struct SpatialIndex::QuadNode *indexNode) { const SpatialVector *v0, *v1, *v2; // const struct SpatialIndex::QuadNode &indexNode = index_->nodes_[id]; const struct SpatialIndex::QuadNode *indexNode = &index_->nodes_[id]; int m; m = indexNode->v_[0]; v0 = &index_->vertices_[m]; // the vertex vector m m = indexNode->v_[1]; v1 = &index_->vertices_[m]; m = indexNode->v_[2]; v2 = &index_->vertices_[m]; // testNode(V(NV(0)),V(NV(1)),V(NV(2))); // #define NV(m) indexNode.v_[(m)] // the vertices of n // #define NV(m) index_->nodes_[id].v_[(m)] // the vertices of n // #define V(m) index_->vertices_[(m)] // the vertex vector m // Start with testing the vertices for the QuadNode with this convex. int vsum = testVertex(v0) + testVertex(v1) + testVertex(v2); #ifdef DIAGNOSE char name[10]; SpatialVector v = v0 + v1 + v2; cout << index_->nameById(index_->idByPoint(v),name) << " " << vsum << " " << endl; #endif SpatialMarkup mark = testTriangle( *v0, *v1, *v2, vsum); #ifdef DIAGNOSE cout << ( mark == pARTIAL ? " partial " : ( mark == fULL ? " full " : ( mark == rEJECT ? " reject " : " dontknow " ) ) ) << name << endl; /* << v0 << "," << v1 << "," << v2 << " " << endl; << V(NV(0)) << " , " << V(NV(1)) << " , " << V(NV(2)) << endl << " (" << V(NV(0)).ra() << "," << V(NV(0)).dec() << ")" << " (" << V(NV(1)).ra() << "," << V(NV(1)).dec() << ")" << " (" << V(NV(2)).ra() << "," << V(NV(2)).dec() << ")" << endl; */ #endif // since we cannot play games using the on-the-fly triangles, // substitute dontknow with partial. if (mark == dONTKNOW) mark = pARTIAL; return mark; }