diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index 39d897489ae0352ef423a97739eff2c302edd785..b6cfbb3e3bee2eea27085953adb97b1ccc3782c4 100644 --- a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp +++ b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp @@ -18,6 +18,9 @@ #include #include #include +#include + +#include #include "src/codec/SkJpegCodec.h" #include "src/codec/SkJpegDecoderMgr.h" @@ -51,6 +54,7 @@ #include "heif_type.h" #include "image/image_plugin_type.h" +#define DMA_BUF_SET_TYPE _IOW(DMA_BUF_BASE, 2, const char *) #include "image_type_converter.h" #include "include/core/SkBitmap.h" #include "include/core/SkCanvas.h" @@ -284,6 +288,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()); + 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) {