From: Benoit Parrot <bparrot@ti.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: <linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [Patch v2 16/21] media: ti-vpe: vpe: use standard struct instead of duplicating fields
Date: Mon, 7 Oct 2019 07:45:29 -0500 [thread overview]
Message-ID: <20191007124529.nnrzx2btnraimivq@ti.com> (raw)
In-Reply-To: <cb01914f-3bca-2558-2b07-86ddbfc9626e@xs4all.nl>
Hans Verkuil <hverkuil@xs4all.nl> wrote on Mon [2019-Oct-07 09:57:26 +0200]:
> On 10/4/19 6:29 PM, Benoit Parrot wrote:
> > For each queue we need to maintain resolutions, pixel format,
> > bytesperline, sizeimage, colorspace, etc.
> >
> > Instead of manually adding more entries in the vpe_q_data struct, it is
> > better to just add a "struct v4l2_format" member and use that to store
> > all needed information.
> >
> > Signed-off-by: Benoit Parrot <bparrot@ti.com>
> > ---
> > drivers/media/platform/ti-vpe/vpe.c | 185 ++++++++++++++--------------
> > 1 file changed, 91 insertions(+), 94 deletions(-)
> >
> > diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
> > index d7f8eb901475..5b1e9908fff2 100644
> > --- a/drivers/media/platform/ti-vpe/vpe.c
> > +++ b/drivers/media/platform/ti-vpe/vpe.c
> > @@ -319,14 +319,9 @@ static struct vpe_fmt vpe_formats[] = {
> > * there is one source queue and one destination queue for each m2m context.
> > */
> > struct vpe_q_data {
> > - unsigned int width; /* frame width */
> > - unsigned int height; /* frame height */
> > - unsigned int nplanes; /* Current number of planes */
> > - unsigned int bytesperline[VPE_MAX_PLANES]; /* bytes per line in memory */
> > - enum v4l2_colorspace colorspace;
> > - enum v4l2_field field; /* supported field value */
> > + /* current v4l2 format info */
> > + struct v4l2_format format;
>
> Wouldn't it make more sense to use struct v4l2_pix_format_mplane? That avoid having to
> use the '.fmt.pix_mp' sequence every time you need to access it.
Maybe, I chose "struct v4l2_format" because that is the parameter type used
in all related IOCTL. But I guess I can change it, if it make the code
cleaner :).
Benoit
>
> Regards,
>
> Hans
>
next prev parent reply other threads:[~2019-10-07 12:42 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-04 16:29 [Patch v2 00/21] media: vpe: maintenance Benoit Parrot
2019-10-04 16:29 ` [Patch v2 01/21] media: ti-vpe: Fix a parallel build issue Benoit Parrot
2019-10-04 16:29 ` [Patch v2 02/21] media: ti-vpe: vpe: Fix Motion Vector vpdma stride Benoit Parrot
2019-10-04 16:29 ` [Patch v2 03/21] media: ti-vpe: vpe: Add missing null pointer checks Benoit Parrot
2019-10-04 16:29 ` [Patch v2 04/21] media: ti-vpe: vpe: Remove unnecessary use of container_of Benoit Parrot
2019-10-04 16:29 ` [Patch v2 05/21] media: ti-vpe: Add support for SEQ_BT Benoit Parrot
2019-10-04 16:29 ` [Patch v2 06/21] media: ti-vpe: Add support for NV21 format Benoit Parrot
2019-10-04 16:29 ` [Patch v2 07/21] media: ti-vpe: Set MAX height supported to 2048 pixels Benoit Parrot
2019-10-04 16:29 ` [Patch v2 08/21] media: ti-vpe: vpe: fix a v4l2-compliance failure causing a kernel panic Benoit Parrot
2019-10-04 16:29 ` [Patch v2 09/21] media: ti-vpe: vpe: fix a v4l2-compliance warning about invalid pixel format Benoit Parrot
2019-10-04 16:29 ` [Patch v2 10/21] media: ti-vpe: vpe: Make sure YUYV is set as default format Benoit Parrot
2019-10-04 16:29 ` [Patch v2 11/21] media: ti-vpe: vpe: fix a v4l2-compliance failure about invalid sizeimage Benoit Parrot
2019-10-04 16:29 ` [Patch v2 12/21] media: ti-vpe: vpe: fix a v4l2-compliance failure about frame sequence number Benoit Parrot
2019-10-04 16:29 ` [Patch v2 13/21] media: ti-vpe: vpe: ensure buffers are cleaned up properly in abort cases Benoit Parrot
2019-10-04 16:29 ` [Patch v2 14/21] media: ti-vpe: vpdma: Use fixed type for address in descriptor Benoit Parrot
2019-10-04 16:29 ` [Patch v2 15/21] media: ti-vpe: Set the DMA mask and coherent mask Benoit Parrot
2019-10-04 16:29 ` [Patch v2 16/21] media: ti-vpe: vpe: use standard struct instead of duplicating fields Benoit Parrot
2019-10-07 7:57 ` Hans Verkuil
2019-10-07 12:45 ` Benoit Parrot [this message]
2019-10-04 16:29 ` [Patch v2 17/21] media: ti-vpe: vpe: fix v4l2_compliance issue related to xfer_func Benoit Parrot
2019-10-04 16:29 ` [Patch v2 18/21] media: ti-vpe: csc: rgb-to-yuv HD full range coeff are wrong Benoit Parrot
2019-10-04 16:29 ` [Patch v2 19/21] media: v4l2-common: add pixel encoding support Benoit Parrot
2019-10-05 0:46 ` kbuild test robot
2019-10-05 2:45 ` kbuild test robot
2019-10-07 8:06 ` Hans Verkuil
2019-10-07 12:52 ` Benoit Parrot
2019-10-04 16:29 ` [Patch v2 20/21] media: v4l2-common: add RGB565 and RGB55 to v4l2_format_info Benoit Parrot
2019-10-04 16:29 ` [Patch v2 21/21] media: ti-vpe: vpe: don't rely on colorspace member for conversion 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=20191007124529.nnrzx2btnraimivq@ti.com \
--to=bparrot@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
/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®