Re: [PATCHv2 21/22] drm/bridge: tc358767: add IRQ and HPD support

2019-04-29 Thread Tomi Valkeinen
Hi, On 17/04/2019 10:32, Andrzej Hajda wrote: > On 15.04.2019 12:59, Tomi Valkeinen wrote: >> On 15/04/2019 13:42, Andrzej Hajda wrote: >> >>> Ok we have here 4 combinations: >>> >>> 1. noHPD + eDP. >>> >>> 2. noHPD + DP. >>>

Re: [PATCHv2 02/22] drm/bridge: tc358767: reset voltage-swing & pre-emphasis

2019-04-26 Thread Tomi Valkeinen
On 20/04/2019 23:30, Laurent Pinchart wrote: > Hi Tomi, > > Thank you for the patch. > > On Tue, Mar 26, 2019 at 12:31:26PM +0200, Tomi Valkeinen wrote: >> We need to reset DPCD voltage-swing & pre-emphasis before starting the >> link training, as otherwise tc3587

Re: [PATCHv2 01/22] drm/bridge: tc358767: fix tc_aux_get_status error handling

2019-04-26 Thread Tomi Valkeinen
On 20/04/2019 23:14, Laurent Pinchart wrote: > Hi Tomi, > > Thank you for the patch. > > On Tue, Mar 26, 2019 at 12:31:25PM +0200, Tomi Valkeinen wrote: >> tc_aux_get_status() does not report AUX_TIMEOUT correctly, as it only >> checks the AUX_TIMEOUT if aux is sti

Re: [PATCH] drm: support gpu aliases defined in DT data

2019-04-26 Thread Tomi Valkeinen
On 17/04/2019 20:42, Emil Velikov wrote: > Have you looked at the libdrm drmDevice2 (yes use the second version) API? > It provides various information about the different devices, yet if > it's missing anything do send us a patch ;-) No, I didn't notice that. At least with a quick look, looks go

Re: [PATCHv2 10/22] drm/bridge: tc358767: add link disable function

2019-04-15 Thread Tomi Valkeinen
On 15/04/2019 11:36, Andrzej Hajda wrote: >> +static int tc_main_link_disable(struct tc_data *tc) >> +{ >> +int ret; >> + >> +dev_dbg(tc->dev, "link disable\n"); >> + >> +tc_write(DP0_SRCCTRL, 0); >> +tc_write(DP0CTL, 0); > > > The same register is set in stream_disable, is it co

Re: [PATCHv2 11/22] drm/bridge: tc358767: ensure DP is disabled before LT

2019-04-15 Thread Tomi Valkeinen
On 15/04/2019 11:49, Andrzej Hajda wrote: > On 26.03.2019 11:31, Tomi Valkeinen wrote: >> Link training will sometimes fail if the DP link is, for some whatever >> reason, enabled when tc_main_link_enable() is called. > > > Only tc_stream_enable enables it, does it mea

Re: [PATCHv2 19/22] drm/bridge: tc358767: copy the mode data, instead of storing the pointer

2019-04-15 Thread Tomi Valkeinen
On 15/04/2019 13:09, Andrzej Hajda wrote: > On 26.03.2019 11:31, Tomi Valkeinen wrote: >> In tc_bridge_mode_set callback, we store the pointer to the given >> drm_display_mode, and use the mode later. Storing a pointer in such a >> way looks very suspicious to me, and I hav

Re: [PATCHv2 15/22] drm/bridge: tc358767: clean-up link training

2019-04-15 Thread Tomi Valkeinen
On 15/04/2019 12:54, Andrzej Hajda wrote: > On 26.03.2019 11:31, Tomi Valkeinen wrote: >> The current link training code does unnecessary retry-loops, and does >> extra writes to the registers. It is easier to follow the flow and >> ensure it's similar to Toshiba's d

Re: [PATCHv2 21/22] drm/bridge: tc358767: add IRQ and HPD support

2019-04-15 Thread Tomi Valkeinen
On 15/04/2019 13:42, Andrzej Hajda wrote: > Ok we have here 4 combinations: > > 1. noHPD + eDP. > > 2. noHPD + DP. > > 3. HPD + eDP. > > 4. HPD + DP. > > > Which ones do you want to support, disallow. It is not clear to me. They all should work. If there is HPD, we use it to return connect

Re: [PATCHv2 06/22] drm/bridge: tc358767: cleanup aux_link_setup

2019-04-15 Thread Tomi Valkeinen
On 15/04/2019 10:38, Andrzej Hajda wrote: > On 26.03.2019 11:31, Tomi Valkeinen wrote: >> Modify aux_link_setup so that it does not use tc->link, and thus makes >> aux setup independent of the link probing. >> >> Signed-off-by: Tomi Valkeinen >> --- >&

Re: [PATCHv2 21/22] drm/bridge: tc358767: add IRQ and HPD support

2019-04-12 Thread Tomi Valkeinen
Hi Andrey, On 03/04/2019 14:34, Tomi Valkeinen wrote: > On 02/04/2019 05:16, Andrey Smirnov wrote: > >> The early return above causes tc_get_display_props() to never be >> called for eDP case, which in turn result in tc_mode_valid() returning >> MODE_BAD for every m

Re: [PATCHv2 21/22] drm/bridge: tc358767: add IRQ and HPD support

2019-04-03 Thread Tomi Valkeinen
On 02/04/2019 05:16, Andrey Smirnov wrote: > The early return above causes tc_get_display_props() to never be > called for eDP case, which in turn result in tc_mode_valid() returning > MODE_BAD for every mode it is given since it depends on tc->link.base > being initialized properly. I had to chan

Re: [PATCHv5 0/6] omapdrm: DSI command mode panel support

2019-04-02 Thread Tomi Valkeinen
Hi Sebastian, On 21/11/2018 18:09, Sebastian Reichel wrote: > Hi, > > Here is another round of the DSI command mode panel patchset > integrating the feedback from PATCHv4. The patches are based > on 4.20-rc1 + fixes from Laurent and Tony. I dropped the patches > for OMAP3 support (it needs a work

Re: [PATCH -next] drm/omap: Use PTR_ERR_OR_ZERO in hdmi4_core_init()

2019-04-01 Thread Tomi Valkeinen
Hi, On 29/03/2019 03:41, YueHaibing wrote: > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR > > Signed-off-by: YueHaibing > --- > drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | 5 + > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4_c

[PATCHv2.1 22/22] dt-bindings: tc358767: add HPD support

2019-04-01 Thread Tomi Valkeinen
Add DT property for defining the pin used for HPD. Signed-off-by: Tomi Valkeinen Cc: devicet...@vger.kernel.org Cc: Rob Herring --- * Dropped the interrupt properties * Renamed hpd-num to hpd-pin * Added toshiba prefix for hpd-pin .../devicetree/bindings/display/bridge/toshiba,tc358767.txt

Re: [PATCH v7 0/4] drm: add support for Cadence MHDP DPI/DP bridge.

2019-03-29 Thread Tomi Valkeinen
On 27/03/2019 16:58, Damian Kos wrote: > We would be very happy to have a separate driver for mhdp8546 instead of > mixing it with Rockchip's driver. Unfortunately we need to have one driver > for both IP's, so I'll just change mhdp8546.ko to cdns-mhdp.ko. (Unless, > maintainers give us a green li

Re: [PATCHv2] omapdrm: hdmi4_cec: Fix CEC clock handling for PM

2019-03-27 Thread Tomi Valkeinen
On 26/03/2019 17:14, Tony Lindgren wrote: > If CONFIG_OMAP4_DSS_HDMI_CEC is enabled in .config, deeper SoC idle > states are blocked because the CEC clock gets always enabled on init. > > Let's fix the issue by moving the CEC clock handling to happen later in > hdmi_cec_adap_enable() as suggested

[PATCHv2 13/22] drm/bridge: tc358767: use more reliable seq when finishing LT

2019-03-26 Thread Tomi Valkeinen
d the link disconnects right after those steps. If I reverse the steps, it works every time. There's a chance that this is DP sink specific, though, but as my testing shows this sequence to be much more reliable, let's change it. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc35

[PATCHv2 20/22] drm/bridge: tc358767: add GPIO & interrupt registers

2019-03-26 Thread Tomi Valkeinen
Add GPIO and interrupt related registers for HPD work. Mark INTSTS_G and GPIOI as volatile. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c

[PATCHv2 19/22] drm/bridge: tc358767: copy the mode data, instead of storing the pointer

2019-03-26 Thread Tomi Valkeinen
instead to ensure we don't refer to freed/modified data. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 114d535

[PATCHv2 22/22] dt-bindings: tc358767: add IRQ & HPD support

2019-03-26 Thread Tomi Valkeinen
Add DT properties needed for IRQ and HPD support. Signed-off-by: Tomi Valkeinen Cc: devicet...@vger.kernel.org Cc: Rob Herring --- A quick summary of tc358767's HPD/GPIO support: tc358767 has two pins that can be used as GPIOs. Those can be used for HPD by configuring the pin as

[PATCHv2 17/22] drm/bridge: tc358767: use bridge mode_valid

2019-03-26 Thread Tomi Valkeinen
We have tc_connector_mode_valid() to filter out videomdoes that the tc358767 cannot support. As it is a bridge limitation, change the code to use drm_bridge_funcs's mode_valid instead. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 8 1 file changed, 4 inser

[PATCHv2 16/22] drm/bridge: tc358767: remove check for video mode in link enable

2019-03-26 Thread Tomi Valkeinen
tc_main_link_enable() checks if videomode has been set, and fails if there's no videomode. As tc_main_link_enable() no longer depends on the videomode, we can drop the check. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 4 1 file changed, 4 deletions(-) diff

[PATCHv2 12/22] drm/bridge: tc358767: remove unnecessary msleep

2019-03-26 Thread Tomi Valkeinen
For some reason the driver has a msleep(100) after writing to DP_PHY_CTRL. Toshiba's documentation doesn't suggest any delay is needed, and I have not seen any issues with the sleep removed. Drop it, as msleep(100) is a rather big one. Signed-off-by: Tomi Valkeinen --- drivers/gpu/

[PATCHv2 15/22] drm/bridge: tc358767: clean-up link training

2019-03-26 Thread Tomi Valkeinen
ch handles waiting for the LT phase to finish, and does the necessary LT register setups in tc_main_link_enable, without extra loops. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 129 +- 1 file changed, 57 insertions(+), 72 deletions(-) di

[PATCHv2 14/22] drm/bridge: tc358767: cleanup LT result check

2019-03-26 Thread Tomi Valkeinen
ff-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 62 +-- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 700e161015af..220408db82f7 100644 --- a/drivers/gpu/drm/b

[PATCHv2 21/22] drm/bridge: tc358767: add IRQ and HPD support

2019-03-26 Thread Tomi Valkeinen
Add support for interrupt and hotplug handling. Both are optional. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 157 ++ 1 file changed, 139 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm

[PATCHv2 18/22] drm/bridge: tc358767: remove tc_connector_best_encoder

2019-03-26 Thread Tomi Valkeinen
As far as I know, drm_connector_helper_funcs.best_encoder is not needed in a trivial case as we have here. So remove tc_connector_best_encoder. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/bridge

[PATCHv2 08/22] drm/bridge: tc358767: split stream enable/disable

2019-03-26 Thread Tomi Valkeinen
It is nicer to have enable/disable functions instead of set(bool enable) style function. Split tc_main_link_stream into tc_stream_enable and tc_stream_disable. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 81 +-- 1 file changed, 45

[PATCHv2 03/22] drm/bridge: tc358767: fix ansi 8b10b use

2019-03-26 Thread Tomi Valkeinen
working. This patch makes the driver to always use ANSI 8B10B encoding, and drops the 'coding8b10b' field which is no longer used. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/

[PATCHv2 07/22] drm/bridge: tc358767: move video stream setup to tc_main_link_stream

2019-03-26 Thread Tomi Valkeinen
The driver currently sets the video stream registers in tc_main_link_setup. One should be able to establish the DP link without any video stream, so a more logical place is to configure the stream in the tc_main_link_stream. So move them there. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm

[PATCHv2 11/22] drm/bridge: tc358767: ensure DP is disabled before LT

2019-03-26 Thread Tomi Valkeinen
Link training will sometimes fail if the DP link is, for some whatever reason, enabled when tc_main_link_enable() is called. Ensure that the DP link is disabled by setting DP0CTL to 0 as the first thing. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 2 ++ 1 file changed

[PATCHv2 09/22] drm/bridge: tc358767: move PXL PLL enable/disable to stream enable/disable

2019-03-26 Thread Tomi Valkeinen
nable. Also, currently the PXL PLL is only disabled if the driver if removed. Let's disable the PXL PLL when the stream is disabled. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/d

[PATCHv2 10/22] drm/bridge: tc358767: add link disable function

2019-03-26 Thread Tomi Valkeinen
Currently we have tc_main_link_setup(), which configures and enabled the link, but we have no counter-part for disabling the link. Add tc_main_link_disable, and rename tc_main_link_setup to tc_main_link_enable. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 27

[PATCHv2 01/22] drm/bridge: tc358767: fix tc_aux_get_status error handling

2019-03-26 Thread Tomi Valkeinen
tc_aux_get_status() does not report AUX_TIMEOUT correctly, as it only checks the AUX_TIMEOUT if aux is still busy. Fix this by always checking for AUX_TIMEOUT. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions

[PATCHv2 02/22] drm/bridge: tc358767: reset voltage-swing & pre-emphasis

2019-03-26 Thread Tomi Valkeinen
We need to reset DPCD voltage-swing & pre-emphasis before starting the link training, as otherwise tc358767 will use the previous values as minimums. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu

[PATCHv2 04/22] drm/bridge: tc358767: cleanup spread & scrambler_dis

2019-03-26 Thread Tomi Valkeinen
Minor cleanups: - Use bool for boolean fields - Use DP_MAX_DOWNSPREAD_0_5 instead of BIT(0) - debug print down-spread and scrambler status Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a

[PATCHv2 05/22] drm/bridge: tc358767: remove unused swing & preemp

2019-03-26 Thread Tomi Valkeinen
swing and preemp fields are not used. Remove them. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 8e53073f0e35..7ef8d754b4ff 100644 --- a

[PATCHv2 06/22] drm/bridge: tc358767: cleanup aux_link_setup

2019-03-26 Thread Tomi Valkeinen
Modify aux_link_setup so that it does not use tc->link, and thus makes aux setup independent of the link probing. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c

[PATCHv2 00/22] drm/bridge: tc358767: DP support

2019-03-26 Thread Tomi Valkeinen
y) of the two GPIO pins is used for HPD. I have tested this with interrupt and polling based HPD, and also with a "simulated" eDP panel (DP monitor but defining a simple-panel in the DT data). Tomi Tomi Valkeinen (22): drm/bridge: tc358767: fix tc_aux_get_status error handling dr

Re: INFO: task hung in process_measurement

2019-03-25 Thread Tomi Valkeinen
On 23/03/2019 08:58, syzbot wrote: > syzbot has bisected this bug to: > > commit 8fe5616b20e5742bb5fee0e77dffe2fc76ac92a0 > Author: Jyri Sarha > Date:   Tue Jun 14 08:43:30 2016 + > >     drm/tilcdc: Restore old dpms state in pm_resume() > > bisection log:  https://syzkaller.appspot.com/x/b

Re: [PATCH v2 08/15] drm/bridge: tc358767: Increase AUX transfer length limit

2019-03-22 Thread Tomi Valkeinen
On 22/03/2019 05:28, Andrey Smirnov wrote: > According to the datasheet tc358767 can transfer up to 16 bytes via > its AUX channel, so the artificial limit of 8 apperas to be too > low. However only up to 15-bytes seem to be actually supported and > trying to use 16-byte transfers results in transf

Re: [PATCH v2 07/15] drm/bridge: tc358767: Simplify AUX data write

2019-03-22 Thread Tomi Valkeinen
er transformation was dropped in this patch. > > Signed-off-by: Andrey Smirnov > Cc: Archit Taneja > Cc: Andrzej Hajda > Cc: Laurent Pinchart > Cc: Tomi Valkeinen > Cc: Andrey Gusakov > Cc: Philipp Zabel > Cc: Chris Healy > Cc: Luc

Re: [PATCH v2 05/15] drm/bridge: tc358767: Drop custom tc_write()/tc_read() accessors

2019-03-22 Thread Tomi Valkeinen
On 22/03/2019 05:28, Andrey Smirnov wrote: > A very unfortunate aspect of tc_write()/tc_read() macro helpers is > that they capture quite a bit of context around them and thus require > the caller to have magic variables 'ret' and 'tc' as well as label > 'err'. That makes a number of code paths rat

Re: [PATCH v2 04/15] drm/bridge: tc358767: Simplify tc_set_video_mode()

2019-03-22 Thread Tomi Valkeinen
> Signed-off-by: Andrey Smirnov > Cc: Archit Taneja > Cc: Andrzej Hajda > Cc: Laurent Pinchart > Cc: Tomi Valkeinen > Cc: Andrey Gusakov > Cc: Philipp Zabel > Cc: Chris Healy > Cc: Lucas Stach > Cc: dri-devel@lists.freedesktop.org > Cc: linux-ker...@vger.ker

Re: [PATCH v2 03/15] drm/bridge: tc358767: Simplify polling in tc_link_training()

2019-03-22 Thread Tomi Valkeinen
rchit Taneja > Cc: Andrzej Hajda > Cc: Laurent Pinchart > Cc: Tomi Valkeinen > Cc: Andrey Gusakov > Cc: Philipp Zabel > Cc: Chris Healy > Cc: Lucas Stach > Cc: dri-devel@lists.freedesktop.org > Cc: linux-ker...@vger.kernel.org > --- > drivers/gpu/drm/bridge

Re: [PATCH v2 02/15] drm/bridge: tc358767: Simplify polling in tc_main_link_setup()

2019-03-22 Thread Tomi Valkeinen
On 22/03/2019 05:28, Andrey Smirnov wrote: > Replace explicit polling loop with equivalent call to > tc_poll_timeout() for brevity. No functional change intended. > > Signed-off-by: Andrey Smirnov > Cc: Archit Taneja > Cc: Andrzej Hajda > Cc: Laurent Pinchart >

Re: [PATCH v2 01/15] drm/bridge: tc358767: Simplify tc_poll_timeout()

2019-03-22 Thread Tomi Valkeinen
ot; instead of "struct regmap *" for brevity. No > functional change intended. > > Signed-off-by: Andrey Smirnov > Reviewed-by: Andrzej Hajda > Reviewed-by: Laurent Pinchart > Cc: Archit Taneja > Cc: Andrzej Hajda > Cc: Laurent Pinchart > Cc: Tomi Valkeinen &

Re: [PATCH v2 00/15] tc358767 driver improvements

2019-03-22 Thread Tomi Valkeinen
Hi, On 22/03/2019 05:28, Andrey Smirnov wrote: > Everyone: > > This series contains various improvements (at least in my mind) and > fixes that I made to tc358767 while working with the code of the > driver. Hopefuly each patch is self explanatory. > > Feedback is welcome! Ah, I hadn't realized

Re: [21/21] drm/bridge: tc358767: implement naive HPD handling

2019-03-21 Thread Tomi Valkeinen
On 21/03/2019 00:58, Andrey Smirnov wrote: > Regardless of how it's going to be implemented in the end, there'd > have to be a way to specify which HPD input is being used. Which means True. > a either a new DT binding or re-using already existing to be agreed on > by DT folks. It just seems to

Re: [21/21] drm/bridge: tc358767: implement naive HPD handling

2019-03-20 Thread Tomi Valkeinen
On 20/03/2019 08:57, Tomi Valkeinen wrote: > On 19/03/2019 20:18, Andrey Smirnov wrote: > >> TC358767 has two GPIO pins that can be used for HPD signal. I think >> instead of hardcoding GPIO0 here it would be more flexible to expose >> boths gpios as a gpiochip and use

Re: [PATCH v7 0/4] drm: add support for Cadence MHDP DPI/DP bridge.

2019-03-20 Thread Tomi Valkeinen
Damian, ping. On 31/01/2019 14:08, Tomi Valkeinen wrote: > Hi, > > On 30/01/2019 13:03, Damian Kos wrote: >> Hello! >> >> This is the series of patches that will add support for the Cadence's DPI/DP >> bridge. Please note that this is a preliminary version

Re: [21/21] drm/bridge: tc358767: implement naive HPD handling

2019-03-20 Thread Tomi Valkeinen
lements a naive, polling-based HPD handling, which is used >>> when the driver is in DP mode. >> >>> Signed-off-by: Tomi Valkeinen >>> --- >>> drivers/gpu/drm/bridge/tc358767.c | 56 +-- >>> 1 file changed, 38 insert

Re: [21/21] drm/bridge: tc358767: implement naive HPD handling

2019-03-19 Thread Tomi Valkeinen
On 19/03/2019 20:18, Andrey Smirnov wrote: > TC358767 has two GPIO pins that can be used for HPD signal. I think > instead of hardcoding GPIO0 here it would be more flexible to expose > boths gpios as a gpiochip and use gpiolib API to query the value of > HPD as well as use "hpd-gpios" binidng in

[PATCH 10/21] drm/bridge: tc358767: add link disable function

2019-03-19 Thread Tomi Valkeinen
Currently we have tc_main_link_setup(), which configures and enabled the link, but we have no counter-part for disabling the link. Add tc_main_link_disable, and rename tc_main_link_setup to tc_main_link_enable. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 27

[PATCH 21/21] drm/bridge: tc358767: implement naive HPD handling

2019-03-19 Thread Tomi Valkeinen
tc358767 driver doesn't have any HPD handling at the moment, as it was originally developed to support only eDP. This patch implements a naive, polling-based HPD handling, which is used when the driver is in DP mode. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c

[PATCH 14/21] drm/bridge: tc358767: cleanup LT result check

2019-03-19 Thread Tomi Valkeinen
ff-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 62 +-- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 700e161015af..220408db82f7 100644 --- a/drivers/gpu/drm/b

[PATCH 11/21] drm/bridge: tc358767: ensure DP is disabled before LT

2019-03-19 Thread Tomi Valkeinen
Link training will sometimes fail if the DP link is, for some whatever reason, enabled when tc_main_link_enable() is called. Ensure that the DP link is disabled by setting DP0CTL to 0 as the first thing. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 2 ++ 1 file changed

[PATCH 20/21] drm/bridge: tc358767: add GPIO & interrupt registers

2019-03-19 Thread Tomi Valkeinen
Add GPIO and interrupt related registers for HPD work. Mark INTSTS_G and GPIOI as volatile. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c

[PATCH 16/21] drm/bridge: tc358767: remove check for video mode in link enable

2019-03-19 Thread Tomi Valkeinen
tc_main_link_enable() checks if videomode has been set, and fails if there's no videomode. As tc_main_link_enable() no longer depends on the videomode, we can drop the check. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 4 1 file changed, 4 deletions(-) diff

[PATCH 08/21] drm/bridge: tc358767: split stream enable/disable

2019-03-19 Thread Tomi Valkeinen
It is nicer to have enable/disable functions instead of set(bool enable) style function. Split tc_main_link_stream into tc_stream_enable and tc_stream_disable. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 81 +-- 1 file changed, 45

[PATCH 15/21] drm/bridge: tc358767: clean-up link training

2019-03-19 Thread Tomi Valkeinen
ch handles waiting for the LT phase to finish, and does the necessary LT register setups in tc_main_link_enable, without extra loops. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 129 +- 1 file changed, 57 insertions(+), 72 deletions(-) di

[PATCH 03/21] drm/bridge: tc358767: fix ansi 8b10b use

2019-03-19 Thread Tomi Valkeinen
working. This patch makes the driver to always use ANSI 8B10B encoding, and drops the 'coding8b10b' field which is no longer used. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/

[PATCH 19/21] drm/bridge: tc358767: copy the mode data, instead of storing the pointer

2019-03-19 Thread Tomi Valkeinen
instead to ensure we don't refer to freed/modified data. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 114d535

[PATCH 13/21] drm/bridge: tc358767: use more reliable seq when finishing LT

2019-03-19 Thread Tomi Valkeinen
d the link disconnects right after those steps. If I reverse the steps, it works every time. There's a chance that this is DP sink specific, though, but as my testing shows this sequence to be much more reliable, let's change it. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc35

[PATCH 12/21] drm/bridge: tc358767: remove unnecessary msleep

2019-03-19 Thread Tomi Valkeinen
For some reason the driver has a msleep(100) after writing to DP_PHY_CTRL. Toshiba's documentation doesn't suggest any delay is needed, and I have not seen any issues with the sleep removed. Drop it, as msleep(100) is a rather big one. Signed-off-by: Tomi Valkeinen --- drivers/gpu/

[PATCH 18/21] drm/bridge: tc358767: remove tc_connector_best_encoder

2019-03-19 Thread Tomi Valkeinen
As far as I know, drm_connector_helper_funcs.best_encoder is not needed in a trivial case as we have here. So remove tc_connector_best_encoder. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/bridge

[PATCH 17/21] drm/bridge: tc358767: use bridge mode_valid

2019-03-19 Thread Tomi Valkeinen
We have tc_connector_mode_valid() to filter out videomdoes that the tc358767 cannot support. As it is a bridge limitation, change the code to use drm_bridge_funcs's mode_valid instead. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 8 1 file changed, 4 inser

[PATCH 06/21] drm/bridge: tc358767: cleanup aux_link_setup

2019-03-19 Thread Tomi Valkeinen
Modify aux_link_setup so that it does not use tc->link, and thus makes aux setup independent of the link probing. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c

[PATCH 09/21] drm/bridge: tc358767: move PXL PLL enable/disable to stream enable/disable

2019-03-19 Thread Tomi Valkeinen
nable. Also, currently the PXL PLL is only disabled if the driver if removed. Let's disable the PXL PLL when the stream is disabled. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/d

[PATCH 07/21] drm/bridge: tc358767: move video stream setup to tc_main_link_stream

2019-03-19 Thread Tomi Valkeinen
The driver currently sets the video stream registers in tc_main_link_setup. One should be able to establish the DP link without any video stream, so a more logical place is to configure the stream in the tc_main_link_stream. So move them there. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm

[PATCH 05/21] drm/bridge: tc358767: remove unused swing & preemp

2019-03-19 Thread Tomi Valkeinen
swing and preemp fields are not used. Remove them. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 8e53073f0e35..7ef8d754b4ff 100644 --- a

[PATCH 00/21] drm/bridge: tc358767: DP support

2019-03-19 Thread Tomi Valkeinen
re is that there's no HPD interrupt, so this uses polling. I believe the polling support could be improved by using the INTSTS_G register to find out it there has been plug-ins/outs, but for now this does the HPD handling the naive way. Tomi Tomi Valkeinen (21): drm/bridge: tc358767: fix tc

[PATCH 04/21] drm/bridge: tc358767: cleanup spread & scrambler_dis

2019-03-19 Thread Tomi Valkeinen
Minor cleanups: - Use bool for boolean fields - Use DP_MAX_DOWNSPREAD_0_5 instead of BIT(0) - debug print down-spread and scrambler status Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a

[PATCH 02/21] drm/bridge: tc358767: reset voltage-swing & pre-emphasis

2019-03-19 Thread Tomi Valkeinen
We need to reset DPCD voltage-swing & pre-emphasis before starting the link training, as otherwise tc358767 will use the previous values as minimums. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu

[PATCH 01/21] drm/bridge: tc358767: fix tc_aux_get_status error handling

2019-03-19 Thread Tomi Valkeinen
tc_aux_get_status() does not report AUX_TIMEOUT correctly, as it only checks the AUX_TIMEOUT if aux is still busy. Fix this by always checking for AUX_TIMEOUT. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions

[GIT PULL] omapdrm changes for 5.2

2019-03-18 Thread Tomi Valkeinen
Hi Dave, Please pull omapdrm changes for 5.2. There's the DRM_BUS_FLAG change in the series which might cause conflicts with other pull requests, so I'm sending this very early. Tomi The following changes since commit 9e98c678c2d6ae3a17cb2de55d17f69dddaa231b: Linux 5.1-rc1 (2019-03-17 14:22

Re: [PATCH v3 41/50] drm/bridge: ti-tfp410: Report input bus config through bridge timings

2019-03-15 Thread Tomi Valkeinen
On 15/03/2019 14:28, Peter Ujfalusi wrote: > On 15/03/2019 14.07, Tomi Valkeinen wrote: >>> If the pclk-sample is not defined in DT, it will default to 0 which >>> selects SAMPLE_NEGEDGE (== DRIVE_POSEDGE), right? >>> >>> But all the boards where I can

Re: [PATCH v3 41/50] drm/bridge: ti-tfp410: Report input bus config through bridge timings

2019-03-15 Thread Tomi Valkeinen
On 15/03/2019 13:30, Peter Ujfalusi wrote: > > > On 28/02/2019 12.31, Tomi Valkeinen wrote: >> On 28/02/2019 12:27, Tomi Valkeinen wrote: >>> Hi Laurent, >>> >>> On 11/02/2019 11:46, Laurent Pinchart wrote: >>> >>>> + /* Get the s

Re: [PATCH] drm: support gpu aliases defined in DT data

2019-03-05 Thread Tomi Valkeinen
On 06/03/2019 03:41, Laurent Pinchart wrote: > Hi Tomi, > > On Fri, Jan 18, 2019 at 10:29:33AM +0200, Tomi Valkeinen wrote: >> On 18/01/19 00:04, Rob Herring wrote: >> >>> Mesa/libdrm already has lots of code to open the correct devices and >>> not care

Re: [PATCH v3 41/50] drm/bridge: ti-tfp410: Report input bus config through bridge timings

2019-02-28 Thread Tomi Valkeinen
On 28/02/2019 12:27, Tomi Valkeinen wrote: > Hi Laurent, > > On 11/02/2019 11:46, Laurent Pinchart wrote: > >> +/* Get the sampling edge from the endpoint. */ >> +of_property_read_u32(ep, "pclk-sample", &pclk_sample); >> +of_node_pu

Re: [PATCH v3 41/50] drm/bridge: ti-tfp410: Report input bus config through bridge timings

2019-02-28 Thread Tomi Valkeinen
Hi Laurent, On 11/02/2019 11:46, Laurent Pinchart wrote: > + /* Get the sampling edge from the endpoint. */ > + of_property_read_u32(ep, "pclk-sample", &pclk_sample); > + of_node_put(ep); > + > + timings->input_bus_flags = DRM_BUS_FLAG_DE_HIGH; > + > + switch (pclk_sample) { >

Re: [PATCH v2 0/2] drm/omap: panel-tpo-td028ttec1: add backlight support

2019-02-16 Thread Tomi Valkeinen via dri-devel
On 15/02/2019 09:12, Andreas Kemnade wrote: > Hi, > > On Fri, 8 Feb 2019 11:13:33 +0200 > Tomi Valkeinen wrote: > >> On 05/02/2019 08:38, Andreas Kemnade wrote: >>> This panel has a backlight, so add a property describing that and >>> add the code to us

Re: [PATCH 2/2] drm/tilcdc: Remove unnecessary struct tilcdc_panel_info members

2019-02-15 Thread Tomi Valkeinen via dri-devel
On 15/02/2019 10:13, Jyri Sarha wrote: > Most of the struct tilcdc_panel_info data members, that are also > exposed in dts binding, are essentially display IP register bits that > should not need customization per connected display basis. This patch > removes them, both from the binding and the str

Re: [PATCH 1/2] drm/tilcdc: use drm_fbdev_generic_setup

2019-02-15 Thread Tomi Valkeinen via dri-devel
ection to go. > > Signed-off-by: Jyri Sarha > --- > drivers/gpu/drm/tilcdc/tilcdc_drv.c | 9 +++-- > 1 file changed, 3 insertions(+), 6 deletions(-) Reviewed-by: Tomi Valkeinen Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 061

Re: [PATCH v2 45/49] drm/omap: Add support for drm_bridge

2019-02-11 Thread Tomi Valkeinen
On 08/02/2019 17:20, Laurent Pinchart wrote: > Hi Tomi, > > On Fri, Jan 18, 2019 at 12:33:03PM +0200, Tomi Valkeinen wrote: >> On 11/01/19 05:51, Laurent Pinchart wrote: >>> Hook up drm_bridge support in the omapdrm driver. Despite the recent >>> extensive p

Re: [PATCH v2 0/2] drm/omap: panel-tpo-td028ttec1: add backlight support

2019-02-08 Thread Tomi Valkeinen
On 05/02/2019 08:38, Andreas Kemnade wrote: > This panel has a backlight, so add a property describing that and > add the code to use that. > This makes things like xset dpms force off > also turn off the backlight, so we do not need to rely on additional > userspace programs to do that. > > Andre

Re: [PATCHv2] drm/omap: dsi: Fix PM for display blank with paired dss_pll calls

2019-02-08 Thread Tomi Valkeinen
just call dss_pll_disable() from > dsi_display_uninit_dsi() and the code becomes a bit easier to follow. > > However, we need to also consider that DSI PLL can be muxed for DVI too > as pointed out by Tomi Valkeinen . In the DVI > case, we want to unconditionally disable the clocks. To get around thi

Re: [PATCH] drm/omap: dsi: Fix PM for display blank with paired dss_pll calls

2019-02-07 Thread Tomi Valkeinen
On 06/02/2019 18:29, Tony Lindgren wrote: > OK. Looks good to me otherwise. > > So I guess we should fix. Do you want me to post it all > as a single patch after some testing? Yes please =) Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-

Re: [PATCH] drm/omap: dsi: Fix PM for display blank with paired dss_pll calls

2019-02-06 Thread Tomi Valkeinen
On 06/02/2019 18:00, Tony Lindgren wrote: > OK I'll give it a try. Based on a quick glance, we need to still > check for enabled regulator to avoid unpaired calls. > >> static int dsi_dump_dsi_clocks(struct seq_file *s, void *p) >> @@ -4108,6 +4094,10 @@ static int dsi_display_init_dsi(struct ds

Re: [PATCH v2 00/49] omapdrm: drm_bridge and drm_panel support

2019-02-06 Thread Tomi Valkeinen
Hi, On 11/01/2019 05:50, Laurent Pinchart wrote: > Hello, > > This patch series consolidates the three pending series for the omapdrm and > tfp410 drivers that all together implement drm_bridge and drm_panel support > for omapdrm. > > The series starts with four patches not posted before as part

Re: [PATCH] drm/omap: dsi: Fix PM for display blank with paired dss_pll calls

2019-02-06 Thread Tomi Valkeinen
On 05/02/2019 19:58, Tony Lindgren wrote: > * Tomi Valkeinen [190205 11:07]: >> Yep... So there's the DSI internal code which needs to deal with ulps >> and disconnect_lanes, and then the external interface to the DSI PLL (so >> that DPI can use DSI PLL) without ulps

Re: [PATCH] drm/omap: dsi: Fix PM for display blank with paired dss_pll calls

2019-02-05 Thread Tomi Valkeinen
On 04/02/2019 17:42, Tony Lindgren wrote: > Hi, > > * Tomi Valkeinen [190204 09:57]: >> On 31/01/2019 05:32, Tony Lindgren wrote: >>> Currently dsi_display_init_dsi() calls dss_pll_enable() but it is not >>> paired with dss_pll_disable() in dsi_display_uninit_d

Re: [PATCH] drm/omap: dsi: Fix PM for display blank with paired dss_pll calls

2019-02-04 Thread Tomi Valkeinen
Hi Tony, On 31/01/2019 05:32, Tony Lindgren wrote: > Currently dsi_display_init_dsi() calls dss_pll_enable() but it is not > paired with dss_pll_disable() in dsi_display_uninit_dsi(). This leaves But it is paired with dsi_pll_uninit(). > the DSS clocks enabled when the display is blanked wasting

Re: [PATCH 1/2] drm/omap: panel-tpo-td028ttec1: add backlight support

2019-02-04 Thread Tomi Valkeinen
Hi, On 19/01/2019 20:21, Andreas Kemnade wrote: > This panel has a backlight, so fetch it from devicetree using the > as documented in panel-common.txt. It is implemented the same way as in Extra words above, or maybe some are missing... > panel-dpi.c > This ensures the backlight is also disable

Re: [PATCH v7 0/4] drm: add support for Cadence MHDP DPI/DP bridge.

2019-01-31 Thread Tomi Valkeinen
Hi, On 30/01/2019 13:03, Damian Kos wrote: > Hello! > > This is the series of patches that will add support for the Cadence's DPI/DP > bridge. Please note that this is a preliminary version of the driver and there > will be more patches in the future with updates, fixes and improvements. > Please

Re: [PATCH] drm/doc: Make igts for cross-driver stuff strongly suggested

2019-01-29 Thread Tomi Valkeinen
erties, new files in sysfs or anything else that constitutes an API > change > +should have driver-agnostic testcases in IGT for that feature, if such a test > +can be reasonably made using IGT for the target hardware. > + Acked-by: Tomi Valkeinen Tomi -- Texas Instruments Finland

Re: [PATCHv2 0/7] drm/bridge: tc358767: small fixes

2019-01-23 Thread Tomi Valkeinen
Hi Andrzej, On 09/01/19 12:12, Andrzej Hajda wrote: > On 09.01.2019 10:51, Lucas Stach wrote: >> Am Mittwoch, den 09.01.2019, 11:12 +0200 schrieb Tomi Valkeinen: >>> Hi Andrzej, >>> >>> On 09/01/19 10:22, Andrzej Hajda wrote: >>>> Hi Tomi, >

Re: [PATCH v2 45/49] drm/omap: Add support for drm_bridge

2019-01-18 Thread Tomi Valkeinen
Hi Laurent, On 11/01/19 05:51, Laurent Pinchart wrote: > Hook up drm_bridge support in the omapdrm driver. Despite the recent > extensive preparation work, this is a rather intrusive change, as the > management of outputs needs to be adapted through the driver to handle > both omap_dss_device and

Re: [PATCH] drm: support gpu aliases defined in DT data

2019-01-18 Thread Tomi Valkeinen
On 18/01/19 00:04, Rob Herring wrote: > Mesa/libdrm already has lots of code to open the correct devices and > not care about minor numbers. What's the problem here? Well, maybe the problem is that I don't know how to do this =). So, if we have multiple DRM devices, how does one manage those? It

<    11   12   13   14   15   16   17   18   19   20   >