linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Tabi Timur-B04825 <B04825@freescale.com>
To: Anatolij Gustschin <agust@denx.de>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>,
	Gala Kumar-B11780 <B11780@freescale.com>,
	"lethal@linux-sh.org" <lethal@linux-sh.org>,
	Tabi Timur-B04825 <B04825@freescale.com>,
	"linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>
Subject: Re: [PATCH] drivers/video: use strings to specify the Freescale DIU monitor port
Date: Sat, 9 Jul 2011 19:37:16 +0000	[thread overview]
Message-ID: <4E18ADEB.3000904@freescale.com> (raw)
In-Reply-To: <20110709163809.53f18fea@wker>

Anatolij Gustschin wrote:
>> >    	ad->pix_fmt =3D
>> >  -		diu_ops.get_pixel_format(var->bits_per_pixel,
>> >  -					 machine_data->monitor_port);
>> >  +		cpu_to_be32(diu_ops.get_pixel_format(machine_data->monitor_port,
>> >  +						     var->bits_per_pixel));

> I think you can drop cpu_to_be32 here, it is somehow confusing. The
> descriptor fields are LE32,

Not according to the structure definition:

struct diu_ad {
	/* Word 0(32-bit) in DDR memory */
/* 	__u16 comp; */
/* 	__u16 pixel_s:2; */
/* 	__u16 pallete:1; */
/* 	__u16 red_c:2; */
/* 	__u16 green_c:2; */
/* 	__u16 blue_c:2; */
/* 	__u16 alpha_c:3; */
/* 	__u16 byte_f:1; */
/* 	__u16 res0:3; */

	__be32 pix_fmt; /* hard coding pixel format */

I see other places where the endianness of pix_fmt is assumed.  I'll have=20
to fix those later.

When I look at the 5121 and 1022 reference manuals, it says that the area=20
descriptor is little-endian.  I think York made this register big-endian=20
so that it matches the endianness of get_pixel_format(), which doesn't=20
make much sense.  I'll have to fix the whole endianness thing with pix_fmt=
=20
in another patch.

 > get_pixel_format() returns LE32 value.

I don't think the endianness of get_pixel_format() is fixed.  It's=20
whatever the CPU native endiannes is.  That's why I added a cpu_to_be32().

Anyway, I'm not quite sure what the right answer is, but it seems obvious=20
that cpu_to_be32() is wrong.  I'll post another patch which removes it.

--=20
Timur Tabi
Linux kernel developer at Freescale=

      reply	other threads:[~2011-07-09 19:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 16:51 [PATCH] drivers/video: use strings to specify the Freescale DIU monitor port Timur Tabi
2011-07-09 14:38 ` Anatolij Gustschin
2011-07-09 19:37   ` Tabi Timur-B04825 [this message]

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=4E18ADEB.3000904@freescale.com \
    --to=b04825@freescale.com \
    --cc=B11780@freescale.com \
    --cc=agust@denx.de \
    --cc=lethal@linux-sh.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).