mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] media: mediatek: vcodec: Return NULL if no vdec_fb is found
@ 2023-07-03  3:59 Irui Wang
  2023-07-05  8:05 ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 2+ messages in thread
From: Irui Wang @ 2023-07-03  3:59 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab, Matthias Brugger
  Cc: Yunfei Dong, Maoguang Meng, Irui Wang,
	Project_Global_Chrome_Upstream_Group, linux-media, linux-kernel,
	linux-arm-kernel, linux-mediatek

"fb_use_list" is used to store used or referenced frame buffers for
vp9 stateful decoder. "NULL" should be returned when getting target
frame buffer failed from "fb_use_list", not a random unexpected one.

Signed-off-by: Irui Wang <irui.wang@mediatek.com>
---
changed with v1:
- remove the added flag variable.
- update commit message.
---
 drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c
index 70b8383f7c8e..a27a109d8d14 100644
--- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c
+++ b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c
@@ -226,10 +226,11 @@ static struct vdec_fb *vp9_rm_from_fb_use_list(struct vdec_vp9_inst
 		if (fb->base_y.va == addr) {
 			list_move_tail(&node->list,
 				       &inst->available_fb_node_list);
-			break;
+			return fb;
 		}
 	}
-	return fb;
+
+	return NULL;
 }
 
 static void vp9_add_to_fb_free_list(struct vdec_vp9_inst *inst,
-- 
2.18.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] media: mediatek: vcodec: Return NULL if no vdec_fb is found
  2023-07-03  3:59 [PATCH v2] media: mediatek: vcodec: Return NULL if no vdec_fb is found Irui Wang
@ 2023-07-05  8:05 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 2+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-07-05  8:05 UTC (permalink / raw)
  To: Irui Wang, Hans Verkuil, Mauro Carvalho Chehab, Matthias Brugger
  Cc: Yunfei Dong, Maoguang Meng, Project_Global_Chrome_Upstream_Group,
	linux-media, linux-kernel, linux-arm-kernel, linux-mediatek

Il 03/07/23 05:59, Irui Wang ha scritto:
> "fb_use_list" is used to store used or referenced frame buffers for
> vp9 stateful decoder. "NULL" should be returned when getting target
> frame buffer failed from "fb_use_list", not a random unexpected one.
> 
> Signed-off-by: Irui Wang <irui.wang@mediatek.com>

This commit needs a Fixes tag. Please add the relevant one and resend.

Regards,
Angelo

> ---
> changed with v1:
> - remove the added flag variable.
> - update commit message.
> ---
>   drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c
> index 70b8383f7c8e..a27a109d8d14 100644
> --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c
> +++ b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c
> @@ -226,10 +226,11 @@ static struct vdec_fb *vp9_rm_from_fb_use_list(struct vdec_vp9_inst
>   		if (fb->base_y.va == addr) {
>   			list_move_tail(&node->list,
>   				       &inst->available_fb_node_list);
> -			break;
> +			return fb;
>   		}
>   	}
> -	return fb;
> +
> +	return NULL;
>   }
>   
>   static void vp9_add_to_fb_free_list(struct vdec_vp9_inst *inst,
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-05  8:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03  3:59 [PATCH v2] media: mediatek: vcodec: Return NULL if no vdec_fb is found Irui Wang
2023-07-05  8:05 ` AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®