2 * Copyright 2016 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
10 #include "cros_gralloc_helpers.h"
13 #include <unordered_map>
14 #include <unordered_set>
16 struct cros_gralloc_bo {
19 struct cros_gralloc_handle *hnd;
20 struct map_info *map_data;
26 int32_t registrations;
29 struct cros_gralloc_module {
30 gralloc_module_t base;
33 std::unordered_map<cros_gralloc_handle *, handle_info> handles;
34 std::unordered_map<uint32_t, cros_gralloc_bo *> buffers;
37 int cros_gralloc_open(const struct hw_module_t *mod, const char *name, struct hw_device_t **dev);
39 int cros_gralloc_validate_reference(struct cros_gralloc_module *mod,
40 struct cros_gralloc_handle *hnd, struct cros_gralloc_bo **obj);
42 int cros_gralloc_decrement_reference_count(struct cros_gralloc_module *mod,
43 struct cros_gralloc_bo *obj);