[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAOTY_8z9YDrC6yJ80TUJQ6FmU6wQOdgGJ0eCN15gu0LYds0ig@mail.gmail.com>
Date: Sun, 2 Jul 2023 17:50:47 +0800
From: Chun-Kuang Hu <chunkuang.hu@...nel.org>
To: Julien Stephan <jstephan@...libre.com>
Cc: Phi-bang Nguyen <pnguyen@...libre.com>,
Florian Sylvestre <fsylvestre@...libre.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Andy Hsieh <andy.hsieh@...iatek.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Conor Dooley <conor+dt@...nel.org>,
daoyuan huang <daoyuan.huang@...iatek.com>,
devicetree@...r.kernel.org,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-mediatek@...ts.infradead.org, linux-media@...r.kernel.org,
Louis Kuo <louis.kuo@...iatek.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Moudy Ho <moudy.ho@...iatek.com>,
Ping-Hsun Wu <ping-hsun.wu@...iatek.com>,
Rob Herring <robh+dt@...nel.org>,
Vasily Gorbik <gor@...ux.ibm.com>
Subject: Re: [PATCH v2 4/4] media: platform: mediatek: isp_30: add mediatek
ISP3.0 camsv
Hi, Julien:
Julien Stephan <jstephan@...libre.com> 於 2023年6月30日 週五 下午6:06寫道:
>
> From: Phi-bang Nguyen <pnguyen@...libre.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@...libre.com>
> Signed-off-by: Florian Sylvestre <fsylvestre@...libre.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Signed-off-by: Julien Stephan <jstephan@...libre.com>
> ---
[snip]
> +
> +static irqreturn_t isp_irq_camsv30(int irq, void *data)
> +{
> + struct mtk_cam_dev *cam_dev = (struct mtk_cam_dev *)data;
> + struct mtk_cam_dev_buffer *buf;
> + unsigned long flags = 0;
> + unsigned int irq_status;
> +
> + spin_lock_irqsave(&cam_dev->irqlock, flags);
> +
> + irq_status = mtk_camsv30_read(cam_dev, CAMSV_INT_STATUS);
> +
> + if (irq_status & INT_ST_MASK_CAMSV_ERR) {
> + dev_err(cam_dev->dev, "irq error 0x%x\n",
> + (unsigned int)(irq_status & INT_ST_MASK_CAMSV_ERR));
> + }
> +
> + /* De-queue frame */
> + if (irq_status & CAMSV_IRQ_PASS1_DON) {
> + cam_dev->sequence++;
> +
> + if (!cam_dev->is_dummy_used) {
> + buf = list_first_entry_or_null(&cam_dev->buf_list,
> + struct mtk_cam_dev_buffer,
> + list);
> + if (buf) {
> + buf->v4l2_buf.sequence = cam_dev->sequence;
> + buf->v4l2_buf.vb2_buf.timestamp = ktime_get_ns();
> + vb2_buffer_done(&buf->v4l2_buf.vb2_buf,
> + VB2_BUF_STATE_DONE);
> + list_del(&buf->list);
> + }
> + }
> +
> + if (list_empty(&cam_dev->buf_list)) {
> + (*cam_dev->hw_functions->mtk_cam_update_buffers_add)
> + (cam_dev, &cam_dev->dummy);
It's not necessary to use function pointer. Call
mtk_camsv30_update_buffers_add() directly.
Regards,
Chun-Kuang.
> + cam_dev->is_dummy_used = true;
> + } else {
> + buf = list_first_entry_or_null(&cam_dev->buf_list,
> + struct mtk_cam_dev_buffer,
> + list);
> + (*cam_dev->hw_functions->mtk_cam_update_buffers_add)
> + (cam_dev, buf);
> + cam_dev->is_dummy_used = false;
> + }
> + }
> +
> + spin_unlock_irqrestore(&cam_dev->irqlock, flags);
> +
> + return IRQ_HANDLED;
> +}
> +
Powered by blists - more mailing lists