1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_HDI_DISPLAY_V1_1_IDISPLAY_COMPOSER_VDI_H 17 #define OHOS_HDI_DISPLAY_V1_1_IDISPLAY_COMPOSER_VDI_H 18 19 #include <vector> 20 #include <string> 21 #include "idisplay_composer_vdi.h" 22 #include "v1_2/display_composer_type.h" 23 #include "v1_1/imode_callback.h" 24 #include "v1_1/iseamless_change_callback.h" 25 26 namespace OHOS { 27 namespace HDI { 28 namespace Display { 29 namespace Composer { 30 using namespace OHOS::HDI::Display::Composer::V1_2; 31 32 class IDisplayComposerVdiV1_1 : public IDisplayComposerVdi { 33 public: 34 virtual int32_t RegSeamlessChangeCallback(SeamlessChangeCallback cb, void* data) = 0; 35 virtual int32_t GetDisplaySupportedModesExt(uint32_t devId, std::vector<DisplayModeInfoExt>& modes) = 0; 36 virtual int32_t SetDisplayModeAsync(uint32_t devId, uint32_t modeId, ModeCallback cb, void *data) = 0; 37 virtual int32_t GetDisplayVBlankPeriod(uint32_t devId, uint64_t& period) = 0; 38 virtual int32_t SetLayerPerFrameParameter(uint32_t devId, uint32_t layerId, const std::string& key, 39 const std::vector<int8_t>& value) = 0; 40 virtual int32_t GetSupportedLayerPerFrameParameterKey(std::vector<std::string>& keys) = 0; 41 virtual int32_t SetDisplayOverlayResolution(uint32_t devId, uint32_t width, uint32_t height) = 0; 42 virtual int32_t RegRefreshCallback(RefreshCallback cb, void* data) = 0; 43 virtual int32_t GetDisplaySupportedColorGamuts(uint32_t devId, std::vector<ColorGamut>& gamuts) = 0; 44 virtual int32_t GetHDRCapabilityInfos(uint32_t devId, HDRCapability& info) = 0; 45 virtual int32_t RegDisplayVBlankIdleCallback(VBlankIdleCallback cb, void* data) = 0; 46 virtual int32_t SetDisplayConstraint(uint32_t devId, uint64_t frameID, uint64_t ns, uint32_t type) = 0; 47 virtual int32_t SetHardwareCursorPosition(uint32_t devId, int32_t x, int32_t y) = 0; 48 virtual int32_t EnableHardwareCursorStats(uint32_t devId, bool enable) = 0; 49 virtual int32_t GetHardwareCursorStats(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount) = 0; 50 }; 51 52 using CreateComposerVdiFuncV1_1 = IDisplayComposerVdiV1_1* (*)(); 53 using DestroyComposerVdiFuncV1_1 = void (*)(IDisplayComposerVdiV1_1* vdi); 54 extern "C" IDisplayComposerVdiV1_1* CreateComposerVdiV1_1(); 55 extern "C" void DestroyComposerVdiV1_1(IDisplayComposerVdiV1_1* vdi); 56 } // namespace Composer 57 } // namespace Display 58 } // namespace HDI 59 } // namespace OHOS 60 #endif // OHOS_HDI_DISPLAY_V1_1_IDISPLAY_COMPOSER_VDI_H 61