Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Weird clock behaviour with current (amd64) kernel



rvp%SDF.ORG@localhost (RVP) writes:

>Unsurprisingly, EFI also has a colour-index similar to VGA (see:
>/usr/src/sys/external/bsd/gnu-efi/dist/inc/eficon.h). I tried fixing the
>indexes like this, but, it doesn't for some (autoconfig?) reason. Can
>only look into this after I come back from my road-trip.

That color index is used by text mode, but booting from EFI uses
a graphics framebuffer (nowadays mostly 24bit or 32bit per pixel).


But all this color shift is unrelated to the color indexes, but
how the framebuffer pixels are organized.


The early console code has no information about byte order in
the framebuffer. rasops then initializes e.g. for 32bit pixels:

        if (ri->ri_rnum == 0) {
                ri->ri_rnum = ri->ri_gnum = ri->ri_bnum = 8;

                ri->ri_rpos = 0;
                ri->ri_gpos = 8;
                ri->ri_bpos = 16;
        }

which is 0x00BBGGRR.

When genfb actually attaches it carries information about
the byte ordering and rasops gets initialized with the
right values.

For the green color it doesn't matter if the order is BGR or RGB.
For cyan, the wrong order gives "brown" which is a dark yellow.



Home | Main Index | Thread Index | Old Index