From 0a770327cfec8d8593ac750a75f4558951b4a320 Mon Sep 17 00:00:00 2001 From: huyx Date: Mon, 30 Jun 2025 11:47:30 +0800 Subject: [PATCH 1/6] no ipc Signed-off-by: huyx --- display/buffer/v1_2/IMapper.idl | 1 + display/buffer/v1_3/BUILD.gn | 86 +++++++++++++ display/buffer/v1_3/DisplayBufferType.idl | 36 ++++++ display/buffer/v1_3/IMapper.idl | 35 +++++ .../v1_3/hdi_impl/display_buffer_hdi_impl.cpp | 36 ++++++ .../v1_3/hdi_impl/display_buffer_hdi_impl.h | 121 ++++++++++++++++++ display/buffer/v1_3/include/idisplay_buffer.h | 48 +++++++ display/bundle.json | 36 +++++- 8 files changed, 398 insertions(+), 1 deletion(-) create mode 100644 display/buffer/v1_3/BUILD.gn create mode 100644 display/buffer/v1_3/DisplayBufferType.idl create mode 100644 display/buffer/v1_3/IMapper.idl create mode 100644 display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.cpp create mode 100644 display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h create mode 100644 display/buffer/v1_3/include/idisplay_buffer.h diff --git a/display/buffer/v1_2/IMapper.idl b/display/buffer/v1_2/IMapper.idl index fe01d210..eadb5a70 100644 --- a/display/buffer/v1_2/IMapper.idl +++ b/display/buffer/v1_2/IMapper.idl @@ -14,6 +14,7 @@ */ package ohos.hdi.display.buffer.v1_2; +import ohos.hdi.display.buffer.v1_0.DisplayBufferType; import ohos.hdi.display.buffer.v1_2.DisplayBufferType; import ohos.hdi.display.buffer.v1_0.IMapper; diff --git a/display/buffer/v1_3/BUILD.gn b/display/buffer/v1_3/BUILD.gn new file mode 100644 index 00000000..03aad7d1 --- /dev/null +++ b/display/buffer/v1_3/BUILD.gn @@ -0,0 +1,86 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/hdi/hdi.gni") + +hdi("display_buffer") { + module_name = "display_buffer" + + proxy_deps = [ + "../v1_0:libdisplay_buffer_proxy_1.0", + "../v1_0:libdisplay_buffer_proxy_1.1", + "../v1_0:libdisplay_buffer_proxy_1.2" + ] + stub_deps = [ + "../v1_0:libdisplay_buffer_stub_1.0", + "../v1_0:libdisplay_buffer_stub_1.1", + "../v1_0:libdisplay_buffer_stub_1.2" + ] + + sources = [ + "IMapper.idl", + ] + innerapi_tags = [ + "chipsetsdk_indirect", + "platformsdk_indirect", + ] + + branch_protector_ret = "pac_ret" + + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_display" +} + +config("libdisplay_buffer_hdi_impl_config") { + include_dirs = [ "./../" ] +} + +ohos_shared_library("libdisplay_buffer_hdi_impl_v1_3") { + sources = [ + "../v1_0/hdi_impl/display_buffer_hdi_impl.cpp", + "../v1_1/hdi_impl/display_buffer_hdi_impl.cpp", + "../v1_2/hdi_impl/display_buffer_hdi_impl.cpp", + "./hdi_impl/display_buffer_hdi_impl.cpp", + ] + + public_configs = [ ":libdisplay_buffer_hdi_impl_config" ] + + deps = [ + ":libdisplay_buffer_proxy_1.3", + "../v1_0:libdisplay_buffer_proxy_1.0", + "../v1_1:libdisplay_buffer_proxy_1.1", + "../v1_2:libdisplay_buffer_proxy_1.2", + ] + + external_deps = [ + "c_utils:utils", + "graphic_surface:buffer_handle", + "hdf_core:libhdi", + "hdf_core:libpub_utils", + "hilog:libhilog", + "hitrace:hitrace_meter", + "ipc:ipc_single", + ] + + install_images = [ "system" ] + subsystem_name = "hdf" + innerapi_tags = [ + "chipsetsdk", + "platformsdk_indirect", + ] + + branch_protector_ret = "pac_ret" + + part_name = "drivers_interface_display" +} diff --git a/display/buffer/v1_3/DisplayBufferType.idl b/display/buffer/v1_3/DisplayBufferType.idl new file mode 100644 index 00000000..a1b87ded --- /dev/null +++ b/display/buffer/v1_3/DisplayBufferType.idl @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.hdi.display.buffer.v1_2; +import ohos.hdi.display.buffer.v1_0.DisplayBufferType; + +/** + * @brief Defines information about the uv offset. + * + */ +struct ImagePlane { + unsigned int offset; /* 偏移量 */ + unsigned int hStride; /* 水平增量 */ + unsigned int vStride; /* 垂直增量 */ +}; + +/** + * @brief Defines information about farmat and position. + * + */ +struct ImageLayout { + unsigned int pixelFormat; /**< 图像格式 */ + struct ImagePlane[] planes; /**< 平面数据 */ +}; diff --git a/display/buffer/v1_3/IMapper.idl b/display/buffer/v1_3/IMapper.idl new file mode 100644 index 00000000..318ce304 --- /dev/null +++ b/display/buffer/v1_3/IMapper.idl @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.hdi.display.buffer.v1_3; +import ohos.hdi.display.buffer.v1_0.DisplayBufferType; +import ohos.hdi.display.buffer.v1_2.DisplayBufferType; +import ohos.hdi.display.buffer.v1_2.IMapper; + +interface IMapper extends ohos.hdi.display.buffer.v1_2.IMapper { + /** + * @brief get iamge position + * + * @param handle The input buffer handle + * @param layout the iamge position data + * + * @return Returns 0 if the operation is successful; returns an error code defined + * in {@link DispErrCode} otherwise. + * @since 6.0 + * @version 1.3 + */ + AllocMem([in] struct AllocInfo info, [out] NativeBuffer handle); + IsSupportAllocPassthrough([in] struct AllocInfo info); +} diff --git a/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.cpp b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.cpp new file mode 100644 index 00000000..cc8c3954 --- /dev/null +++ b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "display_buffer_hdi_impl.h" +namespace OHOS { +namespace HDI { +namespace Display { +namespace Buffer { +namespace V1_3 { +using namespace OHOS::HDI::Display::Buffer::V1_3; +IDisplayBuffer *IDisplayBuffer::Get() +{ + IDisplayBuffer *instance = new V1_3::HdiDisplayBufferImpl(); + if (instance == nullptr) { + return nullptr; + } + return instance; +} + +} // namespace V1_3 +} // namespace Buffer +} // namespace Display +} // namespace HDI +} // namespace OHOS diff --git a/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h new file mode 100644 index 00000000..9f3bd412 --- /dev/null +++ b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_HDI_DISPLAY_V1_3_DISPLAY_BUFFER_HDI_IMPL_H +#define OHOS_HDI_DISPLAY_V1_3_DISPLAY_BUFFER_HDI_IMPL_H + +#include +#include +#include "hdf_log.h" +#include "hilog/log.h" +#include "v1_0/imapper.h" +#include "v1_2/imapper.h" +#include "v1_3/imapper.h" +#include "v1_1/include/idisplay_buffer.h" +#include "v1_2/include/idisplay_buffer.h" +#include "v1_3/include/idisplay_buffer.h" +#include "v1_0/hdi_impl/display_buffer_hdi_impl.h" +#include "v1_1/hdi_impl/display_buffer_hdi_impl.h" +#include "v1_2/hdi_impl/display_buffer_hdi_impl.h" + +#undef LOG_TAG +#define LOG_TAG "DISP_HDI_BUFF" +#undef LOG_DOMAIN +#define LOG_DOMAIN 0xD002515 + +namespace OHOS { +namespace HDI { +namespace Display { +namespace Buffer { +namespace V1_3 { +template +class DisplayBufferHdiImpl : public V1_2::DisplayBufferHdiImpl { +public: + explicit DisplayBufferHdiImpl(bool isAllocLocal = false) : BaseType2_0(isAllocLocal), mapper_v1_3_(nullptr) + { + while ((mapper_v1_3_ = IMapper::Get(true)) == nullptr) { + // Waiting for metadata service ready + usleep(WAIT_TIME_INTERVAL); + } + } + virtual ~DisplayBufferHdiImpl() {}; + + int32_t AllocMemPassThrough(const AllocMem& info, BufferHandle& handle) const + { + DISPLAY_TRACE; + CHECK_NULLPOINTER_RETURN_VALUE(mapper_v1_3_, HDF_FAILURE); + sptr hdiBuffer; + int32_t ret = mapper_v1_3_->AllocMem(info, hdiBuffer); + if ((ret == HDF_SUCCESS) && (hdiBuffer != nullptr)) { + handle = hdiBuffer->Move(); + } else { + handle = nullptr; + if (ret == HDF_SUCCESS) { + ret = HDF_FAILURE; + } + HDF_LOGE("%{public}s: AllocMem error", __func__); + } + return ret; + } + + int32_t AllocMemIpc(const AllocMem& info, BufferHandle& handle) const + { + DISPLAY_TRACE; + CHECK_NULLPOINTER_RETURN_VALUE(mapper_v1_3_, HDF_FAILURE); + sptr hdiBuffer; + int32_t ret = allocator_->AllocMem(info, hdiBuffer); + if ((ret == HDF_SUCCESS) && (hdiBuffer != nullptr)) { + handle = hdiBuffer->Move(); + } else { + handle = nullptr; + if (ret == HDF_SUCCESS) { + ret = HDF_FAILURE; + } + HDF_LOGE("%{public}s: AllocMem error", __func__); + } + return ret; + } + + int32_t AllocMem(const AllocMem& info, BufferHandle& handle) const override + { + DISPLAY_TRACE; + CHECK_NULLPOINTER_RETURN_VALUE(mapper_v1_3_, HDF_FAILURE); + + //Step1. check is support alloc passthrough + if (mapper_v1_3_->IsSupportAllocPassthrough(info) == HDF_SUCCESS) { + int32_t ret = AllocMemPassThrough(info, handle); + if (ret != HDF_FAILURE) { + HDF_LOGW("%{public}s: AllocMem Passthrough mode failed, use allocator_host", __func__); + } else { + return AllocMemIpc(info, handle); + } + } + } + +private: + using BaseType3_0 = V1_2::DisplayBufferHdiImpl; +protected: + using BaseType3_0::WAIT_TIME_INTERVAL; + using BaseType3_0::allocator_; + sptr mapper_v1_3_; +}; +using HdiDisplayBufferImpl = DisplayBufferHdiImpl; +} // namespace V1_3 +} // namespace Buffer +} // namespace Display +} // namespace HDI +} // namespace OHOS + +#endif // OHOS_HDI_DISPLAY_V1_3_DISPLAY_BUFFER_HDI_IMPL_H diff --git a/display/buffer/v1_3/include/idisplay_buffer.h b/display/buffer/v1_3/include/idisplay_buffer.h new file mode 100644 index 00000000..166ef006 --- /dev/null +++ b/display/buffer/v1_3/include/idisplay_buffer.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_HDI_DISPLAY_V1_3_IDISPLAY_BUFFER_H +#define OHOS_HDI_DISPLAY_V1_3_IDISPLAY_BUFFER_H + +#include "v1_0/include/idisplay_buffer.h" +#include "v1_1/include/idisplay_buffer.h" +#include "v1_2/include/idisplay_buffer.h" + +namespace OHOS { +namespace HDI { +namespace Display { +namespace Buffer { +namespace V1_3 { +class IDisplayBuffer : public V1_2::IDisplayBuffer { +public: + virtual ~IDisplayBuffer() = default; + + /** + * @brief Obtains all interfaces of IDisplayBuffer. + * + * @return Returns IDisplayBuffer* if the operation is successful; returns an null point otherwise. + * @since 5.0 + * @version 1.2 + */ + static IDisplayBuffer *Get(); + virtual int32_t AllocMem(const V1_0::AllocInfo& info, BufferHandle& handle) const = 0; +}; +} // namespace V1_3 +} // namespace Buffer +} // namespace Display +} // namespace HDI +} // namespace OHOS + +#endif // OHOS_HDI_DISPLAY_V1_3_IDISPLAY_BUFFER_H diff --git a/display/bundle.json b/display/bundle.json index 7643e832..300344cc 100644 --- a/display/bundle.json +++ b/display/bundle.json @@ -46,6 +46,8 @@ "//drivers/interface/display/buffer/v1_1:libdisplay_buffer_hdi_impl_v1_1", "//drivers/interface/display/buffer/v1_2:display_buffer_idl_target", "//drivers/interface/display/buffer/v1_2:libdisplay_buffer_hdi_impl_v1_2", + "//drivers/interface/display/buffer/v1_3:display_buffer_idl_target", + "//drivers/interface/display/buffer/v1_3:libdisplay_buffer_hdi_impl_v1_3", "//drivers/interface/display/composer/cache_manager:libcomposer_buffer_cache", "//drivers/interface/display/composer/v1_0:display_composer_idl_target", "//drivers/interface/display/composer/v1_1:display_composer_idl_target", @@ -131,7 +133,7 @@ "header_base": "//drivers/interface/display/buffer" } }, - { + { "name": "//drivers/interface/display/buffer/v1_2:libdisplay_buffer_proxy_1.2", "header": { "header_files": [ @@ -163,6 +165,38 @@ "header_base": "//drivers/interface/display/buffer" } }, + { + "name": "//drivers/interface/display/buffer/v1_3:libdisplay_buffer_proxy_1.3", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/display/buffer" + } + }, + { + "name": "//drivers/interface/display/buffer/v1_3:libdisplay_buffer_stub_1.3", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/display/buffer" + } + }, + { + "name": "//drivers/interface/display/buffer/v1_3:display_buffer_idl_headers_1.3", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/display/buffer" + } + }, + { + "name": "//drivers/interface/display/buffer/v1_3:libdisplay_buffer_hdi_impl_v1_3", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/display/buffer" + } + }, { "name": "//drivers/interface/display/composer/cache_manager:libcomposer_buffer_cache", "header": { -- Gitee From fbbb9eacffda538946da69dd04294681261dec7c Mon Sep 17 00:00:00 2001 From: huyx Date: Mon, 30 Jun 2025 11:50:26 +0800 Subject: [PATCH 2/6] no ipc Signed-off-by: huyx --- display/buffer/v1_3/DisplayBufferType.idl | 36 ----------------------- 1 file changed, 36 deletions(-) delete mode 100644 display/buffer/v1_3/DisplayBufferType.idl diff --git a/display/buffer/v1_3/DisplayBufferType.idl b/display/buffer/v1_3/DisplayBufferType.idl deleted file mode 100644 index a1b87ded..00000000 --- a/display/buffer/v1_3/DisplayBufferType.idl +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ohos.hdi.display.buffer.v1_2; -import ohos.hdi.display.buffer.v1_0.DisplayBufferType; - -/** - * @brief Defines information about the uv offset. - * - */ -struct ImagePlane { - unsigned int offset; /* 偏移量 */ - unsigned int hStride; /* 水平增量 */ - unsigned int vStride; /* 垂直增量 */ -}; - -/** - * @brief Defines information about farmat and position. - * - */ -struct ImageLayout { - unsigned int pixelFormat; /**< 图像格式 */ - struct ImagePlane[] planes; /**< 平面数据 */ -}; -- Gitee From 66eaca7bec80202374e0fdc525fad501b719d324 Mon Sep 17 00:00:00 2001 From: huyx Date: Wed, 2 Jul 2025 14:57:42 +0800 Subject: [PATCH 3/6] no ipc Signed-off-by: huyx --- display/buffer/v1_3/BUILD.gn | 12 ++++++------ .../buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h | 12 +++++++----- display/buffer/v1_3/include/idisplay_buffer.h | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/display/buffer/v1_3/BUILD.gn b/display/buffer/v1_3/BUILD.gn index 03aad7d1..5d69e281 100644 --- a/display/buffer/v1_3/BUILD.gn +++ b/display/buffer/v1_3/BUILD.gn @@ -17,14 +17,14 @@ hdi("display_buffer") { module_name = "display_buffer" proxy_deps = [ - "../v1_0:libdisplay_buffer_proxy_1.0", - "../v1_0:libdisplay_buffer_proxy_1.1", - "../v1_0:libdisplay_buffer_proxy_1.2" + "//drivers/interface/display/buffer/v1_0:libdisplay_buffer_proxy_1.0", + "//drivers/interface/display/buffer/v1_1:libdisplay_buffer_proxy_1.1", + "//drivers/interface/display/buffer/v1_2:libdisplay_buffer_proxy_1.2" ] stub_deps = [ - "../v1_0:libdisplay_buffer_stub_1.0", - "../v1_0:libdisplay_buffer_stub_1.1", - "../v1_0:libdisplay_buffer_stub_1.2" + "//drivers/interface/display/buffer/v1_0:libdisplay_buffer_stub_1.0", + "//drivers/interface/display/buffer/v1_1:libdisplay_buffer_stub_1.1", + "//drivers/interface/display/buffer/v1_2:libdisplay_buffer_stub_1.2" ] sources = [ diff --git a/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h index 9f3bd412..884ab001 100644 --- a/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h +++ b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h @@ -43,7 +43,7 @@ namespace V1_3 { template class DisplayBufferHdiImpl : public V1_2::DisplayBufferHdiImpl { public: - explicit DisplayBufferHdiImpl(bool isAllocLocal = false) : BaseType2_0(isAllocLocal), mapper_v1_3_(nullptr) + explicit DisplayBufferHdiImpl(bool isAllocLocal = false) : BaseType3_0(isAllocLocal), mapper_v1_3_(nullptr) { while ((mapper_v1_3_ = IMapper::Get(true)) == nullptr) { // Waiting for metadata service ready @@ -52,7 +52,7 @@ public: } virtual ~DisplayBufferHdiImpl() {}; - int32_t AllocMemPassThrough(const AllocMem& info, BufferHandle& handle) const + int32_t AllocMemPassThrough(const AllocInfo& info, BufferHandle*& handle) const { DISPLAY_TRACE; CHECK_NULLPOINTER_RETURN_VALUE(mapper_v1_3_, HDF_FAILURE); @@ -70,7 +70,7 @@ public: return ret; } - int32_t AllocMemIpc(const AllocMem& info, BufferHandle& handle) const + int32_t AllocMemIpc(const AllocInfo& info, BufferHandle*& handle) const { DISPLAY_TRACE; CHECK_NULLPOINTER_RETURN_VALUE(mapper_v1_3_, HDF_FAILURE); @@ -88,7 +88,7 @@ public: return ret; } - int32_t AllocMem(const AllocMem& info, BufferHandle& handle) const override + int32_t AllocMem(const AllocInfo& info, BufferHandle*& handle) const override { DISPLAY_TRACE; CHECK_NULLPOINTER_RETURN_VALUE(mapper_v1_3_, HDF_FAILURE); @@ -98,9 +98,11 @@ public: int32_t ret = AllocMemPassThrough(info, handle); if (ret != HDF_FAILURE) { HDF_LOGW("%{public}s: AllocMem Passthrough mode failed, use allocator_host", __func__); - } else { return AllocMemIpc(info, handle); } + return ret; + } else { + return AllocMemIpc(info, handle); } } diff --git a/display/buffer/v1_3/include/idisplay_buffer.h b/display/buffer/v1_3/include/idisplay_buffer.h index 166ef006..881ddf93 100644 --- a/display/buffer/v1_3/include/idisplay_buffer.h +++ b/display/buffer/v1_3/include/idisplay_buffer.h @@ -37,7 +37,7 @@ public: * @version 1.2 */ static IDisplayBuffer *Get(); - virtual int32_t AllocMem(const V1_0::AllocInfo& info, BufferHandle& handle) const = 0; + virtual int32_t AllocMem(const V1_0::AllocInfo& info, BufferHandle*& handle) const = 0; }; } // namespace V1_3 } // namespace Buffer -- Gitee From 5bc82e2eacbf654989ba17a272473babf4be0cbf Mon Sep 17 00:00:00 2001 From: huyx Date: Fri, 4 Jul 2025 18:18:48 +0800 Subject: [PATCH 4/6] no ipc Signed-off-by: huyx --- display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h index 884ab001..25155a97 100644 --- a/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h +++ b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h @@ -96,7 +96,7 @@ public: //Step1. check is support alloc passthrough if (mapper_v1_3_->IsSupportAllocPassthrough(info) == HDF_SUCCESS) { int32_t ret = AllocMemPassThrough(info, handle); - if (ret != HDF_FAILURE) { + if (ret != HDF_SUCCESS) { HDF_LOGW("%{public}s: AllocMem Passthrough mode failed, use allocator_host", __func__); return AllocMemIpc(info, handle); } -- Gitee From c756078e26cd6a1b13403de9c94bf0c7c3da6794 Mon Sep 17 00:00:00 2001 From: huyx Date: Fri, 4 Jul 2025 20:58:55 +0800 Subject: [PATCH 5/6] no ipc Signed-off-by: huyx --- display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h index 25155a97..6ac7c6a4 100644 --- a/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h +++ b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h @@ -50,6 +50,7 @@ public: usleep(WAIT_TIME_INTERVAL); } } + virtual ~DisplayBufferHdiImpl() {}; int32_t AllocMemPassThrough(const AllocInfo& info, BufferHandle*& handle) const -- Gitee From 326960a159bb72e4211e41368ef62168f2504450 Mon Sep 17 00:00:00 2001 From: huyx Date: Sat, 5 Jul 2025 10:16:04 +0800 Subject: [PATCH 6/6] no ipc Signed-off-by: huyx --- display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h index 6ac7c6a4..bba4ccb8 100644 --- a/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h +++ b/display/buffer/v1_3/hdi_impl/display_buffer_hdi_impl.h @@ -74,7 +74,7 @@ public: int32_t AllocMemIpc(const AllocInfo& info, BufferHandle*& handle) const { DISPLAY_TRACE; - CHECK_NULLPOINTER_RETURN_VALUE(mapper_v1_3_, HDF_FAILURE); + CHECK_NULLPOINTER_RETURN_VALUE(allocator_, HDF_FAILURE); sptr hdiBuffer; int32_t ret = allocator_->AllocMem(info, hdiBuffer); if ((ret == HDF_SUCCESS) && (hdiBuffer != nullptr)) { -- Gitee