diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /Documentation/fb | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'Documentation/fb')
-rw-r--r-- | Documentation/fb/api.txt | 306 | ||||
-rw-r--r-- | Documentation/fb/intel810.txt | 2 | ||||
-rw-r--r-- | Documentation/fb/intelfb.txt | 2 | ||||
-rw-r--r-- | Documentation/fb/matroxfb.txt | 8 | ||||
-rw-r--r-- | Documentation/fb/udlfb.txt | 39 |
5 files changed, 18 insertions, 339 deletions
diff --git a/Documentation/fb/api.txt b/Documentation/fb/api.txt deleted file mode 100644 index d4ff7de8570..00000000000 --- a/Documentation/fb/api.txt +++ /dev/null | |||
@@ -1,306 +0,0 @@ | |||
1 | The Frame Buffer Device API | ||
2 | --------------------------- | ||
3 | |||
4 | Last revised: June 21, 2011 | ||
5 | |||
6 | |||
7 | 0. Introduction | ||
8 | --------------- | ||
9 | |||
10 | This document describes the frame buffer API used by applications to interact | ||
11 | with frame buffer devices. In-kernel APIs between device drivers and the frame | ||
12 | buffer core are not described. | ||
13 | |||
14 | Due to a lack of documentation in the original frame buffer API, drivers | ||
15 | behaviours differ in subtle (and not so subtle) ways. This document describes | ||
16 | the recommended API implementation, but applications should be prepared to | ||
17 | deal with different behaviours. | ||
18 | |||
19 | |||
20 | 1. Capabilities | ||
21 | --------------- | ||
22 | |||
23 | Device and driver capabilities are reported in the fixed screen information | ||
24 | capabilities field. | ||
25 | |||
26 | struct fb_fix_screeninfo { | ||
27 | ... | ||
28 | __u16 capabilities; /* see FB_CAP_* */ | ||
29 | ... | ||
30 | }; | ||
31 | |||
32 | Application should use those capabilities to find out what features they can | ||
33 | expect from the device and driver. | ||
34 | |||
35 | - FB_CAP_FOURCC | ||
36 | |||
37 | The driver supports the four character code (FOURCC) based format setting API. | ||
38 | When supported, formats are configured using a FOURCC instead of manually | ||
39 | specifying color components layout. | ||
40 | |||
41 | |||
42 | 2. Types and visuals | ||
43 | -------------------- | ||
44 | |||
45 | Pixels are stored in memory in hardware-dependent formats. Applications need | ||
46 | to be aware of the pixel storage format in order to write image data to the | ||
47 | frame buffer memory in the format expected by the hardware. | ||
48 | |||
49 | Formats are described by frame buffer types and visuals. Some visuals require | ||
50 | additional information, which are stored in the variable screen information | ||
51 | bits_per_pixel, grayscale, red, green, blue and transp fields. | ||
52 | |||
53 | Visuals describe how color information is encoded and assembled to create | ||
54 | macropixels. Types describe how macropixels are stored in memory. The following | ||
55 | types and visuals are supported. | ||
56 | |||
57 | - FB_TYPE_PACKED_PIXELS | ||
58 | |||
59 | Macropixels are stored contiguously in a single plane. If the number of bits | ||
60 | per macropixel is not a multiple of 8, whether macropixels are padded to the | ||
61 | next multiple of 8 bits or packed together into bytes depends on the visual. | ||
62 | |||
63 | Padding at end of lines may be present and is then reported through the fixed | ||
64 | screen information line_length field. | ||
65 | |||
66 | - FB_TYPE_PLANES | ||
67 | |||
68 | Macropixels are split across multiple planes. The number of planes is equal to | ||
69 | the number of bits per macropixel, with plane i'th storing i'th bit from all | ||
70 | macropixels. | ||
71 | |||
72 | Planes are located contiguously in memory. | ||
73 | |||
74 | - FB_TYPE_INTERLEAVED_PLANES | ||
75 | |||
76 | Macropixels are split across multiple planes. The number of planes is equal to | ||
77 | the number of bits per macropixel, with plane i'th storing i'th bit from all | ||
78 | macropixels. | ||
79 | |||
80 | Planes are interleaved in memory. The interleave factor, defined as the | ||
81 | distance in bytes between the beginning of two consecutive interleaved blocks | ||
82 | belonging to different planes, is stored in the fixed screen information | ||
83 | type_aux field. | ||
84 | |||
85 | - FB_TYPE_FOURCC | ||
86 | |||
87 | Macropixels are stored in memory as described by the format FOURCC identifier | ||
88 | stored in the variable screen information grayscale field. | ||
89 | |||
90 | - FB_VISUAL_MONO01 | ||
91 | |||
92 | Pixels are black or white and stored on a number of bits (typically one) | ||
93 | specified by the variable screen information bpp field. | ||
94 | |||
95 | Black pixels are represented by all bits set to 1 and white pixels by all bits | ||
96 | set to 0. When the number of bits per pixel is smaller than 8, several pixels | ||
97 | are packed together in a byte. | ||
98 | |||
99 | FB_VISUAL_MONO01 is currently used with FB_TYPE_PACKED_PIXELS only. | ||
100 | |||
101 | - FB_VISUAL_MONO10 | ||
102 | |||
103 | Pixels are black or white and stored on a number of bits (typically one) | ||
104 | specified by the variable screen information bpp field. | ||
105 | |||
106 | Black pixels are represented by all bits set to 0 and white pixels by all bits | ||
107 | set to 1. When the number of bits per pixel is smaller than 8, several pixels | ||
108 | are packed together in a byte. | ||
109 | |||
110 | FB_VISUAL_MONO01 is currently used with FB_TYPE_PACKED_PIXELS only. | ||
111 | |||
112 | - FB_VISUAL_TRUECOLOR | ||
113 | |||
114 | Pixels are broken into red, green and blue components, and each component | ||
115 | indexes a read-only lookup table for the corresponding value. Lookup tables | ||
116 | are device-dependent, and provide linear or non-linear ramps. | ||
117 | |||
118 | Each component is stored in a macropixel according to the variable screen | ||
119 | information red, green, blue and transp fields. | ||
120 | |||
121 | - FB_VISUAL_PSEUDOCOLOR and FB_VISUAL_STATIC_PSEUDOCOLOR | ||
122 | |||
123 | Pixel values are encoded as indices into a colormap that stores red, green and | ||
124 | blue components. The colormap is read-only for FB_VISUAL_STATIC_PSEUDOCOLOR | ||
125 | and read-write for FB_VISUAL_PSEUDOCOLOR. | ||
126 | |||
127 | Each pixel value is stored in the number of bits reported by the variable | ||
128 | screen information bits_per_pixel field. | ||
129 | |||
130 | - FB_VISUAL_DIRECTCOLOR | ||
131 | |||
132 | Pixels are broken into red, green and blue components, and each component | ||
133 | indexes a programmable lookup table for the corresponding value. | ||
134 | |||
135 | Each component is stored in a macropixel according to the variable screen | ||
136 | information red, green, blue and transp fields. | ||
137 | |||
138 | - FB_VISUAL_FOURCC | ||
139 | |||
140 | Pixels are encoded and interpreted as described by the format FOURCC | ||
141 | identifier stored in the variable screen information grayscale field. | ||
142 | |||
143 | |||
144 | 3. Screen information | ||
145 | --------------------- | ||
146 | |||
147 | Screen information are queried by applications using the FBIOGET_FSCREENINFO | ||
148 | and FBIOGET_VSCREENINFO ioctls. Those ioctls take a pointer to a | ||
149 | fb_fix_screeninfo and fb_var_screeninfo structure respectively. | ||
150 | |||
151 | struct fb_fix_screeninfo stores device independent unchangeable information | ||
152 | about the frame buffer device and the current format. Those information can't | ||
153 | be directly modified by applications, but can be changed by the driver when an | ||
154 | application modifies the format. | ||
155 | |||
156 | struct fb_fix_screeninfo { | ||
157 | char id[16]; /* identification string eg "TT Builtin" */ | ||
158 | unsigned long smem_start; /* Start of frame buffer mem */ | ||
159 | /* (physical address) */ | ||
160 | __u32 smem_len; /* Length of frame buffer mem */ | ||
161 | __u32 type; /* see FB_TYPE_* */ | ||
162 | __u32 type_aux; /* Interleave for interleaved Planes */ | ||
163 | __u32 visual; /* see FB_VISUAL_* */ | ||
164 | __u16 xpanstep; /* zero if no hardware panning */ | ||
165 | __u16 ypanstep; /* zero if no hardware panning */ | ||
166 | __u16 ywrapstep; /* zero if no hardware ywrap */ | ||
167 | __u32 line_length; /* length of a line in bytes */ | ||
168 | unsigned long mmio_start; /* Start of Memory Mapped I/O */ | ||
169 | /* (physical address) */ | ||
170 | __u32 mmio_len; /* Length of Memory Mapped I/O */ | ||
171 | __u32 accel; /* Indicate to driver which */ | ||
172 | /* specific chip/card we have */ | ||
173 | __u16 capabilities; /* see FB_CAP_* */ | ||
174 | __u16 reserved[2]; /* Reserved for future compatibility */ | ||
175 | }; | ||
176 | |||
177 | struct fb_var_screeninfo stores device independent changeable information | ||
178 | about a frame buffer device, its current format and video mode, as well as | ||
179 | other miscellaneous parameters. | ||
180 | |||
181 | struct fb_var_screeninfo { | ||
182 | __u32 xres; /* visible resolution */ | ||
183 | __u32 yres; | ||
184 | __u32 xres_virtual; /* virtual resolution */ | ||
185 | __u32 yres_virtual; | ||
186 | __u32 xoffset; /* offset from virtual to visible */ | ||
187 | __u32 yoffset; /* resolution */ | ||
188 | |||
189 | __u32 bits_per_pixel; /* guess what */ | ||
190 | __u32 grayscale; /* 0 = color, 1 = grayscale, */ | ||
191 | /* >1 = FOURCC */ | ||
192 | struct fb_bitfield red; /* bitfield in fb mem if true color, */ | ||
193 | struct fb_bitfield green; /* else only length is significant */ | ||
194 | struct fb_bitfield blue; | ||
195 | struct fb_bitfield transp; /* transparency */ | ||
196 | |||
197 | __u32 nonstd; /* != 0 Non standard pixel format */ | ||
198 | |||
199 | __u32 activate; /* see FB_ACTIVATE_* */ | ||
200 | |||
201 | __u32 height; /* height of picture in mm */ | ||
202 | __u32 width; /* width of picture in mm */ | ||
203 | |||
204 | __u32 accel_flags; /* (OBSOLETE) see fb_info.flags */ | ||
205 | |||
206 | /* Timing: All values in pixclocks, except pixclock (of course) */ | ||
207 | __u32 pixclock; /* pixel clock in ps (pico seconds) */ | ||
208 | __u32 left_margin; /* time from sync to picture */ | ||
209 | __u32 right_margin; /* time from picture to sync */ | ||
210 | __u32 upper_margin; /* time from sync to picture */ | ||
211 | __u32 lower_margin; | ||
212 | __u32 hsync_len; /* length of horizontal sync */ | ||
213 | __u32 vsync_len; /* length of vertical sync */ | ||
214 | __u32 sync; /* see FB_SYNC_* */ | ||
215 | __u32 vmode; /* see FB_VMODE_* */ | ||
216 | __u32 rotate; /* angle we rotate counter clockwise */ | ||
217 | __u32 colorspace; /* colorspace for FOURCC-based modes */ | ||
218 | __u32 reserved[4]; /* Reserved for future compatibility */ | ||
219 | }; | ||
220 | |||
221 | To modify variable information, applications call the FBIOPUT_VSCREENINFO | ||
222 | ioctl with a pointer to a fb_var_screeninfo structure. If the call is | ||
223 | successful, the driver will update the fixed screen information accordingly. | ||
224 | |||
225 | Instead of filling the complete fb_var_screeninfo structure manually, | ||
226 | applications should call the FBIOGET_VSCREENINFO ioctl and modify only the | ||
227 | fields they care about. | ||
228 | |||
229 | |||
230 | 4. Format configuration | ||
231 | ----------------------- | ||
232 | |||
233 | Frame buffer devices offer two ways to configure the frame buffer format: the | ||
234 | legacy API and the FOURCC-based API. | ||
235 | |||
236 | |||
237 | The legacy API has been the only frame buffer format configuration API for a | ||
238 | long time and is thus widely used by application. It is the recommended API | ||
239 | for applications when using RGB and grayscale formats, as well as legacy | ||
240 | non-standard formats. | ||
241 | |||
242 | To select a format, applications set the fb_var_screeninfo bits_per_pixel field | ||
243 | to the desired frame buffer depth. Values up to 8 will usually map to | ||
244 | monochrome, grayscale or pseudocolor visuals, although this is not required. | ||
245 | |||
246 | - For grayscale formats, applications set the grayscale field to one. The red, | ||
247 | blue, green and transp fields must be set to 0 by applications and ignored by | ||
248 | drivers. Drivers must fill the red, blue and green offsets to 0 and lengths | ||
249 | to the bits_per_pixel value. | ||
250 | |||
251 | - For pseudocolor formats, applications set the grayscale field to zero. The | ||
252 | red, blue, green and transp fields must be set to 0 by applications and | ||
253 | ignored by drivers. Drivers must fill the red, blue and green offsets to 0 | ||
254 | and lengths to the bits_per_pixel value. | ||
255 | |||
256 | - For truecolor and directcolor formats, applications set the grayscale field | ||
257 | to zero, and the red, blue, green and transp fields to describe the layout of | ||
258 | color components in memory. | ||
259 | |||
260 | struct fb_bitfield { | ||
261 | __u32 offset; /* beginning of bitfield */ | ||
262 | __u32 length; /* length of bitfield */ | ||
263 | __u32 msb_right; /* != 0 : Most significant bit is */ | ||
264 | /* right */ | ||
265 | }; | ||
266 | |||
267 | Pixel values are bits_per_pixel wide and are split in non-overlapping red, | ||
268 | green, blue and alpha (transparency) components. Location and size of each | ||
269 | component in the pixel value are described by the fb_bitfield offset and | ||
270 | length fields. Offset are computed from the right. | ||
271 | |||
272 | Pixels are always stored in an integer number of bytes. If the number of | ||
273 | bits per pixel is not a multiple of 8, pixel values are padded to the next | ||
274 | multiple of 8 bits. | ||
275 | |||
276 | Upon successful format configuration, drivers update the fb_fix_screeninfo | ||
277 | type, visual and line_length fields depending on the selected format. | ||
278 | |||
279 | |||
280 | The FOURCC-based API replaces format descriptions by four character codes | ||
281 | (FOURCC). FOURCCs are abstract identifiers that uniquely define a format | ||
282 | without explicitly describing it. This is the only API that supports YUV | ||
283 | formats. Drivers are also encouraged to implement the FOURCC-based API for RGB | ||
284 | and grayscale formats. | ||
285 | |||
286 | Drivers that support the FOURCC-based API report this capability by setting | ||
287 | the FB_CAP_FOURCC bit in the fb_fix_screeninfo capabilities field. | ||
288 | |||
289 | FOURCC definitions are located in the linux/videodev2.h header. However, and | ||
290 | despite starting with the V4L2_PIX_FMT_prefix, they are not restricted to V4L2 | ||
291 | and don't require usage of the V4L2 subsystem. FOURCC documentation is | ||
292 | available in Documentation/DocBook/v4l/pixfmt.xml. | ||
293 | |||
294 | To select a format, applications set the grayscale field to the desired FOURCC. | ||
295 | For YUV formats, they should also select the appropriate colorspace by setting | ||
296 | the colorspace field to one of the colorspaces listed in linux/videodev2.h and | ||
297 | documented in Documentation/DocBook/v4l/colorspaces.xml. | ||
298 | |||
299 | The red, green, blue and transp fields are not used with the FOURCC-based API. | ||
300 | For forward compatibility reasons applications must zero those fields, and | ||
301 | drivers must ignore them. Values other than 0 may get a meaning in future | ||
302 | extensions. | ||
303 | |||
304 | Upon successful format configuration, drivers update the fb_fix_screeninfo | ||
305 | type, visual and line_length fields depending on the selected format. The type | ||
306 | and visual fields are set to FB_TYPE_FOURCC and FB_VISUAL_FOURCC respectively. | ||
diff --git a/Documentation/fb/intel810.txt b/Documentation/fb/intel810.txt index a8e9f5bca6f..be3e7836abe 100644 --- a/Documentation/fb/intel810.txt +++ b/Documentation/fb/intel810.txt | |||
@@ -211,7 +211,7 @@ Using the same setup as described above, load the module like this: | |||
211 | modprobe i810fb vram=2 xres=1024 bpp=8 hsync1=30 hsync2=55 vsync1=50 \ | 211 | modprobe i810fb vram=2 xres=1024 bpp=8 hsync1=30 hsync2=55 vsync1=50 \ |
212 | vsync2=85 accel=1 mtrr=1 | 212 | vsync2=85 accel=1 mtrr=1 |
213 | 213 | ||
214 | Or just add the following to a configuration file in /etc/modprobe.d/ | 214 | Or just add the following to /etc/modprobe.conf |
215 | 215 | ||
216 | options i810fb vram=2 xres=1024 bpp=16 hsync1=30 hsync2=55 vsync1=50 \ | 216 | options i810fb vram=2 xres=1024 bpp=16 hsync1=30 hsync2=55 vsync1=50 \ |
217 | vsync2=85 accel=1 mtrr=1 | 217 | vsync2=85 accel=1 mtrr=1 |
diff --git a/Documentation/fb/intelfb.txt b/Documentation/fb/intelfb.txt index feac4e4d696..dd9e944ea62 100644 --- a/Documentation/fb/intelfb.txt +++ b/Documentation/fb/intelfb.txt | |||
@@ -120,7 +120,7 @@ Using the same setup as described above, load the module like this: | |||
120 | 120 | ||
121 | modprobe intelfb mode=800x600-32@75 vram=8 accel=1 hwcursor=1 | 121 | modprobe intelfb mode=800x600-32@75 vram=8 accel=1 hwcursor=1 |
122 | 122 | ||
123 | Or just add the following to a configuration file in /etc/modprobe.d/ | 123 | Or just add the following to /etc/modprobe.conf |
124 | 124 | ||
125 | options intelfb mode=800x600-32@75 vram=8 accel=1 hwcursor=1 | 125 | options intelfb mode=800x600-32@75 vram=8 accel=1 hwcursor=1 |
126 | 126 | ||
diff --git a/Documentation/fb/matroxfb.txt b/Documentation/fb/matroxfb.txt index b95f5bb522f..e5ce8a1a978 100644 --- a/Documentation/fb/matroxfb.txt +++ b/Documentation/fb/matroxfb.txt | |||
@@ -177,8 +177,8 @@ sgram - tells to driver that you have Gxx0 with SGRAM memory. It has no | |||
177 | effect without `init'. | 177 | effect without `init'. |
178 | sdram - tells to driver that you have Gxx0 with SDRAM memory. | 178 | sdram - tells to driver that you have Gxx0 with SDRAM memory. |
179 | It is a default. | 179 | It is a default. |
180 | inv24 - change timings parameters for 24bpp modes on Millennium and | 180 | inv24 - change timings parameters for 24bpp modes on Millenium and |
181 | Millennium II. Specify this if you see strange color shadows around | 181 | Millenium II. Specify this if you see strange color shadows around |
182 | characters. | 182 | characters. |
183 | noinv24 - use standard timings. It is the default. | 183 | noinv24 - use standard timings. It is the default. |
184 | inverse - invert colors on screen (for LCD displays) | 184 | inverse - invert colors on screen (for LCD displays) |
@@ -204,9 +204,9 @@ grayscale - enable grayscale summing. It works in PSEUDOCOLOR modes (text, | |||
204 | can paint colors. | 204 | can paint colors. |
205 | nograyscale - disable grayscale summing. It is default. | 205 | nograyscale - disable grayscale summing. It is default. |
206 | cross4MB - enables that pixel line can cross 4MB boundary. It is default for | 206 | cross4MB - enables that pixel line can cross 4MB boundary. It is default for |
207 | non-Millennium. | 207 | non-Millenium. |
208 | nocross4MB - pixel line must not cross 4MB boundary. It is default for | 208 | nocross4MB - pixel line must not cross 4MB boundary. It is default for |
209 | Millennium I or II, because of these devices have hardware | 209 | Millenium I or II, because of these devices have hardware |
210 | limitations which do not allow this. But this option is | 210 | limitations which do not allow this. But this option is |
211 | incompatible with some (if not all yet released) versions of | 211 | incompatible with some (if not all yet released) versions of |
212 | XF86_FBDev. | 212 | XF86_FBDev. |
diff --git a/Documentation/fb/udlfb.txt b/Documentation/fb/udlfb.txt index 57d2f2908b1..7fdde2a02a2 100644 --- a/Documentation/fb/udlfb.txt +++ b/Documentation/fb/udlfb.txt | |||
@@ -87,38 +87,23 @@ Special configuration for udlfb is usually unnecessary. There are a few | |||
87 | options, however. | 87 | options, however. |
88 | 88 | ||
89 | From the command line, pass options to modprobe | 89 | From the command line, pass options to modprobe |
90 | modprobe udlfb fb_defio=0 console=1 shadow=1 | 90 | modprobe udlfb defio=1 console=1 |
91 | 91 | ||
92 | Or modify options on the fly at /sys/module/udlfb/parameters directory via | 92 | Or for permanent option, create file like /etc/modprobe.d/options with text |
93 | sudo nano fb_defio | 93 | options udlfb defio=1 console=1 |
94 | change the parameter in place, and save the file. | ||
95 | 94 | ||
96 | Unplug/replug USB device to apply with new settings | 95 | Accepted options: |
97 | |||
98 | Or for permanent option, create file like /etc/modprobe.d/udlfb.conf with text | ||
99 | options udlfb fb_defio=0 console=1 shadow=1 | ||
100 | |||
101 | Accepted boolean options: | ||
102 | 96 | ||
103 | fb_defio Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel | 97 | fb_defio Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel |
104 | module to track changed areas of the framebuffer by page faults. | 98 | module to track changed areas of the framebuffer by page faults. |
105 | Standard fbdev applications that use mmap but that do not | 99 | Standard fbdev applications that use mmap but that do not |
106 | report damage, should be able to work with this enabled. | 100 | report damage, may be able to work with this enabled. |
107 | Disable when running with X server that supports reporting | 101 | Disabled by default because of overhead and other issues. |
108 | changed regions via ioctl, as this method is simpler, | 102 | |
109 | more stable, and higher performance. | 103 | console Allow fbcon to attach to udlfb provided framebuffers. This |
110 | default: fb_defio=1 | 104 | is disabled by default because fbcon will aggressively consume |
111 | 105 | the first framebuffer it finds, which isn't usually what the | |
112 | console Allow fbcon to attach to udlfb provided framebuffers. | 106 | user wants in the case of USB displays. |
113 | Can be disabled if fbcon and other clients | ||
114 | (e.g. X with --shared-vt) are in conflict. | ||
115 | default: console=1 | ||
116 | |||
117 | shadow Allocate a 2nd framebuffer to shadow what's currently across | ||
118 | the USB bus in device memory. If any pixels are unchanged, | ||
119 | do not transmit. Spends host memory to save USB transfers. | ||
120 | Enabled by default. Only disable on very low memory systems. | ||
121 | default: shadow=1 | ||
122 | 107 | ||
123 | Sysfs Attributes | 108 | Sysfs Attributes |
124 | ================ | 109 | ================ |