Skip to content

Commit d9d9681

Browse files
committed
update USAGE.md with central bo_create call
This is how I would envision the bo alloc call to work. Having the liballoc core do the work to ask around which device is able to allocate with a given set of caps/constraints makes the application API easier and would allow to plug in things like ION by just providing a liballoc driver backend on top of them.
1 parent cc3323d commit d9d9681

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

USAGE.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,16 @@ combine_capabilities(&result_capabilities, camera_capabilities);
101101
Allocate Buffer
102102
---------------
103103

104-
Just try allocating from each device until one succeeds.
104+
Ask the allocator to create the buffer, it will go around and ask each
105+
of the devices it knows about to do the allocation until one succeeds.
106+
107+
This means the allocation may be done on a device not involved in the
108+
buffer sharing itself, like ION.
105109

106110
```
107111
alloc_bo_t *buf;
108112
109-
buf = alloc_bo_create(display, &assertion, &result_capabilities);
110-
if (!buf)
111-
buf = alloc_bo_create(camera, &assertion, &result_capabilities);
112-
#ifdef HAVE_ION
113-
if (!buf)
114-
buf = alloc_bo_create(ion, &assertion, &result_capabilities);
115-
#endif
113+
buf = alloc_bo_create(&assertion, &result_capabilities);
116114
117115
assert(buf);
118116
```

0 commit comments

Comments
 (0)