1 /*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include "ExynosDeviceModule.h"
18
19 #include <aidl/android/hardware/graphics/common/Dataspace.h>
20 #include <aidl/android/hardware/graphics/common/PixelFormat.h>
21
22 using DisplayPixelFormat = aidl::android::hardware::graphics::common::PixelFormat;
23 using Dataspace = aidl::android::hardware::graphics::common::Dataspace;
24
25 namespace zuma {
26
ExynosDeviceModule(bool isVrrApiSupported)27 ExynosDeviceModule::ExynosDeviceModule(bool isVrrApiSupported)
28 : gs201::ExynosDeviceModule(isVrrApiSupported) {}
29
~ExynosDeviceModule()30 ExynosDeviceModule::~ExynosDeviceModule() {}
31
32 const ExynosDeviceModule::SupportedBufferCombinations overlay_caps_rgb =
33 {{
34
35 DisplayPixelFormat::RGBA_8888, DisplayPixelFormat::RGBX_8888,
36 DisplayPixelFormat::RGB_888, DisplayPixelFormat::RGB_565,
37 DisplayPixelFormat::BGRA_8888, DisplayPixelFormat::RGBA_FP16,
38 DisplayPixelFormat::RGBA_1010102, DisplayPixelFormat::R_8},
39 {Dataspace::STANDARD_BT2020, Dataspace::STANDARD_BT709, Dataspace::STANDARD_DCI_P3},
40 {Dataspace::TRANSFER_UNSPECIFIED, Dataspace::TRANSFER_LINEAR, Dataspace::TRANSFER_SRGB,
41 Dataspace::TRANSFER_SMPTE_170M, Dataspace::TRANSFER_GAMMA2_2,
42 Dataspace::TRANSFER_GAMMA2_6, Dataspace::TRANSFER_GAMMA2_8, Dataspace::TRANSFER_ST2084,
43 Dataspace::TRANSFER_HLG},
44 {Dataspace::RANGE_FULL}};
45
46 const ExynosDeviceModule::SupportedBufferCombinations overlay_caps_yuv =
47 {{DisplayPixelFormat::YCRCB_420_SP, DisplayPixelFormat::YV12,
48 DisplayPixelFormat::YCBCR_P010},
49 {Dataspace::STANDARD_BT2020, Dataspace::STANDARD_BT709, Dataspace::STANDARD_DCI_P3},
50 {Dataspace::TRANSFER_UNSPECIFIED, Dataspace::TRANSFER_LINEAR, Dataspace::TRANSFER_SRGB,
51 Dataspace::TRANSFER_SMPTE_170M, Dataspace::TRANSFER_GAMMA2_2,
52 Dataspace::TRANSFER_GAMMA2_6, Dataspace::TRANSFER_GAMMA2_8, Dataspace::TRANSFER_ST2084,
53 Dataspace::TRANSFER_HLG},
54 {Dataspace::RANGE_FULL, Dataspace::RANGE_LIMITED}};
55
getOverlaySupport(OverlayProperties * caps)56 int32_t ExynosDeviceModule::getOverlaySupport(OverlayProperties* caps) {
57 if (caps == nullptr) {
58 ALOGE("%s:: no caps pointer", __func__);
59 return NO_ERROR;
60 }
61 caps->combinations.push_back(overlay_caps_rgb);
62 caps->combinations.push_back(overlay_caps_yuv);
63
64 caps->supportMixedColorSpaces = supportMixedColorSpaces;
65 return NO_ERROR;
66 }
67 } // namespace zuma
68