All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: jon@ringle.org, linux-kernel@vger.kernel.org,
	linux-fbdev@vger.kernel.org
Cc: plagnioj@jcrosoft.com, Jon Ringle <jringle@gridpoint.com>,
	"Etheridge, Darren" <detheridge@ti.com>
Subject: Re: [PATCH v3 2/2] video: da8xx-fb: Fix casting of info->pseudo_palette
Date: Fri, 04 Apr 2014 10:49:45 +0000	[thread overview]
Message-ID: <533E8E49.1030307@ti.com> (raw)
In-Reply-To: <1396355974-2257-2-git-send-email-jon@ringle.org>

[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]

On 01/04/14 15:39, jon@ringle.org wrote:
> From: Jon Ringle <jringle@gridpoint.com>
> 
> The casting to (u16 *) on info->pseudo_palette is wrong and causes the
> display to show a blue (garbage) vertical line on every other pixel column
> 
> Signed-off-by: Jon Ringle <jringle@gridpoint.com>
> ---
>  drivers/video/da8xx-fb.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> index 233f65f..c17f901 100644
> --- a/drivers/video/da8xx-fb.c
> +++ b/drivers/video/da8xx-fb.c
> @@ -678,15 +678,7 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
>  			(green << info->var.green.offset) |
>  			(blue << info->var.blue.offset);
>  
> -		switch (info->var.bits_per_pixel) {
> -		case 16:
> -			((u16 *) (info->pseudo_palette))[regno] = v;
> -			break;
> -		case 24:
> -		case 32:
> -			((u32 *) (info->pseudo_palette))[regno] = v;
> -			break;
> -		}
> +		((u32 *) (info->pseudo_palette))[regno] = v;
>  		if (palette[0] != 0x4000) {
>  			update_hw = 1;
>  			palette[0] = 0x4000;
> 

Thanks.

I wonder why the pseudo_palette in fb.h is 'void *' in the first place.
It seems to be cast to 'u32 *' everywhere...

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: <jon@ringle.org>, <linux-kernel@vger.kernel.org>,
	<linux-fbdev@vger.kernel.org>
Cc: <plagnioj@jcrosoft.com>, Jon Ringle <jringle@gridpoint.com>,
	"Etheridge, Darren" <detheridge@ti.com>
Subject: Re: [PATCH v3 2/2] video: da8xx-fb: Fix casting of info->pseudo_palette
Date: Fri, 4 Apr 2014 13:49:45 +0300	[thread overview]
Message-ID: <533E8E49.1030307@ti.com> (raw)
In-Reply-To: <1396355974-2257-2-git-send-email-jon@ringle.org>

[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]

On 01/04/14 15:39, jon@ringle.org wrote:
> From: Jon Ringle <jringle@gridpoint.com>
> 
> The casting to (u16 *) on info->pseudo_palette is wrong and causes the
> display to show a blue (garbage) vertical line on every other pixel column
> 
> Signed-off-by: Jon Ringle <jringle@gridpoint.com>
> ---
>  drivers/video/da8xx-fb.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> index 233f65f..c17f901 100644
> --- a/drivers/video/da8xx-fb.c
> +++ b/drivers/video/da8xx-fb.c
> @@ -678,15 +678,7 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
>  			(green << info->var.green.offset) |
>  			(blue << info->var.blue.offset);
>  
> -		switch (info->var.bits_per_pixel) {
> -		case 16:
> -			((u16 *) (info->pseudo_palette))[regno] = v;
> -			break;
> -		case 24:
> -		case 32:
> -			((u32 *) (info->pseudo_palette))[regno] = v;
> -			break;
> -		}
> +		((u32 *) (info->pseudo_palette))[regno] = v;
>  		if (palette[0] != 0x4000) {
>  			update_hw = 1;
>  			palette[0] = 0x4000;
> 

Thanks.

I wonder why the pseudo_palette in fb.h is 'void *' in the first place.
It seems to be cast to 'u32 *' everywhere...

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-04-04 10:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 12:39 [PATCH v3 1/2] video: da8xx-fb: Add support for Densitron 84-0023-001T jon
2014-04-01 12:39 ` jon
2014-04-01 12:39 ` [PATCH v3 2/2] video: da8xx-fb: Fix casting of info->pseudo_palette jon
2014-04-01 12:39   ` jon
2014-04-04 10:49   ` Tomi Valkeinen [this message]
2014-04-04 10:49     ` Tomi Valkeinen
2014-04-05 11:35     ` Geert Uytterhoeven
2014-04-05 11:35       ` Geert Uytterhoeven

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=533E8E49.1030307@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=detheridge@ti.com \
    --cc=jon@ringle.org \
    --cc=jringle@gridpoint.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plagnioj@jcrosoft.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 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.