DSS 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. OMAP2/3 Display Subsystem
  2. -------------------------
  3. This is an almost total rewrite of the OMAP FB driver in drivers/video/omap
  4. (let's call it DSS1). The main differences between DSS1 and DSS2 are DSI,
  5. TV-out and multiple display support, but there are lots of small improvements
  6. also.
  7. The DSS2 driver (omapdss module) is in arch/arm/plat-omap/dss/, and the FB,
  8. panel and controller drivers are in drivers/video/omap2/. DSS1 and DSS2 live
  9. currently side by side, you can choose which one to use.
  10. Features
  11. --------
  12. Working and tested features include:
  13. - MIPI DPI (parallel) output
  14. - MIPI DSI output in command mode
  15. - MIPI DBI (RFBI) output
  16. - SDI output
  17. - TV output
  18. - All pieces can be compiled as a module or inside kernel
  19. - Use DISPC to update any of the outputs
  20. - Use CPU to update RFBI or DSI output
  21. - OMAP DISPC planes
  22. - RGB16, RGB24 packed, RGB24 unpacked
  23. - YUV2, UYVY
  24. - Scaling
  25. - Adjusting DSS FCK to find a good pixel clock
  26. - Use DSI DPLL to create DSS FCK
  27. Tested boards include:
  28. - OMAP3 SDP board
  29. - Beagle board
  30. - N810
  31. omapdss driver
  32. --------------
  33. The DSS driver does not itself have any support for Linux framebuffer, V4L or
  34. such like the current ones, but it has an internal kernel API that upper level
  35. drivers can use.
  36. The DSS driver models OMAP's overlays, overlay managers and displays in a
  37. flexible way to enable non-common multi-display configuration. In addition to
  38. modelling the hardware overlays, omapdss supports virtual overlays and overlay
  39. managers. These can be used when updating a display with CPU or system DMA.
  40. Panel and controller drivers
  41. ----------------------------
  42. The drivers implement panel or controller specific functionality and are not
  43. usually visible to users except through omapfb driver. They register
  44. themselves to the DSS driver.
  45. omapfb driver
  46. -------------
  47. The omapfb driver implements arbitrary number of standard linux framebuffers.
  48. These framebuffers can be routed flexibly to any overlays, thus allowing very
  49. dynamic display architecture.
  50. The driver exports some omapfb specific ioctls, which are compatible with the
  51. ioctls in the old driver.
  52. The rest of the non standard features are exported via sysfs. Whether the final
  53. implementation will use sysfs, or ioctls, is still open.
  54. V4L2 drivers
  55. ------------
  56. V4L2 is being implemented in TI.
  57. From omapdss point of view the V4L2 drivers should be similar to framebuffer
  58. driver.
  59. Architecture
  60. --------------------
  61. Some clarification what the different components do:
  62. - Framebuffer is a memory area inside OMAP's SRAM/SDRAM that contains the
  63. pixel data for the image. Framebuffer has width and height and color
  64. depth.
  65. - Overlay defines where the pixels are read from and where they go on the
  66. screen. The overlay may be smaller than framebuffer, thus displaying only
  67. part of the framebuffer. The position of the overlay may be changed if
  68. the overlay is smaller than the display.
  69. - Overlay manager combines the overlays in to one image and feeds them to
  70. display.
  71. - Display is the actual physical display device.
  72. A framebuffer can be connected to multiple overlays to show the same pixel data
  73. on all of the overlays. Note that in this case the overlay input sizes must be
  74. the same, but, in case of video overlays, the output size can be different. Any
  75. framebuffer can be connected to any overlay.
  76. An overlay can be connected to one overlay manager. Also DISPC overlays can be
  77. connected only to DISPC overlay managers, and virtual overlays can be only
  78. connected to virtual overlays.
  79. An overlay manager can be connected to one display. There are certain
  80. restrictions which kinds of displays an overlay manager can be connected:
  81. - DISPC TV overlay manager can be only connected to TV display.
  82. - Virtual overlay managers can only be connected to DBI or DSI displays.
  83. - DISPC LCD overlay manager can be connected to all displays, except TV
  84. display.
  85. Sysfs
  86. -----
  87. The sysfs interface is mainly used for testing. I don't think sysfs
  88. interface is the best for this in the final version, but I don't quite know
  89. what would be the best interfaces for these things.
  90. The sysfs interface is divided to two parts: DSS and FB.
  91. /sys/class/graphics/fb? directory:
  92. mirror 0=off, 1=on
  93. rotate Rotation 0-3 for 0, 90, 180, 270 degrees
  94. rotate_type 0 = DMA rotation, 1 = VRFB rotation
  95. overlays List of overlay numbers to which framebuffer pixels go
  96. phys_addr Physical address of the framebuffer
  97. virt_addr Virtual address of the framebuffer
  98. size Size of the framebuffer
  99. /sys/devices/platform/omapdss/overlay? directory:
  100. enabled 0=off, 1=on
  101. input_size width,height (ie. the framebuffer size)
  102. manager Destination overlay manager name
  103. name
  104. output_size width,height
  105. position x,y
  106. screen_width width
  107. global_alpha global alpha 0-255 0=transparent 255=opaque
  108. /sys/devices/platform/omapdss/manager? directory:
  109. display Destination display
  110. name
  111. alpha_blending_enabled 0=off, 1=on
  112. trans_key_enabled 0=off, 1=on
  113. trans_key_type gfx-destination, video-source
  114. trans_key_value transparency color key (RGB24)
  115. default_color default background color (RGB24)
  116. /sys/devices/platform/omapdss/display? directory:
  117. ctrl_name Controller name
  118. mirror 0=off, 1=on
  119. update_mode 0=off, 1=auto, 2=manual
  120. enabled 0=off, 1=on
  121. name
  122. rotate Rotation 0-3 for 0, 90, 180, 270 degrees
  123. timings Display timings (pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw)
  124. When writing, two special timings are accepted for tv-out:
  125. "pal" and "ntsc"
  126. panel_name
  127. tear_elim Tearing elimination 0=off, 1=on
  128. output_type Output type (video encoder only): "composite" or "svideo"
  129. There are also some debugfs files at <debugfs>/omapdss/ which show information
  130. about clocks and registers.
  131. Examples
  132. --------
  133. The following definitions have been made for the examples below:
  134. ovl0=/sys/devices/platform/omapdss/overlay0
  135. ovl1=/sys/devices/platform/omapdss/overlay1
  136. ovl2=/sys/devices/platform/omapdss/overlay2
  137. mgr0=/sys/devices/platform/omapdss/manager0
  138. mgr1=/sys/devices/platform/omapdss/manager1
  139. lcd=/sys/devices/platform/omapdss/display0
  140. dvi=/sys/devices/platform/omapdss/display1
  141. tv=/sys/devices/platform/omapdss/display2
  142. fb0=/sys/class/graphics/fb0
  143. fb1=/sys/class/graphics/fb1
  144. fb2=/sys/class/graphics/fb2
  145. Default setup on OMAP3 SDP
  146. --------------------------
  147. Here's the default setup on OMAP3 SDP board. All planes go to LCD. DVI
  148. and TV-out are not in use. The columns from left to right are:
  149. framebuffers, overlays, overlay managers, displays. Framebuffers are
  150. handled by omapfb, and the rest by the DSS.
  151. FB0 --- GFX -\ DVI
  152. FB1 --- VID1 --+- LCD ---- LCD
  153. FB2 --- VID2 -/ TV ----- TV
  154. Example: Switch from LCD to DVI
  155. ----------------------
  156. w=`cat $dvi/timings | cut -d "," -f 2 | cut -d "/" -f 1`
  157. h=`cat $dvi/timings | cut -d "," -f 3 | cut -d "/" -f 1`
  158. echo "0" > $lcd/enabled
  159. echo "" > $mgr0/display
  160. fbset -fb /dev/fb0 -xres $w -yres $h -vxres $w -vyres $h
  161. # at this point you have to switch the dvi/lcd dip-switch from the omap board
  162. echo "dvi" > $mgr0/display
  163. echo "1" > $dvi/enabled
  164. After this the configuration looks like:
  165. FB0 --- GFX -\ -- DVI
  166. FB1 --- VID1 --+- LCD -/ LCD
  167. FB2 --- VID2 -/ TV ----- TV
  168. Example: Clone GFX overlay to LCD and TV
  169. -------------------------------
  170. w=`cat $tv/timings | cut -d "," -f 2 | cut -d "/" -f 1`
  171. h=`cat $tv/timings | cut -d "," -f 3 | cut -d "/" -f 1`
  172. echo "0" > $ovl0/enabled
  173. echo "0" > $ovl1/enabled
  174. echo "" > $fb1/overlays
  175. echo "0,1" > $fb0/overlays
  176. echo "$w,$h" > $ovl1/output_size
  177. echo "tv" > $ovl1/manager
  178. echo "1" > $ovl0/enabled
  179. echo "1" > $ovl1/enabled
  180. echo "1" > $tv/enabled
  181. After this the configuration looks like (only relevant parts shown):
  182. FB0 +-- GFX ---- LCD ---- LCD
  183. \- VID1 ---- TV ---- TV
  184. Misc notes
  185. ----------
  186. OMAP FB allocates the framebuffer memory using the OMAP VRAM allocator.
  187. Using DSI DPLL to generate pixel clock it is possible produce the pixel clock
  188. of 86.5MHz (max possible), and with that you get 1280x1024@57 output from DVI.
  189. Rotation and mirroring currently only supports RGB565 and RGB8888 modes. VRFB
  190. does not support mirroring.
  191. VRFB rotation requires much more memory than non-rotated framebuffer, so you
  192. probably need to increase your vram setting before using VRFB rotation. Also,
  193. many applications may not work with VRFB if they do not pay attention to all
  194. framebuffer parameters.
  195. Kernel boot arguments
  196. ---------------------
  197. vram=<size>[,<physaddr>]
  198. - Amount of total VRAM to preallocate and optionally a physical start
  199. memory address. For example, "10M". omapfb allocates memory for
  200. framebuffers from VRAM.
  201. omapfb.mode=<display>:<mode>[,...]
  202. - Default video mode for specified displays. For example,
  203. "dvi:800x400MR-24@60". See drivers/video/modedb.c.
  204. There are also two special modes: "pal" and "ntsc" that
  205. can be used to tv out.
  206. omapfb.vram=<fbnum>:<size>[@<physaddr>][,...]
  207. - VRAM allocated for a framebuffer. Normally omapfb allocates vram
  208. depending on the display size. With this you can manually allocate
  209. more or define the physical address of each framebuffer. For example,
  210. "1:4M" to allocate 4M for fb1.
  211. omapfb.debug=<y|n>
  212. - Enable debug printing. You have to have OMAPFB debug support enabled
  213. in kernel config.
  214. omapfb.test=<y|n>
  215. - Draw test pattern to framebuffer whenever framebuffer settings change.
  216. You need to have OMAPFB debug support enabled in kernel config.
  217. omapfb.vrfb=<y|n>
  218. - Use VRFB rotation for all framebuffers.
  219. omapfb.rotate=<angle>
  220. - Default rotation applied to all framebuffers.
  221. 0 - 0 degree rotation
  222. 1 - 90 degree rotation
  223. 2 - 180 degree rotation
  224. 3 - 270 degree rotation
  225. omapfb.mirror=<y|n>
  226. - Default mirror for all framebuffers. Only works with DMA rotation.
  227. omapdss.def_disp=<display>
  228. - Name of default display, to which all overlays will be connected.
  229. Common examples are "lcd" or "tv".
  230. omapdss.debug=<y|n>
  231. - Enable debug printing. You have to have DSS debug support enabled in
  232. kernel config.
  233. TODO
  234. ----
  235. DSS locking
  236. Error checking
  237. - Lots of checks are missing or implemented just as BUG()
  238. System DMA update for DSI
  239. - Can be used for RGB16 and RGB24P modes. Probably not for RGB24U (how
  240. to skip the empty byte?)
  241. OMAP1 support
  242. - Not sure if needed