From d9d96819c102d7302bf3c5e2d4a255e7c2e12fed Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Wed, 12 Oct 2016 14:03:12 +0200 Subject: [PATCH] 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. --- USAGE.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/USAGE.md b/USAGE.md index 038e787..eb52d3e 100644 --- a/USAGE.md +++ b/USAGE.md @@ -101,18 +101,16 @@ combine_capabilities(&result_capabilities, camera_capabilities); Allocate Buffer --------------- -Just try allocating from each device until one succeeds. +Ask the allocator to create the buffer, it will go around and ask each +of the devices it knows about to do the allocation until one succeeds. + +This means the allocation may be done on a device not involved in the +buffer sharing itself, like ION. ``` alloc_bo_t *buf; -buf = alloc_bo_create(display, &assertion, &result_capabilities); -if (!buf) - buf = alloc_bo_create(camera, &assertion, &result_capabilities); -#ifdef HAVE_ION -if (!buf) - buf = alloc_bo_create(ion, &assertion, &result_capabilities); -#endif +buf = alloc_bo_create(&assertion, &result_capabilities); assert(buf); ```