From: Vishal Sagar <vsagar@xilinx.com>
To: Joe Perches <joe@perches.com>, Hyun Kwon <hyunk@xilinx.com>,
Vishal Sagar <vishal.sagar@xilinx.com>
Cc: Hyun Kwon <hyunk@xilinx.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Michal Simek <michals@xilinx.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Dinesh Kumar <dineshk@xilinx.com>,
Sandip Kothari <sandipk@xilinx.com>
Subject: RE: [PATCH 2/2] media: v4l: xilinx: Add Xilinx UHD-SDI Rx Subsystem driver
Date: Fri, 14 Jun 2019 12:15:24 +0000 [thread overview]
Message-ID: <CH2PR02MB60885E9B81D89073BC451FC9A7EE0@CH2PR02MB6088.namprd02.prod.outlook.com> (raw)
In-Reply-To: <39e6c0f7d7529da9906a17450a8bcdf416297520.camel@perches.com>
Hi Joe,
Thanks for reviewing.
> -----Original Message-----
> From: linux-media-owner@vger.kernel.org [mailto:linux-media-
> owner@vger.kernel.org] On Behalf Of Joe Perches
> Sent: Friday, June 14, 2019 4:02 AM
> To: Hyun Kwon <hyunk@xilinx.com>; Vishal Sagar <vishal.sagar@xilinx.com>
> Cc: Hyun Kwon <hyunk@xilinx.com>; Laurent Pinchart
> <laurent.pinchart@ideasonboard.com>; Mauro Carvalho Chehab
> <mchehab@kernel.org>; Michal Simek <michals@xilinx.com>; Rob Herring
> <robh+dt@kernel.org>; Mark Rutland <mark.rutland@arm.com>; linux-
> kernel@vger.kernel.org; linux-media@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; devicetree@vger.kernel.org; Dinesh Kumar
> <dineshk@xilinx.com>; Sandip Kothari <sandipk@xilinx.com>
> Subject: Re: [PATCH 2/2] media: v4l: xilinx: Add Xilinx UHD-SDI Rx Subsystem
> driver
>
> EXTERNAL EMAIL
>
> On Thu, 2019-06-13 at 15:05 -0700, Hyun Kwon wrote:
> > On Tue, 2019-06-04 at 06:55:56 -0700, Vishal Sagar wrote:
>
> trivia:
>
> > > diff --git a/drivers/media/platform/xilinx/xilinx-sdirxss.c
> b/drivers/media/platform/xilinx/xilinx-sdirxss.c
> []
> > > +static int xsdirx_get_stream_properties(struct xsdirxss_state *state)
> > > +{
> []
> > > + if (valid & XSDIRX_ST352_VALID_DS1_MASK) {
> > > + payload = xsdirxss_read(core, XSDIRX_ST352_DS1_REG);
> > > + byte1 = (payload >> XST352_PAYLOAD_BYTE1_SHIFT) &
> > > + XST352_PAYLOAD_BYTE_MASK;
>
> Is XST352_PAYLOAD_BYTE_MASK correct ?
> Should it be XST352_PAYLOAD_BYTE1_MASK ?
>
I had thought of it to be a generic mask to extract a byte out of 4 bytes in a ST352 packet.
Hence named it as XST352_PAYLOAD_BYTE_MASK
> > > + active_luma = (payload &
> XST352_BYTE3_ACT_LUMA_COUNT_MASK) >>
> > > + XST352_BYTE3_ACT_LUMA_COUNT_OFFSET;
> > > + pic_type = (payload & XST352_BYTE2_PIC_TYPE_MASK) >>
> > > + XST352_BYTE2_PIC_TYPE_OFFSET;
> > > + framerate = (payload >> XST352_BYTE2_FPS_SHIFT) &
> > > + XST352_BYTE2_FPS_MASK;
> > > + tscan = (payload & XST352_BYTE2_TS_TYPE_MASK) >>
> > > + XST352_BYTE2_TS_TYPE_OFFSET;
> >
> > Please align consistently throughout the patch. I believe the checkpatch
> > --strict warns on these.
>
> I believe not.
>
> Another possibility would be to use a macro like:
>
> #define mask_and_shift(val, type) \
> ((val) & (XST352_ ## type ## _MASK)) >> (XST352_ ## type ## _OFFSET))
>
> > > + sampling = (payload & XST352_BYTE3_COLOR_FORMAT_MASK) >>
> > > + XST352_BYTE3_COLOR_FORMAT_OFFSET;
>
> So these could be something like:
>
> sampling = mask_and_shift(payload, BYTE3_COLOR_FORMAT);
>
This looks like a good way. I will modify this in v2.
I will also modify the XST352_PAYLOAD_BYTE_MASK to
XST352_PAYLOAD_BYTE1_MASK so that this aligns with the macro.
Regards
Vishal Sagar
next prev parent reply other threads:[~2019-06-14 12:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 13:55 [PATCH 0/2] Add support for Xilinx UHD-SDI Receiver subsystem Vishal Sagar
2019-06-04 13:55 ` [PATCH 1/2] media: dt-bindings: media: xilinx: Add Xilinx UHD-SDI Receiver Subsystem Vishal Sagar
2019-07-08 22:50 ` Rob Herring
2019-10-02 7:22 ` Sakari Ailus
2019-06-04 13:55 ` [PATCH 2/2] media: v4l: xilinx: Add Xilinx UHD-SDI Rx Subsystem driver Vishal Sagar
2019-06-05 12:57 ` Hans Verkuil
2019-06-14 11:44 ` Vishal Sagar
2019-06-15 7:55 ` Hans Verkuil
2019-06-18 11:51 ` Vishal Sagar
2019-06-18 12:08 ` Hans Verkuil
2019-06-18 12:45 ` Vishal Sagar
2019-06-13 22:05 ` Hyun Kwon
2019-06-13 22:31 ` Joe Perches
2019-06-14 12:15 ` Vishal Sagar [this message]
2019-06-14 12:12 ` Vishal Sagar
2019-10-02 8:04 ` Sakari Ailus
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=CH2PR02MB60885E9B81D89073BC451FC9A7EE0@CH2PR02MB6088.namprd02.prod.outlook.com \
--to=vsagar@xilinx.com \
--cc=devicetree@vger.kernel.org \
--cc=dineshk@xilinx.com \
--cc=hyunk@xilinx.com \
--cc=joe@perches.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=michals@xilinx.com \
--cc=robh+dt@kernel.org \
--cc=sandipk@xilinx.com \
--cc=vishal.sagar@xilinx.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;
as well as URLs for NNTP newsgroup(s).