All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shankar, Uma" <uma.shankar@intel.com>
To: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "Kulkarni, Vandita" <vandita.kulkarni@intel.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Sharma,  Swati2" <swati2.sharma@intel.com>
Subject: RE: [RFC 07/13] drm/dp_helper: Add support for link status and link recovery
Date: Sun, 18 Oct 2020 22:37:04 +0000	[thread overview]
Message-ID: <1ed379aa6cd24d569599b557a46008cf@intel.com> (raw)
In-Reply-To: <20201015105259.27934-8-ankit.k.nautiyal@intel.com>



> -----Original Message-----
> From: Nautiyal, Ankit K <ankit.k.nautiyal@intel.com>
> Sent: Thursday, October 15, 2020 4:23 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org; Shankar, Uma <uma.shankar@intel.com>;
> Kulkarni, Vandita <vandita.kulkarni@intel.com>; ville.syrjala@linux.intel.com;
> Sharma, Swati2 <swati2.sharma@intel.com>
> Subject: [RFC 07/13] drm/dp_helper: Add support for link status and link
> recovery

Move this in the start of the series along with rest of the generic DRM helpers.

> From: Swati Sharma <swati2.sharma@intel.com>
> 
> This patch adds support for link status and link recovery. There are specific
> DPCD’s defined for link status check and recovery in case of any issues. PCON will
> communicate the same using an IRQ_HPD to source. HDMI sink would have
> indicated the same to PCON using SCDC interrupt mechanism. While source can
> always read final HDMI sink’s status using I2C over AUX, it’s easier and faster to
> read the PCON’s already read HDMI sink’s status registers.
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 33 +++++++++++++++++++++++++++++++++
>  include/drm/drm_dp_helper.h     | 16 ++++++++++++++++
>  2 files changed, 49 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_helper.c
> b/drivers/gpu/drm/drm_dp_helper.c index df858533dbf7..33a4ac2fb225 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -2896,3 +2896,36 @@ int drm_dp_pcon_hdmi_link_mode(struct
> drm_dp_aux *aux, u8 *frl_trained_mask)
>  	return mode;
>  }
>  EXPORT_SYMBOL(drm_dp_pcon_hdmi_link_mode);
> +
> +void drm_dp_pcon_hdmi_frl_link_error_count(struct drm_dp_aux *aux,
> +					   struct drm_connector *connector) {

This just prints a message if error counts are detected. There isn't any recovery here.
May be you should re-phrase the patch header and description to reflect the same.

Also what will be the usage of this just prints a message, may be return the error to caller
to plan a recovery or link reset .

> +	u8 buf, error_count;
> +	int i, num_error;
> +	struct drm_hdmi_info *hdmi = &connector->display_info.hdmi;
> +
> +	for (i = 0; i < hdmi->max_lanes; i++)
> +	{
> +		if (drm_dp_dpcd_readb(aux,
> DP_PCON_HDMI_ERROR_STATUS_LN0 + i , &buf) < 0)
> +			return;
> +
> +		error_count = buf & DP_PCON_HDMI_ERROR_COUNT_MASK;
> +
> +	switch(error_count) {

Alignment is off.

> +	case DP_PCON_HDMI_ERROR_COUNT_HUNDRED_PLUS:
> +		num_error = 100;
> +		break;
> +	case DP_PCON_HDMI_ERROR_COUNT_TEN_PLUS:
> +		num_error = 10;
> +		break;
> +	case DP_PCON_HDMI_ERROR_COUNT_THREE_PLUS:
> +		num_error = 3;
> +		break;
> +	default:
> +		num_error = 0;
> +	}
> +
> +		DRM_ERROR("More than %d errors since the last read for lane
> %d", num_error, i);
> +	}
> +}
> +EXPORT_SYMBOL(drm_dp_pcon_hdmi_frl_link_error_count);
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index
> d6f79b2d1287..eb26c86dc8ca 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -946,6 +946,11 @@ struct drm_device;
>  # define DP_CEC_IRQ                          (1 << 2)
> 
>  #define DP_LINK_SERVICE_IRQ_VECTOR_ESI0     0x2005   /* 1.2 */
> +# define RX_CAP_CHANGED                      (1 << 0)
> +# define LINK_STATUS_CHANGED                 (1 << 1)
> +# define STREAM_STATUS_CHANGED               (1 << 2)
> +# define HDMI_LINK_STATUS_CHANGED            (1 << 3)
> +# define CONNECTED_OFF_ENTRY_REQUESTED       (1 << 4)
> 
>  #define DP_PSR_ERROR_STATUS                 0x2006  /* XXX 1.2? */
>  # define DP_PSR_LINK_CRC_ERROR              (1 << 0)
> @@ -1130,6 +1135,16 @@ struct drm_device;
>  #define DP_PROTOCOL_CONVERTER_CONTROL_2		0x3052 /* DP 1.3
> */
>  # define DP_CONVERSION_TO_YCBCR422_ENABLE	(1 << 0) /* DP 1.3 */
> 
> +/* PCON Downstream HDMI ERROR Status per Lane */
> +#define DP_PCON_HDMI_ERROR_STATUS_LN0          0x3037
> +#define DP_PCON_HDMI_ERROR_STATUS_LN1          0x3038
> +#define DP_PCON_HDMI_ERROR_STATUS_LN2          0x3039
> +#define DP_PCON_HDMI_ERROR_STATUS_LN3          0x303A
> +# define DP_PCON_HDMI_ERROR_COUNT_MASK         (0x7 << 0)
> +# define DP_PCON_HDMI_ERROR_COUNT_THREE_PLUS   (1 << 0)
> +# define DP_PCON_HDMI_ERROR_COUNT_TEN_PLUS     (1 << 1)
> +# define DP_PCON_HDMI_ERROR_COUNT_HUNDRED_PLUS (1 << 2)
> +
>  /* HDCP 1.3 and HDCP 2.2 */
>  #define DP_AUX_HDCP_BKSV		0x68000
>  #define DP_AUX_HDCP_RI_PRIME		0x68005
> @@ -2047,4 +2062,5 @@ int drm_dp_pcon_frl_enable(struct drm_dp_aux *aux);
> 
>  bool drm_dp_pcon_hdmi_link_active(struct drm_dp_aux *aux);  int
> drm_dp_pcon_hdmi_link_mode(struct drm_dp_aux *aux, u8 *frl_trained_mask);
> +void drm_dp_pcon_hdmi_frl_link_error_count(struct drm_dp_aux *aux,
> +struct drm_connector *connector);

Leave a blank line.

>  #endif /* _DRM_DP_HELPER_H_ */
> --
> 2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: "Shankar, Uma" <uma.shankar@intel.com>
To: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [RFC 07/13] drm/dp_helper: Add support for link status and link recovery
Date: Sun, 18 Oct 2020 22:37:04 +0000	[thread overview]
Message-ID: <1ed379aa6cd24d569599b557a46008cf@intel.com> (raw)
In-Reply-To: <20201015105259.27934-8-ankit.k.nautiyal@intel.com>



> -----Original Message-----
> From: Nautiyal, Ankit K <ankit.k.nautiyal@intel.com>
> Sent: Thursday, October 15, 2020 4:23 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org; Shankar, Uma <uma.shankar@intel.com>;
> Kulkarni, Vandita <vandita.kulkarni@intel.com>; ville.syrjala@linux.intel.com;
> Sharma, Swati2 <swati2.sharma@intel.com>
> Subject: [RFC 07/13] drm/dp_helper: Add support for link status and link
> recovery

Move this in the start of the series along with rest of the generic DRM helpers.

> From: Swati Sharma <swati2.sharma@intel.com>
> 
> This patch adds support for link status and link recovery. There are specific
> DPCD’s defined for link status check and recovery in case of any issues. PCON will
> communicate the same using an IRQ_HPD to source. HDMI sink would have
> indicated the same to PCON using SCDC interrupt mechanism. While source can
> always read final HDMI sink’s status using I2C over AUX, it’s easier and faster to
> read the PCON’s already read HDMI sink’s status registers.
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 33 +++++++++++++++++++++++++++++++++
>  include/drm/drm_dp_helper.h     | 16 ++++++++++++++++
>  2 files changed, 49 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_helper.c
> b/drivers/gpu/drm/drm_dp_helper.c index df858533dbf7..33a4ac2fb225 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -2896,3 +2896,36 @@ int drm_dp_pcon_hdmi_link_mode(struct
> drm_dp_aux *aux, u8 *frl_trained_mask)
>  	return mode;
>  }
>  EXPORT_SYMBOL(drm_dp_pcon_hdmi_link_mode);
> +
> +void drm_dp_pcon_hdmi_frl_link_error_count(struct drm_dp_aux *aux,
> +					   struct drm_connector *connector) {

This just prints a message if error counts are detected. There isn't any recovery here.
May be you should re-phrase the patch header and description to reflect the same.

Also what will be the usage of this just prints a message, may be return the error to caller
to plan a recovery or link reset .

> +	u8 buf, error_count;
> +	int i, num_error;
> +	struct drm_hdmi_info *hdmi = &connector->display_info.hdmi;
> +
> +	for (i = 0; i < hdmi->max_lanes; i++)
> +	{
> +		if (drm_dp_dpcd_readb(aux,
> DP_PCON_HDMI_ERROR_STATUS_LN0 + i , &buf) < 0)
> +			return;
> +
> +		error_count = buf & DP_PCON_HDMI_ERROR_COUNT_MASK;
> +
> +	switch(error_count) {

Alignment is off.

> +	case DP_PCON_HDMI_ERROR_COUNT_HUNDRED_PLUS:
> +		num_error = 100;
> +		break;
> +	case DP_PCON_HDMI_ERROR_COUNT_TEN_PLUS:
> +		num_error = 10;
> +		break;
> +	case DP_PCON_HDMI_ERROR_COUNT_THREE_PLUS:
> +		num_error = 3;
> +		break;
> +	default:
> +		num_error = 0;
> +	}
> +
> +		DRM_ERROR("More than %d errors since the last read for lane
> %d", num_error, i);
> +	}
> +}
> +EXPORT_SYMBOL(drm_dp_pcon_hdmi_frl_link_error_count);
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index
> d6f79b2d1287..eb26c86dc8ca 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -946,6 +946,11 @@ struct drm_device;
>  # define DP_CEC_IRQ                          (1 << 2)
> 
>  #define DP_LINK_SERVICE_IRQ_VECTOR_ESI0     0x2005   /* 1.2 */
> +# define RX_CAP_CHANGED                      (1 << 0)
> +# define LINK_STATUS_CHANGED                 (1 << 1)
> +# define STREAM_STATUS_CHANGED               (1 << 2)
> +# define HDMI_LINK_STATUS_CHANGED            (1 << 3)
> +# define CONNECTED_OFF_ENTRY_REQUESTED       (1 << 4)
> 
>  #define DP_PSR_ERROR_STATUS                 0x2006  /* XXX 1.2? */
>  # define DP_PSR_LINK_CRC_ERROR              (1 << 0)
> @@ -1130,6 +1135,16 @@ struct drm_device;
>  #define DP_PROTOCOL_CONVERTER_CONTROL_2		0x3052 /* DP 1.3
> */
>  # define DP_CONVERSION_TO_YCBCR422_ENABLE	(1 << 0) /* DP 1.3 */
> 
> +/* PCON Downstream HDMI ERROR Status per Lane */
> +#define DP_PCON_HDMI_ERROR_STATUS_LN0          0x3037
> +#define DP_PCON_HDMI_ERROR_STATUS_LN1          0x3038
> +#define DP_PCON_HDMI_ERROR_STATUS_LN2          0x3039
> +#define DP_PCON_HDMI_ERROR_STATUS_LN3          0x303A
> +# define DP_PCON_HDMI_ERROR_COUNT_MASK         (0x7 << 0)
> +# define DP_PCON_HDMI_ERROR_COUNT_THREE_PLUS   (1 << 0)
> +# define DP_PCON_HDMI_ERROR_COUNT_TEN_PLUS     (1 << 1)
> +# define DP_PCON_HDMI_ERROR_COUNT_HUNDRED_PLUS (1 << 2)
> +
>  /* HDCP 1.3 and HDCP 2.2 */
>  #define DP_AUX_HDCP_BKSV		0x68000
>  #define DP_AUX_HDCP_RI_PRIME		0x68005
> @@ -2047,4 +2062,5 @@ int drm_dp_pcon_frl_enable(struct drm_dp_aux *aux);
> 
>  bool drm_dp_pcon_hdmi_link_active(struct drm_dp_aux *aux);  int
> drm_dp_pcon_hdmi_link_mode(struct drm_dp_aux *aux, u8 *frl_trained_mask);
> +void drm_dp_pcon_hdmi_frl_link_error_count(struct drm_dp_aux *aux,
> +struct drm_connector *connector);

Leave a blank line.

>  #endif /* _DRM_DP_HELPER_H_ */
> --
> 2.17.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-10-18 22:37 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 10:52 [RFC 00/13] Add support for DP-HDMI2.1 PCON Ankit Nautiyal
2020-10-15 10:52 ` [Intel-gfx] " Ankit Nautiyal
2020-10-15 10:52 ` [RFC 01/13] drm/edid: Add additional HFVSDB fields for HDMI2.1 Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-18 20:47   ` Shankar, Uma
2020-10-18 20:47     ` [Intel-gfx] " Shankar, Uma
2020-11-01  5:31     ` Nautiyal, Ankit K
2020-11-01  5:31       ` [Intel-gfx] " Nautiyal, Ankit K
2020-10-15 10:52 ` [RFC 02/13] drm/edid: Parse MAX_FRL field from HFVSDB block Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-18 20:47   ` Shankar, Uma
2020-10-18 20:47     ` [Intel-gfx] " Shankar, Uma
2020-11-01  5:41     ` Nautiyal, Ankit K
2020-11-01  5:41       ` [Intel-gfx] " Nautiyal, Ankit K
2020-10-15 10:52 ` [RFC 03/13] drm/dp_helper: Add FRL training support for a DP-HDMI2.1 PCON Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-18 21:33   ` Shankar, Uma
2020-10-18 21:33     ` [Intel-gfx] " Shankar, Uma
2020-11-01  5:53     ` Nautiyal, Ankit K
2020-11-01  5:53       ` [Intel-gfx] " Nautiyal, Ankit K
2020-10-15 10:52 ` [RFC 04/13] drm/i915: Capture max frl rate for PCON in dfp cap structure Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-18 21:41   ` Shankar, Uma
2020-10-18 21:41     ` [Intel-gfx] " Shankar, Uma
2020-11-01  5:56     ` Nautiyal, Ankit K
2020-11-01  5:56       ` [Intel-gfx] " Nautiyal, Ankit K
2020-10-15 10:52 ` [RFC 05/13] drm/i915: Add support for starting FRL training for HDMI2.1 via PCON Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-18 22:14   ` Shankar, Uma
2020-10-18 22:14     ` [Intel-gfx] " Shankar, Uma
2020-11-01  6:01     ` Nautiyal, Ankit K
2020-11-01  6:01       ` [Intel-gfx] " Nautiyal, Ankit K
2020-10-15 10:52 ` [RFC 06/13] drm/i915: Check for FRL training before DP Link training Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-18 22:21   ` Shankar, Uma
2020-10-18 22:21     ` [Intel-gfx] " Shankar, Uma
2020-11-01  6:06     ` Nautiyal, Ankit K
2020-11-01  6:06       ` [Intel-gfx] " Nautiyal, Ankit K
2020-10-15 10:52 ` [RFC 07/13] drm/dp_helper: Add support for link status and link recovery Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-18 22:37   ` Shankar, Uma [this message]
2020-10-18 22:37     ` Shankar, Uma
2020-11-01  6:18     ` Nautiyal, Ankit K
2020-11-01  6:18       ` [Intel-gfx] " Nautiyal, Ankit K
2020-10-15 10:52 ` [RFC 08/13] drm/i915: Add support for enabling link status and recovery Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-18 22:49   ` Shankar, Uma
2020-10-18 22:49     ` [Intel-gfx] " Shankar, Uma
2020-11-01  6:26     ` Nautiyal, Ankit K
2020-11-01  6:26       ` [Intel-gfx] " Nautiyal, Ankit K
2020-10-15 10:52 ` [RFC 09/13] drm/edid: Parse DSC1.2 cap fields from HFVSDB block Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-18 23:01   ` Shankar, Uma
2020-10-18 23:01     ` [Intel-gfx] " Shankar, Uma
2020-11-01  6:52     ` Nautiyal, Ankit K
2020-11-01  6:52       ` [Intel-gfx] " Nautiyal, Ankit K
2020-10-15 10:52 ` [RFC 10/13] drm/dp_helper: Add support for Configuring DSC for HDMI2.1 Pcon Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-18 23:19   ` Shankar, Uma
2020-10-18 23:19     ` [Intel-gfx] " Shankar, Uma
2020-11-01  7:00     ` Nautiyal, Ankit K
2020-11-01  7:00       ` [Intel-gfx] " Nautiyal, Ankit K
2020-10-15 10:52 ` [RFC 11/13] drm/i915: Read DSC capabilities of the HDMI2.1 PCON encoder Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-15 14:19   ` kernel test robot
2020-10-15 14:19   ` [RFC PATCH] drm/i915: intel_dp_get_pcon_dsc_cap() can be static kernel test robot
2020-10-15 14:47   ` [Intel-gfx] [RFC 11/13] drm/i915: Read DSC capabilities of the HDMI2.1 PCON encoder kernel test robot
2020-10-15 15:10   ` kernel test robot
2020-10-15 17:07   ` kernel test robot
2020-10-15 17:07   ` [PATCH] drm/i915: fix semicolon.cocci warnings kernel test robot
2020-10-18 23:32   ` [RFC 11/13] drm/i915: Read DSC capabilities of the HDMI2.1 PCON encoder Shankar, Uma
2020-10-18 23:32     ` [Intel-gfx] " Shankar, Uma
2020-10-18 23:34     ` Shankar, Uma
2020-10-18 23:34       ` [Intel-gfx] " Shankar, Uma
2020-11-01  7:14       ` Nautiyal, Ankit K
2020-11-01  7:14         ` [Intel-gfx] " Nautiyal, Ankit K
2020-11-01  7:13     ` Nautiyal, Ankit K
2020-11-01  7:13       ` [Intel-gfx] " Nautiyal, Ankit K
2020-10-15 10:52 ` [RFC 12/13] drm/i915: Add helper functions for calculating DSC parameters for HDMI2.1 Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-15 10:52 ` [RFC 13/13] drm/i915: Configure PCON for DSC1.1 to DSC1.2 encoding Ankit Nautiyal
2020-10-15 10:52   ` [Intel-gfx] " Ankit Nautiyal
2020-10-15 11:37 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Add support for DP-HDMI2.1 PCON (rev3) Patchwork
2020-10-15 11:39 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-10-15 12:02 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-10-15 13:41 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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=1ed379aa6cd24d569599b557a46008cf@intel.com \
    --to=uma.shankar@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=swati2.sharma@intel.com \
    --cc=vandita.kulkarni@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.