We want to allow multiple mappings of a single buffer with different
map flags. To do this, we'll need some sort of linked list or dynamic
array of mappings. We already use dynamic arrays in minigbm, so let's
centralize that functionality and use it.
BUG=chromium:764871
TEST=emerge-kevin {minigbm, arc-cros-gralloc}
Change-Id: I2b391d6e8e690eac6368b1404a806b2bfbbcdf44
Reviewed-on: https://chromium-review.googlesource.com/758145
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
22 lines
729 B
C
22 lines
729 B
C
/*
|
|
* Copyright 2017 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
struct drv_array;
|
|
|
|
struct drv_array *drv_array_init(uint32_t item_size);
|
|
|
|
/* The data will be copied and appended to the array. */
|
|
void *drv_array_append(struct drv_array *array, void *data);
|
|
|
|
/* The data at the specified index will be freed -- the array will shrink. */
|
|
void drv_array_remove(struct drv_array *array, uint32_t idx);
|
|
|
|
void *drv_array_at_idx(struct drv_array *array, uint32_t idx);
|
|
|
|
uint32_t drv_array_size(struct drv_array *array);
|
|
|
|
/* The array and all associated data will be freed. */
|
|
void drv_array_destroy(struct drv_array *array);
|