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.
10 #include <aidl/android/hardware/graphics/common/PlaneLayout.h>
11 #include <android/hardware/graphics/common/1.2/types.h>
12 #include <android/hardware/graphics/mapper/4.0/IMapper.h>
14 #include "cros_gralloc/cros_gralloc_types.h"
16 std::string getDrmFormatString(uint32_t drmFormat);
18 std::string getPixelFormatString(android::hardware::graphics::common::V1_2::PixelFormat format);
20 std::string getUsageString(
21 android::hardware::hidl_bitfield<android::hardware::graphics::common::V1_2::BufferUsage>
24 int convertToDrmFormat(android::hardware::graphics::common::V1_2::PixelFormat format,
25 uint32_t* outDrmFormat);
27 int convertToBufferUsage(uint64_t grallocUsage, uint64_t* outBufferUsage);
29 int convertToCrosDescriptor(
30 const android::hardware::graphics::mapper::V4_0::IMapper::BufferDescriptorInfo& descriptor,
31 struct cros_gralloc_buffer_descriptor* outCrosDescriptor);
33 int convertToMapUsage(uint64_t grallocUsage, uint32_t* outMapUsage);
35 int convertToFenceFd(const android::hardware::hidl_handle& fence_handle, int* out_fence_fd);
37 int convertToFenceHandle(int fence_fd, android::hardware::hidl_handle* out_fence_handle);
41 std::vector<aidl::android::hardware::graphics::common::PlaneLayout>* out_layouts);