mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Du, Bin" <bin.du@amd.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"hverkuil@xs4all.nl" <hverkuil@xs4all.nl>,
	"laurent.pinchart+renesas@ideasonboard.com"
	<laurent.pinchart+renesas@ideasonboard.com>,
	"bryan.odonoghue@linaro.org" <bryan.odonoghue@linaro.org>,
	"prabhakar.mahadev-lad.rj@bp.renesas.com"
	<prabhakar.mahadev-lad.rj@bp.renesas.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"sultan@kerneltoast.com" <sultan@kerneltoast.com>,
	"Nirujogi, Pratap" <Pratap.Nirujogi@amd.com>,
	"Chan, Benjamin (Koon Pan)" <Benjamin.Chan@amd.com>,
	"Li, King" <King.Li@amd.com>,
	"Rosikopulos, Gjorgji" <Gjorgji.Rosikopulos@amd.com>,
	"Jawich, Phil" <Phil.Jawich@amd.com>,
	"Antony, Dominic" <Dominic.Antony@amd.com>,
	"Limonciello, Mario" <Mario.Limonciello@amd.com>,
	"Gong, Richard" <Richard.Gong@amd.com>,
	"Tsao, Anson" <anson.tsao@amd.com>,
	Svetoslav Stoilov <Svetoslav.Stoilov@amd.com>,
	Alexey Zagorodnikov <xglooom@gmail.com>
Subject: Re: [PATCH v7 5/7] media: platform: amd: isp4 video node and buffers handling added
Date: Tue, 3 Feb 2026 14:32:52 +0800	[thread overview]
Message-ID: <35075404-d0ef-4571-bb86-05f63f95a444@amd.com> (raw)
In-Reply-To: <aXvOfXNn2gGsmkfg@valkosipuli.retiisi.eu>

Thank you, Sakari. I sincerely appreciate you taking the time from your 
busy schedule to provide the valuable feedback.

On 1/30/2026 5:17 AM, Sakari Ailus wrote:
> Hi Bin,
> 
> On Fri, Jan 09, 2026 at 06:08:00PM +0800, Du, Bin wrote:
>>>> +static const struct vb2_mem_ops isp4vid_vb2_memops = {
>>>> +	.alloc		= isp4vid_vb2_alloc,
>>>> +	.put		= isp4vid_vb2_put,
>>>> +#ifdef CONFIG_HAS_DMA
>>>> +	.get_dmabuf	= isp4vid_vb2_get_dmabuf,
>>>> +#endif
>>>> +	.map_dmabuf	= isp4vid_vb2_map_dmabuf,
>>>> +	.unmap_dmabuf	= isp4vid_vb2_unmap_dmabuf,
>>>> +	.attach_dmabuf	= isp4vid_vb2_attach_dmabuf,
>>>> +	.detach_dmabuf	= isp4vid_vb2_detach_dmabuf,
>>>> +	.vaddr		= isp4vid_vb2_vaddr,
>>>> +	.mmap		= isp4vid_vb2_mmap,
>>>> +	.num_users	= isp4vid_vb2_num_users,
>>>> +};
>>>
>>> Could you elaborate a bit why do you need your own videobuf mem ops?
>>>
>>
>> Sure, ISP FW/HW can access system memory only via GPU VA, not system VA, so
>> vb2_vmalloc_memops can't be used directly, we need to base on it to
>> implement our own videobuf mem ops to support both GPU VA and system VA.
> 
> It's fine to use other virtual addresses than system ones (a lot of other
> drivers do in fact, e.g. IPU6), you generally don't need to add new memory
> types for this.
> 
> ...
> 

Thanks for the guidance, will work on it.

>>>> +struct isp4vid_capture_buffer {
>>>> +	/*
>>>> +	 * struct vb2_v4l2_buffer must be the first element
>>>> +	 * the videobuf2 framework will allocate this struct based on
>>>> +	 * buf_struct_size and use the first sizeof(struct vb2_buffer) bytes of
>>>> +	 * memory as a vb2_buffer
>>>> +	 */
>>>> +	struct vb2_v4l2_buffer vb2;
>>>> +	struct isp4if_img_buf_info img_buf;
>>>> +	struct list_head list;
>>>> +};
>>>> +
>>>> +struct isp4vid_ops {
>>>> +	int (*send_buffer)(struct v4l2_subdev *sd,
>>>> +			   struct isp4if_img_buf_info *img_buf);
>>>
>>> Is there a reason why isp4sd_ioc_send_img_buf() isn't called directly?
>>>
>>
>> In our design, isp4sd serves as the upper layer of video. Therefore, isp4sd
>> can directly call functions within video, but not vice versa, This callback
>> mechanism is implemented to support the call from video to isp4sd by
>> indirect way.
> 
> You still have a single module, don't you? Thus you can make a direct
> function call. Only use a callback pointer when you actually need one.
> 

Yes, exactly, will switch to direct function call which is more 
straightforward.

>>
>>>> +};
>>>> +
>>>> +struct isp4vid_dev {
>>>> +	struct video_device vdev;
>>>> +	struct media_pad vdev_pad;
>>>> +	struct v4l2_pix_format format;
>>>> +
>>>> +	/* mutex that protects vbq */
>>>> +	struct mutex vbq_lock;
>>>> +	struct vb2_queue vbq;
>>>> +
>>>> +	/* mutex that protects buf_list */
>>>> +	struct mutex buf_list_lock;
>>>> +	struct list_head buf_list;
>>>> +
>>>> +	u32 sequence;
>>>> +	bool stream_started;
>>>> +
>>>> +	struct media_pipeline pipe;
> 
> You might not need this for the time being at least.
> 

Sure, will drop it.

>>>> +	struct device *dev;
>>>> +	struct v4l2_subdev *isp_sdev;
>>>> +	struct v4l2_fract timeperframe;
>>>> +
>>>> +	/* Callback operations */
>>>> +	const struct isp4vid_ops *ops;
>>>> +};
>>>> +
>>>> +int isp4vid_dev_init(struct isp4vid_dev *isp_vdev,
>>>> +		     struct v4l2_subdev *isp_sdev,
>>>> +		     const struct isp4vid_ops *ops);
>>>> +
>>>> +void isp4vid_dev_deinit(struct isp4vid_dev *isp_vdev);
>>>> +
>>>> +void isp4vid_handle_frame_done(struct isp4vid_dev *isp_vdev,
>>>> +			       const struct isp4if_img_buf_info *img_buf);
>>>> +
>>>> +#endif /* _ISP4_VIDEO_H_ */
> 

-- 
Regards,
Bin


  reply	other threads:[~2026-02-03  6:33 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16  9:13 [PATCH v7 0/7] Add AMD ISP4 driver Bin Du
2025-12-16  9:13 ` [PATCH v7 1/7] media: platform: amd: Introduce amd isp4 capture driver Bin Du
2025-12-22  9:23   ` Sakari Ailus
2026-01-06  8:30     ` Du, Bin
2025-12-16  9:13 ` [PATCH v7 2/7] media: platform: amd: low level support for isp4 firmware Bin Du
2025-12-16  9:13 ` [PATCH v7 3/7] media: platform: amd: Add isp4 fw and hw interface Bin Du
2025-12-22  9:37   ` Sakari Ailus
2026-01-07  8:44     ` Du, Bin
2026-01-14 20:55       ` Sakari Ailus
2026-01-15  2:24         ` Du, Bin
2026-01-20  9:22       ` Du, Bin
2026-01-27  8:38         ` Du, Bin
2026-02-02  9:10         ` Sakari Ailus
2026-02-03  6:37           ` Du, Bin
2025-12-16  9:13 ` [PATCH v7 4/7] media: platform: amd: isp4 subdev and firmware loading handling added Bin Du
2025-12-22 10:11   ` Sakari Ailus
2026-01-07  7:33     ` Sultan Alsawaf
2026-01-14 21:03       ` Sakari Ailus
2026-01-14 21:08         ` Mario Limonciello
2026-01-15  5:56           ` Du, Bin
2026-01-15  7:21         ` Sultan Alsawaf
2026-01-20  9:29           ` Du, Bin
2026-01-27  8:39             ` Du, Bin
2026-01-15 10:36         ` Du, Bin
2026-01-14 10:34     ` Du, Bin
2026-01-14 21:07       ` Sakari Ailus
2026-01-15  7:51         ` Du, Bin
2026-01-14  9:45   ` Markus Elfring
2025-12-16  9:13 ` [PATCH v7 5/7] media: platform: amd: isp4 video node and buffers " Bin Du
2025-12-22 17:07   ` Sakari Ailus
2026-01-09 10:08     ` Du, Bin
2026-01-29 21:17       ` Sakari Ailus
2026-02-03  6:32         ` Du, Bin [this message]
2025-12-16  9:13 ` [PATCH v7 6/7] media: platform: amd: isp4 debug fs logging and more descriptive errors Bin Du
2025-12-16  9:13 ` [PATCH v7 7/7] Documentation: add documentation of AMD isp 4 driver Bin Du
2025-12-17  7:36 ` [PATCH v7 0/7] Add AMD ISP4 driver Sultan Alsawaf
2025-12-17  7:47   ` Du, Bin
2025-12-17 10:29 ` Du, Bin
2025-12-17 11:04   ` Sakari Ailus
2025-12-31  9:03 ` Kate Hsuan
2026-01-06  5:49   ` Kate Hsuan
2026-01-06  8:35     ` Du, Bin
2026-01-13 14:11       ` Kate Hsuan
2026-01-13 17:14         ` Nirujogi, Pratap
2026-01-14  8:59           ` Kate Hsuan
2026-01-15  6:47             ` Du, Bin

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=35075404-d0ef-4571-bb86-05f63f95a444@amd.com \
    --to=bin.du@amd.com \
    --cc=Benjamin.Chan@amd.com \
    --cc=Dominic.Antony@amd.com \
    --cc=Gjorgji.Rosikopulos@amd.com \
    --cc=King.Li@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Phil.Jawich@amd.com \
    --cc=Pratap.Nirujogi@amd.com \
    --cc=Richard.Gong@amd.com \
    --cc=Svetoslav.Stoilov@amd.com \
    --cc=anson.tsao@amd.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=sakari.ailus@iki.fi \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sultan@kerneltoast.com \
    --cc=xglooom@gmail.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®