From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Benoit Parrot <bparrot@ti.com>, Hans Verkuil <hverkuil@xs4all.nl>,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
<linux-media@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, Jyri Sarha <jsarha@ti.com>,
Peter Ujfalusi <peter.ujfalusi@ti.com>
Subject: Re: [Patch 2/2] media: ti-vpe: vpe: allow use of user specified stride
Date: Wed, 15 Feb 2017 13:22:42 +0200 [thread overview]
Message-ID: <4f5aa907-59fe-0230-7108-ef292978fcde@ti.com> (raw)
In-Reply-To: <20170213130658.31907-3-bparrot@ti.com>
[-- Attachment #1.1: Type: text/plain, Size: 1797 bytes --]
Hi,
On 13/02/17 15:06, Benoit Parrot wrote:
> Bytesperline/stride was always overwritten by VPE to the most
> adequate value based on needed alignment.
>
> However in order to make use of arbitrary size DMA buffer it
> is better to use the user space provide stride instead.
>
> The driver will still calculate an appropriate stride but will
> use the provided one when it is larger than the calculated one.
>
> Signed-off-by: Benoit Parrot <bparrot@ti.com>
> ---
> drivers/media/platform/ti-vpe/vpe.c | 28 ++++++++++++++++++++--------
> 1 file changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
> index 2dd67232b3bc..c47151495b6f 100644
> --- a/drivers/media/platform/ti-vpe/vpe.c
> +++ b/drivers/media/platform/ti-vpe/vpe.c
> @@ -1597,6 +1597,7 @@ static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f,
> struct v4l2_plane_pix_format *plane_fmt;
> unsigned int w_align;
> int i, depth, depth_bytes, height;
> + unsigned int stride = 0;
>
> if (!fmt || !(fmt->types & type)) {
> vpe_err(ctx->dev, "Fourcc format (0x%08x) invalid.\n",
> @@ -1683,16 +1684,27 @@ static int __vpe_try_fmt(struct vpe_ctx *ctx, struct v4l2_format *f,
> plane_fmt = &pix->plane_fmt[i];
> depth = fmt->vpdma_fmt[i]->depth;
>
> - if (i == VPE_LUMA)
> - plane_fmt->bytesperline = (pix->width * depth) >> 3;
> - else
> - plane_fmt->bytesperline = pix->width;
> + stride = (pix->width * fmt->vpdma_fmt[VPE_LUMA]->depth) >> 3;
> + if (stride > plane_fmt->bytesperline)
> + plane_fmt->bytesperline = stride;
The old code calculates different bytes per line for luma and chroma,
but the new one calculates only for luma. Is that correct?
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-02-15 11:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 13:06 [Patch 0/2] media: ti-vpe: allow " Benoit Parrot
2017-02-13 13:06 ` [Patch 1/2] media: ti-vpe: vpdma: add support for " Benoit Parrot
2017-02-13 13:06 ` [Patch 2/2] media: ti-vpe: vpe: allow use of " Benoit Parrot
2017-02-15 11:22 ` Tomi Valkeinen [this message]
2017-02-15 14:34 ` Benoit Parrot
2017-02-17 9:45 ` [Patch 0/2] media: ti-vpe: allow " Tomi Valkeinen
2017-03-02 19:08 ` Benoit Parrot
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=4f5aa907-59fe-0230-7108-ef292978fcde@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=bparrot@ti.com \
--cc=hverkuil@xs4all.nl \
--cc=jsarha@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=peter.ujfalusi@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 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®