summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-08-09 23:24:56 +0100
committerThomas White <taw@bitwiz.org.uk>2009-08-09 23:24:56 +0100
commit9082bd4627b5031ae09ea88c6610c39d6b893b26 (patch)
treec9cefa0689e9e0d0519b004ec07a0bdd37d0ed41
parent2ed4dac1383a681f7b8748ac42f052f257b84a3a (diff)
Use libDRM functions instead of bom->funcs etc
-rw-r--r--gdri-buf-cmdq.c9
-rw-r--r--gdri-mem-manager.c25
2 files changed, 7 insertions, 27 deletions
diff --git a/gdri-buf-cmdq.c b/gdri-buf-cmdq.c
index 614c473..f9fe278 100644
--- a/gdri-buf-cmdq.c
+++ b/gdri-buf-cmdq.c
@@ -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");
diff --git a/gdri-mem-manager.c b/gdri-mem-manager.c
index 6224a42..5d8c1cc 100644
--- a/gdri-mem-manager.c
+++ b/gdri-mem-manager.c
@@ -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);