1.2.8 -> 1.2.11 Upgrade

Hello,

I’ve upgraded SDL version from 1.2.8 to 1.2.11 and I’m noticing that
colors are not the same. SDL is used on an embedded device with 8bpp,
320x240 sized LCD.
My first investigations were around blitting code of the surface and I
found out that several changes were made in that section
(src/video/SDL_blit* files).

I guess that grey ‘bars’ appear 'cause of the low bpp for my embedded
screen, no matter at least colors are right in the 1.2.8 version. The
fact the testalpha forces the display to work at 16bpp instead os 8bpp
doesn’t seem to have any problems running on older version of SDL 1.2.8,
if that would be the case for the 1.2.11…

When running testalpha on 1.2.8 version, grey bars are nicely stacked
from black to white, with pale orange rectangle on the middle - which
seems fine. But on 1.2.11 grey bars are not grey - just first bar is
black and last is white, the ones in between are pink, yellow, green
,white?. Plus the rectangle in the middle is pale green! Sprite is
always yellow on 1.2.8, but is changing to some weird colors on 1.2.11.

I can confirm that running testalpha 1.2.11 version on the host works
fine (smooth and at 32-bpp).

Cursor is nice in the both screens- probably 'cause it is only BW.

Can anyone give me some pointers what might be wrong?

best regards,
hinko–
?ETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: @Hinko_Kocevar
Http: www.cetrtapot.si

Hello !

I’ve upgraded SDL version from 1.2.8 to 1.2.11 and I’m noticing that
colors are not the same. SDL is used on an embedded device with 8bpp,
320x240 sized LCD.
My first investigations were around blitting code of the surface and I
found out that several changes were made in that section
(src/video/SDL_blit* files).

Did you also recompile your app with SDL 1.2.11 ?
If not, maybe test this too.

When you know that you will only have 8bpp available,
then you should use your own palettes with it.

Even if the new SDL code may be broken,
with using palettes you will be sure
that the app looks the way you want.

CU

CU

Torsten Giebl wrote:

Hello !

I’ve upgraded SDL version from 1.2.8 to 1.2.11 and I’m noticing that
colors are not the same. SDL is used on an embedded device with 8bpp,
320x240 sized LCD.
My first investigations were around blitting code of the surface and I
found out that several changes were made in that section
(src/video/SDL_blit* files).

Did you also recompile your app with SDL 1.2.11 ?
If not, maybe test this too.

Yes I’ve done that …

When you know that you will only have 8bpp available,
then you should use your own palettes with it.

Even if the new SDL code may be broken,
with using palettes you will be sure
that the app looks the way you want.

Hmm, can you elaborate a bit… In my app I’m using code very similar to
the example found in SDL SDL_SetColors() man page at init time. Eg.

 int rval, l, i, g, b;
 u32 ops = SDL_SWSURFACE;
 SDL_Color Barve[256];

 if ((rval = SDL_Init (SDL_INIT_VIDEO)) < 0)
     return (false);

 if (gui_config_full_screen ())
ops = (ops | SDL_FULLSCREEN);

 screen = SDL_SetVideoMode (w, h, gui_config_bpp (), ops);

 if (screen == NULL)
     return (false);

 for (l = 0; l < 8; ++l)
 {
     for (g = 0; g < 8; ++g)
     {
         for (b = 0; b < 4; ++b)
         {
             i = ((l << 5) | (g << 2) | b);
             Barve[i].r = l << 5;
             Barve[i].g = g << 5;
             Barve[i].b = b << 6;
         }
     }
 }

 SDL_SetColors (screen, (SDL_Color *) & Barve, 0, 256);

 SDL_EventState (SDL_MOUSEMOTION, SDL_IGNORE);
 SDL_EventState (SDL_MOUSEBUTTONUP, SDL_IGNORE);
 SDL_EventState (SDL_SYSWMEVENT, SDL_ENABLE);

 SDL_FillRect (screen, NULL, GUIDRAW_COLOR_GREY);
 return (true);

best regards,
hinko–
?ETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: @Hinko_Kocevar
Http: www.cetrtapot.si

Hello,

I’ve got little more info - when running SDL application on the embedded
system colors output is bad. If for instance I try native fbdev
application (using FB directly, wo SDL) colors are fine!

Now the fun part - running on an embedded system under Linux kernel
2.6.12 SDL works fine (this holds true for 1.2.8 AND 1.2.11 release).

After upgrading to 2.6.15 kernel SDL application build against 1.2.8
continues to show correct colors, while application built against
1.2.11 release of SDL library shows incorrect colors!

Native fbdev (fbcon) application works on both kernels 2.6.12 and 2.6.15
and showing correct colors.

It seems that kernel could be the main culprit here. But it doesn’t
’sound’ right, 'cause raw fb access works just fine.

To sum up: SDL apps under 2.6.15 are not displaying colors correctly,
while the same code and SDL lib work fine on 2.6.12 kernel.

Had anyone noticed any major difficulties when upgrading their kernel
version ?

best regards,
hinko–
?ETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: @Hinko_Kocevar
Http: www.cetrtapot.si

Hello !

To sum up: SDL apps under 2.6.15 are not displaying colors correctly,
while the same code and SDL lib work fine on 2.6.12 kernel.

Please check also the latest official kernel and
also Andrew Morton’s -mm kernel tree.

CU