Use libDRM functions instead of bom->funcs etc
authorThomas White <taw@bitwiz.org.uk>
Sun, 9 Aug 2009 22:24:56 +0000 (23:24 +0100)
committerThomas White <taw@bitwiz.org.uk>
Sun, 9 Aug 2009 22:24:56 +0000 (23:24 +0100)
gdri-buf-cmdq.c
gdri-mem-manager.c

index 614c473..f9fe278 100644 (file)
@@ -68,12 +68,7 @@ int main()
        bufmgr = glamo_bo_manager_gem_ctor(fd);
        printf("Allocated a new glamo_bo_manager: 0x%p\n", bufmgr);
 
-       bo = bufmgr->funcs->bo_open(bufmgr,
-                                   0, /* handle */
-                                   480*480*2,
-                                   2,
-                                   GLAMO_GEM_DOMAIN_VRAM,
-                                   0); /* flags */
+       bo = glamo_bo_open(bufmgr, 0, 480*480*2, 2, GLAMO_GEM_DOMAIN_VRAM, 0);
 
        printf("Allocated a 480x480x2 byte buffer object: 0x%p\n", bo);
        printf(" handle = %i\n", bo->handle);
@@ -143,7 +138,7 @@ int main()
         }
        printf("Copied the buffer to the screen\n");
 
-       bufmgr->funcs->bo_unref(bo);
+       glamo_bo_unref(bo);
 
        glamo_bo_manager_gem_dtor(bufmgr);
        printf("Destroyed the glamo_bo_manager.\n");
index 6224a42..5d8c1cc 100644 (file)
@@ -69,32 +69,17 @@ int main()
        bufmgr = glamo_bo_manager_gem_ctor(fd);
        printf("Allocated a new glamo_bo_manager: 0x%p\n", bufmgr);
 
-       bo = bufmgr->funcs->bo_open(bufmgr,
-                                   0, /* handle */
-                                   1024,
-                                   2,
-                                   GLAMO_GEM_DOMAIN_VRAM,
-                                   0); /* flags */
+       bo = glamo_bo_open(bufmgr, 0, 1024, 2, GLAMO_GEM_DOMAIN_VRAM, 0);
 
        printf("Allocated a 1024 byte buffer object: 0x%p\n", bo);
        printf(" handle = %i\n", bo->handle);
 
-       bo2 = bufmgr->funcs->bo_open(bufmgr,
-                                   0, /* handle */
-                                   16384,
-                                   2,
-                                   GLAMO_GEM_DOMAIN_VRAM,
-                                   0); /* flags */
+       bo2 = glamo_bo_open(bufmgr, 0, 16384, 2, GLAMO_GEM_DOMAIN_VRAM, 0);
 
        printf("Allocated a 16384 byte buffer object: 0x%p\n", bo2);
        printf(" handle = %i\n", bo2->handle);
 
-       bo3 = bufmgr->funcs->bo_open(bufmgr,
-                                   0, /* handle */
-                                   1024*1024,
-                                   2,
-                                   GLAMO_GEM_DOMAIN_VRAM,
-                                   0); /* flags */
+       bo3 = glamo_bo_open(bufmgr, 0, 1024*1024, 2, GLAMO_GEM_DOMAIN_VRAM, 0);
 
        printf("Allocated a 1024 kilobyte buffer object: 0x%p\n", bo3);
        printf(" handle = %i\n", bo3->handle);
@@ -102,12 +87,12 @@ int main()
        printf("Press enter to continue...\n");
        fgets(tmp, 3, stdin);
 
-       bufmgr->funcs->bo_unref(bo);
+       glamo_bo_unref(bo);
        printf("Unreferenced the first buffer object.\n");
 
        printf("I *didn't* unreference the second buffer object.\n");
 
-       bufmgr->funcs->bo_unref(bo3);
+       glamo_bo_unref(bo3);
        printf("Unreferenced the third buffer object.\n");
 
        glamo_bo_manager_gem_dtor(bufmgr);