diff options
author | Jaya Kumar <jayakumar.lkml@gmail.com> | 2008-03-19 20:01:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-03-19 21:53:37 -0400 |
commit | de7c6d15e354bc94a846f03749819768c331280a (patch) | |
tree | c917a58576c73d8deb218c1e09858ebaba195697 /Documentation/fb | |
parent | 9fedc9f1b18f6b931c3b695d7280f17fc308309b (diff) |
fbdev: defio and Metronomefb
Implement support for the E-Ink Metronome controller. It provides an mmapable
interface to the controller using defio support. It was tested with a gumstix
pxa255 with Vizplex media using Xfbdev and various X clients such as xeyes,
xpdf, xloadimage.
This patch also fixes the following bug: Defio would cause a hang on write
access to the framebuffer as the page fault would be called ad-infinitum. It
fixes fb_defio by setting the mapping to be used by page_mkclean.
Signed-off-by: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/fb')
-rw-r--r-- | Documentation/fb/cmap_xfbdev.txt | 53 | ||||
-rw-r--r-- | Documentation/fb/metronomefb.txt | 38 |
2 files changed, 91 insertions, 0 deletions
diff --git a/Documentation/fb/cmap_xfbdev.txt b/Documentation/fb/cmap_xfbdev.txt new file mode 100644 index 000000000000..55e1f0a3d2b4 --- /dev/null +++ b/Documentation/fb/cmap_xfbdev.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | Understanding fbdev's cmap | ||
2 | -------------------------- | ||
3 | |||
4 | These notes explain how X's dix layer uses fbdev's cmap structures. | ||
5 | |||
6 | *. example of relevant structures in fbdev as used for a 3-bit grayscale cmap | ||
7 | struct fb_var_screeninfo { | ||
8 | .bits_per_pixel = 8, | ||
9 | .grayscale = 1, | ||
10 | .red = { 4, 3, 0 }, | ||
11 | .green = { 0, 0, 0 }, | ||
12 | .blue = { 0, 0, 0 }, | ||
13 | } | ||
14 | struct fb_fix_screeninfo { | ||
15 | .visual = FB_VISUAL_STATIC_PSEUDOCOLOR, | ||
16 | } | ||
17 | for (i = 0; i < 8; i++) | ||
18 | info->cmap.red[i] = (((2*i)+1)*(0xFFFF))/16; | ||
19 | memcpy(info->cmap.green, info->cmap.red, sizeof(u16)*8); | ||
20 | memcpy(info->cmap.blue, info->cmap.red, sizeof(u16)*8); | ||
21 | |||
22 | *. X11 apps do something like the following when trying to use grayscale. | ||
23 | for (i=0; i < 8; i++) { | ||
24 | char colorspec[64]; | ||
25 | memset(colorspec,0,64); | ||
26 | sprintf(colorspec, "rgb:%x/%x/%x", i*36,i*36,i*36); | ||
27 | if (!XParseColor(outputDisplay, testColormap, colorspec, &wantedColor)) | ||
28 | printf("Can't get color %s\n",colorspec); | ||
29 | XAllocColor(outputDisplay, testColormap, &wantedColor); | ||
30 | grays[i] = wantedColor; | ||
31 | } | ||
32 | There's also named equivalents like gray1..x provided you have an rgb.txt. | ||
33 | |||
34 | Somewhere in X's callchain, this results in a call to X code that handles the | ||
35 | colormap. For example, Xfbdev hits the following: | ||
36 | |||
37 | xc-011010/programs/Xserver/dix/colormap.c: | ||
38 | |||
39 | FindBestPixel(pentFirst, size, prgb, channel) | ||
40 | |||
41 | dr = (long) pent->co.local.red - prgb->red; | ||
42 | dg = (long) pent->co.local.green - prgb->green; | ||
43 | db = (long) pent->co.local.blue - prgb->blue; | ||
44 | sq = dr * dr; | ||
45 | UnsignedToBigNum (sq, &sum); | ||
46 | BigNumAdd (&sum, &temp, &sum); | ||
47 | |||
48 | co.local.red are entries that were brought in through FBIOGETCMAP which come | ||
49 | directly from the info->cmap.red that was listed above. The prgb is the rgb | ||
50 | that the app wants to match to. The above code is doing what looks like a least | ||
51 | squares matching function. That's why the cmap entries can't be set to the left | ||
52 | hand side boundaries of a color range. | ||
53 | |||
diff --git a/Documentation/fb/metronomefb.txt b/Documentation/fb/metronomefb.txt new file mode 100644 index 000000000000..b9a2e7b7e838 --- /dev/null +++ b/Documentation/fb/metronomefb.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | Metronomefb | ||
2 | ----------- | ||
3 | Maintained by Jaya Kumar <jayakumar.lkml.gmail.com> | ||
4 | Last revised: Nov 20, 2007 | ||
5 | |||
6 | Metronomefb is a driver for the Metronome display controller. The controller | ||
7 | is from E-Ink Corporation. It is intended to be used to drive the E-Ink | ||
8 | Vizplex display media. E-Ink hosts some details of this controller and the | ||
9 | display media here http://www.e-ink.com/products/matrix/metronome.html . | ||
10 | |||
11 | Metronome is interfaced to the host CPU through the AMLCD interface. The | ||
12 | host CPU generates the control information and the image in a framebuffer | ||
13 | which is then delivered to the AMLCD interface by a host specific method. | ||
14 | Currently, that's implemented for the PXA's LCDC controller. The display and | ||
15 | error status are each pulled through individual GPIOs. | ||
16 | |||
17 | Metronomefb was written for the PXA255/gumstix/lyre combination and | ||
18 | therefore currently has board set specific code in it. If other boards based on | ||
19 | other architectures are available, then the host specific code can be separated | ||
20 | and abstracted out. | ||
21 | |||
22 | Metronomefb requires waveform information which is delivered via the AMLCD | ||
23 | interface to the metronome controller. The waveform information is expected to | ||
24 | be delivered from userspace via the firmware class interface. The waveform file | ||
25 | can be compressed as long as your udev or hotplug script is aware of the need | ||
26 | to uncompress it before delivering it. metronomefb will ask for waveform.wbf | ||
27 | which would typically go into /lib/firmware/waveform.wbf depending on your | ||
28 | udev/hotplug setup. I have only tested with a single waveform file which was | ||
29 | originally labeled 23P01201_60_WT0107_MTC. I do not know what it stands for. | ||
30 | Caution should be exercised when manipulating the waveform as there may be | ||
31 | a possibility that it could have some permanent effects on the display media. | ||
32 | I neither have access to nor know exactly what the waveform does in terms of | ||
33 | the physical media. | ||
34 | |||
35 | Metronomefb uses the deferred IO interface so that it can provide a memory | ||
36 | mappable frame buffer. It has been tested with tinyx (Xfbdev). It is known | ||
37 | to work at this time with xeyes, xclock, xloadimage, xpdf. | ||
38 | |||