Skip to contentSkip to conversation

video: da8xx-fb: Fix casting of info->pseudo_palette

PATCH In review [email protected] 1 participant 2 messages Mar 5, 2014 – Mar 26, 2014 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: da8xx-fb: Fix casting of info->pseudo_palette

From: Jon Ringle <[email protected]>

(Resending without corporate disclaimer in email footer)

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

---
 drivers/video/da8xx-fb.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/video/da8xx-fb.c +1 -9
index d042624..83c43b2 100644
@@ -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;
Signature · 1 line
1.8.5.4
author
#1 lore raw

I've not heard anything regarding this patch. I just want to make sure it's not lost :)

Jon

Quoted 36 lines · On Wed, Mar 5, 2014 at 3:19 AM, <[email protected]> wrote:

From: Jon Ringle <[email protected]>

(Resending without corporate disclaimer in email footer)

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

---
 drivers/video/da8xx-fb.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/video/da8xx-fb.c +1 -10
index d042624..83c43b2 100644
@@ -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;
--

1.8.5.4