From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: Julien Stephan <jstephan@baylibre.com>
Cc: "robh@kernel.org" <robh@kernel.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"paul.elder@ideasonboard.com" <paul.elder@ideasonboard.com>,
"laurent.pinchart@ideasonboard.com"
<laurent.pinchart@ideasonboard.com>,
"mchehab@kernel.org" <mchehab@kernel.org>,
"Andy Hsieh (謝智皓)" <Andy.Hsieh@mediatek.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"fsylvestre@baylibre.com" <fsylvestre@baylibre.com>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"pnguyen@baylibre.com" <pnguyen@baylibre.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>
Subject: Re: [PATCH v8 4/5] media: platform: mediatek: isp: add mediatek ISP3.0 camsv
Date: Wed, 9 Apr 2025 02:40:55 +0000 [thread overview]
Message-ID: <9e9fd35b62cb1c9e234be0ff432aa4a965801e08.camel@mediatek.com> (raw)
In-Reply-To: <CAEHHSvYcet16TrWRbE=nkyS-0jXNbB+=knL0zUKLbnqcYBaSpA@mail.gmail.com>
On Tue, 2025-04-08 at 15:56 +0200, Julien Stephan wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
>
>
> Le jeu. 20 mars 2025 à 03:18, CK Hu (胡俊光) <ck.hu@mediatek.com> a écrit :
> >
> > On Wed, 2025-01-22 at 14:59 +0100, Julien Stephan wrote:
> > > External email : Please do not click links or open attachments until you have verified the sender or the content.
> > >
> > >
> > > From: Phi-bang Nguyen <pnguyen@baylibre.com>
> > >
> > > This driver provides a path to bypass the SoC ISP so that image data
> > > coming from the SENINF can go directly into memory without any image
> > > processing. This allows the use of an external ISP.
> > >
> > > Signed-off-by: Phi-bang Nguyen <pnguyen@baylibre.com>
> > > Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>
> > > [Paul Elder fix irq locking]
> > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> > > Co-developed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > Co-developed-by: Julien Stephan <jstephan@baylibre.com>
> > > Signed-off-by: Julien Stephan <jstephan@baylibre.com>
> > > ---
> >
[snip]
> >
> > > +
> > > +static void mtk_cam_vb2_buf_queue(struct vb2_buffer *vb)
> > > +{
> > > + struct mtk_cam_dev *cam = vb2_get_drv_priv(vb->vb2_queue);
> > > + struct mtk_cam_dev_buffer *buf = to_mtk_cam_dev_buffer(vb);
> > > + unsigned long flags;
> > > +
> > > + /* Add the buffer into the tracking list */
> > > + spin_lock_irqsave(&cam->buf_list_lock, flags);
> > > + if (vb2_start_streaming_called(vb->vb2_queue) && list_empty(&cam->buf_list))
> > > + mtk_camsv_update_buffers_add(cam, buf);
> > > +
> > > + list_add_tail(&buf->list, &cam->buf_list);
> > > + spin_unlock_irqrestore(&cam->buf_list_lock, flags);
> > > + if (vb2_start_streaming_called(vb->vb2_queue))
> > > + mtk_camsv_fbc_inc(cam);
> >
> > I think you should call mtk_camsv_fbc_inc() just after mtk_camsv_update_buffers_add();
> >
>
> Hi CK,
>
> Is there any particular reason? I moved it at the bottom, to reduce
> the spinlock region as you requested in v7.. OR maybe I am missing
> something ?
I think I just partially review before, and this case is a little more complicated.
To let things be more simple,
I suggest to remove mtk_camsv_update_buffers_add() and mtk_camsv_fbc_inc() in mtk_cam_vb2_buf_queue(),
and do mtk_camsv_update_buffers_add() and mtk_camsv_fbc_inc() in irq handler and call mtk_camsv_fbc_inc() just after mtk_camsv_update_buffers_add().
So this spinlock just protect cam->buf_list and not protect register writing.
Call mtk_camsv_update_buffers_add() in mtk_cam_vb2_buf_queue() is too early because mtk_cam_vb2_buf_queue() is executed when scan line is in center of a video.
Hardware still need to wait for vblank to start writing a full video data.
So call mtk_camsv_update_buffers_add() and mtk_camsv_fbc_inc() only in irq handler would be reasonable and code flow would be simple.
Regards,
CK
>
> Cheers
> Julien
>
> > > +}
> > > +
> >
next prev parent reply other threads:[~2025-04-09 2:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-22 13:59 [PATCH v8 0/5] Add Mediatek ISP3.0 Julien Stephan
2025-01-22 13:59 ` [PATCH v8 1/5] dt-bindings: media: add mediatek ISP3.0 sensor interface Julien Stephan
2025-01-22 13:59 ` [PATCH v8 2/5] dt-bindings: media: add mediatek ISP3.0 camsv Julien Stephan
2025-03-20 3:48 ` CK Hu (胡俊光)
2025-01-22 13:59 ` [PATCH v8 3/5] media: platform: mediatek: isp: add mediatek ISP3.0 sensor interface Julien Stephan
2025-01-22 13:59 ` [PATCH v8 4/5] media: platform: mediatek: isp: add mediatek ISP3.0 camsv Julien Stephan
2025-02-13 5:54 ` CK Hu (胡俊光)
2025-03-20 2:18 ` CK Hu (胡俊光)
2025-04-08 13:56 ` Julien Stephan
2025-04-09 2:40 ` CK Hu (胡俊光) [this message]
2025-01-22 13:59 ` [PATCH v8 5/5] arm64: dts: mediatek: mt8365: Add support for camera Julien Stephan
2025-03-20 3:53 ` CK Hu (胡俊光)
2025-01-23 15:57 ` [PATCH v8 0/5] Add Mediatek ISP3.0 Rob Herring (Arm)
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=9e9fd35b62cb1c9e234be0ff432aa4a965801e08.camel@mediatek.com \
--to=ck.hu@mediatek.com \
--cc=Andy.Hsieh@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fsylvestre@baylibre.com \
--cc=jstephan@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=laurent.pinchart@ideasonboard.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=paul.elder@ideasonboard.com \
--cc=pnguyen@baylibre.com \
--cc=robh@kernel.org \
/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®