fbgen & multiple RGBA
PATCH 1/1 fbgen & multiple RGBA
Hello,
the attached patch fix a problem with fbgen when changing the RGBA components but not the depth ; fbgen would not change the colormap in this case, where it should.
Signature · 1 line
romain
Quoted 4 lines
the attached patch fix a problem with fbgen when changing the RGBA components but not the depth ; fbgen would not change the colormap in this case, where it should.
It would be much easier to use a memcmp.
Quoted 6 lines · James Simmons
Quoted 4 lines
the attached patch fix a problem with fbgen when changing the RGBA components but not the depth ; fbgen would not change the colormap in this case, where it should.
It would be much easier to use a memcmp.
For the color component, yes, but you can't use a memcmp on the 'fb_var_screeninfo', as some member of the struct are irrelevant to colormap switching (you don't want to reinstall the colormap if only the refresh rate changed, for instance).
Signature · 3 lines
DOLBEAU Romain | l'histoire est entierement vraie, puisque ENS Cachan / Ker Lann | je l'ai imaginee d'un bout a l'autre [email protected] | -- Boris Vian
Quoted 6 lines
For the color component, yes, but you can't use a memcmp on the '
fb_var_screeninfo', as some member of the struct are irrelevant to colormap switching (you don't want to reinstall the colormap if only the refresh rate changed, for instance).
But it does. If you look at the console code it always calls set_palette which in turn calls fbcon_set_palette which in turn calls fb_set_cmap. This happens every time you VC switch. A few driver writers noticed this and don't bother with calling fb_Set_var in con_switch but instead a few pieces of the function. But because of the way the current console system is designed the colormap will always be set on VC switches.
Quoted 1 line
This happens every time you VC switch.
[snip]
Quoted 2 lines
But because of the way the current console system is designed the colormap will always be set on VC switches.
The fix wasn't intended for VC switch, but for any change of fb_var_screeninfo parameter. Those can happen without VC switching, that's exactly what 'fbset' is for.
If on your console you do a 'fbset -depth 16 -rgba 5,6,5,0' followed by a 'fbset -depth 16 -rgba 5,5,5,1' [1], any driver using fbdev will end up with a crazy colormap because it hasn't been reinstalled after the RGBA change.
Hence the need for the fix.
[1] yes, in fbset, "-depth" really mean "-bpp" ...
Signature · 4 lines
DOLBEAU Romain | ENS Cachan / Ker Lann | l'histoire est entierement vraie, puisque Thesard IRISA / CAPS | je l'ai imaginee d'un bout a l'autre [email protected] | -- Boris Vian
Quoted 2 lines · Romain Dolbeau
If on your console you do a 'fbset -depth 16 -rgba 5,6,5,0' followed by a 'fbset -depth 16 -rgba 5,5,5,1' [1], any driver using fbdev will end
^^^^^^^^
That should have been 'fbgen', sorry for the momentary lapse of reason and the waste of bandwith.
Quoted 2 lines
up with a crazy colormap because it hasn't been reinstalled after the RGBA change.
Signature · 4 lines
DOLBEAU Romain | The Gods made Heavy Metal ENS Cachan / Ker Lann | and it's never gonna die Thesard IRISA / CAPS | -- Manowar [email protected] | in 'The Gods made Heavy Metal'
PATCH 1/1 fbgen & multiple RGBA (w/ memcmp)
In reply to Romain DolbeauQuoted 3 lines · Romain Dolbeau
the attached patch fix a problem with fbgen when changing the RGBA components but not the depth ; fbgen would not change the colormap in this case, where it should.
This is the same patch but using memcmp() on the 3 color components.
Signature · 3 lines
DOLBEAU Romain | l'histoire est entierement vraie, puisque ENS Cachan / Ker Lann | je l'ai imaginee d'un bout a l'autre [email protected] | -- Boris Vian