Few fixes for psplash
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
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
@@ -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
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
Signed-off-by Juro Bystricky <[email protected]>--- psplash-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)psplash-fb.c +1
-2@@ -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
Re: [PSPLASH 1/2] psplash-fb.c: Fix BGR888 detection
Quoted 4 lines · Aws Ismail
:) 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
I can only apologise. At least it's merged now!
Ross
PATCH 2/2 psplash-fb.c: Fix some endian issues
In reply to Juro BystrickyThe 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
@@ -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
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
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
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