blob: 655143c35e5858ee42e5c6f3f51b3255e2a3ed7b [file] [log] [blame]
Jason Macnak1de7f662020-01-24 15:05:57 -08001/*
2 * Copyright 2020 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.
5 */
6
7#include <android/hardware/graphics/allocator/3.0/IAllocator.h>
8#include <android/hardware/graphics/mapper/3.0/IMapper.h>
9
10#include "cros_gralloc/cros_gralloc_driver.h"
11
12class CrosGralloc3Allocator : public android::hardware::graphics::allocator::V3_0::IAllocator {
13 public:
14 CrosGralloc3Allocator();
15
16 android::hardware::Return<void> allocate(
17 const android::hardware::hidl_vec<uint32_t>& descriptor, uint32_t count,
18 allocate_cb hidl_cb) override;
19
20 android::hardware::Return<void> dumpDebugInfo(dumpDebugInfo_cb hidl_cb) override;
21
22 private:
23 android::hardware::graphics::mapper::V3_0::Error allocate(
24 const android::hardware::graphics::mapper::V3_0::IMapper::BufferDescriptorInfo&
25 description,
26 uint32_t* outStride, android::hardware::hidl_handle* outHandle);
27
28 std::unique_ptr<cros_gralloc_driver> mDriver;
29};