mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yakir Yang <ykk@rock-chips.com>
To: Thierry Reding <treding@nvidia.com>
Cc: Heiko Stuebner <heiko@sntech.de>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	s.infradead.org@NULL.NULL, David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org,
	Andrzej Hajda <a.hajda@samsung.com>,
	Gustavo Padovan <gustavo.padovan@collabora.co.uk>,
	architt@codeaurora.org, linux-samsung-soc@vger.kernel.org,
	seanpaul@chromium.com, djkurtz@chromium.com,
	Kishon Vijay Abraham I <kishon@ti.com>,
	linux-rockchip@lists.infradead.org, Kukjin Kim <kgene@kernel.org>,
	robherring2@gmail.com, Russell King <rmk+kernel@arm.linux.org.uk>,
	linux-arm-kernel@list.NULL.NULL, devicetree@vger.kernel.org,
	Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Inki Dae <inki.dae@samsung.com>,
	joe@perches.com, Rob Herring <robh+dt@kernel.org>,
	dianders@chromium.com, Mark Yao <mark.yao@rock-chips.com>,
	Jingoo Han <jingoohan1@gmail.com>,
	linux-kernel@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Kumar Gala <galak@codeaurora.org>,
	ajaynumb@gmail.com, Andy Yan <andy.yan@rock-chips.com>
Subject: Re: [PATCH v4 0/16] Add Analogix Core Display Port Driver
Date: Mon, 21 Sep 2015 18:27:40 +0800	[thread overview]
Message-ID: <55FFDB9C.1030901@rock-chips.com> (raw)
In-Reply-To: <20150921091537.GA20992@ulmo.nvidia.com>

Hi Thierry,

Thanks for your suggest :)

On 09/21/2015 05:15 PM, Thierry Reding wrote:
> On Mon, Sep 21, 2015 at 04:45:44PM +0800, Yakir Yang wrote:
>> Hi Heiko,
>>
>> On 09/02/2015 10:15 AM, Yakir Yang wrote:
>>> Hi Heiko,
>>>
>>> 在 09/02/2015 05:47 AM, Heiko Stuebner 写道:
>>>> Hi Yakir,
>>>>
>>>> Am Dienstag, 1. September 2015, 13:46:11 schrieb Yakir Yang:
>>>>>     The Samsung Exynos eDP controller and Rockchip RK3288 eDP
>>>>> controller
>>>>> share the same IP, so a lot of parts can be re-used. I split the common
>>>>> code into bridge directory, then rk3288 and exynos only need to keep
>>>>> some platform code. Cause I can't find the exact IP name of exynos dp
>>>>> controller, so I decide to name dp core driver with "analogix" which I
>>>>> find in rk3288 eDP TRM ;)
>>>>>
>>>>> Beyond that, there are three light registers setting differents bewteen
>>>>> exynos and rk3288.
>>>>> 1. RK3288 have five special pll resigters which not indicata in exynos
>>>>>     dp controller.
>>>>> 2. The address of DP_PHY_PD(dp phy power manager register) are
>>>>> different
>>>>>     between rk3288 and exynos.
>>>>> 3. Rk3288 and exynos have different setting with AUX_HW_RETRY_CTL(dp
>>>>> debug
>>>>>     register).
>>>>>
>>>>> I have verified this series on two kinds of rockchip platform board,
>>>>> one
>>>>> is rk3288 sdk board which connect with a 2K display port monitor, the
>>>>> other
>>>>> is google jerry chromebook which connect with a eDP screen
>>>>> "cnm,n116bgeea2",
>>>>> both of them works rightlly.
>>>> it looks like during the rebase something did go wrong and I found some
>>>> issues
>>>> I mentioned in the replies to individual patches.
>>>>
>>>> I did prepare a branch based on mainline [0] with both the old and the
>>>> new edp
>>>> driver - rk3288_veyron_defconfig build both drivers into the image.
>>>>
>>>> While the old driver still works, I wasn't able to make the new one work
>>>> yet
>>>> ... the drm core does find the connector, but not that anything is
>>>> connected
>>>> to it. I'll try to dig deeper tomorrow, but maybe you'll see anything
>>>> interesting before then.
>>> Many thanks for your comment and debug, I would rebase on your
>>> "edp-with-veyron" branch and fix the broken, make sure v6 would
>>> work rightly at least in your side and my side.
>> Just like we talk off line, I guess there are two tricky questions which
>> make analogix_dp just crash/failed on rockchip platform:
>>
>> -  One is how to reach a agreement with the common way to register
>> connector. There would be a conflict with Exynos & IMX & Rockchip.
>>       On analogix_dp thread, Exynos want to register connector when that
>> connector is ready.
>>       On dw_hdmi thread, IMX want to register connector when all component is
>> already.
>>       So Exynos & IMX & Rockchip should reach a common way to register
>> connector to fix this issue.
>>
>> -  The other is atomic API.
>>        The rockchip drm haven't implemented the atomic API, but the original
>> exynos_dp have used the atomic API on connector helper function. That's why
>> analogix_dp just keep crash on your side.
> There's really no reason not to convert Rockchip to atomic. It will have
> to happen eventually anyway.

Do agree on this point, and I see Tomasz Figa have done some WIP
works on implementing the atomic_commit, maybe would upstream
in further.(https://chromium-review.googlesource.com/#/c/284560/1)


> That said, there's another option that would allow you to side-step both
> of the above problems at the same time. If you turn the common code into
> a helper library that should give you enough flexibility to integrate it
> into all existing users. For example you could leave out the connector
> registration and let the drivers do that. Similarly since the helpers
> are only hooked up at registration time you could probably find a way to
> share the low-level code but again leave it up to the drivers to glue it
> all together at registration time (drivers could wrap the low-level code
> with atomic or non-atomic callbacks).

Wow, sounds good, but I'm not sure I understand this rightly. Do you
mean that I could support two kinds of callbacks in analogix_dp_core
driver, and export them out. And move the connector registration code
into the helper driver (like exynos_dp.c), so helper driver could chose to
use the atomic or non-atomic callbacks. like:

-- analogix_dp_core.c 
--------------------------------------------------------------------
...
struct drm_connector_funcs analogix_dp_connector_atomic_funcs = {
         .dpms = drm_atomic_helper_connector_dpms,
         .fill_modes = drm_helper_probe_single_connector_modes,
         .detect = analogix_dp_detect,
         .destroy = analogix_dp_connector_destroy,
         .reset = drm_atomic_helper_connector_reset,
         .atomic_duplicate_state = 
drm_atomic_helper_connector_duplicate_state,
         .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
};
EXPORT_SYMBOL(analogix_dp_connector_atomic_funcs);

struct drm_connector_funcs analogix_dp_connector_funcs = {
         .dpms = drm_helper_connector_dpms,
         .fill_modes = drm_helper_probe_single_connector_modes,
         .detect = analogix_dp_detect,
         .destroy = analogix_dp_connector_destroy,
};
EXPORT_SYMBOL(analogix_dp_connector_funcs);

struct drm_connector_helper_funcs analogix_dp_connector_helper_funcs = {
         .get_modes = analogix_dp_get_modes,
         .best_encoder = analogix_dp_best_encoder,
};
EXPORT_SYMBOL(analogix_dp_connector_helper_funcs);
...

-- exynos_dp 
----------------------------------------------------------------------------
         ret = drm_connector_init(dp->drm_dev, connector,
&analogix_dp_connector_atomic_funcs,
                                  DRM_MODE_CONNECTOR_eDP);
         if (ret) {
                 DRM_ERROR("Failed to initialize connector with drm\n");
                 return ret;
         }

         drm_connector_helper_add(connector, 
&analogix_dp_connector_helper_funcs);
         drm_connector_register(connector);
         drm_mode_connector_attach_encoder(connector, encoder);

-- analogix_dp-rockchip 
----------------------------------------------------------------------------
         ret = drm_connector_init(dp->drm_dev, connector,
                                  &analogix_dp_connector_funcs,
                                  DRM_MODE_CONNECTOR_eDP);
         if (ret) {
                 DRM_ERROR("Failed to initialize connector with drm\n");
                 return ret;
         }

         drm_connector_helper_add(connector, 
&analogix_dp_connector_helper_funcs);
         drm_mode_connector_attach_encoder(connector, encoder);


Are those code corresponding to your suggestion.   :)

Thanks
- Yakir

> This option may also have the benefit of loosening the coupling between
> DRM drivers and the helper code for this IP, which may be handy in case
> the drivers diverge again in the future, or ease transitions to new API.
>
> Thierry



  reply	other threads:[~2015-09-21 10:28 UTC|newest]

Thread overview: 151+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01  5:46 Yakir Yang
2015-09-01  5:46 ` [PATCH v4 01/16] drm: exynos/dp: fix code style Yakir Yang
2015-09-03  0:21   ` Krzysztof Kozlowski
2015-09-03  5:04     ` Yakir Yang
2015-09-03  5:08       ` Krzysztof Kozlowski
2015-09-03  5:33         ` Yakir Yang
2015-09-03  5:57           ` Joe Perches
2015-09-06  1:33             ` Yakir Yang
2015-09-01  5:49 ` [PATCH v4 02/16] drm: exynos/dp: convert to drm bridge mode Yakir Yang
2015-09-01  5:49 ` [PATCH v4 03/16] drm: bridge: analogix/dp: split exynos dp driver to bridge dir Yakir Yang
2015-09-01 20:46   ` Heiko Stuebner
2015-09-02  1:45     ` Yakir Yang
2015-09-04 21:06     ` Rob Herring
2015-09-04 21:29       ` Heiko Stuebner
2015-09-07  8:11         ` Thierry Reding
2015-09-02 14:50   ` Emil Velikov
2015-09-03  3:55     ` Yakir Yang
2015-09-03  0:58   ` Krzysztof Kozlowski
2015-09-03  5:30     ` Yakir Yang
2015-09-04  0:41       ` Krzysztof Kozlowski
2015-09-06  7:49         ` Yakir Yang
2015-09-07  0:22           ` Krzysztof Kozlowski
2015-09-07  2:27             ` Yakir Yang
2015-09-01  5:52 ` [PATCH v4 04/16] drm: bridge: analogix/dp: remove duplicate configuration of link rate and link count Yakir Yang
2015-09-01  5:55 ` [PATCH v4 05/16] drm: bridge: analogix/dp: dynamic parse sync_pol & interlace & colorimetry Yakir Yang
2015-09-03  8:04   ` Krzysztof Kozlowski
2015-09-06  2:00     ` Yakir Yang
2015-09-01  5:58 ` [PATCH v4 06/16] Documentation: drm/bridge: add document for analogix_dp Yakir Yang
2015-09-01  6:01 ` [PATCH v4 07/16] ARM: dts: exynos/dp: remove some properties that deprecated by analogix_dp driver Yakir Yang
2015-09-03  0:01   ` Krzysztof Kozlowski
2015-09-01  6:01 ` [PATCH v4 08/16] drm: rockchip/dp: add rockchip platform dp driver Yakir Yang
2015-09-01 14:24   ` Heiko Stuebner
2015-09-01 14:48     ` Yakir Yang
2015-09-01 21:00   ` Heiko Stuebner
2015-09-02  1:52     ` Yakir Yang
2015-09-01  6:01 ` [PATCH v4 09/16] drm: rockchip: add bpc and color mode setting Yakir Yang
2015-09-01 21:00   ` Heiko Stuebner
2015-09-02  2:06     ` Yakir Yang
2015-09-02  8:34       ` Thierry Reding
2015-09-02 10:02         ` Yakir Yang
2015-09-03  8:38           ` Thierry Reding
2015-09-06  2:06             ` Yakir Yang
2015-09-01  6:04 ` [PATCH v4 10/16] phy: Add driver for rockchip Display Port PHY Yakir Yang
2015-09-01 16:51   ` Heiko Stuebner
2015-09-01 20:58     ` Heiko Stuebner
2015-09-02  1:46       ` Yakir Yang
2015-09-02  1:02     ` Yakir Yang
2015-09-02 13:27   ` Rob Herring
2015-09-03  3:25     ` Yakir Yang
2015-09-03 13:52       ` Heiko Stuebner
2015-09-01  6:07 ` [PATCH v4 11/16] drm: bridge: analogix/dp: add platform device type support Yakir Yang
2015-09-04  0:36   ` Krzysztof Kozlowski
2015-09-06  4:07     ` Yakir Yang
2015-09-06 23:55       ` Krzysztof Kozlowski
2015-09-07  1:47         ` Yakir Yang
2015-09-01  6:09 ` [PATCH v4 12/16] drm: bridge: analogix/dp: add some rk3288 special registers setting Yakir Yang
2015-09-01  6:11 ` [PATCH v4 13/16] drm: bridge: analogix/dp: add max link rate and lane count limit for RK3288 Yakir Yang
2015-09-01  6:14 ` [PATCH v4 14/16] drm: bridge: analogix/dp: try force hpd after plug in lookup failed Yakir Yang
2015-09-02 20:17   ` Rob Herring
2015-09-03  4:27     ` Yakir Yang
2015-09-03  9:04       ` Thierry Reding
2015-09-04 10:20         ` Russell King - ARM Linux
2015-09-07  9:01           ` Thierry Reding
     [not found]         ` <55EBBA0C.1030100@rock-chips.com>
2015-09-07  8:20           ` Thierry Reding
2015-09-04 21:46       ` Rob Herring
2015-09-06  8:20         ` Yakir Yang
2015-09-07  8:39           ` Thierry Reding
2015-09-03  8:47     ` Thierry Reding
2015-09-03 21:55       ` Rob Herring
2015-09-04 10:01         ` Thierry Reding
2015-09-01  6:17 ` [PATCH v4 15/16] drm: bridge: analogix/dp: move hpd detect to connector detect function Yakir Yang
2015-09-01  6:20 ` [PATCH v4 16/16] drm: bridge: analogix/dp: add edid modes parse in get_modes method Yakir Yang
2015-09-01 21:47 ` [PATCH v4 0/16] Add Analogix Core Display Port Driver Heiko Stuebner
2015-09-02  2:15   ` Yakir Yang
     [not found]     ` <55FFC3B8.9030108@rock-chips.com>
2015-09-21  9:15       ` Thierry Reding
2015-09-21 10:27         ` Yakir Yang [this message]
2015-09-21 11:22           ` Thierry Reding
2015-09-22  7:20 ` [PATCH v5 0/17] " Yakir Yang
2015-09-22  7:26   ` [PATCH v5 01/17] drm: exynos: dp: convert to drm bridge mode Yakir Yang
2015-09-22  7:29   ` [PATCH v5 02/17] drm: bridge: analogix/dp: split exynos dp driver to bridge directory Yakir Yang
2015-09-30  5:17     ` Krzysztof Kozlowski
2015-09-30  6:48       ` Yakir Yang
2015-09-22  7:34   ` [PATCH v5 03/17] drm: bridge: analogix/dp: fix some obvious code style Yakir Yang
2015-09-30  5:22     ` Krzysztof Kozlowski
2015-09-30  6:52       ` Yakir Yang
2015-09-22  7:35   ` [PATCH v5 04/17] drm: bridge: analogix/dp: remove duplicate configuration of link rate and link count Yakir Yang
2015-09-22  7:37   ` [PATCH v5 05/17] drm: bridge: analogix/dp: dynamic parse sync_pol & interlace & dynamic_range Yakir Yang
2015-09-30  5:32     ` Krzysztof Kozlowski
     [not found]       ` <560B8CF1.7050102@rock-chips.com>
2015-09-30  7:34         ` Krzysztof Kozlowski
     [not found]           ` <560B9B33.2060409@rock-chips.com>
2015-09-30  8:26             ` Krzysztof Kozlowski
2015-09-30  9:39               ` Yakir Yang
2015-09-22  7:40   ` [PATCH v5 06/17] Documentation: drm/bridge: add document for analogix_dp Yakir Yang
2015-09-22  7:43   ` [PATCH v5 07/17] ARM: dts: exynos/dp: remove some properties that deprecated by analogix_dp driver Yakir Yang
2015-09-30  5:39     ` Krzysztof Kozlowski
2015-09-30  7:20       ` Yakir Yang
2015-09-22  7:45   ` [PATCH v5 08/17] drm: rockchip: dp: add rockchip platform dp driver Yakir Yang
2015-09-22  7:48   ` [PATCH v5 09/17] Documentation: drm/bridge: add document for analogix_dp Yakir Yang
2015-09-22  7:48   ` [PATCH v5 10/17] phy: Add driver for rockchip Display Port PHY Yakir Yang
2015-09-22  7:51   ` [PATCH v5 11/17] Documentation: phy: add document for rockchip dp phy Yakir Yang
2015-09-22  7:55   ` [PATCH v5 12/17] drm: rockchip: vop: add bpc and color mode setting Yakir Yang
2015-09-22  7:57   ` [PATCH v5 13/17] drm: bridge: analogix/dp: add some rk3288 special registers setting Yakir Yang
2015-09-22  8:00   ` [PATCH v5 14/17] drm: bridge: analogix/dp: add max link rate and lane count limit for RK3288 Yakir Yang
2015-09-22  8:02   ` [PATCH v5 15/17] drm: bridge: analogix/dp: try force hpd after plug in lookup failed Yakir Yang
2015-09-22  8:05   ` [PATCH v5 16/17] drm: bridge: analogix/dp: move hpd detect to connector detect function Yakir Yang
2015-09-22  8:07   ` [PATCH v5 17/17] drm: bridge: analogix/dp: add edid modes parse in get_modes method Yakir Yang
2015-10-07  6:25   ` [PATCH v5 0/17] Add Analogix Core Display Port Driver Yakir Yang
2015-10-07  8:46     ` Javier Martinez Canillas
2015-10-07  9:02       ` Yakir Yang
2015-10-07  9:26         ` Javier Martinez Canillas
     [not found]           ` <5614FC6B.4080702@rock-chips.com>
2015-10-07 11:25             ` Javier Martinez Canillas
2015-10-08  0:40               ` Yakir Yang
2015-10-10 14:31                 ` Yakir Yang
2015-10-13  9:21                   ` Javier Martinez Canillas
2015-10-13 13:50                     ` Yakir Yang
2015-10-14  8:18                       ` Javier Martinez Canillas
2015-10-10 15:35 ` [PATCH v6 " Yakir Yang
2015-10-10 15:38   ` [PATCH v6 01/17] drm: exynos: dp: convert to drm bridge mode Yakir Yang
2015-10-10 15:39   ` [PATCH v6 02/17] drm: bridge: analogix/dp: split exynos dp driver to bridge directory Yakir Yang
2015-10-10 15:41   ` [PATCH v6 03/17] drm: bridge: analogix/dp: fix some obvious code style Yakir Yang
2015-10-10 15:43   ` [PATCH v6 04/17] drm: bridge: analogix/dp: remove duplicate configuration of link rate and link count Yakir Yang
2015-10-10 15:46   ` [PATCH v6 05/17] drm: bridge: analogix/dp: dynamic parse sync_pol & interlace & dynamic_range Yakir Yang
2015-10-12  0:37     ` Yakir Yang
2015-10-12  0:49       ` Krzysztof Kozlowski
2015-10-12  2:43         ` Yakir Yang
2015-10-12  3:51           ` Krzysztof Kozlowski
2015-10-12  4:09             ` Yakir Yang
2015-10-12  4:16               ` Krzysztof Kozlowski
2015-10-10 15:49   ` [PATCH v6 06/17] Documentation: drm/bridge: add document for analogix_dp Yakir Yang
2015-10-10 15:49   ` [PATCH v6 07/17] ARM: dts: exynos/dp: remove some properties that deprecated by analogix_dp driver Yakir Yang
2015-10-10 15:51   ` [PATCH v6 08/17] drm: rockchip: dp: add rockchip platform dp driver Yakir Yang
2015-10-10 15:53   ` [PATCH v6 09/17] Documentation: drm/bridge: add document for analogix_dp Yakir Yang
2015-10-10 15:55   ` [PATCH v6 10/17] phy: Add driver for rockchip Display Port PHY Yakir Yang
2015-10-12 15:02     ` Kishon Vijay Abraham I
2015-10-12 16:18       ` Heiko Stübner
2015-10-13  1:20       ` Yakir Yang
2015-10-10 15:58   ` [PATCH v6 11/17] Documentation: phy: add document for rockchip dp phy Yakir Yang
2015-10-12 22:28     ` Kishon Vijay Abraham I
2015-10-13  1:21       ` Yakir Yang
2015-10-10 16:00   ` [PATCH v6 12/17] drm: rockchip: vop: add bpc and color mode setting Yakir Yang
2015-10-10 16:05   ` [PATCH v6 13/17] drm: bridge: analogix/dp: add some rk3288 special registers setting Yakir Yang
2015-10-10 16:05   ` [PATCH v6 14/17] drm: bridge: analogix/dp: add max link rate and lane count limit for RK3288 Yakir Yang
2015-10-10 16:05   ` [PATCH v6 15/17] drm: bridge: analogix/dp: try force hpd after plug in lookup failed Yakir Yang
2015-10-10 16:05   ` [PATCH v6 16/17] drm: bridge: analogix/dp: move hpd detect to connector detect function Yakir Yang
2015-10-10 16:06   ` [PATCH v6 17/17] drm: bridge: analogix/dp: add edid modes parse in get_modes method Yakir Yang
2015-10-12  4:29   ` [PATCH v7 05/17] drm: bridge: analogix/dp: dynamic parse sync_pol & interlace & dynamic_range Yakir Yang
2015-10-12  6:54     ` Krzysztof Kozlowski
2015-10-12  7:20       ` Yakir Yang
2015-10-19 10:40   ` [PATCH v6 0/17] Add Analogix Core Display Port Driver Javier Martinez Canillas
2015-10-20  2:10     ` Yakir Yang
2015-10-20  9:48       ` Javier Martinez Canillas
2015-10-20 11:40         ` Yakir Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55FFDB9C.1030901@rock-chips.com \
    --to=ykk@rock-chips.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=ajaynumb@gmail.com \
    --cc=andy.yan@rock-chips.com \
    --cc=architt@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.com \
    --cc=djkurtz@chromium.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=galak@codeaurora.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=heiko@sntech.de \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=inki.dae@samsung.com \
    --cc=jingoohan1@gmail.com \
    --cc=joe@perches.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=kishon@ti.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@list.NULL.NULL \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mark.yao@rock-chips.com \
    --cc=pawel.moll@arm.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=robh+dt@kernel.org \
    --cc=robherring2@gmail.com \
    --cc=s.infradead.org@NULL.NULL \
    --cc=seanpaul@chromium.com \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome