- 19 3月, 2018 1 次提交
-
-
由 Chen-Yu Tsai 提交于
The Allwinner A80 SoC has 2 documented TCONs. The display pipeline diagram from the user manual shows a third TCON, but it's missing an interrupt line, and its registers are not explained either. It's also not used in Allwinner's vendor BSP. The first TCON only has channel 0, for LCD panel output. The TCON hardware setup is peculiar in that the eDP reset must also be deasserted to allow access to the TCON. How the eDP module is wired in the SoC itself is never explained. The second TCON only has channel 1, and its output is connected to the HDMI encoder block. This patch adds a "needs_edp_reset" field to the tcon quirks structure, and adds quirks and compatible strings for the 2 documented TCONs. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180315114136.24747-4-wens@csie.org
-
- 14 3月, 2018 1 次提交
-
-
由 Giulio Benetti 提交于
Handle both positive and negative dclk polarity, according to bus_flags, taking care of this: On A20 and similar SoCs, the only way to achieve Positive Edge (Rising Edge), is setting dclk clock phase to 2/3(240°). By default TCON works in Negative Edge(Falling Edge), this is why phase is set to 0 in that case. Unfortunately there's no way to logically invert dclk through IO_POL register. The only acceptable way to work, triple checked with scope, is using clock phase set to 0° for Negative Edge and set to 240° for Positive Edge. On A33 and similar SoCs there would be a 90° phase option, but it divides also dclk by 2. This patch is a way to avoid quirks all around TCON and DOTCLOCK drivers for using A33 90° phase divided by 2 and consequently increase code complexity. Signed-off-by: NGiulio Benetti <giulio.benetti@micronovasrl.com> Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/1520963677-124239-1-git-send-email-giulio.benetti@micronovasrl.com
-
- 17 2月, 2018 1 次提交
-
-
由 Giulio Benetti 提交于
Differently from other Lcd signals, HSYNC and VSYNC signals result inverted if their bits are cleared to 0. Invert their settings of IO_POL register. Signed-off-by: NGiulio Benetti <giulio.benetti@micronovasrl.com> Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/1518717288-123578-1-git-send-email-giulio.benetti@micronovasrl.com
-
- 16 2月, 2018 2 次提交
-
-
由 Jernej Skrabec 提交于
This TCON is connected to HDMI encoder. Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NJernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180214200906.31509-9-jernej.skrabec@siol.net
-
由 Jernej Skrabec 提交于
Some TCONs on newer SoCs doesn't support channel 0, since they are meant to be used only with TV or HDMI encoder. Prepare support for them with adding has_channel_0 quirk. Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NJernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180214200906.31509-8-jernej.skrabec@siol.net
-
- 22 1月, 2018 1 次提交
-
-
由 Maxime Ripard 提交于
In some cases, the display engine needs to apply some quirks during the VBLANK event. In the Display Engine 1.0 case for example, we can only disable the frontend once the backend has been, which is at VBLANK. Let's introduce a callback that can be implemented by the various engines. Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/7c298d43aa1500196aa5d15d7a7c0f228c7a6f3c.1516613040.git-series.maxime.ripard@free-electrons.com
-
- 15 1月, 2018 1 次提交
-
-
由 Dan Carpenter 提交于
We accidentally passed the wrong variable to PTR_ERR(). Fixes: a0c1214e ("drm/sun4i: Add LVDS support") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180115081113.wlam5wkmdynisf4r@mwanda
-
- 05 1月, 2018 3 次提交
-
-
由 Maxime Ripard 提交于
Add support for the A83T display pipeline. Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/614b430adf3a67320362a75c01b01bd53013da8a.1513854122.git-series.maxime.ripard@free-electrons.com
-
由 Maxime Ripard 提交于
The TCON supports the LVDS interface to output to a panel or a bridge. Let's add support for it. Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/7fbb85f33ee1d5009fde4f0d7d236e11ca58b114.1513854122.git-series.maxime.ripard@free-electrons.com
-
由 Maxime Ripard 提交于
The various outputs the TCON can provide have different constraints on the dotclock divider. Let's make them configurable by the various mode_set functions. Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/92ff5881c8f8674056d34458b2f264cd48d4e136.1513854122.git-series.maxime.ripard@free-electrons.com
-
- 19 12月, 2017 1 次提交
-
-
由 Maxime Ripard 提交于
The commit 4c7f16d1 ("drm/sun4i: Fix TCON clock and regmap initialization sequence") moved a bunch of logic around, but forgot to update the gotos after the introduction of the err_free_dotclock label. It means that if we fail later that the one introduced in that commit, we'll just to the old label which isn't free the clock we created. This will result in a breakage as soon as someone tries to do something with that clock, since its resources will have been long reclaimed. Cc: <stable@vger.kernel.org> Fixes: 4c7f16d1 ("drm/sun4i: Fix TCON clock and regmap initialization sequence") Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/f83c1cebc731f0b4251f5ddd7b38c718cd79bb0b.1512662253.git-series.maxime.ripard@free-electrons.com
-
- 30 11月, 2017 1 次提交
-
-
由 Chen-Yu Tsai 提交于
The sun4i DRM driver maintains a list of compatible strings it uses to check if a device node within the display component graph is a TCON. The TCON driver also has this list, used to bind the TCON driver to the device. These two lists are identical. Instead of maintaining two identical lists, export the list from the TCON driver for the DRM driver to use. Suggested-by: NRob Herring <robh@kernel.org> Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171127084632.25511-1-wens@csie.org
-
- 18 10月, 2017 7 次提交
-
-
由 Jonathan Liu 提交于
The A20 display pipeline has 2 frontends, 2 backends, and 2 TCONs. This patch adds support (or a compatible string in the frontend's case) for these components. The TCONs support directly outputting to CPU/RGB/LVDS LCD panels, or it can output to HDMI via an on-chip HDMI controller, or CVBS/YPbPr/VGA signals via on-chip TV encoders. These additional encoders are not covered in this patch. Signed-off-by: NJonathan Liu <net147@gmail.com> [wens@csie.org: Expand commit message] Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171017121807.2994-6-wens@csie.org
-
由 Jonathan Liu 提交于
The A10 has two TCONs that are similar to the ones found on other SoCs. Like the A31, TCON0 has a register used to mux the TCON outputs to the downstream encoders. The bit fields are slightly different. Signed-off-by: NJonathan Liu <net147@gmail.com> [wens@csie.org: Reworked for A10 and fixed up commit message] Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171017121807.2994-3-wens@csie.org
-
由 Maxime Ripard 提交于
Some channel0 setup has to be done, no matter what the output interface is (RGB, CPU, LVDS). Move that code into a common function in order to avoid duplication. Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/183100/
-
由 Maxime Ripard 提交于
Just like we did for the TCON enable and disable, for historical reasons we used to rely on the encoders calling the TCON mode_set function, while the CRTC has a callback for that. Let's implement it in order to reduce the boilerplate code. Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/faa3a4d511039af1d116270dfef3a8b60ca3591e.1508231063.git-series.maxime.ripard@free-electrons.com
-
由 Maxime Ripard 提交于
So far, we've required all the TCON-connected encoders to call the TCON enable and disable functions. This was made this way because in the RGB/LVDS case, the TCON is the CRTC and the encoder. However, in all the other cases (HDMI, TV, DSI, etc.), we have another encoder down the road that needs to be programmed. We also needed to know which channel the encoder is connected to, which is encoder-specific. The CRTC's enable and disable callbacks can work just fine for our use case, and we can get the channel to use just by looking at the type of encoder, since that is fixed. Implement those callbacks, which will remove some of the encoder boilerplate. Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/90b4396e19b3eca61b2ebfdae0672074b88ad74d.1508231063.git-series.maxime.ripard@free-electrons.com
-
由 Maxime Ripard 提交于
The drm_display_mode pointer can be mark const, so let's do it. Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/e6f92f126640aa6de639386f9b4677db3d8bb37b.1508231063.git-series.maxime.ripard@free-electrons.com
-
由 Maxime Ripard 提交于
The drm_display_mode pointer can be mark const, so let's do it. Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/b0cce5a43fc3b56953d21a54fc3c14672f755f42.1508231063.git-series.maxime.ripard@free-electrons.com
-
- 11 10月, 2017 2 次提交
-
-
由 Chen-Yu Tsai 提交于
On systems with 2 TCONs such as the A31, it is possible to demux the output of the TCONs to one encoder. Add support for this for the A31. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-3-wens@csie.org
-
由 Chen-Yu Tsai 提交于
Different SoCs have different muxing options and values for the TCON outputs. Instead of stuffing every possibility in sun4i_tcon_set_mux(), add a callback pointer to sun4i_tcon_quirks that each TCON variant can use to provide muxing support. The current muxing options in sun4i_tcon_set_mux() for sun5i-a13 are moved to a new sun5i-specific callback function. Since the new callback replaces what the .has_unknown_mux field in tcon quirks did in the past, the field is removed. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-2-wens@csie.org
-
- 09 9月, 2017 5 次提交
-
-
由 Chen-Yu Tsai 提交于
The TCON has a mux to select the source of the data to display. This mux includes selecting the display backends. On the A31, which has two display pipelines, this mux can let the TCON select either backend as its data source. Although the muxing can be changed on the fly, DRM needs to be able to group a bunch of layers such that they get switched to another crtc together. This is because the display backend does the layer compositing, while the TCON generates the display timings. This constraint is not supported by DRM. Here we simply pair up backends and TCONs with the same ID. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170908075016.18657-7-wens@csie.org
-
由 Chen-Yu Tsai 提交于
Now that sun4i_tcon_find_engine_traverse() usage is restricted to the single input case, we can remove the for_each_available_child_of_node loop. While at it, consolidate all the of_node_put calls into a common exit path. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170908075016.18657-6-wens@csie.org
-
由 Chen-Yu Tsai 提交于
The device tree binding for sun4i-drm says: For all connections between components up to the TCONs in the display pipeline, when there are multiple components of the same type at the same depth, the local endpoint ID must be the same as the remote component's index. For example, if the remote endpoint is Frontend 1, then the local endpoint ID must be 1. We should be able to get the TCON's ID directly from any of the remote endpoints from its input port. With the ID, we can then go through the list of registered engines and find a matching one by ID. However the A31 device tree is incorrect. We assumed that there were no cross pipeline connections between the backends and TCONs. As a result, in all the endpoints between the backends and TCONs of the second display pipeline, the endpoint IDs were incorrectly set to 0, when in fact they should've been set to 1. To maintain compatibility with this incorrect device tree, we first check if the TCON's input port has 1 or many endpoints. If there are more than 1, then it is likely a fixed version, and we can proceed with the new method. If there is only 1 endpoint, then it is possibly an incorrect version, or it could be the SoC only has one pipeline. In either case we fall back to using the old method of traversing the input connections to find a matching engine, and then get its ID. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170908075016.18657-5-wens@csie.org
-
由 Chen-Yu Tsai 提交于
The patch b317fa3b ("drm/sun4i: tcon: Find matching display backend by device node matching") assumed a one-to-one mapping between TCONs and backends. This turned out wrong, as we found muxing controls in the TCON of the A31, and undocumented usage of the backend output selector of the A20. Make sun4i_tcon_find_engine() bail out if the current node has multiple input connections. Fixes: b317fa3b ("drm/sun4i: tcon: Find matching display backend by device node matching") Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170908075016.18657-4-wens@csie.org
-
由 Chen-Yu Tsai 提交于
When binding the TCON, we were checking the reset control status and asserting reset if it wasn't in reset. The check failed to account for the reset control API returning error codes if the status callback was not implemented. Since we want the TCON to be reset in all cases, use reset_control_reset to force a reset instead. Fixes: 9026e0d1 ("drm: Add Allwinner A10 Display Engine support") Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170908090016.32224-1-wens@csie.org
-
- 01 6月, 2017 8 次提交
-
-
由 Maxime Ripard 提交于
It appears that the total vertical resolution needs to be doubled when we're not in interlaced. Make sure that is the case. Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
由 Maxime Ripard 提交于
Both TCON channels need to have the resolution doubled, since the size the hardware is going to use is whatever we put in the register divided by two. However, we handle it differently for the two channels: in the channel 0, our register access macro does the multiplication of the value passed as paremeter, while in the channel 1, the macro doesn't do this, and we need to do it before calling it. Make this consistent by aligning the channel 0 with the channel 1 behaviour. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
由 Maxime Ripard 提交于
It seems like what's called a backporch in the datasheet is actually the backporch plus the sync period. Fix that in our driver. Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
由 Maxime Ripard 提交于
Even though that mux is undocumented, it seems like it needs to be set to 1 when using composite, and 0 when using HDMI. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
由 Maxime Ripard 提交于
The muxing can actually happen on both channels on some SoCs, so it makes more sense to just move it out of the sun4i_tcon1_mode_set function and create a separate function that needs to be called by the encoders. Let's do that and convert the existing drivers. Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
由 Maxime Ripard 提交于
While all functions have debug logs, the channel enable and disable are not logged. Make sure this is the case. Acked-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
由 Icenowy Zheng 提交于
Allwinner V3s SoC features a TCON without channel 1. Add support for it. Signed-off-by: NIcenowy Zheng <icenowy@aosc.io> Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
由 Icenowy Zheng 提交于
As we are going to add support for the Allwinner DE2 engine in sun4i-drm driver, we will finally have two types of display engines -- the DE1 backend and the DE2 mixer. They both do some display blending and feed graphics data to TCON, and is part of the "Display Engine" called by Allwinner, so I choose to call them both "engine" here. Abstract the engine type to a new struct with an ops struct, which contains functions that should be called outside the engine-specified code (in TCON, CRTC or TV Encoder code). In order to preserve bisectability, we also switch the backend and layer code in its own module. Signed-off-by: NIcenowy Zheng <icenowy@aosc.io> Reviewed-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
- 14 5月, 2017 4 次提交
-
-
由 Chen-Yu Tsai 提交于
Currently we are configuring the TCON's dot clock or special clock directly from the encoder mode_set functions. Since we already provide mode_set helper functions for the TCON's 2 channels, we can set the respective clock from those helpers, and reduce the exposure of the TCON's internals. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
由 Chen-Yu Tsai 提交于
The tcons and backends have a one-to-one relationship. Their IDs, or indexes in the documentation, are also the same. Copy the ID from the associated backend and save it in the tcon structure. This will later be used when we add support for the output data path muxes. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
由 Chen-Yu Tsai 提交于
With Allwinner's Display Engine 1.0, each TCON's input is tied to a specific display backend, and the 2 comprise what is known as a crtc in DRM KMS land: The layer, framebuffer, and compositing functions are provided by the backend, while the TCON provides the display timing signals and vblank interrupts. This 1 to 1 relationship is represented in the device tree. On some systems there is an intermediate DRC component. Pointers to both matching components must be provided when initializing the crtc. As the backend is always registered before the associated tcon, we can recursively search upwards through the of_graph to find the matching backend. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
由 Chen-Yu Tsai 提交于
To support multiple display pipelines, we need to keep track of the multiple display backends and TCONs registered with the driver. Switch to lists to track registered components. Components are only appended to their respective lists if the bind process was successful. The TCON bind function now defers if a backend was not registered. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-
- 07 4月, 2017 1 次提交
-
-
由 Rob Herring 提交于
Similar to the previous commit, convert drivers open coding OF graph parsing to use drm_of_find_panel_or_bridge instead. This changes some error messages to debug messages (in the graph core). Graph connections are often "no connects" depending on the particular board, so we want to avoid spurious messages. Plus the kernel is not a DT validator. Signed-off-by: NRob Herring <robh@kernel.org> Reviewed-by: NArchit Taneja <architt@codeaurora.org> Tested-by: NPhilipp Zabel <p.zabel@pengutronix.de> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> [seanpaul dropped rockchip changes since they're now obsolete] Signed-off-by: NSean Paul <seanpaul@chromium.org>
-
- 09 3月, 2017 1 次提交
-
-
由 Chen-Yu Tsai 提交于
sun4i_crtc controls the backend and tcon hardware blocks of the display pipeline. Pass pointers to the underlying devices into the crtc init function, instead of trying to fetch them from the drm_device structure. This avoids the headache of trying to figure out which devices the crtc is actually associated with. Signed-off-by: NChen-Yu Tsai <wens@csie.org> Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
-