linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: [linux-fbdev] Re: r128 DRI driver now fully functional
@ 2001-01-31 20:29 Petr Vandrovec
  2001-02-02 15:00 ` Michel Dänzer
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Vandrovec @ 2001-01-31 20:29 UTC (permalink / raw)
  To: Michel Daenzer; +Cc: andi, benh, linuxppc-dev, linux-fbdev, geert


On 31 Jan 01 at 19:53, Michel Dänzer wrote:
> > The disadvantage is that if you change the palette, the text colors don't
> > change until you redraw the screen (or switch VC back-and-forth). That's why
> > I decided to use the hardware palette in directcolor modes.
>
> I don't mind using the hardware palette if you (or anyone) tell me how to get
> RGB565 working with that. :)

It depends on how your hardware works:

If it uses palette entries 0-31 for R/B and 0-63 for G, program
dispsw_data pointed array (pseudo_palette) with

for (i = 0; i < 16; i++) arr[i] = i * ((1 << 11) | (1 << 5) | 1);

and your setcolreg should program r,g,b fields for regno register.

If your hardware uses entries 0,8,16,24...248 for R/B and
0,4,8,12,... for G, things are worse:

program pseudo_palette with same 'arr[i] = i * ((1 << 11) | (1 << 5) | 1);'

But setcolreg is much worse:

if (regno) {
  if (regno & 1) {
    oldR = oldB = 0;
  } else {
    outb(regno * 4, PALETTE_R_INDEX);
    oldR = inb(PALETTE_DATA);
    inb(PALETTE_DATA);
    oldG = inb(PALETTE_DATA);
  }
  outb(regno * 4, PALETTE_W_INDEX);
  outb(oldR, PALETTE_DATA);
  outb(g, PALETTE_DATA);
  outb(oldB, PALETTE_DATA);

  outb(regno * 8, PALETTE_R_INDEX);
  inb(PALETTE_DATA);
  oldG = inb(PALETTE_DATA);
  inb(PALETTE_DATA);
} else {
  oldG = g;
}
outb(regno * 8, PALETTE_W_INDEX);
outb(r, PALETTE_DATA);
outb(oldG, PALETTE_DATA);
outb(g, PALETTE_DATA);

I think that you should create 3x256 (or 3x64) array which will mirror
DAC state, as otherwise you have to do too many ops to set
one register...

Also do not forget that you must use only low 16 color registers (regno
on input to setcolreg) for text console, as others (16-31/16-63) are not
saved/restored by console palette handling code.
                                            Best regards,
                                                Petr Vandrovec
                                                vandrove@vc.cvut.cz


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-02-02 15:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-31 20:29 [linux-fbdev] Re: r128 DRI driver now fully functional Petr Vandrovec
2001-02-02 15:00 ` Michel Dänzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).