diff mbox

[2/2] drm/rockchip: analogix_dp: Refuse to enable PSR if panel doesn't support it

Message ID 1474639600-30090-2-git-send-email-tomeu.vizoso@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomeu Vizoso Sept. 23, 2016, 2:06 p.m. UTC
There's no point in enabling PSR when the panel doesn't support it.

This also avoids a problem when PSR gets enabled when a CRTC is being
disabled, because sometimes in that situation the DSP_HOLD_VALID_INTR
interrupt on which we wait will never arrive. This was observed on
RK3288 with a panel without PSR (veyron-jaq Chromebook).

It's very easy to reproduce by running the kms_rmfb test in IGT a few
times.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Yakir Yang <ykk@rock-chips.com>
Cc: Archit Taneja <architt@codeaurora.org>
---
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Sean Paul Sept. 27, 2016, 1:28 p.m. UTC | #1
On Fri, Sep 23, 2016 at 10:06 AM, Tomeu Vizoso
<tomeu.vizoso@collabora.com> wrote:
> There's no point in enabling PSR when the panel doesn't support it.
>
> This also avoids a problem when PSR gets enabled when a CRTC is being
> disabled, because sometimes in that situation the DSP_HOLD_VALID_INTR
> interrupt on which we wait will never arrive. This was observed on
> RK3288 with a panel without PSR (veyron-jaq Chromebook).
>
> It's very easy to reproduce by running the kms_rmfb test in IGT a few
> times.
>
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>

Thanks for digging into this.

Reviewed-by: Sean Paul <seanpaul@chromium.org>



> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: Yakir Yang <ykk@rock-chips.com>
> Cc: Archit Taneja <architt@codeaurora.org>
> ---
>  drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> index e83be157cc2a..8548e8271639 100644
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> @@ -85,6 +85,9 @@ static void analogix_dp_psr_set(struct drm_encoder *encoder, bool enabled)
>         struct rockchip_dp_device *dp = to_dp(encoder);
>         unsigned long flags;
>
> +       if (!analogix_dp_psr_supported(dp->dev))
> +               return;
> +
>         dev_dbg(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit");
>
>         spin_lock_irqsave(&dp->psr_lock, flags);
> --
> 2.7.4
>
Archit Taneja Oct. 3, 2016, 11:13 a.m. UTC | #2
On 09/27/2016 06:58 PM, Sean Paul wrote:
> On Fri, Sep 23, 2016 at 10:06 AM, Tomeu Vizoso
> <tomeu.vizoso@collabora.com> wrote:
>> There's no point in enabling PSR when the panel doesn't support it.
>>
>> This also avoids a problem when PSR gets enabled when a CRTC is being
>> disabled, because sometimes in that situation the DSP_HOLD_VALID_INTR
>> interrupt on which we wait will never arrive. This was observed on
>> RK3288 with a panel without PSR (veyron-jaq Chromebook).
>>
>> It's very easy to reproduce by running the kms_rmfb test in IGT a few
>> times.
>>
>> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
>
> Thanks for digging into this.
>
> Reviewed-by: Sean Paul <seanpaul@chromium.org>
>

queued to drm-misc.

Archit


>
>
>> Cc: Sean Paul <seanpaul@chromium.org>
>> Cc: Yakir Yang <ykk@rock-chips.com>
>> Cc: Archit Taneja <architt@codeaurora.org>
>> ---
>>  drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> index e83be157cc2a..8548e8271639 100644
>> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> @@ -85,6 +85,9 @@ static void analogix_dp_psr_set(struct drm_encoder *encoder, bool enabled)
>>         struct rockchip_dp_device *dp = to_dp(encoder);
>>         unsigned long flags;
>>
>> +       if (!analogix_dp_psr_supported(dp->dev))
>> +               return;
>> +
>>         dev_dbg(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit");
>>
>>         spin_lock_irqsave(&dp->psr_lock, flags);
>> --
>> 2.7.4
>>
diff mbox

Patch

diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index e83be157cc2a..8548e8271639 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -85,6 +85,9 @@  static void analogix_dp_psr_set(struct drm_encoder *encoder, bool enabled)
 	struct rockchip_dp_device *dp = to_dp(encoder);
 	unsigned long flags;
 
+	if (!analogix_dp_psr_supported(dp->dev))
+		return;
+
 	dev_dbg(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit");
 
 	spin_lock_irqsave(&dp->psr_lock, flags);