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 #include "display_composer_vdi_impl.h"
17 #include <hdf_base.h>
18 #include "display_log.h"
19 #include "hdf_log.h"
20
21 namespace OHOS {
22 namespace HDI {
23 namespace DISPLAY {
DisplayComposerVdiImpl()24 DisplayComposerVdiImpl::DisplayComposerVdiImpl()
25 {
26 composerModel_.reset(&HdiSession::GetInstance());
27 }
28
~DisplayComposerVdiImpl()29 DisplayComposerVdiImpl::~DisplayComposerVdiImpl()
30 {
31 }
32
RegHotPlugCallback(HotPlugCallback cb,void * data)33 int32_t DisplayComposerVdiImpl::RegHotPlugCallback(HotPlugCallback cb, void* data)
34 {
35 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
36 composerModel_->RegHotPlugCallback(cb, data);
37 return HDF_SUCCESS;
38 }
39
GetDisplayCapability(uint32_t devId,DisplayCapability & info)40 int32_t DisplayComposerVdiImpl::GetDisplayCapability(uint32_t devId, DisplayCapability& info)
41 {
42 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
43 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::GetDisplayCapability, &info);
44 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
45 return HDF_SUCCESS;
46 }
47
GetDisplaySupportedModes(uint32_t devId,std::vector<DisplayModeInfo> & modes)48 int32_t DisplayComposerVdiImpl::GetDisplaySupportedModes(uint32_t devId, std::vector<DisplayModeInfo>& modes)
49 {
50 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
51 DisplayModeInfo* placeHoler = nullptr;
52 uint32_t num = 0;
53 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::GetDisplaySupportedModes,
54 &num, placeHoler);
55 if (ec != DISPLAY_SUCCESS) {
56 DISPLAY_LOGE("failed, ec=%{public}d", ec);
57 return HDF_FAILURE;
58 }
59 if (num != 0) {
60 modes.resize(num);
61 ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::GetDisplaySupportedModes, &num, modes.data());
62 }
63 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
64 return HDF_SUCCESS;
65 }
66
GetDisplayMode(uint32_t devId,uint32_t & modeId)67 int32_t DisplayComposerVdiImpl::GetDisplayMode(uint32_t devId, uint32_t& modeId)
68 {
69 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
70 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::GetDisplayMode, &modeId);
71 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
72 return HDF_SUCCESS;
73 }
74
SetDisplayMode(uint32_t devId,uint32_t modeId)75 int32_t DisplayComposerVdiImpl::SetDisplayMode(uint32_t devId, uint32_t modeId)
76 {
77 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
78 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::SetDisplayMode, modeId);
79 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
80 return HDF_SUCCESS;
81 }
82
GetDisplayPowerStatus(uint32_t devId,DispPowerStatus & status)83 int32_t DisplayComposerVdiImpl::GetDisplayPowerStatus(uint32_t devId, DispPowerStatus& status)
84 {
85 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
86 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::GetDisplayPowerStatus, &status);
87 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
88 return HDF_SUCCESS;
89 }
90
SetDisplayPowerStatus(uint32_t devId,DispPowerStatus status)91 int32_t DisplayComposerVdiImpl::SetDisplayPowerStatus(uint32_t devId, DispPowerStatus status)
92 {
93 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
94 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::SetDisplayPowerStatus, status);
95 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
96 return HDF_SUCCESS;
97 }
98
GetDisplayBacklight(uint32_t devId,uint32_t & level)99 int32_t DisplayComposerVdiImpl::GetDisplayBacklight(uint32_t devId, uint32_t& level)
100 {
101 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
102 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::GetDisplayBacklight, &level);
103 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
104 return HDF_SUCCESS;
105 }
106
SetDisplayBacklight(uint32_t devId,uint32_t level)107 int32_t DisplayComposerVdiImpl::SetDisplayBacklight(uint32_t devId, uint32_t level)
108 {
109 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
110 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::SetDisplayBacklight, level);
111 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
112 return HDF_SUCCESS;
113 }
114
GetDisplayProperty(uint32_t devId,uint32_t id,uint64_t & value)115 int32_t DisplayComposerVdiImpl::GetDisplayProperty(uint32_t devId, uint32_t id, uint64_t& value)
116 {
117 DISPLAY_LOGE("%s is not supported", __func__);
118 return HDF_ERR_NOT_SUPPORT;
119 }
120
GetDisplayCompChange(uint32_t devId,std::vector<uint32_t> & layers,std::vector<int32_t> & types)121 int32_t DisplayComposerVdiImpl::GetDisplayCompChange(uint32_t devId, std::vector<uint32_t>& layers,
122 std::vector<int32_t>& types)
123 {
124 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
125 uint32_t* layersHoler = nullptr;
126 int32_t* typesHoler = nullptr;
127 uint32_t num = 0;
128 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::GetDisplayCompChange, &num, layersHoler,
129 typesHoler);
130 if (ec == HDF_SUCCESS && num != 0) {
131 layers.resize(num);
132 types.resize(num);
133 ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::GetDisplayCompChange, &num, layers.data(),
134 types.data());
135 }
136 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
137 return HDF_SUCCESS;
138 }
139
SetDisplayClientCrop(uint32_t devId,const IRect & rect)140 int32_t DisplayComposerVdiImpl::SetDisplayClientCrop(uint32_t devId, const IRect& rect)
141 {
142 DISPLAY_LOGE("%s is not supported", __func__);
143 return HDF_ERR_NOT_SUPPORT;
144 }
145
SetDisplayClientBuffer(uint32_t devId,const BufferHandle & buffer,int32_t fence)146 int32_t DisplayComposerVdiImpl::SetDisplayClientBuffer(uint32_t devId, const BufferHandle& buffer, int32_t fence)
147 {
148 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
149 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::SetDisplayClientBuffer, &buffer, fence);
150 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
151 return HDF_SUCCESS;
152 }
153
SetDisplayClientDamage(uint32_t devId,std::vector<IRect> & rects)154 int32_t DisplayComposerVdiImpl::SetDisplayClientDamage(uint32_t devId, std::vector<IRect>& rects)
155 {
156 DISPLAY_LOGE("%s is not supported", __func__);
157 return HDF_ERR_NOT_SUPPORT;
158 }
159
SetDisplayVsyncEnabled(uint32_t devId,bool enabled)160 int32_t DisplayComposerVdiImpl::SetDisplayVsyncEnabled(uint32_t devId, bool enabled)
161 {
162 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
163 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::SetDisplayVsyncEnabled, enabled);
164 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
165 return HDF_SUCCESS;
166 }
167
RegDisplayVBlankCallback(uint32_t devId,VBlankCallback cb,void * data)168 int32_t DisplayComposerVdiImpl::RegDisplayVBlankCallback(uint32_t devId, VBlankCallback cb, void* data)
169 {
170 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
171 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::RegDisplayVBlankCallback, cb, data);
172 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
173 return HDF_SUCCESS;
174 }
175
GetDisplayReleaseFence(uint32_t devId,std::vector<uint32_t> & layers,std::vector<int32_t> & fences)176 int32_t DisplayComposerVdiImpl::GetDisplayReleaseFence(uint32_t devId, std::vector<uint32_t>& layers,
177 std::vector<int32_t>& fences)
178 {
179 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
180 uint32_t* layersHoler = nullptr;
181 int32_t* typesHoler = nullptr;
182 uint32_t num = 0;
183 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::GetDisplayReleaseFence, &num, layersHoler,
184 typesHoler);
185 if (ec == HDF_SUCCESS && num != 0) {
186 layers.resize(num);
187 fences.resize(num);
188 ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::GetDisplayReleaseFence, &num, layers.data(),
189 fences.data());
190 }
191 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
192 return HDF_SUCCESS;
193 }
194
CreateVirtualDisplay(uint32_t width,uint32_t height,int32_t & format,uint32_t & devId)195 int32_t DisplayComposerVdiImpl::CreateVirtualDisplay(uint32_t width, uint32_t height, int32_t& format, uint32_t& devId)
196 {
197 DISPLAY_LOGE("%s is not supported", __func__);
198 return HDF_ERR_NOT_SUPPORT;
199 }
200
DestroyVirtualDisplay(uint32_t devId)201 int32_t DisplayComposerVdiImpl::DestroyVirtualDisplay(uint32_t devId)
202 {
203 DISPLAY_LOGE("%s is not supported", __func__);
204 return HDF_ERR_NOT_SUPPORT;
205 }
206
SetVirtualDisplayBuffer(uint32_t devId,const BufferHandle & buffer,const int32_t fence)207 int32_t DisplayComposerVdiImpl::SetVirtualDisplayBuffer(uint32_t devId, const BufferHandle& buffer, const int32_t fence)
208 {
209 DISPLAY_LOGE("%s is not supported", __func__);
210 return HDF_ERR_NOT_SUPPORT;
211 }
212
SetDisplayProperty(uint32_t devId,uint32_t id,uint64_t value)213 int32_t DisplayComposerVdiImpl::SetDisplayProperty(uint32_t devId, uint32_t id, uint64_t value)
214 {
215 DISPLAY_LOGE("%s is not supported", __func__);
216 return HDF_ERR_NOT_SUPPORT;
217 }
218
Commit(uint32_t devId,int32_t & fence)219 int32_t DisplayComposerVdiImpl::Commit(uint32_t devId, int32_t& fence)
220 {
221 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
222 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::Commit, &fence);
223 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
224 return HDF_SUCCESS;
225 }
226
CreateLayer(uint32_t devId,const LayerInfo & layerInfo,uint32_t & layerId)227 int32_t DisplayComposerVdiImpl::CreateLayer(uint32_t devId, const LayerInfo& layerInfo, uint32_t& layerId)
228 {
229 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
230 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::CreateLayer, &layerInfo, &layerId);
231 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
232 return HDF_SUCCESS;
233 }
234
DestroyLayer(uint32_t devId,uint32_t layerId)235 int32_t DisplayComposerVdiImpl::DestroyLayer(uint32_t devId, uint32_t layerId)
236 {
237 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
238 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::DestroyLayer, layerId);
239 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
240 return HDF_SUCCESS;
241 }
242
PrepareDisplayLayers(uint32_t devId,bool & needFlushFb)243 int32_t DisplayComposerVdiImpl::PrepareDisplayLayers(uint32_t devId, bool& needFlushFb)
244 {
245 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
246 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::PrepareDisplayLayers, &needFlushFb);
247 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
248 return HDF_SUCCESS;
249 }
250
SetLayerAlpha(uint32_t devId,uint32_t layerId,const LayerAlpha & alpha)251 int32_t DisplayComposerVdiImpl::SetLayerAlpha(uint32_t devId, uint32_t layerId, const LayerAlpha& alpha)
252 {
253 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
254 int32_t ec = composerModel_->CallLayerFunction(devId, layerId, &HdiLayer::SetLayerAlpha,
255 const_cast<LayerAlpha*>(&alpha));
256 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
257 return HDF_SUCCESS;
258 }
259
SetLayerRegion(uint32_t devId,uint32_t layerId,const IRect & rect)260 int32_t DisplayComposerVdiImpl::SetLayerRegion(uint32_t devId, uint32_t layerId, const IRect& rect)
261 {
262 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
263 int32_t ec = composerModel_->CallLayerFunction(devId, layerId, &HdiLayer::SetLayerRegion,
264 const_cast<IRect*>(&rect));
265 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
266 return HDF_SUCCESS;
267 }
268
SetLayerCrop(uint32_t devId,uint32_t layerId,const IRect & rect)269 int32_t DisplayComposerVdiImpl::SetLayerCrop(uint32_t devId, uint32_t layerId, const IRect& rect)
270 {
271 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
272 int32_t ec = composerModel_->CallLayerFunction(devId, layerId, &HdiLayer::SetLayerCrop, const_cast<IRect*>(&rect));
273 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
274 return HDF_SUCCESS;
275 }
276
SetLayerZorder(uint32_t devId,uint32_t layerId,uint32_t zorder)277 int32_t DisplayComposerVdiImpl::SetLayerZorder(uint32_t devId, uint32_t layerId, uint32_t zorder)
278 {
279 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
280 int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::SetLayerZorder, layerId, zorder);
281 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
282 return HDF_SUCCESS;
283 }
284
SetLayerPreMulti(uint32_t devId,uint32_t layerId,bool preMul)285 int32_t DisplayComposerVdiImpl::SetLayerPreMulti(uint32_t devId, uint32_t layerId, bool preMul)
286 {
287 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
288 int32_t ec = composerModel_->CallLayerFunction(devId, layerId, &HdiLayer::SetLayerPreMulti, preMul);
289 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
290 return HDF_SUCCESS;
291 }
292
SetLayerTransformMode(uint32_t devId,uint32_t layerId,TransformType type)293 int32_t DisplayComposerVdiImpl::SetLayerTransformMode(uint32_t devId, uint32_t layerId, TransformType type)
294 {
295 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
296 int32_t ec = composerModel_->CallLayerFunction(devId, layerId, &HdiLayer::SetLayerTransformMode, type);
297 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
298 return HDF_SUCCESS;
299 }
300
SetLayerDirtyRegion(uint32_t devId,uint32_t layerId,const std::vector<IRect> & rects)301 int32_t DisplayComposerVdiImpl::SetLayerDirtyRegion(uint32_t devId, uint32_t layerId, const std::vector<IRect>& rects)
302 {
303 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
304 int32_t ec = composerModel_->CallLayerFunction(devId, layerId, &HdiLayer::SetLayerDirtyRegion,
305 const_cast<IRect*>(rects.data()));
306 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
307 return HDF_SUCCESS;
308 }
309
SetLayerVisibleRegion(uint32_t devId,uint32_t layerId,std::vector<IRect> & rects)310 int32_t DisplayComposerVdiImpl::SetLayerVisibleRegion(uint32_t devId, uint32_t layerId, std::vector<IRect>& rects)
311 {
312 DISPLAY_LOGE("%s is not supported", __func__);
313 return HDF_ERR_NOT_SUPPORT;
314 }
315
SetLayerBuffer(uint32_t devId,uint32_t layerId,const BufferHandle & buffer,int32_t fence)316 int32_t DisplayComposerVdiImpl::SetLayerBuffer(uint32_t devId, uint32_t layerId, const BufferHandle& buffer,
317 int32_t fence)
318 {
319 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
320 const BufferHandle* holder = &buffer;
321 int32_t ec = composerModel_->CallLayerFunction(devId, layerId, &HdiLayer::SetLayerBuffer, holder, fence);
322 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
323 return HDF_SUCCESS;
324 }
325
SetLayerCompositionType(uint32_t devId,uint32_t layerId,CompositionType type)326 int32_t DisplayComposerVdiImpl::SetLayerCompositionType(uint32_t devId, uint32_t layerId, CompositionType type)
327 {
328 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
329 int32_t ec = composerModel_->CallLayerFunction(devId, layerId, &HdiLayer::SetLayerCompositionType, type);
330 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
331 return HDF_SUCCESS;
332 }
333
SetLayerBlendType(uint32_t devId,uint32_t layerId,BlendType type)334 int32_t DisplayComposerVdiImpl::SetLayerBlendType(uint32_t devId, uint32_t layerId, BlendType type)
335 {
336 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
337 int32_t ec = composerModel_->CallLayerFunction(devId, layerId, &HdiLayer::SetLayerBlendType, type);
338 DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec));
339 return HDF_SUCCESS;
340 }
341
SetLayerMaskInfo(uint32_t devId,uint32_t layerId,const MaskInfo maskInfo)342 int32_t DisplayComposerVdiImpl::SetLayerMaskInfo(uint32_t devId, uint32_t layerId, const MaskInfo maskInfo)
343 {
344 DISPLAY_LOGE("%s is not supported", __func__);
345 return HDF_ERR_NOT_SUPPORT;
346 }
347
SetLayerColor(uint32_t devId,uint32_t layerId,const LayerColor & layerColor)348 int32_t DisplayComposerVdiImpl::SetLayerColor(uint32_t devId, uint32_t layerId, const LayerColor& layerColor)
349 {
350 CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE);
351 DISPLAY_LOGE("%s layerColor: r=%{public}d, g=%{public}d, b=%{public}d, a=%{public}d",
352 __func__, layerColor.r, layerColor.g, layerColor.b, layerColor.a);
353 DISPLAY_LOGE("%s is not supported", __func__);
354 return HDF_ERR_NOT_SUPPORT;
355 }
356
CreateComposerVdi()357 extern "C" IDisplayComposerVdi *CreateComposerVdi()
358 {
359 return new DisplayComposerVdiImpl();
360 }
361
DestroyComposerVdi(IDisplayComposerVdi * vdi)362 extern "C" void DestroyComposerVdi(IDisplayComposerVdi* vdi)
363 {
364 delete vdi;
365 }
366 } // DISPLAY
367 } // HDI
368 } // OHOS
369