From: Paul Elder <paul.elder@ideasonboard.com>
To: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Sakari Ailus <sakari.ailus@iki.fi>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Stefan Klug <stefan.klug@ideasonboard.com>,
Daniel Scally <dan.scally@ideasonboard.com>,
Kieran Bingham <kieran.bingham@ideasonboard.com>,
Umang Jain <umang.jain@ideasonboard.com>,
Dafna Hirschfeld <dafna@fastmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Heiko Stuebner <heiko@sntech.de>
Subject: Re: [PATCH v3 3/7] media: rkisp1: Add struct rkisp1_params_buffer
Date: Wed, 3 Jul 2024 16:56:00 +0900 [thread overview]
Message-ID: <ZoUEEBfmNV_KXS_-@pyrite.rasen.tech> (raw)
In-Reply-To: <20240701165222.205510-4-jacopo.mondi@ideasonboard.com>
On Mon, Jul 01, 2024 at 06:52:17PM +0200, Jacopo Mondi wrote:
> Create the 'struct rkisp1_params_buffer' type that wraps a
> vb2_v4l2_buffer to prepare to hold a copy of the parameters buffer that
> will be used to cache the user-provided configuration buffer in the
> following patches.
>
> Replace usage of 'struct rkisp1_buffer' with 'struct
> rkisp1_params_buffer' in rkisp1-params.c to prepare for that.
>
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
> ---
> .../platform/rockchip/rkisp1/rkisp1-common.h | 14 ++++++++++++-
> .../platform/rockchip/rkisp1/rkisp1-params.c | 21 ++++++++++---------
> 2 files changed, 24 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
> index 26573f6ae575..a615bbb0255e 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
> @@ -232,7 +232,7 @@ struct rkisp1_vdev_node {
>
> /*
> * struct rkisp1_buffer - A container for the vb2 buffers used by the video devices:
> - * params, stats, mainpath, selfpath
> + * stats, mainpath, selfpath
> *
> * @vb: vb2 buffer
> * @queue: entry of the buffer in the queue
> @@ -244,6 +244,18 @@ struct rkisp1_buffer {
> dma_addr_t buff_addr[VIDEO_MAX_PLANES];
> };
>
> +/*
> + * struct rkisp1_params_buffer - A container for the vb2 buffers used by the
> + * params video device
> + *
> + * @vb: vb2 buffer
> + * @queue: entry of the buffer in the queue
> + */
> +struct rkisp1_params_buffer {
> + struct vb2_v4l2_buffer vb;
> + struct list_head queue;
> +};
> +
> /*
> * struct rkisp1_dummy_buffer - A buffer to write the next frame to in case
> * there are no vb2 buffers available.
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
> index 173d1ea41874..2844e55bc4f2 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
> @@ -1502,20 +1502,21 @@ static void rkisp1_isp_isr_meas_config(struct rkisp1_params *params,
> }
>
> static bool rkisp1_params_get_buffer(struct rkisp1_params *params,
> - struct rkisp1_buffer **buf,
> + struct rkisp1_params_buffer **buf,
> struct rkisp1_params_cfg **cfg)
> {
> if (list_empty(¶ms->params))
> return false;
>
> - *buf = list_first_entry(¶ms->params, struct rkisp1_buffer, queue);
> + *buf = list_first_entry(¶ms->params, struct rkisp1_params_buffer,
> + queue);
> *cfg = vb2_plane_vaddr(&(*buf)->vb.vb2_buf, 0);
>
> return true;
> }
>
> static void rkisp1_params_complete_buffer(struct rkisp1_params *params,
> - struct rkisp1_buffer *buf,
> + struct rkisp1_params_buffer *buf,
> unsigned int frame_sequence)
> {
> list_del(&buf->queue);
> @@ -1528,7 +1529,7 @@ void rkisp1_params_isr(struct rkisp1_device *rkisp1)
> {
> struct rkisp1_params *params = &rkisp1->params;
> struct rkisp1_params_cfg *new_params;
> - struct rkisp1_buffer *cur_buf;
> + struct rkisp1_params_buffer *cur_buf;
>
> spin_lock(¶ms->config_lock);
>
> @@ -1604,7 +1605,7 @@ void rkisp1_params_pre_configure(struct rkisp1_params *params,
> {
> struct rkisp1_cif_isp_hst_config hst = rkisp1_hst_params_default_config;
> struct rkisp1_params_cfg *new_params;
> - struct rkisp1_buffer *cur_buf;
> + struct rkisp1_params_buffer *cur_buf;
>
> params->quantization = quantization;
> params->ycbcr_encoding = ycbcr_encoding;
> @@ -1650,7 +1651,7 @@ void rkisp1_params_pre_configure(struct rkisp1_params *params,
> void rkisp1_params_post_configure(struct rkisp1_params *params)
> {
> struct rkisp1_params_cfg *new_params;
> - struct rkisp1_buffer *cur_buf;
> + struct rkisp1_params_buffer *cur_buf;
>
> spin_lock_irq(¶ms->config_lock);
>
> @@ -1821,8 +1822,8 @@ static int rkisp1_params_vb2_queue_setup(struct vb2_queue *vq,
> static void rkisp1_params_vb2_buf_queue(struct vb2_buffer *vb)
> {
> struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
> - struct rkisp1_buffer *params_buf =
> - container_of(vbuf, struct rkisp1_buffer, vb);
> + struct rkisp1_params_buffer *params_buf =
> + container_of(vbuf, struct rkisp1_params_buffer, vb);
> struct vb2_queue *vq = vb->vb2_queue;
> struct rkisp1_params *params = vq->drv_priv;
>
> @@ -1844,7 +1845,7 @@ static int rkisp1_params_vb2_buf_prepare(struct vb2_buffer *vb)
> static void rkisp1_params_vb2_stop_streaming(struct vb2_queue *vq)
> {
> struct rkisp1_params *params = vq->drv_priv;
> - struct rkisp1_buffer *buf;
> + struct rkisp1_params_buffer *buf;
> LIST_HEAD(tmp_list);
>
> /*
> @@ -1890,7 +1891,7 @@ static int rkisp1_params_init_vb2_queue(struct vb2_queue *q,
> q->drv_priv = params;
> q->ops = &rkisp1_params_vb2_ops;
> q->mem_ops = &vb2_vmalloc_memops;
> - q->buf_struct_size = sizeof(struct rkisp1_buffer);
> + q->buf_struct_size = sizeof(struct rkisp1_params_buffer);
> q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
> q->lock = &node->vlock;
>
> --
> 2.45.2
>
next prev parent reply other threads:[~2024-07-03 7:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 16:52 [PATCH v3 0/7] media: rkisp1: Implement support for extensible parameters Jacopo Mondi
2024-07-01 16:52 ` [PATCH v3 1/7] uapi: rkisp1-config: Add extensible parameters format Jacopo Mondi
2024-07-03 7:51 ` Paul Elder
2024-07-01 16:52 ` [PATCH v3 2/7] uapi: videodev2: Add V4L2_META_FMT_RK_ISP1_EXT_PARAMS Jacopo Mondi
2024-07-01 16:52 ` [PATCH v3 3/7] media: rkisp1: Add struct rkisp1_params_buffer Jacopo Mondi
2024-07-03 7:56 ` Paul Elder [this message]
2024-07-01 16:52 ` [PATCH v3 4/7] media: rkisp1: Copy the parameters buffer Jacopo Mondi
2024-07-01 16:52 ` [PATCH v3 5/7] media: rkisp1: Cache the currently active format Jacopo Mondi
2024-07-01 16:52 ` [PATCH v3 6/7] media: rkisp1: Implement extensible params support Jacopo Mondi
2024-07-01 16:52 ` [PATCH v3 7/7] media: rkisp1: Implement s_fmt/try_fmt 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=ZoUEEBfmNV_KXS_-@pyrite.rasen.tech \
--to=paul.elder@ideasonboard.com \
--cc=dafna@fastmail.com \
--cc=dan.scally@ideasonboard.com \
--cc=heiko@sntech.de \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jacopo.mondi@ideasonboard.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@iki.fi \
--cc=stefan.klug@ideasonboard.com \
--cc=umang.jain@ideasonboard.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