public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiko Stuebner <heiko@sntech.de>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: architt@codeaurora.org, inki.dae@samsung.com,
	thierry.reding@gmail.com, hjc@rock-chips.com,
	seanpaul@chromium.org, airlied@linux.ie, tfiga@chromium.org,
	hshi@chromium.org, wzz@rock-chips.com, hl@rock-chips.com,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	dianders@chromium.org, linux-rockchip@lists.infradead.org,
	orjan.eide@arm.com, m.szyprowski@samsung.com,
	"Yakir Yang" <ykk@rock-chips.com>,
	"Stéphane Marchesin" <marcheu@chromium.org>
Subject: Re: [PATCH v4 03/38] drm/bridge: analogix_dp: detect Sink PSR state after configuring the PSR
Date: Thu, 08 Mar 2018 23:53:08 +0100	[thread overview]
Message-ID: <2008042.2u3JRVEU5A@phil> (raw)
In-Reply-To: <20180305222324.5872-4-enric.balletbo@collabora.com>

Hi Enric,

Am Montag, 5. März 2018, 23:22:55 CET schrieb Enric Balletbo i Serra:
> From: Yakir Yang <ykk@rock-chips.com>
> 
> Make sure the request PSR state takes effect in analogix_dp_send_psr_spd()
> function, or print the sink PSR error state if we failed to apply the
> requested PSR setting.
> 
> Cc: 征增 王 <wzz@rock-chips.com>
> Cc: Stéphane Marchesin <marcheu@chromium.org>
> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
> [seanpaul changed timeout loop to a readx poll]
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

as this modifies the generic part of the analogix_dp, I think we'll
need some form of Ack from the drm-bridge maintainers.
[Or bridge maintainers applying it].
Change itself looks good, at least to me :-) .

It seems your recipient list is missing some bridge maintainers though.
MAINTAINERS, tells us that
	Archit Taneja <architt@codeaurora.org>
	Andrzej Hajda <a.hajda@samsung.com>
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
should be CCed, but right now I only see Archit.

As there are quite a lot of general patches in here, I'd think this calls
for a v5, including Mareks tested-tag and including the missing people.


Heiko

> 
>  drivers/gpu/drm/bridge/analogix/analogix_dp_core.c |  6 ++--
>  drivers/gpu/drm/bridge/analogix/analogix_dp_core.h |  6 ++--
>  drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c  | 35 +++++++++++++++++++---
>  3 files changed, 37 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index a693ab3078f0..e738aa6de1af 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -122,8 +122,7 @@ int analogix_dp_enable_psr(struct analogix_dp_device *dp)
>  	psr_vsc.DB0 = 0;
>  	psr_vsc.DB1 = EDP_VSC_PSR_STATE_ACTIVE | EDP_VSC_PSR_CRC_VALUES_VALID;
>  
> -	analogix_dp_send_psr_spd(dp, &psr_vsc);
> -	return 0;
> +	return analogix_dp_send_psr_spd(dp, &psr_vsc);
>  }
>  EXPORT_SYMBOL_GPL(analogix_dp_enable_psr);
>  
> @@ -149,8 +148,7 @@ int analogix_dp_disable_psr(struct analogix_dp_device *dp)
>  	if (ret != 1)
>  		dev_err(dp->dev, "Failed to set DP Power0 %d\n", ret);
>  
> -	analogix_dp_send_psr_spd(dp, &psr_vsc);
> -	return 0;
> +	return analogix_dp_send_psr_spd(dp, &psr_vsc);
>  }
>  EXPORT_SYMBOL_GPL(analogix_dp_disable_psr);
>  
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
> index 5c6a28806129..b039b28d8fcc 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
> @@ -20,6 +20,8 @@
>  #define MAX_CR_LOOP 5
>  #define MAX_EQ_LOOP 5
>  
> +#define DP_TIMEOUT_PSR_LOOP_MS			300
> +
>  /* DP_MAX_LANE_COUNT */
>  #define DPCD_ENHANCED_FRAME_CAP(x)		(((x) >> 7) & 0x1)
>  #define DPCD_MAX_LANE_COUNT(x)			((x) & 0x1f)
> @@ -247,8 +249,8 @@ void analogix_dp_config_video_slave_mode(struct analogix_dp_device *dp);
>  void analogix_dp_enable_scrambling(struct analogix_dp_device *dp);
>  void analogix_dp_disable_scrambling(struct analogix_dp_device *dp);
>  void analogix_dp_enable_psr_crc(struct analogix_dp_device *dp);
> -void analogix_dp_send_psr_spd(struct analogix_dp_device *dp,
> -			      struct edp_vsc_psr *vsc);
> +int analogix_dp_send_psr_spd(struct analogix_dp_device *dp,
> +			     struct edp_vsc_psr *vsc);
>  ssize_t analogix_dp_transfer(struct analogix_dp_device *dp,
>  			     struct drm_dp_aux_msg *msg);
>  
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> index 303083ad28e3..005a3f7005d2 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> @@ -10,10 +10,11 @@
>   * option) any later version.
>   */
>  
> -#include <linux/device.h>
> -#include <linux/io.h>
>  #include <linux/delay.h>
> +#include <linux/device.h>
>  #include <linux/gpio.h>
> +#include <linux/io.h>
> +#include <linux/iopoll.h>
>  
>  #include <drm/bridge/analogix_dp.h>
>  
> @@ -992,10 +993,25 @@ void analogix_dp_enable_psr_crc(struct analogix_dp_device *dp)
>  	writel(PSR_VID_CRC_ENABLE, dp->reg_base + ANALOGIX_DP_CRC_CON);
>  }
>  
> -void analogix_dp_send_psr_spd(struct analogix_dp_device *dp,
> -			      struct edp_vsc_psr *vsc)
> +static ssize_t analogix_dp_get_psr_status(struct analogix_dp_device *dp)
> +{
> +	ssize_t val;
> +	u8 status;
> +
> +	val = drm_dp_dpcd_readb(&dp->aux, DP_PSR_STATUS, &status);
> +	if (val < 0) {
> +		dev_err(dp->dev, "PSR_STATUS read failed ret=%zd", val);
> +		return val;
> +	}
> +	return status;
> +}
> +
> +int analogix_dp_send_psr_spd(struct analogix_dp_device *dp,
> +			     struct edp_vsc_psr *vsc)
>  {
>  	unsigned int val;
> +	int ret;
> +	ssize_t psr_status;
>  
>  	/* don't send info frame */
>  	val = readl(dp->reg_base + ANALOGIX_DP_PKT_SEND_CTL);
> @@ -1036,6 +1052,17 @@ void analogix_dp_send_psr_spd(struct analogix_dp_device *dp,
>  	val = readl(dp->reg_base + ANALOGIX_DP_PKT_SEND_CTL);
>  	val |= IF_EN;
>  	writel(val, dp->reg_base + ANALOGIX_DP_PKT_SEND_CTL);
> +
> +	ret = readx_poll_timeout(analogix_dp_get_psr_status, dp, psr_status,
> +		psr_status >= 0 &&
> +		((vsc->DB1 && psr_status == DP_PSR_SINK_ACTIVE_RFB) ||
> +		(!vsc->DB1 && psr_status == DP_PSR_SINK_INACTIVE)), 1500,
> +		DP_TIMEOUT_PSR_LOOP_MS * 1000);
> +	if (ret) {
> +		dev_warn(dp->dev, "Failed to apply PSR %d\n", ret);
> +		return ret;
> +	}
> +	return 0;
>  }
>  
>  ssize_t analogix_dp_transfer(struct analogix_dp_device *dp,
> 

  reply	other threads:[~2018-03-08 22:53 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180305222337epcas3p22a4f5c32c5622d89f6e649b26c0a6043@epcas3p2.samsung.com>
2018-03-05 22:22 ` [PATCH v4 00/38] DRM Rockchip rk3399 (Kevin) Enric Balletbo i Serra
2018-03-05 22:22   ` [PATCH v4 01/38] drm/bridge: analogix_dp: set psr activate/deactivate when enable/disable bridge Enric Balletbo i Serra
2018-03-08 22:44     ` Heiko Stuebner
2018-03-05 22:22   ` [PATCH v4 02/38] drm/rockchip: Don't use atomic constructs for psr Enric Balletbo i Serra
2018-03-08 22:44     ` Heiko Stuebner
2018-03-05 22:22   ` [PATCH v4 03/38] drm/bridge: analogix_dp: detect Sink PSR state after configuring the PSR Enric Balletbo i Serra
2018-03-08 22:53     ` Heiko Stuebner [this message]
2018-03-05 22:22   ` [PATCH v4 04/38] drm/rockchip: Remove analogix psr worker Enric Balletbo i Serra
2018-03-05 22:22   ` [PATCH v4 05/38] drm/bridge: analogix_dp: Don't change psr while bridge is disabled Enric Balletbo i Serra
2018-03-05 22:22   ` [PATCH v4 06/38] drm/rockchip: add mutex vop lock Enric Balletbo i Serra
2018-03-05 22:22   ` [PATCH v4 07/38] drm/bridge: analogix_dp: add fast link train for eDP Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 08/38] drm/rockchip: Only wait for panel ACK on PSR entry Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 09/38] drm/bridge: analogix_dp: Move enable video into config_video() Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 10/38] drm/bridge: analogix_dp: Check AUX_EN status when doing AUX transfer Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 11/38] drm/bridge: analogix_dp: Don't use fast link training when panel just powered up Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 12/38] drm/bridge: analogix_dp: Retry bridge enable when it failed Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 13/38] drm/bridge: analogix_dp: Wait for HPD signal before configuring link Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 14/38] drm/bridge: analogix_dp: Set PD_INC_BG first when powering up edp phy Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 15/38] drm/bridge: analogix_dp: Ensure edp is disabled when shutting down the panel Enric Balletbo i Serra
2018-03-06  7:35     ` Marek Szyprowski
2018-03-06  8:49       ` Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 16/38] drm/bridge: analogix_dp: Extend hpd check time to 100ms Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 17/38] drm/bridge: analogix_dp: Fix incorrect usage of enhanced mode Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 18/38] drm/bridge: analogix_dp: Check dpcd write/read status Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 19/38] drm/bridge: analogix_dp: Fix AUX_PD bit for Rockchip Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 20/38] drm/bridge: analogix_dp: Reset aux channel if an error occurred Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 21/38] drm/rockchip: Restore psr->state when enable/disable psr failed Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 22/38] drm/bridge: analogix_dp: Don't use ANALOGIX_DP_PLL_CTL to control pll Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 23/38] drm/bridge: analogix_dp: Fix timeout of video streamclk config Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 24/38] drm/bridge: analogix_dp: Fix incorrect operations with register ANALOGIX_DP_FUNC_EN_1 Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 25/38] drm/bridge: analogix_dp: Move fast link training detect to set_bridge Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 26/38] drm/bridge: analogix_dp: Reorder plat_data->power_off to happen sooner Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 27/38] drm/bridge: analogix_dp: Properly log AUX CH errors Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 28/38] drm/bridge: analogix_dp: Properly disable aux chan retries on rockchip Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 29/38] drm/rockchip: pre dither down when output bpc is 8bit Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 30/38] drm/bridge: analogix_dp: Split the platform-specific poweron in two parts Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 31/38] drm/rockchip: analogix_dp: Do not call Analogix code before bind Enric Balletbo i Serra
2018-03-05 22:23   ` [PATCH v4 32/38] drm/rockchip: Disable PSR on input events Enric Balletbo i Serra
2018-03-06 10:15   ` [PATCH v4 00/38] DRM Rockchip rk3399 (Kevin) Marek Szyprowski

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=2008042.2u3JRVEU5A@phil \
    --to=heiko@sntech.de \
    --cc=airlied@linux.ie \
    --cc=architt@codeaurora.org \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=enric.balletbo@collabora.com \
    --cc=hjc@rock-chips.com \
    --cc=hl@rock-chips.com \
    --cc=hshi@chromium.org \
    --cc=inki.dae@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=m.szyprowski@samsung.com \
    --cc=marcheu@chromium.org \
    --cc=orjan.eide@arm.com \
    --cc=seanpaul@chromium.org \
    --cc=tfiga@chromium.org \
    --cc=thierry.reding@gmail.com \
    --cc=wzz@rock-chips.com \
    --cc=ykk@rock-chips.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