Skip to contentSkip to conversation

Few fixes for psplash

PATCH In review Juro Bystricky 3 participants 8 messages Nov 24, 2015 – Nov 25, 2015

lore
Share & tools
lore
#0 lore raw

cover Few fixes for psplash

These patches fix https://bugzilla.yoctoproject.org/show_bug.cgi?id=7236
Considering there was a bug in the BGR888 detection, it is probaly safe to assume it was never used. I modified handling of 24BPP modes somewhat as well, but did not test it. 24BPP changes only affect big endian mode, little endian should be the same as before. (If you are aware of anybody actually using 24BPP modes, please let me know)
Tested with jethro/core-image-sato (qemuppc, qemumips, qemuarm).

Juro Bystricky (2):
psplash-fb.c: Fix BGR888 detection
psplash-fb.c: Fix some endian issues

 psplash-fb.c | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 psplash-fb.c: Fix BGR888 detection

---
 psplash-fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
psplash-fb.c +1 -1
index bd9cd9d..e71af8f 100644
@@ -185,7 +185,7 @@ psplash_fb_new (int angle)
          fb->rgbmode = RGB888;
   } else if (fb->red_offset == 0 && fb->red_length == 8 &&
       fb->green_offset == 8 && fb->green_length == 8 &&
-      fb->blue_offset == 8 && fb->blue_length == 8) {
+      fb->blue_offset == 16 && fb->blue_length == 8) {
          fb->rgbmode = BGR888;
   } else {
          fb->rgbmode = GENERIC;
Signature · 1 line
1.9.1
#2 lore raw

Re: [PSPLASH 1/2] psplash-fb.c: Fix BGR888 detection

:) I have sent the same patch three years ago but no one picked it up...

https://lists.yoctoproject.org/pipermail/yocto/2012-October/009846.html

Quoted 26 lines · Juro Bystricky
---
 psplash-fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
psplash-fb.c +1 -2
index bd9cd9d..e71af8f 100644
@@ -185,7 +185,7 @@ psplash_fb_new (int angle)
          fb->rgbmode = RGB888;
   } else if (fb->red_offset == 0 && fb->red_length == 8 &&
       fb->green_offset == 8 && fb->green_length == 8 &&
-      fb->blue_offset == 8 && fb->blue_length == 8) {
+      fb->blue_offset == 16 && fb->blue_length == 8) {
          fb->rgbmode = BGR888;
   } else {
          fb->rgbmode = GENERIC;
--

1.9.1

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#4 lore raw

PATCH 2/2 psplash-fb.c: Fix some endian issues

In reply to Juro Bystricky

The routine psplash_fb_plot_pixel implicitly assumed little endian format when plotting pixels in RGB888 or BGR888 modes.

---
 psplash-fb.c | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)
psplash-fb.c +25 -4
index e71af8f..7b352e0 100644
@@ -14,6 +14,8 @@
  *  GNU General Public License for more details.
  *
  */
+
+#include <endian.h>
 #include "psplash.h"
 
 void
@@ -294,11 +296,21 @@ psplash_fb_plot_pixel (PSplashFB    *fb,
     switch (fb->bpp)
       {
       case 24:
-      case 32:
-        *(fb->data + off)     = blue;
+#if __BYTE_ORDER == __BIG_ENDIAN
+        *(fb->data + off + 0) = red;
+        *(fb->data + off + 1) = green;
+        *(fb->data + off + 2) = blue;
+#else
+        *(fb->data + off + 0) = blue;
         *(fb->data + off + 1) = green;
         *(fb->data + off + 2) = red;
+#endif
+        break;
+      case 32:
+        *(volatile uint32_t *) (fb->data + off)
+          = (red << 16) | (green << 8) | (blue);
         break;
+
       case 16:
         *(volatile uint16_t *) (fb->data + off)
 	  = ((red >> 3) << 11) | ((green >> 2) << 5) | (blue >> 3);
@@ -311,10 +323,19 @@ psplash_fb_plot_pixel (PSplashFB    *fb,
     switch (fb->bpp)
       {
       case 24:
-      case 32:
-        *(fb->data + off)     = red;
+#if __BYTE_ORDER == __BIG_ENDIAN
+        *(fb->data + off + 0) = blue;
+        *(fb->data + off + 1) = green;
+        *(fb->data + off + 2) = red;
+#else
+        *(fb->data + off + 0) = red;
         *(fb->data + off + 1) = green;
         *(fb->data + off + 2) = blue;
+#endif
+        break;
+      case 32:
+        *(volatile uint32_t *) (fb->data + off)
+          = (blue << 16) | (green << 8) | (red);
         break;
       case 16:
         *(volatile uint16_t *) (fb->data + off)
Signature · 1 line
1.9.1
#5 lore raw
In reply to Juro Bystricky
Quoted 11 lines · Juro Bystricky

These patches fix https://bugzilla.yoctoproject.org/show_bug.cgi?id=7236
Considering there was a bug in the BGR888 detection, it is probaly safe to assume it was never used. I modified handling of 24BPP modes somewhat as well,
but did not test it. 24BPP changes only affect big endian mode, little endian
should be the same as before. (If you are aware of anybody actually using 24BPP
modes, please let me know)
Tested with jethro/core-image-sato (qemuppc, qemumips, qemuarm).

Thanks Juro. Merged to psplash master.

Ross

#6 lore raw

Thanks. I’ll mark the bug 7236 as resolved/fixed.
Juro

From: Burton, Ross [mailto:[email protected]]
Sent: Tuesday, November 24, 2015 8:58 AM
To: Bystricky, Juro
Cc: [email protected]; Juro Bystricky
Subject: Re: [yocto] [PSPLASH 0/2] Few fixes for psplash

On 24 November 2015 at 16:39, Juro Bystricky <[email protected]<mailto:[email protected]>> wrote:
These patches fix https://bugzilla.yoctoproject.org/show_bug.cgi?id=7236
Considering there was a bug in the BGR888 detection, it is probaly safe to
assume it was never used. I modified handling of 24BPP modes somewhat as well,
but did not test it. 24BPP changes only affect big endian mode, little endian
should be the same as before. (If you are aware of anybody actually using 24BPP
modes, please let me know)
Tested with jethro/core-image-sato (qemuppc, qemumips, qemuarm).

Thanks Juro. Merged to psplash master.

Ross

#7 lore raw
Quoted 3 lines · Juro

Thanks. I’ll mark the bug 7236 as resolved/fixed.

The recipe needs updating first, just bumping the srcrev will do nicely.

Ross