Skip to contentSkip to conversation

grapric_utils: set_pixel only write 16bit in 16bit mode

PATCH In review Jean-Christophe PLAGNIOL-VILLARD 2 participants 4 messages Feb 19, 2013 – Feb 21, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 grapric_utils: set_pixel only write 16bit in 16bit mode

---
 lib/gui/graphic_utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/gui/graphic_utils.c +1 -1
index 95687df..a1be5d0 100644
@@ -104,7 +104,7 @@ void set_pixel(struct fb_info *info, void *adr, u32 px)
 	case 8:
 		break;
 	case 16:
-		*(u16 *)adr = px;
+		*(u16 *)adr = px & 0xffff;
 		break;
 	case 32:
 		*(u32 *)adr = px;
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw
Quoted 10 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 lib/gui/graphic_utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/gui/graphic_utils.c +0 -0
index 95687df..a1be5d0 100644

lib/gui/graphic_utils.c void set_pixel(struct fb_info *info, void *adr, u32 px) · line 107

Quoted 5 lines
lib/gui/graphic_utils.c +1 -1
@@ -104,7 +104,7 @@ void set_pixel(struct fb_info *info, void *adr, u32 px)
 	case 8:
 		break;
 	case 16:
-		*(u16 *)adr = px;
+		*(u16 *)adr = px & 0xffff;

What does this fix? The result should be the same.

Sascha

Quoted 12 lines
lib/gui/graphic_utils.c +0 -0
 		break;
 	case 32:
 		*(u32 *)adr = px;
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw
Quoted 6 lines · Sascha Hauer
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 lib/gui/graphic_utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

lib/gui/graphic_utils.c void set_pixel(struct fb_info *info, void *adr, u32 px) · line 107

Quoted 10 lines
lib/gui/graphic_utils.c +1 -1
index 95687df..a1be5d0 100644
@@ -104,7 +104,7 @@ void set_pixel(struct fb_info *info, void *adr, u32 px)
 	case 8:
 		break;
 	case 16:
-		*(u16 *)adr = px;
+		*(u16 *)adr = px & 0xffff;

What does this fix? The result should be the same.

not on qemu

Best Regards,
J.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#3 lore raw
Quoted 19 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 6 lines · Sascha Hauer
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 lib/gui/graphic_utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

lib/gui/graphic_utils.c void set_pixel(struct fb_info *info, void *adr, u32 px) · line 107

Quoted 10 lines
lib/gui/graphic_utils.c +1 -1
index 95687df..a1be5d0 100644
@@ -104,7 +104,7 @@ void set_pixel(struct fb_info *info, void *adr, u32 px)
 	case 8:
 		break;
 	case 16:
-		*(u16 *)adr = px;
+		*(u16 *)adr = px & 0xffff;

What does this fix? The result should be the same.

Quoted 1 line

not on qemu

Isn't this a bug in qemu?

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox