From: Hans Verkuil <hverkuil@xs4all.nl>
To: Nikhil Devshatwar <nikhil.nd@ti.com>, linux-media@vger.kernel.org
Subject: Re: [PATCH v3 1/4] media: ti-vpe: Use data offset for getting dma_addr for a plane
Date: Mon, 01 Dec 2014 11:48:05 +0100 [thread overview]
Message-ID: <547C4765.1040807@xs4all.nl> (raw)
In-Reply-To: <1417256860-20233-2-git-send-email-nikhil.nd@ti.com>
On 11/29/2014 11:27 AM, Nikhil Devshatwar wrote:
> The data_offset in v4l2_planes structure will help us point to the start of
> data content for that particular plane. This may be useful when a single
> buffer contains the data for different planes e.g. Y planes of two fields in
> the same buffer. With this, user space can pass queue top field and
> bottom field with same dmafd and different data_offsets.
>
> Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
> ---
> Changes from v2:
> * Use data_offset only for OUTPUT stream buffers
>
> drivers/media/platform/ti-vpe/vpe.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
> index 9a081c2..ba26b83 100644
> --- a/drivers/media/platform/ti-vpe/vpe.c
> +++ b/drivers/media/platform/ti-vpe/vpe.c
> @@ -496,6 +496,14 @@ struct vpe_mmr_adb {
>
> #define VPE_SET_MMR_ADB_HDR(ctx, hdr, regs, offset_a) \
> VPDMA_SET_MMR_ADB_HDR(ctx->mmr_adb, vpe_mmr_adb, hdr, regs, offset_a)
> +
> +static inline dma_addr_t vb2_dma_addr_plus_data_offset(struct vb2_buffer *vb,
> + unsigned int plane_no)
> +{
> + return vb2_dma_contig_plane_dma_addr(vb, plane_no) +
> + vb->v4l2_planes[plane_no].data_offset;
> +}
> +
> /*
> * Set the headers for all of the address/data block structures.
> */
> @@ -1043,7 +1051,7 @@ static void add_in_dtd(struct vpe_ctx *ctx, int port)
>
> vpdma_fmt = fmt->vpdma_fmt[plane];
>
> - dma_addr = vb2_dma_contig_plane_dma_addr(vb, plane);
> + dma_addr = vb2_dma_addr_plus_data_offset(vb, plane);
> if (!dma_addr) {
> vpe_err(ctx->dev,
> "acquiring input buffer(%d) dma_addr failed\n",
>
Should there be a check somewhere that verifies that vb2_get_plane_payload() -
vb->v4l2_planes[plane_no].data_offset is still large enough for the image you
want to copy?
Regards,
Hans
next prev parent reply other threads:[~2014-12-01 10:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-29 10:27 [PATCH v3 0/4] VPE improvements Nikhil Devshatwar
2014-11-29 10:27 ` [PATCH v3 1/4] media: ti-vpe: Use data offset for getting dma_addr for a plane Nikhil Devshatwar
2014-12-01 10:48 ` Hans Verkuil [this message]
2014-12-01 11:00 ` Devshatwar, Nikhil
2014-12-01 11:04 ` Hans Verkuil
2014-12-01 12:05 ` Devshatwar, Nikhil
2014-11-29 10:27 ` [PATCH v3 2/4] media: ti-vpe: Use line average de-interlacing for first 2 frames Nikhil Devshatwar
2014-11-29 10:27 ` [PATCH v3 3/4] media: ti-vpe: Do not perform job transaction atomically Nikhil Devshatwar
2014-11-29 10:27 ` [PATCH v3 4/4] media: ti-vpe: Add support for SEQ_TB buffers Nikhil Devshatwar
2014-12-01 10:52 ` Hans Verkuil
2014-12-02 8:12 ` Devshatwar, Nikhil
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=547C4765.1040807@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=nikhil.nd@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.