mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ALOK TIWARI <alok.a.tiwari@oracle.com>
To: "Jacopo Mondi" <jacopo.mondi+renesas@ideasonboard.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v7 5/5] media: vsp1: Add VSPX support
Date: Wed, 2 Apr 2025 11:44:25 +0530	[thread overview]
Message-ID: <b32309c6-617b-4dbe-a49e-8a1b9a56a327@oracle.com> (raw)
In-Reply-To: <20250401-v4h-iif-v7-5-cc547c0bddd5@ideasonboard.com>

Hi Jacopo,

On 01-04-2025 19:52, Jacopo Mondi wrote:
> Add support for VSPX, a specialized version of the VSP2 that
> transfer data to the ISP. The VSPX is composed by two RPF units
> to read data from external memory and an IIF instance that performs
> transfer towards the ISP.
> 
> The VSPX is supported through a newly introduced vsp1_vspx.c file that
> exposes two interfaces: vsp1_vspx interface, declared in vsp1_vspx.h
> for the vsp1 core to initialize and cleanup the VSPX, and a vsp1_isp
> interface, declared in include/media/vsp1.h for the ISP driver to
> control the VSPX operations.
> 
> Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
> ---
>   drivers/media/platform/renesas/vsp1/Makefile    |   1 +
>   drivers/media/platform/renesas/vsp1/vsp1.h      |   1 +
>   drivers/media/platform/renesas/vsp1/vsp1_drv.c  |  13 +-
>   drivers/media/platform/renesas/vsp1/vsp1_regs.h |   1 +
>   drivers/media/platform/renesas/vsp1/vsp1_vspx.c | 604 ++++++++++++++++++++++++
>   drivers/media/platform/renesas/vsp1/vsp1_vspx.h |  86 ++++
>   include/media/vsp1.h                            |  73 +++
>   7 files changed, 778 insertions(+), 1 deletion(-)
> 

> +
> +/**
> + * vsp1_isp_alloc_buffers - Allocate buffers in the VSPX address space
> + *
> + * Allocate buffers that will be later accessed by the VSPX.
> + *
> + * @dev: The VSP1 struct device
> + * @size: The size of the buffer to be allocated by the VSPX
> + * @buffer_desc: The allocated buffer description, will be filled with the
> + *		 buffer CPU-mapped address and the bus address
> + *
> + * Return: %0 on success or a negative error code on failure
> + */
> +int vsp1_isp_alloc_buffers(struct device *dev, size_t size,
> +			   struct vsp1_isp_buffer_desc *buffer_desc)
> +{
> +	struct device *bus_master = vsp1_isp_get_bus_master(dev);
> +
> +	if (IS_ERR_OR_NULL(bus_master))
> +		return -ENODEV;
> +
> +	buffer_desc->cpu_addr = dma_alloc_coherent(bus_master, size,
> +						   &buffer_desc->dma_addr,
> +						   GFP_KERNEL);
> +	if (IS_ERR_OR_NULL(buffer_desc->cpu_addr))
> +		return -EINVAL;
why use -EINVAL instead -ENOMEM

Since dma_alloc_coherent() never returns error-encoded pointers
IS_ERR(ptr) check is not meaningless here ?
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(vsp1_isp_alloc_buffers);
> +
...

> + * struct vsp1_vspx_frame_end - VSPX frame end callback data
> + *
> + * @vspx_frame_end: Frame end callback. Called after a transfer job has been
> + *		    completed. If the job includes both a ConfigDMA and a
> + *		    RAW image, the callback is called after both have been
> + *		    transferred
> + * @frame_end_data: Frame end callback data, passed to vspx_frame_end
> + */
> +struct vsp1_vspx_frame_end {
> +	void (*vspx_frame_end)(void *data);
> +	void *frame_end_data;
> +};
> +
> +int vsp1_isp_init(struct device *dev);
> +struct device *vsp1_isp_get_bus_master(struct device *dev);
> +int vsp1_isp_alloc_buffers(struct device *dev, size_t size,
> +			   struct vsp1_isp_buffer_desc *buffer_desc);
> +int vsp1_isp_configure(struct device *dev,
> +		       const struct v4l2_pix_format_mplane *fmt);
> +int vsp1_isp_start_streaming(struct device *dev,
> +			     struct vsp1_vspx_frame_end *frame_end,
> +			     bool enable);
> +int vsp1_isp_job_prepare(struct device *dev,
> +			 const struct vsp1_isp_job_desc *desc);
> +void vsp1_isp_job_run(struct device *dev);
> +
>   #endif /* __MEDIA_VSP1_H__ */
> 

Thanks,
Alok

  parent reply	other threads:[~2025-04-02  6:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01 14:22 [PATCH v7 0/5] media: renesas: vsp1: Add support for VSPX and IIF Jacopo Mondi
2025-04-01 14:22 ` [PATCH v7 1/5] media: vsp1: Add support IIF ISP Interface Jacopo Mondi
2025-04-01 14:22 ` [PATCH v7 2/5] media: vsp1: dl: Use singleshot DL for VSPX Jacopo Mondi
2025-04-01 14:22 ` [PATCH v7 3/5] media: vsp1: wpf: Propagate vsp1_rwpf_init_ctrls() Jacopo Mondi
2025-04-01 20:08   ` Niklas Söderlund
2025-04-01 14:22 ` [PATCH v7 4/5] media: vsp1: rwpf: Support operations with IIF Jacopo Mondi
2025-04-01 14:22 ` [PATCH v7 5/5] media: vsp1: Add VSPX support Jacopo Mondi
2025-04-01 20:07   ` Niklas Söderlund
2025-04-23 21:11     ` Laurent Pinchart
2025-04-01 21:33   ` kernel test robot
2025-04-02  6:14   ` ALOK TIWARI [this message]
2025-04-23 21:10   ` Laurent Pinchart
2025-04-24 13:18     ` Jacopo Mondi
2025-04-24 13:27       ` Laurent Pinchart
2025-04-23 21:14 ` [PATCH v7 0/5] media: renesas: vsp1: Add support for VSPX and IIF Laurent Pinchart
2025-04-24  7:28   ` Jacopo Mondi

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=b32309c6-617b-4dbe-a49e-8a1b9a56a327@oracle.com \
    --to=alok.a.tiwari@oracle.com \
    --cc=jacopo.mondi+renesas@ideasonboard.com \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    /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®