Re: [linux-sunxi] [PATCH v2 00/26] drm: Add Allwinner A10 display engine support

From: Priit Laes
Date: Sat Feb 20 2016 - 08:46:46 EST


On Thu, 2016-01-14 at 16:24 +0100, Maxime Ripard wrote:
> Hi everyone,
>
> The Allwinner SoCs (except for the very latest ones) all share the
> same set of controllers, loosely coupled together to form the display
> pipeline.
>
> Depending on the SoC, the number of instances of the controller will
> change (2 instances of each in the A10, only one in the A13, for
> example), and the output availables will change too (HDMI, composite,
> VGA on the A20, none of them on the A13).
>
> On most featured SoCs, it looks like that:
>
> Â+--------------------------------------------+
> Â|ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂRAMÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|
> Â+--------------------------------------------+
> ÂÂÂÂÂÂÂ|ÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂÂÂÂ|ÂÂÂÂÂÂÂÂÂÂÂÂ|
> ÂÂÂÂÂÂÂvÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂÂÂÂ|ÂÂÂÂÂÂÂÂÂÂÂÂv
> Â+----------------+ |ÂÂÂÂÂÂ| +----------------+
> Â|ÂÂÂÂFrontendÂÂÂÂ| |ÂÂÂÂÂÂ| |ÂÂÂÂFrontendÂÂÂÂ|
> Â+----------------+ |ÂÂÂÂÂÂ| +----------------+
> ÂÂÂÂÂÂÂÂÂ|ÂÂÂÂÂÂÂÂÂÂ|ÂÂÂÂÂÂ|ÂÂÂÂÂÂÂÂÂ|
> ÂÂÂÂÂÂÂÂÂvÂÂÂÂÂÂÂÂÂÂ|ÂÂÂÂÂÂ|ÂÂÂÂÂÂÂÂÂv
> Â+----------------+ |ÂÂÂÂÂÂ| +----------------+
> Â|ÂÂÂÂBackendÂÂÂÂÂ|<+ÂÂÂÂÂÂ+>|ÂÂÂÂBackendÂÂÂÂÂ|
> Â+----------------+ÂÂÂÂÂÂÂÂÂÂ+----------------+
> ÂÂÂÂÂÂÂÂÂ|ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|
> ÂÂÂÂÂÂÂÂÂvÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂv
> Â+----------------+ÂÂÂÂÂÂÂÂÂÂ+----------------+---> LVDS
> Â|ÂÂÂÂÂÂTCONÂÂÂÂÂÂ|ÂÂÂÂÂÂÂÂÂÂ|ÂÂÂÂÂÂTCONÂÂÂÂÂÂ|---> RGB
> Â+----------------+ÂÂÂÂÂÂÂÂÂÂ+----------------+
> ÂÂÂÂÂÂÂ|ÂÂÂÂÂÂÂ+---+ÂÂÂÂÂÂÂ+---+ÂÂÂÂÂÂÂÂÂÂ|
> ÂÂÂÂÂÂÂ|ÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂÂÂÂÂ|ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|
> ÂÂÂÂÂÂÂvÂÂÂÂÂÂÂÂÂÂÂvÂÂÂÂÂÂÂvÂÂÂÂÂÂÂÂÂÂÂÂÂÂv
> Â+------------+ÂÂ+------------+ÂÂ+------------+---> VGA
> Â| TV Encoder |ÂÂ|ÂÂÂÂHDMIÂÂÂÂ|ÂÂ| TV Encoder |---> Composite
> Â+------------+ÂÂ+------------+ÂÂ+------------+
>
> The current code only assumes that there is a single instance of all
> the controllers. It also supports only the RGB and Composite
> interfaces.

I found some time to play with it (with intention to get it running
also on sun7i and sun4i) and ran into this when trying to build
sun4i_drm as module:

ERROR: "sun4i_tcon1_mode_set" [drivers/gpu/drm/sun4i/sun4i_tv.ko] undefined!
ERROR: "sun4i_backend_apply_color_correction" [drivers/gpu/drm/sun4i/sun4i_tv.ko] undefined!
ERROR: "sun4i_tcon_channel_disable" [drivers/gpu/drm/sun4i/sun4i_tv.ko] undefined!
ERROR: "sun4i_tcon_channel_enable" [drivers/gpu/drm/sun4i/sun4i_tv.ko] undefined!
ERROR: "clk_unregister_composite" [drivers/gpu/drm/sun4i/sun4i_tcon.ko] undefined!
ERROR: "sun4i_rgb_init" [drivers/gpu/drm/sun4i/sun4i_tcon.ko] undefined!
ERROR: "clk_register_composite" [drivers/gpu/drm/sun4i/sun4i_tcon.ko] undefined!
ERROR: "sun4i_backend_update_layer_coord" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!
ERROR: "sun4i_backend_update_layer_formats" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!
ERROR: "sun4i_tcon_channel_disable" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!
ERROR: "sun4i_tcon_enable_vblank" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!
ERROR: "sun4i_backend_update_layer_buffer" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!
ERROR: "sun4i_backend_layer_enable" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!
ERROR: "sun4i_tcon_channel_enable" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!
ERROR: "sun4i_tcon_enable" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!
ERROR: "sun4i_tcon_disable" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!
ERROR: "sun4i_tcon0_mode_set" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!
ERROR: "sun4i_backend_commit" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!
scripts/Makefile.modpost:91: recipe for target '__modpost' failed



>
> Let me know what you think,
> Maxime
>
> Changes from v1:
> Â - Rebased on top of 4.4
>
> Â - Merged the clock drivers for the display and TCON channel 0
> clocks
> Â - Replaced the container_of calls in the display reset clocks to an
> ÂÂÂÂinline function
> Â - Checked the return code of of_clk_parent_fill in the clocks
> ÂÂÂÂdrivers
> Â - Checked the return code of of_clk_add_provider in the tcon-ch1
> and
> ÂÂÂÂPLL3 clocks
> Â - Added missing clocks headers
> Â - Created a composite clock unregister function
>
> Â - Moved the binding documentation to
> ÂÂÂÂDocumentation/devicetree/bindings/display
> Â - Added the clocks binding documentation
> Â - Added the Olimex vendor to the list of DT vendors
> Â - Moved to the OF graph representation and the component framework
>
> Â - Moved the reset cells count check into the reset framework to
> ÂÂÂÂavoid duplicating the code in every xlate implementation.
> Â - Made the reset_ops const
>
> Â - Reworked the DRM cmdline mode parsing code to allow named mode
> Â - Fixed the TV mode lookup when the mode name is not present (for
> ÂÂÂÂexample because it was given by the userspace)
>
> Â - Made the driver outputs optional (to avoid crashing when a board
> ÂÂÂÂdoesn't have either a panel or a composite output enabled)
> Â - Added multiple plane support with transparency
> Â - Moved the backend registers writes commit in the CRTC
> atomic_flush
> ÂÂÂÂcallback
> Â - Removed the load / unload functions
> Â - Removed the enabled booleans in my private structure and removed
> ÂÂÂÂthe implicit call to disable_unused_functions in the DRM core to
> ÂÂÂÂpush it in the drivers.
> Â - Fixed a few bitmasks on some bitfields definition
> Â - Fixed the RGB connector mode validation that was not testing the
> ÂÂÂÂright values
>
> Matthias Brugger (1):
> Â clk: Add regmap support
>
> Maxime Ripard (25):
> Â reset: Move DT cell size check to the core
> Â reset: Make reset_control_ops const
> Â clk: composite: Add unregister function
> Â clk: sunxi: Add display and TCON0 clocks driver
> Â clk: sunxi: Add PLL3 clock
> Â clk: sunxi: Add TCON channel1 clock
> Â clk: sun5i: add DRAM gates
> Â ARM: sun5i: dt: Add pll3 and pll7 clocks
> Â ARM: sun5i: a13: Add display and TCON clocks
> Â ARM: sun5i: Add DRAM gates
> Â ARM: sun5i: Add TV encoder gate to the DTSI
> Â drm/fb_cma_helper: Remove implicit call to disable_unused_functions
> Â drm/modes: Rewrite the command line parser
> Â drm/modes: Support modes names on the command line
> Â drm: Add Allwinner A10 Display Engine support
> Â drm: sun4i: Add DT bindings documentation
> Â drm: sun4i: Add RGB output
> Â drm: sun4i: Add composite output
> Â drm: sun4i: tv: Add PAL output standard
> Â drm: sun4i: tv: Add NTSC output standard
> Â ARM: sun5i: r8: Add display blocks to the DTSI
> Â ARM: sun5i: chip: Enable the TV Encoder
> Â devicetree: Add olimex vendor prefix
> Â drm/panel: simple: Add timings for the Olimex LCD-OLinuXino-4.3TS
> Â DO NOT MERGE: ARM: sun5i: chip: Enable the LCD panel
>
> ÂDocumentation/devicetree/bindings/clock/sunxi.txtÂÂ|ÂÂÂ5 +
> Â.../display/panel/olimex,lcd-olinuxino-43-ts.txtÂÂÂ|ÂÂÂ7 +
> Â.../bindings/display/sunxi/sun4i-drm.txtÂÂÂÂÂÂÂÂÂÂÂ| 228 +++++++
> Â.../devicetree/bindings/vendor-prefixes.txtÂÂÂÂÂÂÂÂ|ÂÂÂ1 +
> Âarch/arm/boot/dts/sun5i-a10s.dtsiÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ7 +-
> Âarch/arm/boot/dts/sun5i-a13.dtsiÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ46 +-
> Âarch/arm/boot/dts/sun5i-r8-chip.dtsÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ17 +
> Âarch/arm/boot/dts/sun5i-r8.dtsiÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 139 ++++-
> Âarch/arm/boot/dts/sun5i.dtsiÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ62 ++
> Âdrivers/clk/MakefileÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ1 +
> Âdrivers/clk/clk-composite.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ15 +
> Âdrivers/clk/clk-divider.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ68 ++-
> Âdrivers/clk/clk-gate.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ54 +-
> Âdrivers/clk/clk-io.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ48 ++
> Âdrivers/clk/clk-io.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ22 +
> Âdrivers/clk/clk-mux.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ94 ++-
> Âdrivers/clk/sunxi/MakefileÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ3 +
> Âdrivers/clk/sunxi/clk-simple-gates.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ2 +
> Âdrivers/clk/sunxi/clk-sun4i-display.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 241 ++++++++
> Âdrivers/clk/sunxi/clk-sun4i-pll3.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ90 +++
> Âdrivers/clk/sunxi/clk-sun4i-tcon-ch1.cÂÂÂÂÂÂÂÂÂÂÂÂÂ| 154 +++++
> Âdrivers/gpu/drm/KconfigÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ2 +
> Âdrivers/gpu/drm/MakefileÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ3 +-
> Âdrivers/gpu/drm/drm_crtc.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ3 +-
> Âdrivers/gpu/drm/drm_fb_cma_helper.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ3 -
> Âdrivers/gpu/drm/drm_fb_helper.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ4 +
> Âdrivers/gpu/drm/drm_modes.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 327 ++++++----
> Âdrivers/gpu/drm/imx/imx-drm-core.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ1 +
> Âdrivers/gpu/drm/panel/panel-simple.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ26 +
> Âdrivers/gpu/drm/sti/sti_drv.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ1 +
> Âdrivers/gpu/drm/sun4i/KconfigÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ14 +
> Âdrivers/gpu/drm/sun4i/MakefileÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ12 +
> Âdrivers/gpu/drm/sun4i/sun4i_backend.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 321 ++++++++++
> Âdrivers/gpu/drm/sun4i/sun4i_backend.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 160 +++++
> Âdrivers/gpu/drm/sun4i/sun4i_crtc.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 120 ++++
> Âdrivers/gpu/drm/sun4i/sun4i_crtc.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ30 +
> Âdrivers/gpu/drm/sun4i/sun4i_drv.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 325 ++++++++++
> Âdrivers/gpu/drm/sun4i/sun4i_drv.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ30 +
> Âdrivers/gpu/drm/sun4i/sun4i_framebuffer.cÂÂÂÂÂÂÂÂÂÂ|ÂÂ54 ++
> Âdrivers/gpu/drm/sun4i/sun4i_framebuffer.hÂÂÂÂÂÂÂÂÂÂ|ÂÂ19 +
> Âdrivers/gpu/drm/sun4i/sun4i_layer.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 160 +++++
> Âdrivers/gpu/drm/sun4i/sun4i_layer.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ30 +
> Âdrivers/gpu/drm/sun4i/sun4i_rgb.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 229 +++++++
> Âdrivers/gpu/drm/sun4i/sun4i_rgb.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ18 +
> Âdrivers/gpu/drm/sun4i/sun4i_tcon.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 521
> ++++++++++++++++
> Âdrivers/gpu/drm/sun4i/sun4i_tcon.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 177 ++++++
> Âdrivers/gpu/drm/sun4i/sun4i_tv.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 675
> +++++++++++++++++++++
> Âdrivers/gpu/drm/tilcdc/tilcdc_drv.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ1 +
> Âdrivers/reset/core.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ6 +-
> Âinclude/drm/drm_modes.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ1 +
> Âinclude/linux/clk-provider.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ55 +-
> Âinclude/linux/reset-controller.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ2 +-
> Â52 files changed, 4455 insertions(+), 179 deletions(-)
> Âcreate mode 100644
> Documentation/devicetree/bindings/display/panel/olimex,lcd-olinuxino-
> 43-ts.txt
> Âcreate mode 100644
> Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
> Âcreate mode 100644 drivers/clk/clk-io.c
> Âcreate mode 100644 drivers/clk/clk-io.h
> Âcreate mode 100644 drivers/clk/sunxi/clk-sun4i-display.c
> Âcreate mode 100644 drivers/clk/sunxi/clk-sun4i-pll3.c
> Âcreate mode 100644 drivers/clk/sunxi/clk-sun4i-tcon-ch1.c
> Âcreate mode 100644 drivers/gpu/drm/sun4i/Kconfig
> Âcreate mode 100644 drivers/gpu/drm/sun4i/Makefile
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_backend.c
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_backend.h
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_crtc.c
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_crtc.h
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_drv.c
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_drv.h
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_framebuffer.c
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_framebuffer.h
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_layer.c
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_layer.h
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_rgb.c
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_rgb.h
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_tcon.c
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_tcon.h
> Âcreate mode 100644 drivers/gpu/drm/sun4i/sun4i_tv.c
>
> --Â
> 2.6.4
>