Files
BPI-CM9-Linux/aml-patches/aml-comp/hardware/aml-5.15/amlogic/media_modules/0001-v4ldec-CB2-Log-flooding-caused-by-UVM-attachment-1-1.patch

61 lines
1.9 KiB
Diff
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
From 3a4a2ec0b8ce17ae5129ea415939a18bc1504e24 Mon Sep 17 00:00:00 2001
From: miaohong chen <miaohong.chen@amlogic.com>
Date: Tue, 4 Aug 2026 16:39:34 +0800
Subject: [PATCH] v4ldec: CB2 Log flooding caused by UVM attachment [1/1]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PD#SWPL-282824
Problem:
Failed to attach UVM buffer.
Solution:
Non‑UVM buffers do not need to be attached to UVM.
Verify:
a9
Change-Id: Idb0332d90ec398c02d48d8f0b33e7c8abc516a22
Signed-off-by: miaohong chen <miaohong.chen@amlogic.com>
---
drivers/amvdec_ports/aml_vcodec_dec.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/amvdec_ports/aml_vcodec_dec.c b/drivers/amvdec_ports/aml_vcodec_dec.c
index 0aca995a3..f461ce81a 100644
--- a/drivers/amvdec_ports/aml_vcodec_dec.c
+++ b/drivers/amvdec_ports/aml_vcodec_dec.c
@@ -1213,6 +1213,9 @@ static void aml_uvm_mark_status(struct aml_vcodec_ctx *ctx, struct dma_buf *dma)
struct uvm_hook_mod_info u_info = {0};
int ret = 0;
+ if (IS_ERR_OR_NULL(dma) || !dmabuf_is_uvm(dma))
+ return;
+
if (uvm_get_hook_mod(dma, PROCESS_SRC_DECODER)) {
uvm_put_hook_mod(dma, PROCESS_SRC_DECODER);
v4l_dbg(ctx, V4L_DEBUG_CODEC_EXINFO,
@@ -1224,7 +1227,7 @@ static void aml_uvm_mark_status(struct aml_vcodec_ctx *ctx, struct dma_buf *dma)
u_info.free = aml_uvm_free_callback;
ret = uvm_attach_hook_mod(dma, &u_info);
if (ret < 0) {
- v4l_dbg(ctx, V4L_DEBUG_CODEC_ERROR,
+ v4l_dbg(ctx, V4L_DEBUG_CODEC_EXINFO,
"fail to set dmabuf decoder hook\n");
}
@@ -1239,7 +1242,7 @@ static void aml_uvm_unmark_status(struct aml_vcodec_ctx *ctx, struct dma_buf *dm
v4l_dbg(ctx, V4L_DEBUG_CODEC_EXINFO,
"%s dbuf:%px\n", __func__ , dma);
- if (!dmabuf_is_uvm(dma)) {
+ if (IS_ERR_OR_NULL(dma) || !dmabuf_is_uvm(dma)) {
v4l_dbg(ctx, V4L_DEBUG_CODEC_EXINFO,
"%s not uvm dmabuf!\n", __func__);
return;
--
2.43.2