1 =========================
2 OMAP2/3 Display Subsystem
3 =========================
5 This is an almost total rewrite of the OMAP FB driver in drivers/video/omap
6 (let's call it DSS1). The main differences between DSS1 and DSS2 are DSI,
7 TV-out and multiple display support, but there are lots of small improvements
10 The DSS2 driver (omapdss module) is in arch/arm/plat-omap/dss/, and the FB,
11 panel and controller drivers are in drivers/video/omap2/. DSS1 and DSS2 live
12 currently side by side, you can choose which one to use.
17 Working and tested features include:
19 - MIPI DPI (parallel) output
20 - MIPI DSI output in command mode
21 - MIPI DBI (RFBI) output
24 - All pieces can be compiled as a module or inside kernel
25 - Use DISPC to update any of the outputs
26 - Use CPU to update RFBI or DSI output
28 - RGB16, RGB24 packed, RGB24 unpacked
31 - Adjusting DSS FCK to find a good pixel clock
32 - Use DSI DPLL to create DSS FCK
34 Tested boards include:
42 The DSS driver does not itself have any support for Linux framebuffer, V4L or
43 such like the current ones, but it has an internal kernel API that upper level
46 The DSS driver models OMAP's overlays, overlay managers and displays in a
47 flexible way to enable non-common multi-display configuration. In addition to
48 modelling the hardware overlays, omapdss supports virtual overlays and overlay
49 managers. These can be used when updating a display with CPU or system DMA.
51 omapdss driver support for audio
52 --------------------------------
53 There exist several display technologies and standards that support audio as
54 well. Hence, it is relevant to update the DSS device driver to provide an audio
55 interface that may be used by an audio driver or any other driver interested in
58 The audio_enable function is intended to prepare the relevant
59 IP for playback (e.g., enabling an audio FIFO, taking in/out of reset
60 some IP, enabling companion chips, etc). It is intended to be called before
61 audio_start. The audio_disable function performs the reverse operation and is
62 intended to be called after audio_stop.
64 While a given DSS device driver may support audio, it is possible that for
65 certain configurations audio is not supported (e.g., an HDMI display using a
66 VESA video timing). The audio_supported function is intended to query whether
67 the current configuration of the display supports audio.
69 The audio_config function is intended to configure all the relevant audio
70 parameters of the display. In order to make the function independent of any
71 specific DSS device driver, a struct omap_dss_audio is defined. Its purpose
72 is to contain all the required parameters for audio configuration. At the
73 moment, such structure contains pointers to IEC-60958 channel status word
74 and CEA-861 audio infoframe structures. This should be enough to support
75 HDMI and DisplayPort, as both are based on CEA-861 and IEC-60958.
77 The audio_enable/disable, audio_config and audio_supported functions could be
78 implemented as functions that may sleep. Hence, they should not be called
79 while holding a spinlock or a readlock.
81 The audio_start/audio_stop function is intended to effectively start/stop audio
82 playback after the configuration has taken place. These functions are designed
83 to be used in an atomic context. Hence, audio_start should return quickly and be
84 called only after all the needed resources for audio playback (audio FIFOs,
85 DMA channels, companion chips, etc) have been enabled to begin data transfers.
86 audio_stop is designed to only stop the audio transfers. The resources used
87 for playback are released using audio_disable.
89 The enum omap_dss_audio_state may be used to help the implementations of
90 the interface to keep track of the audio state. The initial state is _DISABLED;
91 then, the state transitions to _CONFIGURED, and then, when it is ready to
92 play audio, to _ENABLED. The state _PLAYING is used when the audio is being
96 Panel and controller drivers
97 ----------------------------
99 The drivers implement panel or controller specific functionality and are not
100 usually visible to users except through omapfb driver. They register
101 themselves to the DSS driver.
106 The omapfb driver implements arbitrary number of standard linux framebuffers.
107 These framebuffers can be routed flexibly to any overlays, thus allowing very
108 dynamic display architecture.
110 The driver exports some omapfb specific ioctls, which are compatible with the
111 ioctls in the old driver.
113 The rest of the non standard features are exported via sysfs. Whether the final
114 implementation will use sysfs, or ioctls, is still open.
119 V4L2 is being implemented in TI.
121 From omapdss point of view the V4L2 drivers should be similar to framebuffer
127 Some clarification what the different components do:
129 - Framebuffer is a memory area inside OMAP's SRAM/SDRAM that contains the
130 pixel data for the image. Framebuffer has width and height and color
132 - Overlay defines where the pixels are read from and where they go on the
133 screen. The overlay may be smaller than framebuffer, thus displaying only
134 part of the framebuffer. The position of the overlay may be changed if
135 the overlay is smaller than the display.
136 - Overlay manager combines the overlays in to one image and feeds them to
138 - Display is the actual physical display device.
140 A framebuffer can be connected to multiple overlays to show the same pixel data
141 on all of the overlays. Note that in this case the overlay input sizes must be
142 the same, but, in case of video overlays, the output size can be different. Any
143 framebuffer can be connected to any overlay.
145 An overlay can be connected to one overlay manager. Also DISPC overlays can be
146 connected only to DISPC overlay managers, and virtual overlays can be only
147 connected to virtual overlays.
149 An overlay manager can be connected to one display. There are certain
150 restrictions which kinds of displays an overlay manager can be connected:
152 - DISPC TV overlay manager can be only connected to TV display.
153 - Virtual overlay managers can only be connected to DBI or DSI displays.
154 - DISPC LCD overlay manager can be connected to all displays, except TV
159 The sysfs interface is mainly used for testing. I don't think sysfs
160 interface is the best for this in the final version, but I don't quite know
161 what would be the best interfaces for these things.
163 The sysfs interface is divided to two parts: DSS and FB.
165 /sys/class/graphics/fb? directory:
167 rotate Rotation 0-3 for 0, 90, 180, 270 degrees
168 rotate_type 0 = DMA rotation, 1 = VRFB rotation
169 overlays List of overlay numbers to which framebuffer pixels go
170 phys_addr Physical address of the framebuffer
171 virt_addr Virtual address of the framebuffer
172 size Size of the framebuffer
174 /sys/devices/platform/omapdss/overlay? directory:
176 input_size width,height (ie. the framebuffer size)
177 manager Destination overlay manager name
179 output_size width,height
182 global_alpha global alpha 0-255 0=transparent 255=opaque
184 /sys/devices/platform/omapdss/manager? directory:
185 display Destination display
187 alpha_blending_enabled 0=off, 1=on
188 trans_key_enabled 0=off, 1=on
189 trans_key_type gfx-destination, video-source
190 trans_key_value transparency color key (RGB24)
191 default_color default background color (RGB24)
193 /sys/devices/platform/omapdss/display? directory:
195 =============== =============================================================
196 ctrl_name Controller name
198 update_mode 0=off, 1=auto, 2=manual
201 rotate Rotation 0-3 for 0, 90, 180, 270 degrees
202 timings Display timings (pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw)
203 When writing, two special timings are accepted for tv-out:
206 tear_elim Tearing elimination 0=off, 1=on
207 output_type Output type (video encoder only): "composite" or "svideo"
208 =============== =============================================================
210 There are also some debugfs files at <debugfs>/omapdss/ which show information
211 about clocks and registers.
216 The following definitions have been made for the examples below::
218 ovl0=/sys/devices/platform/omapdss/overlay0
219 ovl1=/sys/devices/platform/omapdss/overlay1
220 ovl2=/sys/devices/platform/omapdss/overlay2
222 mgr0=/sys/devices/platform/omapdss/manager0
223 mgr1=/sys/devices/platform/omapdss/manager1
225 lcd=/sys/devices/platform/omapdss/display0
226 dvi=/sys/devices/platform/omapdss/display1
227 tv=/sys/devices/platform/omapdss/display2
229 fb0=/sys/class/graphics/fb0
230 fb1=/sys/class/graphics/fb1
231 fb2=/sys/class/graphics/fb2
233 Default setup on OMAP3 SDP
234 --------------------------
236 Here's the default setup on OMAP3 SDP board. All planes go to LCD. DVI
237 and TV-out are not in use. The columns from left to right are:
238 framebuffers, overlays, overlay managers, displays. Framebuffers are
239 handled by omapfb, and the rest by the DSS::
242 FB1 --- VID1 --+- LCD ---- LCD
243 FB2 --- VID2 -/ TV ----- TV
245 Example: Switch from LCD to DVI
246 -------------------------------
250 w=`cat $dvi/timings | cut -d "," -f 2 | cut -d "/" -f 1`
251 h=`cat $dvi/timings | cut -d "," -f 3 | cut -d "/" -f 1`
253 echo "0" > $lcd/enabled
254 echo "" > $mgr0/display
255 fbset -fb /dev/fb0 -xres $w -yres $h -vxres $w -vyres $h
256 # at this point you have to switch the dvi/lcd dip-switch from the omap board
257 echo "dvi" > $mgr0/display
258 echo "1" > $dvi/enabled
260 After this the configuration looks like:::
262 FB0 --- GFX -\ -- DVI
263 FB1 --- VID1 --+- LCD -/ LCD
264 FB2 --- VID2 -/ TV ----- TV
266 Example: Clone GFX overlay to LCD and TV
267 ----------------------------------------
271 w=`cat $tv/timings | cut -d "," -f 2 | cut -d "/" -f 1`
272 h=`cat $tv/timings | cut -d "," -f 3 | cut -d "/" -f 1`
274 echo "0" > $ovl0/enabled
275 echo "0" > $ovl1/enabled
277 echo "" > $fb1/overlays
278 echo "0,1" > $fb0/overlays
280 echo "$w,$h" > $ovl1/output_size
281 echo "tv" > $ovl1/manager
283 echo "1" > $ovl0/enabled
284 echo "1" > $ovl1/enabled
286 echo "1" > $tv/enabled
288 After this the configuration looks like (only relevant parts shown)::
290 FB0 +-- GFX ---- LCD ---- LCD
291 \- VID1 ---- TV ---- TV
296 OMAP FB allocates the framebuffer memory using the standard dma allocator. You
297 can enable Contiguous Memory Allocator (CONFIG_CMA) to improve the dma
298 allocator, and if CMA is enabled, you use "cma=" kernel parameter to increase
299 the global memory area for CMA.
301 Using DSI DPLL to generate pixel clock it is possible produce the pixel clock
302 of 86.5MHz (max possible), and with that you get 1280x1024@57 output from DVI.
304 Rotation and mirroring currently only supports RGB565 and RGB8888 modes. VRFB
305 does not support mirroring.
307 VRFB rotation requires much more memory than non-rotated framebuffer, so you
308 probably need to increase your vram setting before using VRFB rotation. Also,
309 many applications may not work with VRFB if they do not pay attention to all
310 framebuffer parameters.
312 Kernel boot arguments
313 ---------------------
315 omapfb.mode=<display>:<mode>[,...]
316 - Default video mode for specified displays. For example,
317 "dvi:800x400MR-24@60". See drivers/video/modedb.c.
318 There are also two special modes: "pal" and "ntsc" that
319 can be used to tv out.
321 omapfb.vram=<fbnum>:<size>[@<physaddr>][,...]
322 - VRAM allocated for a framebuffer. Normally omapfb allocates vram
323 depending on the display size. With this you can manually allocate
324 more or define the physical address of each framebuffer. For example,
325 "1:4M" to allocate 4M for fb1.
328 - Enable debug printing. You have to have OMAPFB debug support enabled
332 - Draw test pattern to framebuffer whenever framebuffer settings change.
333 You need to have OMAPFB debug support enabled in kernel config.
336 - Use VRFB rotation for all framebuffers.
338 omapfb.rotate=<angle>
339 - Default rotation applied to all framebuffers.
340 0 - 0 degree rotation
341 1 - 90 degree rotation
342 2 - 180 degree rotation
343 3 - 270 degree rotation
346 - Default mirror for all framebuffers. Only works with DMA rotation.
348 omapdss.def_disp=<display>
349 - Name of default display, to which all overlays will be connected.
350 Common examples are "lcd" or "tv".
353 - Enable debug printing. You have to have DSS debug support enabled in
363 - Lots of checks are missing or implemented just as BUG()
365 System DMA update for DSI
367 - Can be used for RGB16 and RGB24P modes. Probably not for RGB24U (how
368 to skip the empty byte?)