mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas@ndufresne.ca>
To: Kyrie Wu <kyrie.wu@mediatek.com>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	 Mauro Carvalho Chehab	 <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski	 <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Matthias Brugger	 <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno	
	<angelogioacchino.delregno@collabora.com>,
	linux-media@vger.kernel.org,  devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	 linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Cc: srv_heupstream@mediatek.com
Subject: Re: [PATCH v5 07/12] media: mediatek: jpeg: refactor jpeg dst buffer layout
Date: Fri, 30 May 2025 13:38:14 -0400	[thread overview]
Message-ID: <8eadc152c3542c30fb31bb67093087f2bb0a6c31.camel@ndufresne.ca> (raw)
In-Reply-To: <20250530074537.26338-8-kyrie.wu@mediatek.com>

Hi,

Le vendredi 30 mai 2025 à 15:45 +0800, Kyrie Wu a écrit :
> 1. change dst buffer size to same as struct mtk_jpeg_src_buf
> to make sure all params of mtk_jpeg_src_buf could get a memory.
> 2. For memory alloc operation:
> the v4l2 framework malloc a memory, the base addr is vb2_buffer and
> the size is sizeof(struct mtk_jpeg_src_buf), mtk_jpeg_src_buf could get
> itself addr by container_of like that:
> vb2_buffer -> vb2_v4l2_buffer -> mtk_jpeg_src_buf.
> vb2_v4l2_buffer must keep on the top of mtk_jpeg_src_buf.

The subject imply a refactoring, but the most important change in your
patch is to fix the wrong buf strut size. Can you rework the subject
and message to state what you are fixing please.

Add a Fixes tag, and moved it at the start of the series to show this
isn't a problem you have introduced in previous patch.

> 
> Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
> ---
>  drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 2 +-
>  drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
> b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
> index 52d59bb5c9ad..7e3509be6f69 100644
> --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
> +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
> @@ -1103,7 +1103,7 @@ static int mtk_jpeg_queue_init(void *priv, struct vb2_queue *src_vq,
>  	dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
>  	dst_vq->io_modes = VB2_DMABUF | VB2_MMAP;
>  	dst_vq->drv_priv = ctx;
> -	dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer);
> +	dst_vq->buf_struct_size = sizeof(struct mtk_jpeg_src_buf);
>  	dst_vq->ops = jpeg->variant->qops;
>  	dst_vq->mem_ops = &vb2_dma_contig_memops;
>  	dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
> diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h
> b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h
> index 655dc9c3280c..186cd1862028 100644
> --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h
> +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h
> @@ -96,10 +96,10 @@ struct mtk_jpeg_variant {
>  };
>  
>  struct mtk_jpeg_src_buf {
> -	u32 frame_num;
>  	struct vb2_v4l2_buffer b;
>  	struct list_head list;
>  	u32 bs_size;
> +	u32 frame_num;

This "refactoring" should be split, it does not fix anything.

Nicolas

>  	struct mtk_jpeg_dec_param dec_param;
>  
>  	struct mtk_jpeg_ctx *curr_ctx;

  reply	other threads:[~2025-05-30 17:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-30  7:45 [PATCH v5 00/12] Enable jpeg enc & dec multi-hardwares for MT8196 Kyrie Wu
2025-05-30  7:45 ` [PATCH v5 01/12] media: dt-bindings: mediatek,jpeg: Add mediatek, mt8196-jpgdec compatible Kyrie Wu
2025-05-30  7:45 ` [PATCH v5 02/12] media: dt-bindings: mediatek,jpeg: Add mediatek, mt8196-jpgenc compatible Kyrie Wu
2025-05-30  7:45 ` [PATCH v5 03/12] media: mediatek: jpeg: add jpeg compatible Kyrie Wu
2025-05-30  7:45 ` [PATCH v5 04/12] media: mediatek: jpeg: add jpeg smmu sid setting Kyrie Wu
2025-05-30  7:45 ` [PATCH v5 05/12] media: mediatek: jpeg: fix jpeg hw count setting Kyrie Wu
2025-05-30  7:45 ` [PATCH v5 06/12] media: mediatek: jpeg: refactor jpeg buffer payload setting Kyrie Wu
2025-05-30 17:33   ` Nicolas Dufresne
2025-06-06  2:50     ` Kyrie Wu (吴晗)
2025-05-30  7:45 ` [PATCH v5 07/12] media: mediatek: jpeg: refactor jpeg dst buffer layout Kyrie Wu
2025-05-30 17:38   ` Nicolas Dufresne [this message]
2025-06-06  2:54     ` Kyrie Wu (吴晗)
2025-05-30  7:45 ` [PATCH v5 08/12] media: mediatek: jpeg: fix stop streaming flow for multi-core Kyrie Wu
2025-05-30 17:40   ` Nicolas Dufresne
2025-06-06  3:14     ` Kyrie Wu (吴晗)
2025-05-30  7:45 ` [PATCH v5 09/12] media: mediatek: jpeg: refactor multi-core clk suspend and resume setting Kyrie Wu
2025-05-30 17:43   ` Nicolas Dufresne
2025-06-06  3:23     ` Kyrie Wu (吴晗)
2025-06-06 14:34       ` Nicolas Dufresne
2025-05-30  7:45 ` [PATCH v5 10/12] media: mediatek: jpeg: fix decoding buffer number setting timing issue Kyrie Wu
2025-05-30  7:45 ` [PATCH v5 11/12] media: mediatek: jpeg: refactor decoding resolution change operation Kyrie Wu
2025-05-30  7:45 ` [PATCH v5 12/12] media: mediatek: jpeg: fix remove buffer operation for multi-core Kyrie Wu
2025-05-30 17:45 ` [PATCH v5 00/12] Enable jpeg enc & dec multi-hardwares for MT8196 Nicolas Dufresne
2025-06-06  2:45   ` Kyrie Wu (吴晗)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8eadc152c3542c30fb31bb67093087f2bb0a6c31.camel@ndufresne.ca \
    --to=nicolas@ndufresne.ca \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=krzk+dt@kernel.org \
    --cc=kyrie.wu@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=srv_heupstream@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®