From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: "Troy Kisky" <troy.kisky@boundarydevices.com>,
"Denis Carikli" <denis@eukrea.com>,
"Shawn Guo" <shawn.guo@linaro.org>,
"Mark Rutland" <mark.rutland@arm.com>,
devicetree@vger.kernel.org,
driverdev-devel@linuxdriverproject.org,
"Sascha Hauer" <kernel@pengutronix.de>,
"Pawel Moll" <pawel.moll@arm.com>,
"Stephen Warren" <swarren@wwwdotorg.org>,
"David Airlie" <airlied@linux.ie>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
dri-devel@lists.freedesktop.org,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Eric Bénard" <eric@eukrea.com>,
linux-media@vger.kernel.org,
"Rob Herring" <rob.herring@calxeda.com>,
linux-arm-kernel@lists.infradead.org,
"Mauro Carvalho Chehab" <m.chehab@samsung.com>
Subject: Re: [PATCHv4][ 3/7] staging: imx-drm: Add RGB666 support for parallel display.
Date: Wed, 13 Nov 2013 20:48:20 +0100 [thread overview]
Message-ID: <21976620.UIvc2kPlHX@avalon> (raw)
In-Reply-To: <20131113191230.GU16735@n2100.arm.linux.org.uk>
Hi Russell,
On Wednesday 13 November 2013 19:12:30 Russell King - ARM Linux wrote:
> On Wed, Nov 13, 2013 at 11:43:44AM -0700, Troy Kisky wrote:
> > On 11/13/2013 2:23 AM, Denis Carikli wrote:
> >> + /* rgb666 */
> >>
> >> + ipu_dc_map_clear(priv, IPU_DC_MAP_RGB666);
> >> + ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 2, 17, 0xfc); /* red */
> >> + ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 1, 11, 0xfc); /* green */
> >> + ipu_dc_map_config(priv, IPU_DC_MAP_RGB666, 0, 5, 0xfc); /* blue */
> >> +
> >> return 0;
> >> }
> >
> > Since, rgb24 and bgr24 reverse the byte numbers
> > /* rgb24 */
> > ipu_dc_map_clear(priv, IPU_DC_MAP_RGB24);
> > ipu_dc_map_config(priv, IPU_DC_MAP_RGB24, 0, 7, 0xff); /* blue */
> > ipu_dc_map_config(priv, IPU_DC_MAP_RGB24, 1, 15, 0xff); /* green
> > */
> > ipu_dc_map_config(priv, IPU_DC_MAP_RGB24, 2, 23, 0xff); /* red */
> >
> > /* bgr24 */
> > ipu_dc_map_clear(priv, IPU_DC_MAP_BGR24);
> > ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 2, 7, 0xff); /* red */
> > ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 1, 15, 0xff); /* green
> > */
> > ipu_dc_map_config(priv, IPU_DC_MAP_BGR24, 0, 23, 0xff); /* blue */
> >
> > Shouldn't rgb666 and bgr666 do the same?
> > Currently we have,
> >
> > /* bgr666 */
> > ipu_dc_map_clear(priv, IPU_DC_MAP_BGR666);
> > ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 0, 5, 0xfc); /* blue */
> > ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 1, 11, 0xfc); /*
> > green */
> > ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 2, 17, 0xfc); /* red */
>
> Yes, I concur - this doesn't make sense to me. BGR666 would mean in
> memory:
>
> 1 11
> 7 21 65 0
> BBBBBBGGGGGGRRRRRR
>
> which reflects the same order for "RGB24" above.
Beside component order and number of bits per component, an in-memory RGB
format also defines the memory endianness and, for formats that don't span an
interger number of bytes, the left or right alignment.
BGR666 is currently defined in V4L2 as
Byte 0 1 2
Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
b5 b4 b3 b2 b1 b0 g5 g4 g3 g2 g1 g0 r5 r4 r3 r2 r1 r0 - - - - - -
(see the *second* table in http://linuxtv.org/downloads/v4l-dvb-apis/packed-rgb.html)
I would thus expect RGB666 to be
Byte 0 1 2
Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
r5 r4 r3 r2 r1 r0 g5 g4 g3 g2 g1 g0 b5 b4 b3 b2 b1 b0 - - - - - -
We can also define right-aligned formats if needed.
> > Where I'd expect to see
> > /* bgr666 */
> >
> > ipu_dc_map_clear(priv, IPU_DC_MAP_BGR666);
> > ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 0, 17, 0xfc); /* blue
> > */
> > ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 1, 11, 0xfc); /*
> > green */
> > ipu_dc_map_config(priv, IPU_DC_MAP_BGR666, 2, 5, 0xfc); /* red */
>
> So this makes sense to me.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-11-13 19:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 9:23 [PATCHv4][ 1/7] [media] v4l2: add new V4L2_PIX_FMT_RGB666 pixel format Denis Carikli
2013-11-13 9:23 ` [PATCHv4][ 3/7] staging: imx-drm: Add RGB666 support for parallel display Denis Carikli
2013-11-13 18:43 ` Troy Kisky
2013-11-13 19:12 ` Russell King - ARM Linux
2013-11-13 19:48 ` Laurent Pinchart [this message]
[not found] ` <1384334603-14208-1-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org>
2013-11-13 9:23 ` [PATCHv4][ 4/7] staging: imx-drm: parallel display: add regulator support Denis Carikli
2013-11-13 9:32 ` Alexander Shiyan
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=21976620.UIvc2kPlHX@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=airlied@linux.ie \
--cc=denis@eukrea.com \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=eric@eukrea.com \
--cc=gregkh@linuxfoundation.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-media@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=m.chehab@samsung.com \
--cc=mark.rutland@arm.com \
--cc=p.zabel@pengutronix.de \
--cc=pawel.moll@arm.com \
--cc=rob.herring@calxeda.com \
--cc=shawn.guo@linaro.org \
--cc=swarren@wwwdotorg.org \
--cc=troy.kisky@boundarydevices.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).