From b6c8cab09d09b685a330f6157bb0f5229a2b0e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E4=B8=80=E9=B8=A3?= Date: Fri, 3 Jan 2025 07:01:17 +0000 Subject: [PATCH 1/7] update plugins/common/libs/image/libextplugin/src/ext_decoder.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡一鸣 --- plugins/common/libs/image/libextplugin/src/ext_decoder.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index c699072b9..7dcb4fa80 100644 --- a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp +++ b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp @@ -16,8 +16,10 @@ #include "ext_decoder.h" #include +#include #include #include +#include #include "src/codec/SkJpegCodec.h" #include "src/codec/SkJpegDecoderMgr.h" @@ -269,6 +271,9 @@ uint32_t ExtDecoder::DmaMemAlloc(DecodeContext &context, uint64_t count, SkImage bool cond = ret != GSERROR_OK; CHECK_ERROR_RETURN_RET_LOG(cond, ERR_DMA_NOT_EXIST, "SurfaceBuffer Alloc failed, %{public}s", GSErrorStr(ret).c_str()); + auto fd = sb->GetFileDescriptor(); + std::string usage = "pixelmap; + ioctl(fd,DMA_BUF_SET_NAME_A, usage.c_str())" void* nativeBuffer = sb.GetRefPtr(); int32_t err = ImageUtils::SurfaceBuffer_Reference(nativeBuffer); if (err != OHOS::GSERROR_OK) { -- Gitee From 01e648b517c88bc94865093f7c0a92c3bf4b3874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E4=B8=80=E9=B8=A3?= Date: Fri, 3 Jan 2025 07:08:16 +0000 Subject: [PATCH 2/7] update plugins/common/libs/image/libextplugin/src/ext_decoder.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡一鸣 --- plugins/common/libs/image/libextplugin/src/ext_decoder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index 7dcb4fa80..8a29f41cf 100644 --- a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp +++ b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp @@ -272,8 +272,8 @@ uint32_t ExtDecoder::DmaMemAlloc(DecodeContext &context, uint64_t count, SkImage CHECK_ERROR_RETURN_RET_LOG(cond, ERR_DMA_NOT_EXIST, "SurfaceBuffer Alloc failed, %{public}s", GSErrorStr(ret).c_str()); auto fd = sb->GetFileDescriptor(); - std::string usage = "pixelmap; - ioctl(fd,DMA_BUF_SET_NAME_A, usage.c_str())" + std::string usage = "pixelmap"; + ioctl(fd, DMA_BUF_SET_NAME_A, usage.c_str())" void* nativeBuffer = sb.GetRefPtr(); int32_t err = ImageUtils::SurfaceBuffer_Reference(nativeBuffer); if (err != OHOS::GSERROR_OK) { -- Gitee From 4fed3563c039faeb3dc2b4bbb093e3c3765f84fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E4=B8=80=E9=B8=A3?= Date: Fri, 3 Jan 2025 07:33:14 +0000 Subject: [PATCH 3/7] update plugins/common/libs/image/libextplugin/src/ext_decoder.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡一鸣 --- plugins/common/libs/image/libextplugin/src/ext_decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index 8a29f41cf..742ae2b86 100644 --- a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp +++ b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp @@ -273,7 +273,7 @@ uint32_t ExtDecoder::DmaMemAlloc(DecodeContext &context, uint64_t count, SkImage "SurfaceBuffer Alloc failed, %{public}s", GSErrorStr(ret).c_str()); auto fd = sb->GetFileDescriptor(); std::string usage = "pixelmap"; - ioctl(fd, DMA_BUF_SET_NAME_A, usage.c_str())" + ioctl(fd, DMA_BUF_SET_NAME_A, usage.c_str()); void* nativeBuffer = sb.GetRefPtr(); int32_t err = ImageUtils::SurfaceBuffer_Reference(nativeBuffer); if (err != OHOS::GSERROR_OK) { -- Gitee From 67570affca66fb5a1ac4a78920ed506ac6260372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E4=B8=80=E9=B8=A3?= Date: Mon, 6 Jan 2025 02:35:04 +0000 Subject: [PATCH 4/7] update plugins/common/libs/image/libextplugin/src/ext_decoder.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡一鸣 --- plugins/common/libs/image/libextplugin/src/ext_decoder.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index 742ae2b86..7167f2684 100644 --- a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp +++ b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp @@ -16,11 +16,12 @@ #include "ext_decoder.h" #include -#include #include #include #include +#include + #include "src/codec/SkJpegCodec.h" #include "src/codec/SkJpegDecoderMgr.h" #include "ext_pixel_convert.h" @@ -53,6 +54,8 @@ #include "heif_type.h" #include "image/image_plugin_type.h" +#define DMA_BUF_SET_TYPE_LOW(DMA_BUF_BASE, 2, const char *) + #undef LOG_DOMAIN #define LOG_DOMAIN LOG_TAG_DOMAIN_ID_PLUGIN @@ -273,7 +276,7 @@ uint32_t ExtDecoder::DmaMemAlloc(DecodeContext &context, uint64_t count, SkImage "SurfaceBuffer Alloc failed, %{public}s", GSErrorStr(ret).c_str()); auto fd = sb->GetFileDescriptor(); std::string usage = "pixelmap"; - ioctl(fd, DMA_BUF_SET_NAME_A, usage.c_str()); + ioctl(fd, DMA_BUF_SET_TYPE, usage.c_str()); void* nativeBuffer = sb.GetRefPtr(); int32_t err = ImageUtils::SurfaceBuffer_Reference(nativeBuffer); if (err != OHOS::GSERROR_OK) { -- Gitee From a38a84a40f5fe0494560df832a0df0d160617f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E4=B8=80=E9=B8=A3?= Date: Mon, 6 Jan 2025 02:39:46 +0000 Subject: [PATCH 5/7] update plugins/common/libs/image/libextplugin/src/ext_decoder.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡一鸣 --- plugins/common/libs/image/libextplugin/src/ext_decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index 7167f2684..0d287c4d7 100644 --- a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp +++ b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp @@ -54,7 +54,7 @@ #include "heif_type.h" #include "image/image_plugin_type.h" -#define DMA_BUF_SET_TYPE_LOW(DMA_BUF_BASE, 2, const char *) +#define DMA_BUF_SET_TYPE _IOW(DMA_BUF_BASE, 2, const char *) #undef LOG_DOMAIN #define LOG_DOMAIN LOG_TAG_DOMAIN_ID_PLUGIN -- Gitee From a55965bc2d7662ce209df0ff0f874f2579041ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E4=B8=80=E9=B8=A3?= Date: Mon, 6 Jan 2025 08:34:58 +0000 Subject: [PATCH 6/7] update plugins/common/libs/image/libextplugin/src/ext_decoder.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡一鸣 --- plugins/common/libs/image/libextplugin/src/ext_decoder.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index 0d287c4d7..6b9568c46 100644 --- a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp +++ b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp @@ -274,9 +274,10 @@ uint32_t ExtDecoder::DmaMemAlloc(DecodeContext &context, uint64_t count, SkImage bool cond = ret != GSERROR_OK; CHECK_ERROR_RETURN_RET_LOG(cond, ERR_DMA_NOT_EXIST, "SurfaceBuffer Alloc failed, %{public}s", GSErrorStr(ret).c_str()); - auto fd = sb->GetFileDescriptor(); - std::string usage = "pixelmap"; - ioctl(fd, DMA_BUF_SET_TYPE, usage.c_str()); + int fd = sb->GetFileDescriptor(); + if(fd > 0) { + ioctl(fd, DMA_BUF_SET_TYPE, "pixelmap"); + } void* nativeBuffer = sb.GetRefPtr(); int32_t err = ImageUtils::SurfaceBuffer_Reference(nativeBuffer); if (err != OHOS::GSERROR_OK) { -- Gitee From b340f0e75bcf63357fd3f6e3f781cba96134599c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E4=B8=80=E9=B8=A3?= Date: Mon, 6 Jan 2025 08:41:22 +0000 Subject: [PATCH 7/7] update plugins/common/libs/image/libextplugin/src/ext_decoder.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡一鸣 --- plugins/common/libs/image/libextplugin/src/ext_decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index 6b9568c46..c90fcda84 100644 --- a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp +++ b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp @@ -275,7 +275,7 @@ uint32_t ExtDecoder::DmaMemAlloc(DecodeContext &context, uint64_t count, SkImage CHECK_ERROR_RETURN_RET_LOG(cond, ERR_DMA_NOT_EXIST, "SurfaceBuffer Alloc failed, %{public}s", GSErrorStr(ret).c_str()); int fd = sb->GetFileDescriptor(); - if(fd > 0) { + if (fd > 0) { ioctl(fd, DMA_BUF_SET_TYPE, "pixelmap"); } void* nativeBuffer = sb.GetRefPtr(); -- Gitee