All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCHv2] atmel_lcdfb: support new-style palette format
Date: Mon, 09 Jan 2012 13:34:56 +0000	[thread overview]
Message-ID: <4F0AED00.8060505@atmel.com> (raw)
In-Reply-To: <4EBDBAF9.3090805@gmx.de>

On 11/12/2011 01:16 AM, Florian Tobias Schandinat :
> On 10/13/2011 02:45 PM, Peter Korsgaard wrote:
>> The newer Atmel SoCs use normal 16bit 565 BGR/RGB for the palette data,
>> rather than the special intensity + 555 format.
>>
>> Fill out palette data correctly on these devices, and at the same time
>> respect the RGB/BGR wiring mode.
> 
> Applied this patch.
> 
> 
> Thanks,
> 
> Florian Tobias Schandinat

Florian, here is my:

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Can you please send it upstream through your tree?

>> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
>> ---
>> Changes since v1:
>>  - ATMEL_LCDC_WIRING_RGB/BGR was swapped
>>
>>  drivers/video/atmel_lcdfb.c |   32 ++++++++++++++++++++++++--------
>>  1 files changed, 24 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
>> index 63409c1..7ca3eaf 100644
>> --- a/drivers/video/atmel_lcdfb.c
>> +++ b/drivers/video/atmel_lcdfb.c
>> @@ -682,14 +682,30 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,
>>  
>>  	case FB_VISUAL_PSEUDOCOLOR:
>>  		if (regno < 256) {
>> -			val  = ((red   >> 11) & 0x001f);
>> -			val |= ((green >>  6) & 0x03e0);
>> -			val |= ((blue  >>  1) & 0x7c00);
>> -
>> -			/*
>> -			 * TODO: intensity bit. Maybe something like
>> -			 *   ~(red[10] ^ green[10] ^ blue[10]) & 1
>> -			 */
>> +			if (cpu_is_at91sam9261() || cpu_is_at91sam9263()
>> +			    || cpu_is_at91sam9rl()) {
>> +				/* old style I+BGR:555 */
>> +				val  = ((red   >> 11) & 0x001f);
>> +				val |= ((green >>  6) & 0x03e0);
>> +				val |= ((blue  >>  1) & 0x7c00);
>> +
>> +				/*
>> +				 * TODO: intensity bit. Maybe something like
>> +				 *   ~(red[10] ^ green[10] ^ blue[10]) & 1
>> +				 */
>> +			} else {
>> +				/* new style BGR:565 / RGB:565 */
>> +				if (sinfo->lcd_wiring_mode =
>> +				    ATMEL_LCDC_WIRING_RGB) {
>> +					val  = ((blue >> 11) & 0x001f);
>> +					val |= ((red  >>  0) & 0xf800);
>> +				} else {
>> +					val  = ((red  >> 11) & 0x001f);
>> +					val |= ((blue >>  0) & 0xf800);
>> +				}
>> +
>> +				val |= ((green >>  5) & 0x07e0);
>> +			}
>>  
>>  			lcdc_writel(sinfo, ATMEL_LCDC_LUT(regno), val);
>>  			ret = 0;
> 
> 


-- 
Nicolas Ferre

WARNING: multiple messages have this Message-ID (diff)
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2] atmel_lcdfb: support new-style palette format
Date: Mon, 09 Jan 2012 14:34:56 +0100	[thread overview]
Message-ID: <4F0AED00.8060505@atmel.com> (raw)
In-Reply-To: <4EBDBAF9.3090805@gmx.de>

On 11/12/2011 01:16 AM, Florian Tobias Schandinat :
> On 10/13/2011 02:45 PM, Peter Korsgaard wrote:
>> The newer Atmel SoCs use normal 16bit 565 BGR/RGB for the palette data,
>> rather than the special intensity + 555 format.
>>
>> Fill out palette data correctly on these devices, and at the same time
>> respect the RGB/BGR wiring mode.
> 
> Applied this patch.
> 
> 
> Thanks,
> 
> Florian Tobias Schandinat

Florian, here is my:

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Can you please send it upstream through your tree?

>> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
>> ---
>> Changes since v1:
>>  - ATMEL_LCDC_WIRING_RGB/BGR was swapped
>>
>>  drivers/video/atmel_lcdfb.c |   32 ++++++++++++++++++++++++--------
>>  1 files changed, 24 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
>> index 63409c1..7ca3eaf 100644
>> --- a/drivers/video/atmel_lcdfb.c
>> +++ b/drivers/video/atmel_lcdfb.c
>> @@ -682,14 +682,30 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,
>>  
>>  	case FB_VISUAL_PSEUDOCOLOR:
>>  		if (regno < 256) {
>> -			val  = ((red   >> 11) & 0x001f);
>> -			val |= ((green >>  6) & 0x03e0);
>> -			val |= ((blue  >>  1) & 0x7c00);
>> -
>> -			/*
>> -			 * TODO: intensity bit. Maybe something like
>> -			 *   ~(red[10] ^ green[10] ^ blue[10]) & 1
>> -			 */
>> +			if (cpu_is_at91sam9261() || cpu_is_at91sam9263()
>> +			    || cpu_is_at91sam9rl()) {
>> +				/* old style I+BGR:555 */
>> +				val  = ((red   >> 11) & 0x001f);
>> +				val |= ((green >>  6) & 0x03e0);
>> +				val |= ((blue  >>  1) & 0x7c00);
>> +
>> +				/*
>> +				 * TODO: intensity bit. Maybe something like
>> +				 *   ~(red[10] ^ green[10] ^ blue[10]) & 1
>> +				 */
>> +			} else {
>> +				/* new style BGR:565 / RGB:565 */
>> +				if (sinfo->lcd_wiring_mode ==
>> +				    ATMEL_LCDC_WIRING_RGB) {
>> +					val  = ((blue >> 11) & 0x001f);
>> +					val |= ((red  >>  0) & 0xf800);
>> +				} else {
>> +					val  = ((red  >> 11) & 0x001f);
>> +					val |= ((blue >>  0) & 0xf800);
>> +				}
>> +
>> +				val |= ((green >>  5) & 0x07e0);
>> +			}
>>  
>>  			lcdc_writel(sinfo, ATMEL_LCDC_LUT(regno), val);
>>  			ret = 0;
> 
> 


-- 
Nicolas Ferre

  reply	other threads:[~2012-01-09 13:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13 14:45 [PATCHv2] atmel_lcdfb: support new-style palette format Peter Korsgaard
2011-10-13 14:45 ` Peter Korsgaard
2011-11-12  0:16 ` Florian Tobias Schandinat
2011-11-12  0:16   ` Florian Tobias Schandinat
2012-01-09 13:34   ` Nicolas Ferre [this message]
2012-01-09 13:34     ` Nicolas Ferre

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=4F0AED00.8060505@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.