• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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_2_IDISPLAY_COMPOSER_INTERFACE_H
17 #define OHOS_HDI_DISPLAY_V1_2_IDISPLAY_COMPOSER_INTERFACE_H
18 
19 #include "v1_1/include/idisplay_composer_interface.h"
20 #include "v1_2/display_composer_type.h"
21 
22 namespace OHOS {
23 namespace HDI {
24 namespace Display {
25 namespace Composer {
26 namespace V1_2 {
27 
28 class IDisplayComposerInterface : public V1_1::IDisplayComposerInterface {
29 public:
30     /**
31      * @brief Obtains all interfaces of IDisplayComposerInterface.
32      *
33      * @return Returns <b>IDisplayComposerInterface*</b> if the operation is successful;
34      * returns an null point otherwise.
35      * @since 5.0
36      * @version 1.2
37      */
38     static IDisplayComposerInterface* Get(bool needSMQ = true);
39 
40     /**
41      * @brief Commits the request for composition and display.
42      *        Obtains the fences of the display layers after the commit operation.
43      * If there is a hardware composition layer, the composition is performed and the composition result is sent to
44      * the hardware for display.
45      *
46      * @param devId Indicates the ID of the display device.
47      * @param fence Indicates the pointer to the start address of the fence.
48      * @param skipState Indicates the state of the skip validate feature.
49      * @param needFlush Indicates the pointer that specifies whether the graphics service needs to reset the display
50      * framebuffer by using <b>SetDisplayClientBuffer</b> before the commit operation.
51      * The value <b>true</b> means that the framebuffer needs to be reset, and <b>false</b> means the opposite.
52      *
53      * @return Returns <b>0</b> if the operation is successful; returns an error code defined
54      * in {@link DispErrCode} otherwise.
55      * @since 5.0
56      * @version 1.2
57      */
58     virtual int32_t CommitAndGetReleaseFence(uint32_t devId, int32_t& fence, int32_t& skipState,
59         bool& needFlush, std::vector<uint32_t>& layers, std::vector<int32_t>& fences, bool isValidated) = 0;
60 
61     virtual int32_t RegDisplayVBlankIdleCallback(VBlankIdleCallback cb, void* data) = 0;
62 
63     virtual int32_t SetDisplayConstraint(uint32_t devId, uint64_t frameID, uint64_t ns, uint32_t type) = 0;
64 
65     virtual int32_t ClearClientBuffer(uint32_t devId) = 0;
66 
67     virtual int32_t ClearLayerBuffer(uint32_t devId, uint32_t layerId) = 0;
68 
69     virtual int32_t UpdateHardwareCursor(uint32_t devId, int32_t x, int32_t y, BufferHandle* buffer) = 0;
70 
71     virtual int32_t EnableHardwareCursorStats(uint32_t devId, bool enable) = 0;
72 
73     virtual int32_t GetHardwareCursorStats(uint32_t devId, uint32_t& frameCount, uint32_t& vsyncCount) = 0;
74 
75     virtual int32_t SetDisplayActiveRegion(uint32_t devId, const IRect& rect) = 0;
76 
77     virtual int32_t FastPresent(uint32_t devId, const PresentParam& param,
78         const std::vector<BufferHandle*> inHandles) = 0;
79 
80     virtual int32_t GetDisplayIdentificationData(uint32_t devId, uint8_t& portId, std::vector<uint8_t>& edidData) = 0;
81 
82     virtual int32_t SetLayerPerFrameParameterSmq(uint32_t devId, uint32_t layerId, const std::string& key,
83         const std::vector<int8_t>& value) = 0;
84 
85     virtual int32_t SetDisplayPerFrameParameterSmq(uint32_t devId, const std::string& key,
86         const std::vector<int8_t>& value) = 0;
87 };
88 } // V1_2
89 } // Composer
90 } // Display
91 } // HDI
92 } // OHOS
93 #endif // OHOS_HDI_DISPLAY_V1_2_IDISPLAY_COMPOSER_INTERFACE_H
94