Add DRM for stih4xx platforms
Subsystems (4)
v8 cover Add DRM for stih4xx platforms
This series of patches add the support of DRM/KMS drivers for STMicroelectronics chipsets stih416 and stih407.
version 8:
- Allow driver to be build as kernel module.
- Use Universal Plane instead of legacy code.
patches could be found here: git://git.linaro.org/people/benjamin.gaignard/kernel.git
on branch: drm_kms_for_next-v8
version 7:
- rebased on top of drm-next (2014-07-24)
patches could be found here: git://git.linaro.org/people/benjamin.gaignard/kernel.git
on branch: drm_kms_for_next-v7
version 6:
- rebased on top of new component framework API.
patches could be found here: git://git.linaro.org/people/benjamin.gaignard/kernel.git
on branch: drm_kms_for_next-v6
version 5:
- Rework sti_drm_drv probes functions to support deferred probe. This allow hdmi to delayed framebuffer creation until I2C is available.
- Add ops functions in sti_layer structure to simpify GDP and VID code.
- Add NOTES file to describe how the DRM concepts are mapped on hardware.
patches could be found here: git://git.linaro.org/people/benjamin.gaignard/kernel.git
on branch: drm_kms_for_next-v5
version 4:
- Remove depency between TVout it subdevices HDMI and HDA
- Rework and simplify VTG and VTAC code
- Fix numbers of typo and indentation
- Remove debug (will be push in separate patches)
- Fix remarks done in previous patcheset
patches could be found here: git://git.linaro.org/people/benjamin.gaignard/kernel.git
on branch: drm_kms_for_next-v4
version 3:
- Correctly split code between probe and bind funtions
- Squash some commits
- remove HQ-VDP device code to have a smaller patcheset, we will introduce it later.
patches could be found here: git://git.linaro.org/people/benjamin.gaignard/kernel.git
on branch: drm_kms_for_next-v3
version 2:
- Use componentized device instead of register sub-devices in master driver probe function
- Fix Makefile and Kconfig to only allow built-in compilation
patches could be found here: git://git.linaro.org/people/benjamin.gaignard/kernel.git
on branch: drm_kms_for_next-v2
version 1:
- First path submission
Hardware is split in two main blocks: Compositor and TVout. Each of them includes specific hardware IPs and the display timing are controlled by a specific Video Timing Generator hardware IP (VTG).
Compositor is made of the follow hardware IPs:
- GDP (Generic Display Pipeline) which is an entry point for graphic (RGB) buffers
- VDP (Video Diplay Pipeline) which is an entry point for video (YUV) buffers
- HQVDP (High Quality Video Display Processor) that supports scaling, deinterlacing and some miscellaneous image quality improvements. It fetches the Video decoded buffers from memory, processes them and pushes them to the Compositor through a HW dedicated bus.
- Mixer is responsible of mixing all the entries depending of their respective z-order and layout
TVout is divided in 3 parts:
- HDMI to generate HDMI signals, depending of chipset version HDMI phy can change.
- HDA to generate signals for HD analog TV
- VIP to control/switch data path coming from Compositor
On stih416 compositor and Tvout are on different dies so a Video Trafic Advance inter-die Communication mechanism (VTAC) is needed.
+---------------------------------------------+ +----------------------------------------+ | +-------------------------------+ +----+ | | +----+ +--------------------------+ | | | | | | | | | | | +---------+ +----+ | | | | +----+ +------+ | | | | | | | | | VIP |---->|HDMI| | | | | |GPD +------------->| | | | | | | | | | | | +----+ | | | | +----+ |Mixer |--|-->| | | | | |---|->| switcher| | | | | | | | | | | | | | | | | +----+ | | | | | | | | | | | | | | | |---->|HDA | | | | | +------+ | |VTAC|========>|VTAC| | +---------+ +----+ | | | | | | | | | | | | | | | | Compositor | | | | | | | | TVout | | | +-------------------------------+ | | | | | | +--------------------------+ | | ^ | | | | | | ^ | | | | | | | | | | | | +--------------+ | | | | | | +-------------+ | | | VTG (master) |----->| | | | | |----->| VTG (slave) | | | +--------------+ +----+ | | +----+ +-------------+ | |Digital die | | Analog Die| +---------------------------------------------+ +----------------------------------------+
On stih407 Compositor and Tvout are on the same die
+-----------------------------------------------------------------+ | +-------------------------------+ +--------------------------+ | | | | | +---------+ +----+ | | | | +----+ +------+ | | | VIP |---->|HDMI| | | | | |GPD +------------->| | | | | | +----+ | | | | +----+ |Mixer |--|--|->| switcher| | | | | +----+ +-----+ | | | | | | +----+ | | | | |VDP +-->+HQVDP+--->| | | | | |---->|HDA | | | | | +----+ +-----+ +------+ | | +---------+ +----+ | | | | | | | | | | Compositor | | TVout | | | +-------------------------------+ +--------------------------+ | | ^ ^ | | | | | | +--------------+ | | | VTG | | | +--------------+ | |Digital die | +-----------------------------------------------------------------+
In addition of the drivers for the IPs listed before a thin I2C driver (hdmiddc) is used by HDMI driver to retrieve EDID for monitor.
To unify interfaces of GDP and VDP we create a "layer" interface called by compositor to control both GPD and VDP.
Hardware have memory contraints (alignment, contiguous) so we use CMA drm helpers functions to allocate frame buffer.
File naming convention is:
- sti_* for IPs drivers
- sti_drm_* for drm functions implementation.
Benjamin Gaignard (11):
drm: sti: add bindings for DRM driver
drm: sti: add VTG driver
drm: sti: add VTAC drivers
drm: sti: add HDMI driver
drm: sti: add HDA driver
drm: sti: add TVOut driver
drm: sti: add GDP layer
drm: sti: add VID layer
drm: sti: add Mixer
drm: sti: add Compositor
drm: sti: Add DRM driver itself
.../devicetree/bindings/gpu/st,stih4xx.txt | 189 +++++ drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/sti/Kconfig | 14 + drivers/gpu/drm/sti/Makefile | 21 + drivers/gpu/drm/sti/NOTES | 58 ++ drivers/gpu/drm/sti/sti_compositor.c | 279 +++++++ drivers/gpu/drm/sti/sti_compositor.h | 90 +++ drivers/gpu/drm/sti/sti_drm_crtc.c | 423 +++++++++++ drivers/gpu/drm/sti/sti_drm_crtc.h | 22 + drivers/gpu/drm/sti/sti_drm_drv.c | 241 ++++++ drivers/gpu/drm/sti/sti_drm_drv.h | 29 + drivers/gpu/drm/sti/sti_drm_plane.c | 195 +++++ drivers/gpu/drm/sti/sti_drm_plane.h | 18 + drivers/gpu/drm/sti/sti_gdp.c | 549 ++++++++++++++ drivers/gpu/drm/sti/sti_gdp.h | 16 + drivers/gpu/drm/sti/sti_hda.c | 794 ++++++++++++++++++++ drivers/gpu/drm/sti/sti_hdmi.c | 810 +++++++++++++++++++++ drivers/gpu/drm/sti/sti_hdmi.h | 88 +++ drivers/gpu/drm/sti/sti_hdmi_tx3g0c55phy.c | 336 +++++++++ drivers/gpu/drm/sti/sti_hdmi_tx3g0c55phy.h | 14 + drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.c | 211 ++++++ drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.h | 14 + drivers/gpu/drm/sti/sti_layer.c | 197 +++++ drivers/gpu/drm/sti/sti_layer.h | 123 ++++ drivers/gpu/drm/sti/sti_mixer.c | 249 +++++++ drivers/gpu/drm/sti/sti_mixer.h | 54 ++ drivers/gpu/drm/sti/sti_tvout.c | 648 +++++++++++++++++ drivers/gpu/drm/sti/sti_vid.c | 138 ++++ drivers/gpu/drm/sti/sti_vid.h | 12 + drivers/gpu/drm/sti/sti_vtac.c | 215 ++++++ drivers/gpu/drm/sti/sti_vtg.c | 366 ++++++++++ drivers/gpu/drm/sti/sti_vtg.h | 28 + 33 files changed, 6444 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpu/st,stih4xx.txt create mode 100644 drivers/gpu/drm/sti/Kconfig create mode 100644 drivers/gpu/drm/sti/Makefile create mode 100644 drivers/gpu/drm/sti/NOTES create mode 100644 drivers/gpu/drm/sti/sti_compositor.c create mode 100644 drivers/gpu/drm/sti/sti_compositor.h create mode 100644 drivers/gpu/drm/sti/sti_drm_crtc.c create mode 100644 drivers/gpu/drm/sti/sti_drm_crtc.h create mode 100644 drivers/gpu/drm/sti/sti_drm_drv.c create mode 100644 drivers/gpu/drm/sti/sti_drm_drv.h create mode 100644 drivers/gpu/drm/sti/sti_drm_plane.c create mode 100644 drivers/gpu/drm/sti/sti_drm_plane.h create mode 100644 drivers/gpu/drm/sti/sti_gdp.c create mode 100644 drivers/gpu/drm/sti/sti_gdp.h create mode 100644 drivers/gpu/drm/sti/sti_hda.c create mode 100644 drivers/gpu/drm/sti/sti_hdmi.c create mode 100644 drivers/gpu/drm/sti/sti_hdmi.h create mode 100644 drivers/gpu/drm/sti/sti_hdmi_tx3g0c55phy.c create mode 100644 drivers/gpu/drm/sti/sti_hdmi_tx3g0c55phy.h create mode 100644 drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.c create mode 100644 drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.h create mode 100644 drivers/gpu/drm/sti/sti_layer.c create mode 100644 drivers/gpu/drm/sti/sti_layer.h create mode 100644 drivers/gpu/drm/sti/sti_mixer.c create mode 100644 drivers/gpu/drm/sti/sti_mixer.h create mode 100644 drivers/gpu/drm/sti/sti_tvout.c create mode 100644 drivers/gpu/drm/sti/sti_vid.c create mode 100644 drivers/gpu/drm/sti/sti_vid.h create mode 100644 drivers/gpu/drm/sti/sti_vtac.c create mode 100644 drivers/gpu/drm/sti/sti_vtg.c create mode 100644 drivers/gpu/drm/sti/sti_vtg.h
Signature · 1 line
1.9.1
PATCH v8 1/11 drm: sti: add bindings for DRM driver
Add DRM/KMS driver bindings documentation.
Describe the required properties for each of the hardware IPs drivers.
--- .../devicetree/bindings/gpu/st,stih4xx.txt | 189 +++++++++++++++++++++ drivers/gpu/drm/sti/NOTES | 58 +++++++ 2 files changed, 247 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpu/st,stih4xx.txt create mode 100644 drivers/gpu/drm/sti/NOTES
Documentation/devicetree/bindings/gpu/st,stih4xx.txt new file +189 -0
@@ -0,0 +1,189 @@ +STMicroelectronics stih4xx platforms + +- sti-vtg: video timing generator + Required properties: + - compatible: "st,vtg" + - reg: Physical base address of the IP registers and length of memory mapped region. + Optional properties: + - interrupts : VTG interrupt number to the CPU. + - st,slave: phandle on a slave vtg + +- sti-vtac: video timing advanced inter dye communication Rx and TX + Required properties: + - compatible: "st,vtac-main" or "st,vtac-aux" + - reg: Physical base address of the IP registers and length of memory mapped region. + - clocks: from common clock binding: handle hardware IP needed clocks, the + number of clocks may depend of the SoC type. + See ../clocks/clock-bindings.txt for details. + - clock-names: names of the clocks listed in clocks property in the same + order. + +- sti-display-subsystem: Master device for DRM sub-components + This device must be the parent of all the sub-components and is responsible + of bind them. + Required properties: + - compatible: "st,sti-display-subsystem" + - ranges: to allow probing of subdevices + +- sti-compositor: frame compositor engine + must be a child of sti-display-subsystem + Required properties: + - compatible: "st,stih<chip>-compositor" + - reg: Physical base address of the IP registers and length of memory mapped region. + - clocks: from common clock binding: handle hardware IP needed clocks, the + number of clocks may depend of the SoC type. + See ../clocks/clock-bindings.txt for details. + - clock-names: names of the clocks listed in clocks property in the same + order. + - resets: resets to be used by the device + See ../reset/reset.txt for details. + - reset-names: names of the resets listed in resets property in the same + order. + - st,vtg: phandle(s) on vtg device (main and aux) nodes. + +- sti-tvout: video out hardware block + must be a child of sti-display-subsystem + Required properties: + - compatible: "st,stih<chip>-tvout" + - reg: Physical base address of the IP registers and length of memory mapped region. + - reg-names: names of the mapped memory regions listed in regs property in + the same order. + - resets: resets to be used by the device + See ../reset/reset.txt for details. + - reset-names: names of the resets listed in resets property in the same + order. + - ranges: to allow probing of subdevices + +- sti-hdmi: hdmi output block + must be a child of sti-tvout + Required properties: + - compatible: "st,stih<chip>-hdmi"; + - reg: Physical base address of the IP registers and length of memory mapped region. + - reg-names: names of the mapped memory regions listed in regs property in + the same order. + - interrupts : HDMI interrupt number to the CPU. + - interrupt-names: name of the interrupts listed in interrupts property in + the same order + - clocks: from common clock binding: handle hardware IP needed clocks, the + number of clocks may depend of the SoC type. + - clock-names: names of the clocks listed in clocks property in the same + order. + - hdmi,hpd-gpio: gpio id to detect if an hdmi cable is plugged or not. + +sti-hda: + Required properties: + must be a child of sti-tvout + - compatible: "st,stih<chip>-hda" + - reg: Physical base address of the IP registers and length of memory mapped region. + - reg-names: names of the mapped memory regions listed in regs property in + the same order. + - clocks: from common clock binding: handle hardware IP needed clocks, the + number of clocks may depend of the SoC type. + See ../clocks/clock-bindings.txt for details. + - clock-names: names of the clocks listed in clocks property in the same + order. + +Example: + +/ { + ... + + vtg_main_slave: sti-vtg-main-slave@fe85A800 { + compatible = "st,vtg"; + reg = <0xfe85A800 0x300>; + interrupts = <GIC_SPI 175 IRQ_TYPE_NONE>; + }; + + vtg_main: sti-vtg-main-master@fd348000 { + compatible = "st,vtg"; + reg = <0xfd348000 0x400>; + st,slave = <&vtg_main_slave>; + }; + + vtg_aux_slave: sti-vtg-aux-slave@fd348400 { + compatible = "st,vtg"; + reg = <0xfe858200 0x300>; + interrupts = <GIC_SPI 176 IRQ_TYPE_NONE>; + }; + + vtg_aux: sti-vtg-aux-master@fd348400 { + compatible = "st,vtg"; + reg = <0xfd348400 0x400>; + st,slave = <&vtg_aux_slave>; + }; + + + sti-vtac-rx-main@fee82800 { + compatible = "st,vtac-main"; + reg = <0xfee82800 0x200>; + clock-names = "vtac"; + clocks = <&clk_m_a2_div0 CLK_M_VTAC_MAIN_PHY>; + }; + + sti-vtac-rx-aux@fee82a00 { + compatible = "st,vtac-aux"; + reg = <0xfee82a00 0x200>; + clock-names = "vtac"; + clocks = <&clk_m_a2_div0 CLK_M_VTAC_AUX_PHY>; + }; + + sti-vtac-tx-main@fd349000 { + compatible = "st,vtac-main"; + reg = <0xfd349000 0x200>, <0xfd320000 0x10000>; + clock-names = "vtac"; + clocks = <&clk_s_a1_hs CLK_S_VTAC_TX_PHY>; + }; + + sti-vtac-tx-aux@fd349200 { + compatible = "st,vtac-aux"; + reg = <0xfd349200 0x200>, <0xfd320000 0x10000>; + clock-names = "vtac"; + clocks = <&clk_s_a1_hs CLK_S_VTAC_TX_PHY>; + }; + + sti-display-subsystem { + compatible = "st,sti-display-subsystem"; + ranges; + + sti-compositor@fd340000 { + compatible = "st,stih416-compositor"; + reg = <0xfd340000 0x1000>; + clock-names = "compo_main", "compo_aux", + "pix_main", "pix_aux"; + clocks = <&clk_m_a2_div1 CLK_M_COMPO_MAIN>, <&clk_m_a2_div1 CLK_M_COMPO_AUX>, + <&clockgen_c_vcc CLK_S_PIX_MAIN>, <&clockgen_c_vcc CLK_S_PIX_AUX>; + reset-names = "compo-main", "compo-aux"; + resets = <&softreset STIH416_COMPO_M_SOFTRESET>, <&softreset STIH416_COMPO_A_SOFTRESET>; + st,vtg = <&vtg_main>, <&vtg_aux>; + }; + + sti-tvout@fe000000 { + compatible = "st,stih416-tvout"; + reg = <0xfe000000 0x1000>, <0xfe85a000 0x400>, <0xfe830000 0x10000>; + reg-names = "tvout-reg", "hda-reg", "syscfg"; + reset-names = "tvout"; + resets = <&softreset STIH416_HDTVOUT_SOFTRESET>; + ranges; + + sti-hdmi@fe85c000 { + compatible = "st,stih416-hdmi"; + reg = <0xfe85c000 0x1000>, <0xfe830000 0x10000>; + reg-names = "hdmi-reg", "syscfg"; + interrupts = <GIC_SPI 173 IRQ_TYPE_NONE>; + interrupt-names = "irq"; + clock-names = "pix", "tmds", "phy", "audio"; + clocks = <&clockgen_c_vcc CLK_S_PIX_HDMI>, <&clockgen_c_vcc CLK_S_TMDS_HDMI>, <&clockgen_c_vcc CLK_S_HDMI_REJECT_PLL>, <&clockgen_b1 CLK_S_PCM_0>; + hdmi,hpd-gpio = <&PIO2 5>; + }; + + sti-hda@fe85a000 { + compatible = "st,stih416-hda"; + reg = <0xfe85a000 0x400>, <0xfe83085c 0x4>; + reg-names = "hda-reg", "video-dacs-ctrl"; + clock-names = "pix", "hddac"; + clocks = <&clockgen_c_vcc CLK_S_PIX_HD>, <&clockgen_c_vcc CLK_S_HDDAC>; + }; + }; + }; + ... +};
drivers/gpu/drm/sti/NOTES new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v8 2/11 drm: sti: add VTG driver
In reply to Benjamin GaignardVideo Time Generator drivers are used to synchronize the compositor and tvout hardware IPs by providing line count, sample count, synchronization signals (HSYNC, VSYNC) and top and bottom fields indication.
VTG are used by pair for each data path (main or auxiliary) one for master and one for slave.
--- drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/sti/Kconfig | 5 + drivers/gpu/drm/sti/Makefile | 2 + drivers/gpu/drm/sti/sti_vtg.c | 366 ++++++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/sti/sti_vtg.h | 28 ++++ 6 files changed, 404 insertions(+) create mode 100644 drivers/gpu/drm/sti/Kconfig create mode 100644 drivers/gpu/drm/sti/Makefile create mode 100644 drivers/gpu/drm/sti/sti_vtg.c create mode 100644 drivers/gpu/drm/sti/sti_vtg.h
drivers/gpu/drm/Kconfig +2 -0
@@ -201,3 +201,5 @@ source "drivers/gpu/drm/msm/Kconfig" source "drivers/gpu/drm/tegra/Kconfig" source "drivers/gpu/drm/panel/Kconfig" + +source "drivers/gpu/drm/sti/Kconfig"
drivers/gpu/drm/Makefile +1 -0
@@ -64,6 +64,7 @@ obj-$(CONFIG_DRM_QXL) += qxl/ obj-$(CONFIG_DRM_BOCHS) += bochs/ obj-$(CONFIG_DRM_MSM) += msm/ obj-$(CONFIG_DRM_TEGRA) += tegra/ +obj-$(CONFIG_DRM_STI) += sti/ obj-y += i2c/ obj-y += panel/ obj-y += bridge/
drivers/gpu/drm/sti/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config DRM_STI + tristate "DRM Support for STMicroelectronics SoC stiH41x Series" + depends on DRM && (SOC_STIH415 || SOC_STIH416 || ARCH_MULTIPLATFORM) + help + Choose this option to enable DRM on STM stiH41x chipset
drivers/gpu/drm/sti/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +obj-$(CONFIG_DRM_STI) = \ + sti_vtg.o
drivers/gpu/drm/sti/sti_vtg.c new file +366 -0
366 lines not on this page · raw message
drivers/gpu/drm/sti/sti_vtg.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* Copyright (C) STMicroelectronics SA 2014 +* Author: Benjamin Gaignard <[email protected]> for STMicroelectronics. +* License terms: GNU General Public License (GPL), version 2 +*/ + +#ifndef _STI_VTG_H_ +#define _STI_VTG_H_ + +#define VTG_TOP_FIELD_EVENT 1 +#define VTG_BOTTOM_FIELD_EVENT 2 + +struct sti_vtg ; +struct drm_display_mode ; +struct notifier_block ; + +struct sti_vtg *of_vtg_find (struct device_node *np); +void sti_vtg_set_config (struct sti_vtg *vtg, +const struct drm_display_mode *mode); +int sti_vtg_register_client (struct sti_vtg *vtg, +struct notifier_block *nb,int crtc_id); +int sti_vtg_unregister_client (struct sti_vtg *vtg, +struct notifier_block *nb); + +u32 sti_vtg_get_line_number (struct drm_display_mode mode,int y); +u32 sti_vtg_get_pixel_number (struct drm_display_mode mode,int x); + +#endif
Signature · 1 line
1.9.1
PATCH v8 3/11 drm: sti: add VTAC drivers
In reply to Benjamin GaignardVideo Traffic Advance Communication Rx and Tx drivers are designed for inter-die communication.
--- drivers/gpu/drm/sti/Makefile | 3 +- drivers/gpu/drm/sti/sti_vtac.c | 215 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/sti/sti_vtac.c
drivers/gpu/drm/sti/Makefile +2 -1
@@ -1,2 +1,3 @@ obj-$(CONFIG_DRM_STI) = \ - sti_vtg.o + sti_vtg.o \ + sti_vtac.o
drivers/gpu/drm/sti/sti_vtac.c new file +215 -0
215 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v8 4/11 drm: sti: add HDMI driver
In reply to Benjamin GaignardAdd driver for HDMI output.
HDMI PHY registers are mixed into HDMI device registers and their is only one IRQ for all this hardware block. That is why PHYs aren't using phy framework but only a thin hdmi_phy_ops structure with start and stop functions.
HDMI driver is mapped on drm_bridge and drm_connector structures.
--- drivers/gpu/drm/sti/Makefile | 7 +- drivers/gpu/drm/sti/sti_hdmi.c | 810 +++++++++++++++++++++++++++++ drivers/gpu/drm/sti/sti_hdmi.h | 88 ++++ drivers/gpu/drm/sti/sti_hdmi_tx3g0c55phy.c | 336 ++++++++++++ drivers/gpu/drm/sti/sti_hdmi_tx3g0c55phy.h | 14 + drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.c | 211 ++++++++ drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.h | 14 + 7 files changed, 1479 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/sti/sti_hdmi.c create mode 100644 drivers/gpu/drm/sti/sti_hdmi.h create mode 100644 drivers/gpu/drm/sti/sti_hdmi_tx3g0c55phy.c create mode 100644 drivers/gpu/drm/sti/sti_hdmi_tx3g0c55phy.h create mode 100644 drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.c create mode 100644 drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.h
drivers/gpu/drm/sti/Makefile +6 -1
@@ -1,3 +1,8 @@ +stihdmi-y := sti_hdmi.o \ + sti_hdmi_tx3g0c55phy.o \ + sti_hdmi_tx3g4c28phy.o \ + obj-$(CONFIG_DRM_STI) = \ sti_vtg.o \ - sti_vtac.o + sti_vtac.o \ + stihdmi.o
drivers/gpu/drm/sti/sti_hdmi.c new file +810 -0
810 lines not on this page · raw message
drivers/gpu/drm/sti/sti_hdmi.h new file +88 -0
88 lines not on this page · raw message
drivers/gpu/drm/sti/sti_hdmi_tx3g0c55phy.c new file +336 -0
336 lines not on this page · raw message
drivers/gpu/drm/sti/sti_hdmi_tx3g0c55phy.h new file +14 -0
@@ -0,0 +1,14 @@ +/* +* Copyright (C) STMicroelectronics SA 2014 +* Author: Benjamin Gaignard <[email protected]> for STMicroelectronics. +* License terms: GNU General Public License (GPL), version 2 +*/ + +#ifndef _STI_HDMI_TX3G0C55PHY_H_ +#define _STI_HDMI_TX3G0C55PHY_H_ + +#include "sti_hdmi.h" + +extern struct hdmi_phy_ops tx3g0c55phy_ops; + +#endif
drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.c new file +211 -0
211 lines not on this page · raw message
drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.h new file +14 -0
@@ -0,0 +1,14 @@ +/* +* Copyright (C) STMicroelectronics SA 2014 +* Author: Benjamin Gaignard <[email protected]> for STMicroelectronics. +* License terms: GNU General Public License (GPL), version 2 +*/ + +#ifndef _STI_HDMI_TX3G4C28PHY_H_ +#define _STI_HDMI_TX3G4C28PHY_H_ + +#include "sti_hdmi.h" + +extern struct hdmi_phy_ops tx3g4c28phy_ops; + +#endif
Signature · 1 line
1.9.1
PATCH v8 5/11 drm: sti: add HDA driver
In reply to Benjamin GaignardAdd driver to support analog TV ouput.
HDA driver is mapped on drm_bridge and drm_connector structures.
--- drivers/gpu/drm/sti/Makefile | 3 +- drivers/gpu/drm/sti/sti_hda.c | 794 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 796 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/sti/sti_hda.c
drivers/gpu/drm/sti/Makefile +2 -1
@@ -5,4 +5,5 @@ stihdmi-y := sti_hdmi.o \ obj-$(CONFIG_DRM_STI) = \ sti_vtg.o \ sti_vtac.o \ - stihdmi.o + stihdmi.o \ + sti_hda.o
drivers/gpu/drm/sti/sti_hda.c new file +794 -0
794 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v8 6/11 drm: sti: add TVOut driver
In reply to Benjamin GaignardTVout hardware block is responsible to dispatch the data flow coming from compositor block to any of the output (HDMI or Analog TV). It control when output are start/stop and configure according the require flow path.
TVout is the parent of HDMI and HDA drivers and bind them at runtime.
Tvout is mapped on drm_encoder structure.
One encoder is created for each of the sub-devices and link to their connector/bridge
--- drivers/gpu/drm/sti/Makefile | 3 +- drivers/gpu/drm/sti/sti_tvout.c | 648 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 650 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/sti/sti_tvout.c
drivers/gpu/drm/sti/Makefile +2 -1
@@ -6,4 +6,5 @@ obj-$(CONFIG_DRM_STI) = \ sti_vtg.o \ sti_vtac.o \ stihdmi.o \ - sti_hda.o + sti_hda.o \ + sti_tvout.o
drivers/gpu/drm/sti/sti_tvout.c new file +648 -0
648 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v8 7/11 drm: sti: add GDP layer
In reply to Benjamin GaignardGeneric Display Pipeline are one of the compositor input sub-devices. GDP are dedicated to graphic input like RGB plans.
GDP is part of Compositor hardware block which will be introduce later.
A sti_layer structure is used to abstract GDP calls from Compositor.
--- drivers/gpu/drm/sti/Makefile | 6 +- drivers/gpu/drm/sti/sti_gdp.c | 516 ++++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/sti/sti_gdp.h | 16 ++ drivers/gpu/drm/sti/sti_layer.h | 123 ++++++++++ 4 files changed, 660 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/sti/sti_gdp.c create mode 100644 drivers/gpu/drm/sti/sti_gdp.h create mode 100644 drivers/gpu/drm/sti/sti_layer.h
drivers/gpu/drm/sti/Makefile +5 -1
@@ -1,3 +1,6 @@ +sticompositor-y := \ + sti_gdp.o + stihdmi-y := sti_hdmi.o \ sti_hdmi_tx3g0c55phy.o \ sti_hdmi_tx3g4c28phy.o \
@@ -7,4 +10,5 @@ obj-$(CONFIG_DRM_STI) = \ sti_vtac.o \ stihdmi.o \ sti_hda.o \ - sti_tvout.o + sti_tvout.o \ + sticompositor.o
drivers/gpu/drm/sti/sti_gdp.c new file +516 -0
516 lines not on this page · raw message
drivers/gpu/drm/sti/sti_gdp.h new file +16 -0
@@ -0,0 +1,16 @@ +/* +* Copyright (C) STMicroelectronics SA 2014 +* Authors: Benjamin Gaignard <[email protected]> +* Fabien Dessenne <[email protected]> +* for STMicroelectronics. +* License terms: GNU General Public License (GPL), version 2 +*/ + +#ifndef _STI_GDP_H_ +#define _STI_GDP_H_ + +#include <linux/types.h> + +struct sti_layer *sti_gdp_create (struct device *dev,int id); + +#endif
drivers/gpu/drm/sti/sti_layer.h new file +123 -0
123 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v8 8/11 drm: sti: add VID layer
In reply to Benjamin GaignardVIDeo plug are one of the compositor input sub-devices. VID are dedicated to video inputs like YUV plans.
Like GDP, VID are part of Compositor hardware block and use sti_layer structure to provide an abstraction for Compositor calls.
--- drivers/gpu/drm/sti/Makefile | 3 +- drivers/gpu/drm/sti/sti_vid.c | 138 ++++++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/sti/sti_vid.h | 12 ++++ 3 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/sti/sti_vid.c create mode 100644 drivers/gpu/drm/sti/sti_vid.h
drivers/gpu/drm/sti/Makefile +2 -1
@@ -1,5 +1,6 @@ sticompositor-y := \ - sti_gdp.o + sti_gdp.o \ + sti_vid.o stihdmi-y := sti_hdmi.o \ sti_hdmi_tx3g0c55phy.o \
drivers/gpu/drm/sti/sti_vid.c new file +138 -0
138 lines not on this page · raw message
drivers/gpu/drm/sti/sti_vid.h new file +12 -0
@@ -0,0 +1,12 @@ +/* +* Copyright (C) STMicroelectronics SA 2014 +* Author: Fabien Dessenne <[email protected]> for STMicroelectronics. +* License terms: GNU General Public License (GPL), version 2 +*/ + +#ifndef _STI_VID_H_ +#define _STI_VID_H_ + +struct sti_layer *sti_vid_create (struct device *dev); + +#endif
Signature · 1 line
1.9.1
PATCH v8 9/11 drm: sti: add Mixer
In reply to Benjamin GaignardMixer hardware IP is responsible of mixing the different inputs layers. Z-order is managed by the mixer.
We could 2 mixers: one for main path and one for auxillary path
Mixers are part of Compositor hardware block
--- drivers/gpu/drm/sti/Makefile | 3 +- drivers/gpu/drm/sti/sti_mixer.c | 243 ++++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/sti/sti_mixer.h | 54 +++++++++ 3 files changed, 299 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/sti/sti_mixer.c create mode 100644 drivers/gpu/drm/sti/sti_mixer.h
drivers/gpu/drm/sti/Makefile +2 -1
@@ -1,4 +1,5 @@ sticompositor-y := \ + sti_mixer.o \ sti_gdp.o \ sti_vid.o
@@ -12,4 +13,4 @@ obj-$(CONFIG_DRM_STI) = \ stihdmi.o \ sti_hda.o \ sti_tvout.o \ - sticompositor.o + sticompositor.o
drivers/gpu/drm/sti/sti_mixer.c new file +243 -0
243 lines not on this page · raw message
drivers/gpu/drm/sti/sti_mixer.h new file +54 -0
54 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v8 10/11 drm: sti: add Compositor
In reply to Benjamin GaignardCompositor control all the input sub-device (VID, GDP) and the mixer(s).
It is the main entry point for composition. Layer interface is used to control the abstracted layers.
Add debug in mixer and GDP.
--- drivers/gpu/drm/sti/Kconfig | 1 + drivers/gpu/drm/sti/Makefile | 4 +- drivers/gpu/drm/sti/sti_compositor.c | 236 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/sti/sti_compositor.h | 90 +++++++++++++ drivers/gpu/drm/sti/sti_gdp.c | 33 +++++ drivers/gpu/drm/sti/sti_layer.c | 197 +++++++++++++++++++++++++++++ drivers/gpu/drm/sti/sti_mixer.c | 6 + 7 files changed, 566 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/sti/sti_compositor.c create mode 100644 drivers/gpu/drm/sti/sti_compositor.h create mode 100644 drivers/gpu/drm/sti/sti_layer.c
drivers/gpu/drm/sti/Kconfig +1 -0
@@ -1,5 +1,6 @@ config DRM_STI tristate "DRM Support for STMicroelectronics SoC stiH41x Series" depends on DRM && (SOC_STIH415 || SOC_STIH416 || ARCH_MULTIPLATFORM) + select DRM_KMS_CMA_HELPER help Choose this option to enable DRM on STM stiH41x chipset
drivers/gpu/drm/sti/Makefile +3 -1
@@ -1,7 +1,9 @@ sticompositor-y := \ + sti_layer.o \ sti_mixer.o \ sti_gdp.o \ - sti_vid.o + sti_vid.o \ + sti_compositor.o stihdmi-y := sti_hdmi.o \ sti_hdmi_tx3g0c55phy.o \
drivers/gpu/drm/sti/sti_compositor.c new file +236 -0
236 lines not on this page · raw message
drivers/gpu/drm/sti/sti_compositor.h new file +90 -0
90 lines not on this page · raw message
drivers/gpu/drm/sti/sti_gdp.c +33 -0
@@ -9,6 +9,7 @@#include <linux/clk.h> #include <linux/dma-mapping.h> +#include "sti_compositor.h" #include "sti_gdp.h" #include "sti_layer.h" #include "sti_vtg.h"
@@ -182,6 +183,10 @@ static struct sti_gdp_node_list *sti_gdp_get_free_nodes(struct sti_layer *layer) (virt_nvn != gdp->node_list[i].top_field)) return &gdp->node_list[i]; +/* in hazardious cases restart with the first node */ +DRM_ERROR ("inconsistent NVN for %s: 0x%08X\n" , +sti_layer_to_str (layer), hw_nvn); + end:return &gdp->node_list[0 ]; }
@@ -215,6 +220,9 @@ struct sti_gdp_node_list *sti_gdp_get_current_nodes(struct sti_layer *layer)return &gdp->node_list[i]; end: +DRM_DEBUG_DRIVER ("Warning, NVN 0x%08X for %s does not match any node\n" , + hw_nvn,sti_layer_to_str (layer)); +return NULL ; }
@@ -235,6 +243,7 @@ static int sti_gdp_prepare_layer(struct sti_layer *layer, bool first_prepare)struct drm_display_mode *mode = layer->mode;struct device *dev = layer->dev;struct sti_gdp *gdp =to_sti_gdp (layer); +struct sti_compositor *compo =dev_get_drvdata (dev);int format;unsigned int depth, bpp;int rate = mode->clock *1000 ;
@@ -245,6 +254,9 @@ static int sti_gdp_prepare_layer(struct sti_layer *layer, bool first_prepare) top_field = list->top_field; btm_field = list->btm_field; +dev_dbg (dev,"%s %s top_node:0x%p btm_node:0x%p\n" , __func__, +sti_layer_to_str (layer), top_field, btm_field); +/* Build the top field from layer params */ top_field->gam_gdp_agc =GAM_GDP_AGC_FULL_RANGE ; top_field->gam_gdp_ctl =WAIT_NEXT_VSYNC ;
@@ -289,6 +301,14 @@ static int sti_gdp_prepare_layer(struct sti_layer *layer, bool first_prepare) layer->pitches[0 ];if (first_prepare) { +/* Register gdp callback */ +if (sti_vtg_register_client (layer->mixer_id ==STI_MIXER_MAIN ? + compo->vtg_main : compo->vtg_aux, + &gdp->vtg_field_nb, layer->mixer_id)) { +DRM_ERROR ("Cannot register VTG notifier\n" ); +return 1 ; + } +/* Set and enable gdp clock */ if (gdp->clk_pix) { res =clk_set_rate (gdp->clk_pix, rate);
@@ -333,6 +353,9 @@ static int sti_gdp_commit_layer(struct sti_layer *layer)u32 dma_updated_btm =virt_to_dma (layer->dev, updated_btm_node);struct sti_gdp_node_list *curr_list =sti_gdp_get_current_nodes (layer); +dev_dbg (layer->dev,"%s %s top/btm_node:0x%p/0x%p\n" , __func__, +sti_layer_to_str (layer), + updated_top_node, updated_btm_node);dev_dbg (layer->dev,"Current NVN:0x%X\n" ,readl (layer->regs +GAM_GDP_NVN_OFFSET )); dev_dbg(layer->dev, "Posted buff: %lx current buff: %x\n",
@@ -342,6 +365,9 @@ static int sti_gdp_commit_layer(struct sti_layer *layer)if (curr_list ==NULL ) {/* First update or invalid node should directly write in the * hw register */ +DRM_DEBUG_DRIVER ("%s first update (or invalid node)" , +sti_layer_to_str (layer)); +writel (gdp->is_curr_top == true ? dma_updated_btm : dma_updated_top, layer->regs +GAM_GDP_NVN_OFFSET );
@@ -380,6 +406,9 @@ static int sti_gdp_disable_layer(struct sti_layer *layer) {unsigned int i;struct sti_gdp *gdp =to_sti_gdp (layer); +struct sti_compositor *compo =dev_get_drvdata (layer->dev); + +DRM_DEBUG_DRIVER ("%s\n" ,sti_layer_to_str (layer));/* Set the nodes as 'to be ignored on mixer' */ for (i =0 ; i <GDP_NODE_NB_BANK ; i++) {
@@ -387,6 +416,10 @@ static int sti_gdp_disable_layer(struct sti_layer *layer) gdp->node_list[i].btm_field->gam_gdp_ppt |=GAM_GDP_PPT_IGNORE ; } +if (sti_vtg_unregister_client (layer->mixer_id ==STI_MIXER_MAIN ? + compo->vtg_main : compo->vtg_aux, &gdp->vtg_field_nb)) +DRM_DEBUG_DRIVER ("Warning: cannot unregister VTG notifier\n" ); +if (gdp->clk_pix)clk_disable_unprepare (gdp->clk_pix);
drivers/gpu/drm/sti/sti_layer.c new file +197 -0
197 lines not on this page · raw message
drivers/gpu/drm/sti/sti_mixer.c +6 -0
@@ -6,6 +6,7 @@* License terms: GNU General Public License (GPL), version 2 */ +#include "sti_compositor.h" #include "sti_mixer.h" #include "sti_vtg.h"
@@ -133,6 +134,8 @@ int sti_mixer_set_layer_depth(struct sti_mixer *mixer, struct sti_layer *layer) mask =GAM_DEPTH_MASK_ID << (3 * depth); layer_id = layer_id << (3 * depth); +DRM_DEBUG_DRIVER ("%s %s depth=%d\n" ,sti_mixer_to_str (mixer), +sti_layer_to_str (layer), depth);dev_dbg (mixer->dev,"GAM_MIXER_CRB val 0x%x mask 0x%x\n" , layer_id, mask);
@@ -195,6 +198,9 @@ int sti_mixer_set_layer_status(struct sti_mixer *mixer, {u32 mask, val; +DRM_DEBUG_DRIVER ("%s %s %s\n" , status ?"enable" :"disable" , +sti_mixer_to_str (mixer),sti_layer_to_str (layer)); + mask =sti_mixer_get_layer_mask (layer);if (!mask) {DRM_ERROR ("Can not find layer mask\n" );
Signature · 1 line
1.9.1
PATCH v8 11/11 drm: sti: Add DRM driver itself
In reply to Benjamin GaignardMake the link between all the hardware drivers and DRM/KMS interface. Create the driver itself and make it register all the sub-components. Use GEM CMA helpers for buffer allocation.
--- drivers/gpu/drm/sti/Kconfig | 8 + drivers/gpu/drm/sti/Makefile | 7 +- drivers/gpu/drm/sti/sti_compositor.c | 43 ++++ drivers/gpu/drm/sti/sti_drm_crtc.c | 423 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/sti/sti_drm_crtc.h | 22 ++ drivers/gpu/drm/sti/sti_drm_drv.c | 241 ++++++++++++++++++++ drivers/gpu/drm/sti/sti_drm_drv.h | 29 +++ drivers/gpu/drm/sti/sti_drm_plane.c | 195 ++++++++++++++++ drivers/gpu/drm/sti/sti_drm_plane.h | 18 ++ 9 files changed, 984 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/sti/sti_drm_crtc.c create mode 100644 drivers/gpu/drm/sti/sti_drm_crtc.h create mode 100644 drivers/gpu/drm/sti/sti_drm_drv.c create mode 100644 drivers/gpu/drm/sti/sti_drm_drv.h create mode 100644 drivers/gpu/drm/sti/sti_drm_plane.c create mode 100644 drivers/gpu/drm/sti/sti_drm_plane.h
drivers/gpu/drm/sti/Kconfig +8 -0
@@ -1,6 +1,14 @@ config DRM_STI tristate "DRM Support for STMicroelectronics SoC stiH41x Series" depends on DRM && (SOC_STIH415 || SOC_STIH416 || ARCH_MULTIPLATFORM) + select DRM_KMS_HELPER + select DRM_GEM_CMA_HELPER select DRM_KMS_CMA_HELPER help Choose this option to enable DRM on STM stiH41x chipset + +config DRM_STI_FBDEV + bool "DRM frame buffer device for STMicroelectronics SoC stiH41x Serie" + depends on DRM_STI + help + Choose this option to enable FBDEV on top of DRM for STM stiH41x chipset
drivers/gpu/drm/sti/Makefile +5 -2
@@ -3,7 +3,9 @@ sticompositor-y := \ sti_mixer.o \ sti_gdp.o \ sti_vid.o \ - sti_compositor.o + sti_compositor.o \ + sti_drm_crtc.o \ + sti_drm_plane.o stihdmi-y := sti_hdmi.o \ sti_hdmi_tx3g0c55phy.o \
@@ -15,4 +17,5 @@ obj-$(CONFIG_DRM_STI) = \ stihdmi.o \ sti_hda.o \ sti_tvout.o \ - sticompositor.o + sticompositor.o \ + sti_drm_drv.o
drivers/gpu/drm/sti/sti_compositor.c +43 -0
66 lines not on this page · raw message
drivers/gpu/drm/sti/sti_drm_crtc.c new file +423 -0
423 lines not on this page · raw message
drivers/gpu/drm/sti/sti_drm_crtc.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* Copyright (C) STMicroelectronics SA 2014 +* Author: Benjamin Gaignard <[email protected]> for STMicroelectronics. +* License terms: GNU General Public License (GPL), version 2 +*/ + +#ifndef _STI_DRM_CRTC_H_ +#define _STI_DRM_CRTC_H_ + +#include <drm/drmP.h> + +struct sti_mixer ; + +int sti_drm_crtc_init (struct drm_device *drm_dev,struct sti_mixer *mixer, +struct drm_plane *primary,struct drm_plane *cursor); +int sti_drm_crtc_enable_vblank (struct drm_device *dev,int crtc); +void sti_drm_crtc_disable_vblank (struct drm_device *dev,int crtc); +int sti_drm_crtc_vblank_cb (struct notifier_block *nb, +unsigned long event,void *data); +bool sti_drm_crtc_is_main (struct drm_crtc *drm_crtc); + +#endif
drivers/gpu/drm/sti/sti_drm_drv.c new file +241 -0
241 lines not on this page · raw message
drivers/gpu/drm/sti/sti_drm_drv.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* Copyright (C) STMicroelectronics SA 2014 +* Author: Benjamin Gaignard <[email protected]> for STMicroelectronics. +* License terms: GNU General Public License (GPL), version 2 +*/ + +#ifndef _STI_DRM_DRV_H_ +#define _STI_DRM_DRV_H_ + +#include <drm/drmP.h> + +struct sti_compositor ; +struct sti_tvout ; + +/** +* STI drm private structure +* This structure is stored as private in the drm_device +* +* @compo: compositor +* @plane_zorder_property: z-order property for CRTC planes +* @drm_dev: drm device +*/ +struct sti_drm_private { +struct sti_compositor *compo; +struct drm_property *plane_zorder_property; +struct drm_device *drm_dev; +}; + +#endif
drivers/gpu/drm/sti/sti_drm_plane.c new file +195 -0
195 lines not on this page · raw message
drivers/gpu/drm/sti/sti_drm_plane.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* Copyright (C) STMicroelectronics SA 2014 +* Author: Benjamin Gaignard <[email protected]> for STMicroelectronics. +* License terms: GNU General Public License (GPL), version 2 +*/ + +#ifndef _STI_DRM_PLANE_H_ +#define _STI_DRM_PLANE_H_ + +#include <drm/drmP.h> + +struct sti_layer ; + +struct drm_plane *sti_drm_plane_init (struct drm_device *dev, +struct sti_layer *layer, +unsigned int possible_crtcs, +enum drm_plane_type type); +#endif
Signature · 1 line
1.9.1
Re: [PATCH v8 11/11] drm: sti: Add DRM driver itself
drivers/gpu/drm/sti/sti_compositor.c static int sti_compositor_bind(struct device *dev, struct device *master, · line 99
Quoted 11 lines · Benjamin Gaignard
drivers/gpu/drm/sti/sti_compositor.c +5
-0@@ -87,11 +90,50 @@ static int sti_compositor_bind(struct device *dev, struct device *master,struct sti_compositor *compo =dev_get_drvdata (dev);struct drm_device *drm_dev = data;unsigned int i, crtc =0 , plane =0 ; +struct sti_drm_private *dev_priv = drm_dev->dev_private; +struct drm_plane *cursor =NULL ; +struct drm_plane *primary =NULL ; + + dev_priv->compo = compo;drm_vblank_init (drm_dev, crtc);
This looks strange - you should pass this the total number of crtcs (the same that eventually ends up in dev->mode_config.num_crtc), not
0. And the assignement of cursors to crtcs looks a bit strange on first read-through, but I have no clue about the sti hw. And in any case those pointers really only matter for backwards compat with existing pageflip and cursor ioctls, so doesn't really matter too much.
Anyway didn't spot anything else which would need to be upgrade to never kms interfaces, so ack from my side for that. Only looked at that since right now I'm refreshing drm docs in those areas ;-) -Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Re: [PATCH v8 11/11] drm: sti: Add DRM driver itself
Quoted 12 lines · Daniel Vetter
Quoted 10 lines · Benjamin Gaignard
drivers/gpu/drm/sti/sti_compositor.c +5
-0@@ -87,11 +90,50 @@ static int sti_compositor_bind(struct device *dev, struct device *master,struct sti_compositor *compo =dev_get_drvdata (dev);struct drm_device *drm_dev = data;unsigned int i, crtc =0 , plane =0 ; +struct sti_drm_private *dev_priv = drm_dev->dev_private; +struct drm_plane *cursor =NULL ; +struct drm_plane *primary =NULL ; + + dev_priv->compo = compo;
Quoted 6 lines
drivers/gpu/drm/sti/sti_compositor.c static int sti_compositor_bind(struct device *dev, struct device *master, · line 99
Quoted 1 line
drivers/gpu/drm/sti/sti_compositor.c +0
-0drm_vblank_init (drm_dev, crtc);This looks strange - you should pass this the total number of crtcs (the same that eventually ends up in
dev->mode_config.num_crtc), not
0. And the assignement of cursors to crtcs looks a bit strange on
hmm, Benjamin probably should try modetest w/ -v arg.. it does look a bit like something is missing here..
BR,
-R
Quoted 17 lines
first read-through, but I have no clue about the sti hw. And in any case those pointers really only matter for backwards compat with existing pageflip and cursor ioctls, so doesn't really matter too much.
Anyway didn't spot anything else which would need to be upgrade to never kms interfaces, so ack from my side for that. Only looked at that since right now I'm refreshing drm docs in those areas ;-) -Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v8 11/11] drm: sti: Add DRM driver itself
It is a regression that I have introduce with universal plane. I have fix it and refresh v8 branch.
I have map CRTC on hardware mixers IP.
I could have one or two mixers, its depends of the chipset and I use one graphic input (GDP) per mixer as primary plane.
Other GPD are used as overlay planes.
Some version of the display IP have one hardware cursor which could be used only with the first mixer.
I haven't push yet the code to support the cursor, I would like to do it when the current patches will have been accepted and merge upstream.
2014-07-30 23:04 GMT+02:00 Rob Clark <[email protected]>:
Quoted 43 lines · Daniel Vetter
Quoted 12 lines
Quoted 10 lines · Benjamin Gaignard
drivers/gpu/drm/sti/sti_compositor.c +5
-0@@ -87,11 +90,50 @@ static int sti_compositor_bind(struct device *dev, struct device *master,struct sti_compositor *compo =dev_get_drvdata (dev);struct drm_device *drm_dev = data;unsigned int i, crtc =0 , plane =0 ; +struct sti_drm_private *dev_priv = drm_dev->dev_private; +struct drm_plane *cursor =NULL ; +struct drm_plane *primary =NULL ; + + dev_priv->compo = compo;Quoted 6 lines
drivers/gpu/drm/sti/sti_compositor.c static int sti_compositor_bind(struct device *dev, struct device *master, · line 99
Quoted 1 line
drivers/gpu/drm/sti/sti_compositor.c +0
-0drm_vblank_init (drm_dev, crtc);This looks strange - you should pass this the total number of crtcs (the same that eventually ends up in
dev->mode_config.num_crtc), not
0. And the assignement of cursors to crtcs looks a bit strange onhmm, Benjamin probably should try modetest w/ -v arg.. it does look a bit like something is missing here..
BR,
-RQuoted 17 lines
first read-through, but I have no clue about the sti hw. And in any case those pointers really only matter for backwards compat with existing pageflip and cursor ioctls, so doesn't really matter too much.
Anyway didn't spot anything else which would need to be upgrade to never kms interfaces, so ack from my side for that. Only looked at that since right now I'm refreshing drm docs in those areas ;-) -Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 11 lines
Benjamin Gaignard Graphic Working Group Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v8 11/11] drm: sti: Add DRM driver itself
In reply to Benjamin GaignardQuoted 5 lines · Benjamin Gaignard
drivers/gpu/drm/sti/sti_drm_crtc.c new file +5
-0+static int sti_drm_crtc_page_flip (struct drm_crtc *crtc, +struct drm_framebuffer *fb, +struct drm_pending_vblank_event *event, +uint32_t page_flip_flags) +{
drivers/gpu/drm/sti/sti_drm_crtc.c line 265
Quoted 10 lines
drivers/gpu/drm/sti/sti_drm_crtc.c new file +10
-0+struct drm_device *drm_dev = crtc->dev; +struct drm_framebuffer *old_fb; +struct sti_mixer *mixer =to_sti_mixer (crtc); +unsigned long flags; +int ret; + +DRM_DEBUG_KMS ("fb %d --> fb %d\n" , + crtc->primary->fb->base.id, fb->base.id); + +mutex_lock (&drm_dev->struct_mutex);
struct_mutex locking here is pure cargo-cult. Please remove asap. -Daniel
Quoted 32 lines
drivers/gpu/drm/sti/sti_drm_crtc.c new file +32
-0+ + old_fb = crtc->primary->fb; + crtc->primary->fb = fb; + ret =sti_drm_crtc_mode_set_base (crtc, crtc->x, crtc->y, old_fb); +if (ret) { +DRM_ERROR ("failed\n" ); + crtc->primary->fb = old_fb; + goto out; + } + +if (event) { + event->pipe = mixer->id; + + ret =drm_vblank_get (drm_dev, event->pipe); +if (ret) { +DRM_ERROR ("Cannot get vblank\n" ); + goto out; + } + +spin_lock_irqsave (&drm_dev->event_lock, flags); +if (mixer->pending_event) { +drm_vblank_put (drm_dev, event->pipe); + ret = -EBUSY ; + }else { + mixer->pending_event = event; + } +spin_unlock_irqrestore (&drm_dev->event_lock, flags); + } +out: +mutex_unlock (&drm_dev->struct_mutex); +return ret; +}
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel