android_external_minigbm/drv_array_helpers.h
Yiwei Zhang b7a64441ef minigbm: refactor driver helpers
1. frontends access the driver via drv.h only
2. the renamed drv_helpers and drv_array_helpers are for driver only
3. remove extern "C" from drv_helpers.h given not exposed to gralloc
4. remove all redundant includes for those helpers

BUG=b:199524294
TEST=CQ and gralloc builds on aosp

Change-Id: I3f4d33076a6a8161804f1b7c26950ff5496507e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3195651
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
2021-10-01 18:35:11 +00:00

29 lines
815 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.
*/
#ifndef DRV_ARRAY_HELPERS_H
#define DRV_ARRAY_HELPERS_H
#include <stdint.h>
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);
#endif