public inbox for linux-samsung-soc@vger.kernel.org
 help / color / mirror / Atom feed
From: Joonyoung Shim <jy0922.shim@samsung.com>
To: Gustavo Padovan <gustavo@padovan.org>,
	Inki Dae <inki.dae@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	dri-devel@lists.freedesktop.org, tjakobi@math.uni-bielefeld.de,
	Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: Re: [PATCH v7 12/13] drm/exynos: atomic dpms support
Date: Mon, 01 Jun 2015 11:52:20 +0900	[thread overview]
Message-ID: <556BC8E4.1060600@samsung.com> (raw)
In-Reply-To: <20150529213340.GE20774@joana>

On 05/30/2015 06:33 AM, Gustavo Padovan wrote:
> 2015-05-29 Joonyoung Shim <jy0922.shim@samsung.com>:
> 
>> On 05/29/2015 06:36 AM, Gustavo Padovan wrote:
>>> 2015-05-28 Joonyoung Shim <jy0922.shim@samsung.com>:
>>>
>>>> On 05/28/2015 05:24 PM, Joonyoung Shim wrote:
>>>>> On 05/28/2015 02:39 PM, Inki Dae wrote:
>>>>>> Hi Gustavo,
>>>>>>
>>>>>> On 2015년 05월 28일 05:27, Gustavo Padovan wrote:
>>>>>>> Hi Inki,
>>>>>>>
>>>>>>> 2015-05-27 Inki Dae <inki.dae@samsung.com>:
>>>>>>>
>>>>>>>> Hi Gustavo,
>>>>>>>>
>>>>>>>> On 2015년 05월 23일 00:40, Gustavo Padovan wrote:
>>>>>>>>> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>>>>>>>>>
>>>>>>>>> Run dpms operations through the atomic intefaces. This basically removes
>>>>>>>>> the .dpms() callback from econders and crtcs and use .disable() and
>>>>>>>>> .enable() to turn the crtc on and off.
>>>>>>>>>
>>>>>>>>> v2: Address comments by Joonyoung:
>>>>>>>>> 	- make hdmi code call ->disable() instead of ->dpms()
>>>>>>>>> 	- do not use WARN_ON on crtc enable/disable
>>>>>>>>>
>>>>>>>>> v3: - Fix build failure after the hdmi change in v2
>>>>>>>>>     - Change dpms helper of ptn3460 bridge
>>>>>>>>>
>>>>>>>>> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>>>>>>>>> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
>>>>>>>>> Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
>>>>>>>>> ---
>>>>>>>>>  drivers/gpu/drm/bridge/ps8622.c             |  2 +-
>>>>>>>>>  drivers/gpu/drm/bridge/ptn3460.c            |  2 +-
>>>>>>>>>  drivers/gpu/drm/exynos/exynos_dp_core.c     |  2 +-
>>>>>>>>>  drivers/gpu/drm/exynos/exynos_drm_crtc.c    | 95 ++++++++++++++++-------------
>>>>>>>>>  drivers/gpu/drm/exynos/exynos_drm_dpi.c     |  2 +-
>>>>>>>>>  drivers/gpu/drm/exynos/exynos_drm_drv.h     |  4 +-
>>>>>>>>>  drivers/gpu/drm/exynos/exynos_drm_dsi.c     |  2 +-
>>>>>>>>>  drivers/gpu/drm/exynos/exynos_drm_encoder.c | 27 ++------
>>>>>>>>>  drivers/gpu/drm/exynos/exynos_drm_vidi.c    |  2 +-
>>>>>>>>>  drivers/gpu/drm/exynos/exynos_hdmi.c        |  6 +-
>>>>>>>>>  10 files changed, 69 insertions(+), 75 deletions(-)
>>>>>>>>>
>>>>>>>>> diff --git a/drivers/gpu/drm/bridge/ps8622.c b/drivers/gpu/drm/bridge/ps8622.c
>>>>>>>>> index b604326..d686235 100644
>>>>>>>>> --- a/drivers/gpu/drm/bridge/ps8622.c
>>>>>>>>> +++ b/drivers/gpu/drm/bridge/ps8622.c
>>>>>>>>> @@ -499,7 +499,7 @@ static void ps8622_connector_destroy(struct drm_connector *connector)
>>>>>>>>>  }
>>>>>>>>>  
>>>>>>>>>  static const struct drm_connector_funcs ps8622_connector_funcs = {
>>>>>>>>> -	.dpms = drm_helper_connector_dpms,
>>>>>>>>> +	.dpms = drm_atomic_helper_connector_dpms,
>>>>>>>>>  	.fill_modes = drm_helper_probe_single_connector_modes,
>>>>>>>>>  	.detect = ps8622_detect,
>>>>>>>>>  	.destroy = ps8622_connector_destroy,
>>>>>>>>> diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c
>>>>>>>>> index 8ed3617..260bc9f 100644
>>>>>>>>> --- a/drivers/gpu/drm/bridge/ptn3460.c
>>>>>>>>> +++ b/drivers/gpu/drm/bridge/ptn3460.c
>>>>>>>>> @@ -260,7 +260,7 @@ static void ptn3460_connector_destroy(struct drm_connector *connector)
>>>>>>>>>  }
>>>>>>>>>  
>>>>>>>>>  static struct drm_connector_funcs ptn3460_connector_funcs = {
>>>>>>>>> -	.dpms = drm_helper_connector_dpms,
>>>>>>>>> +	.dpms = drm_atomic_helper_connector_dpms,
>>>>>>>>>  	.fill_modes = drm_helper_probe_single_connector_modes,
>>>>>>>>>  	.detect = ptn3460_detect,
>>>>>>>>>  	.destroy = ptn3460_connector_destroy,
>>>>>>>>> diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c
>>>>>>>>> index 195fe60..c9995b1 100644
>>>>>>>>> --- a/drivers/gpu/drm/exynos/exynos_dp_core.c
>>>>>>>>> +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
>>>>>>>>> @@ -954,7 +954,7 @@ static void exynos_dp_connector_destroy(struct drm_connector *connector)
>>>>>>>>>  }
>>>>>>>>>  
>>>>>>>>
>>>>>>>> [--snip--]
>>>>>>>>
>>>>>>>>>  
>>>>>>>>>  static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
>>>>>>>>> -	.dpms		= exynos_drm_crtc_dpms,
>>>>>>>>> -	.prepare	= exynos_drm_crtc_prepare,
>>>>>>>>> -	.commit		= exynos_drm_crtc_commit,
>>>>>>>>> +	.enable		= exynos_drm_crtc_enable,
>>>>>>>>> +	.disable	= exynos_drm_crtc_disable,
>>>>>>>>>  	.mode_fixup	= exynos_drm_crtc_mode_fixup,
>>>>>>>>>  	.mode_set	= drm_helper_crtc_mode_set,
>>>>>>>>>  	.mode_set_nofb	= exynos_drm_crtc_mode_set_nofb,
>>>>>>>>
>>>>>>>> I think it'd be better to use atomic_flush callback to enable global dma
>>>>>>>> like commit callback did. Is there any reason that you don't use
>>>>>>>> atomic_begin and atomic_flush callbacks?
>>>>>>>>
>>>>>>>> atomic relevant codes I looked into do as follows,
>>>>>>>>
>>>>>>>> atomic_begin();
>>>>>>>>
>>>>>>>> atomic_update();  /* this will call win_commit callback to set a overlay
>>>>>>>> relevant registers and enable its dma channel. */
>>>>>>>>
>>>>>>>> atomic_flush();
>>>>>>>>
>>>>>>>> So atomic overlay updating between atomic_begin() ~ atomic_flush() will
>>>>>>>> be guaranteed.
>>>>>>>
>>>>>>> I think we can go down that road, but I'd suggest we push the atomic
>>>>>>> patches v8 (with the lastest comments from Joonyoung fixed) and then 
>>>>>>> work on the change you are proposing as a follow-up together with the 
>>>>>>> other improvements for atomic I already have queued here. This way
>>>>>>> we don't take the risk of missing one more merge window.
>>>>>>
>>>>>> We(I and Joonyoung) will have discussion about this patch series. For
>>>>>> this, we have already started to analyze entire atomic features
>>>>>> including your patch set so I'd merge it at end of next week according
>>>>>> to the discussion. I'm not kind of sure yet but I will merge it as long
>>>>>> as there is no big problem.
>>>>>>
>>>>>
>>>>> Actually i agree to opinion of Gustavo and will repost the patchset of
>>>>> Gustavo with some patches fixed by me.
>>>>>
>>>>
>>>> Hmm, i meet problem of operations order. It's called .atomic_update
>>>> before enable crtc and called .atomic_disable after disable crtc. It
>>>> means .win_commit and .win_disable just return 0 without any operations
>>>> because e.g. mixer_ctx->powered is 0 in mixer driver, so we cannot
>>>> enable or disable overlay normally.
>>>
>>> The removal of the extra win_commit() from exynos_drm_crtc_enable() that
>>> you pointed out in the last review round led to this issue. The
>>> win_commit() call was hiding the issue since we were calling it a second
>>> time with the FIMD device already enabled.
>>>
>>> I think we can solve this by creating a specific exynos atomic_commit()
>>> callback that does call
>>>
>>> drm_atomic_helper_commit_modeset_enables(dev, state);                   
>>>
>>> before
>>>
>>> drm_atomic_helper_commit_planes(dev, state);
>>>
>>>
>>> This is the opposite order of what drm atomic default implementation
>>> would do, but we won't hit the issue of having the FIMD clks disabled
>>> when trying to setup the plane. This similar to rcar-du solution to the 
>>> same problem.
>>>
>>
>> Yeah, but it can solve only enable operation order, disable operation
>> order still is wrong. It's not big problem yet because drm drivers
>> internally disable planes when crtc is disabled so try to disable again
>> already disabled plane.
>>
>> I'm not sure this is workaround but it seems be simple solution at
>> present.
> 
> This is not workaround, is a valid change according to the atomic doc:
> 
>  * For compatability with legacy crtc helpers this should be called before      
>  * drm_atomic_helper_commit_planes(), which is what the default commit function 
>  * does. But drivers with different needs can group the modeset commits together
>  * and do the plane commits at the end. This is useful for drivers doing runtime
>  * PM since planes updates then only happen when the CRTC is actually enabled.
> 
> So it is completely fine to go ahead with this change as we are now fully ported
> to the atomic helpers.
> 

Right, we can go ahead. Just as i said, disable operation order is
unnatural a bit.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-06-01  2:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 15:40 [PATCH v7 00/13] drm/exynos: atomic modesetting support Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 01/13] drm/exynos: fix source data argument for plane Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 02/13] drm/exynos: atomic phase 1: use drm_plane_helper_update() Gustavo Padovan
2015-05-27  8:35   ` Joonyoung Shim
2015-05-27 18:48     ` Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 03/13] drm/exynos: atomic phase 1: use drm_plane_helper_disable() Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 04/13] drm/exynos: atomic phase 1: add .mode_set_nofb() callback Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 05/13] drm/exynos: atomic phase 2: wire up state reset(), duplicate() and destroy() Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 06/13] drm/exynos: atomic phase 2: keep track of framebuffer pointer Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 07/13] drm/exynos: atomic phase 3: atomic updates of planes Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 08/13] drm/exynos: atomic phase 3: use atomic .set_config helper Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 09/13] drm/exynos: atomic phase 3: convert page flips Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 10/13] drm/exynos: remove exported functions from exynos_drm_plane Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 11/13] drm/exynos: don't disable unused functions at init Gustavo Padovan
2015-05-22 15:40 ` [PATCH v7 12/13] drm/exynos: atomic dpms support Gustavo Padovan
2015-05-27  8:34   ` Joonyoung Shim
2015-05-27 19:26     ` Gustavo Padovan
2015-05-27 12:27   ` Inki Dae
2015-05-27 20:27     ` Gustavo Padovan
2015-05-28  5:39       ` Inki Dae
2015-05-28  8:24         ` Joonyoung Shim
2015-05-28 11:53           ` Joonyoung Shim
2015-05-28 21:36             ` Gustavo Padovan
2015-05-29  6:20               ` Joonyoung Shim
2015-05-29 21:33                 ` Gustavo Padovan
2015-06-01  2:52                   ` Joonyoung Shim [this message]
2015-05-22 15:40 ` [PATCH v7 13/13] drm/exynos: remove unnecessary calls to disable_plane() Gustavo Padovan

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=556BC8E4.1060600@samsung.com \
    --to=jy0922.shim@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=gustavo@padovan.org \
    --cc=inki.dae@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=tjakobi@math.uni-bielefeld.de \
    /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