Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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