On 12/11/2012 10:55 AM, Nishanth Peethambaran wrote:
Johan,
It should be heap->id only. You can always have two heaps with different ids, but of the same type. For eg: two CMA heaps or two carveout heaps. User may control which heap should be used for buffer allocation by setting appropriate bits in the heap_mask.
I don't understand, please elaborate. Using the heap id here makes no sense to me. We are trying to check if the heap matches the supplied heap type mask, just like we checked if the heap matched the client's heap type mask in the line before.
- Nishanth Peethambaran +91-9448074166
On Tue, Dec 11, 2012 at 2:21 PM, Johan Mossberg johan.mossberg@stericsson.com wrote:
The heap id is compared against the heap mask in ion_alloc which is incorrect, the heap type should be used.
Signed-off-by: Johan Mossberg johan.mossberg@stericsson.com
drivers/gpu/ion/ion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index fc152b9..c811380f 100644 --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@ -414,7 +414,7 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len, if (!((1 << heap->type) & client->heap_mask)) continue; /* if the caller didn't specify this heap type */
if (!((1 << heap->id) & heap_mask))
if (!((1 << heap->type) & heap_mask)) continue; buffer = ion_buffer_create(heap, dev, len, align, flags); if (!IS_ERR_OR_NULL(buffer))
-- 1.8.0
Linaro-mm-sig mailing list Linaro-mm-sig@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-mm-sig