kdrive/tinyx grayscale pixel format

jayakumar xorg jayakumar.xorg at gmail.com
Sun Nov 4 01:50:57 PDT 2007


Hi Xorg friends,

I have a quick question. I'm working on an fbdev driver where my
device supports only 3 bit grayscale. I have posted my first pass at
this driver here [ http://marc.info/?l=linux-mm&m=119412513702313&w=2
]. The problem I'm having right now is that I haven't figured out how
to tell kdrive that I would like data as follows:  0x00 is black, 0xF0
is white, 0x20 is darkest gray, 0xD0 is lightest gray. So just the
upper 3 bits matter but each pixel must still take up a full 8 bits in
the framebuffer. I use .visual = FB_VISUAL_STATIC_PSEUDOCOLOR.

I'm guessing I need the right combination of:
+	.bits_per_pixel	= 8,
+	.grayscale	= 1,
+	.nonstd		= 1,
+	.red =		{ 0, 8, 0 },
+	.green =	{ 0, 8, 0 },
+	.blue =		{ 0, 8, 0 },
+	.transp =	{ 0, 0, 0 },

in my fb_var_screeninfo. I've tried various combinations with red = {
5, 3, 0} etc but I'm confusing myself when I look at the kdrive cmap
code. If anyone has hints or suggestions, that would be greatly
appreciated.

Thanks,
jaya



More information about the xorg mailing list