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_set>
14 #include <unordered_map>
16 struct cros_gralloc_bo {
19 struct cros_gralloc_handle *hnd;
25 int32_t registrations;
28 struct cros_gralloc_module {
29 gralloc_module_t base;
32 std::unordered_map<cros_gralloc_handle*, handle_info> handles;
33 std::unordered_map<uint32_t, cros_gralloc_bo*> buffers;
36 int cros_gralloc_open(const struct hw_module_t *mod, const char *name,
37 struct hw_device_t **dev);
39 int cros_gralloc_validate_reference(struct cros_gralloc_module *mod,
40 struct cros_gralloc_handle *hnd,
41 struct cros_gralloc_bo **obj);
43 int cros_gralloc_decrement_reference_count(struct cros_gralloc_module *mod,
44 struct cros_gralloc_bo *obj);