All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gupta, Anshuman" <anshuman.gupta@intel.com>
To: "Li, Juston" <juston.li@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "seanpaul@chromium.org" <seanpaul@chromium.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v2 3/4] drm/i915/hdcp: read RxInfo once when reading Send_Pairing_Info
Date: Wed, 27 Jan 2021 08:52:44 +0000	[thread overview]
Message-ID: <489d8233cf60425b86e7fc21d193486e@intel.com> (raw)
In-Reply-To: <7976a4bd85224f44bf893e5cda00aeeb@intel.com>

Please also send this patch to dri-devel@lists.freedesktop.org as well because this is a drm change.

> -----Original Message-----
> From: Gupta, Anshuman
> Sent: Wednesday, January 27, 2021 12:55 PM
> To: Li, Juston <juston.li@intel.com>; intel-gfx@lists.freedesktop.org
> Cc: seanpaul@chromium.org; C, Ramalingam <ramalingam.c@intel.com>
> Subject: RE: [PATCH v2 3/4] drm/i915/hdcp: read RxInfo once when reading
> Send_Pairing_Info
> 
> 
> 
> > -----Original Message-----
> > From: Li, Juston <juston.li@intel.com>
> > Sent: Wednesday, January 27, 2021 12:21 PM
> > To: intel-gfx@lists.freedesktop.org
> > Cc: seanpaul@chromium.org; Gupta, Anshuman
> <anshuman.gupta@intel.com>;
> > C, Ramalingam <ramalingam.c@intel.com>; Li, Juston
> > <juston.li@intel.com>
> > Subject: [PATCH v2 3/4] drm/i915/hdcp: read RxInfo once when reading
> > Send_Pairing_Info
> >
> > Previously when reading Send_Pairing_Info, RxInfo by itself was read
> > once to retrieve the DEVICE_COUNT and then a second time when reading
> > the RepeaterAuth_Send_ReceiverID_List which contains RxInfo.
> >
> > On a couple HDCP 2.2 docks, this second read attempt on RxInfo fails
> > due to no Ack response. This behavior doesn't seem to be defined but
> > regardless we can fix it by reading RxInfo once and storing it before
> > reading the rest of RepeaterAuth_Send_ReceiverID_List once we know the
> size.
> >
> > Modify get_receiver_id_list_size() to read and store RxInfo in the
> > message buffer and also parse DEVICE_COUNT so we know the size of
> > RepeaterAuth_Send_ReceiverID_List.
> >
> > Afterwards, retrieve the rest of the message at the offset for seq_num_V.
> >
> > Changes in v2:
> > - remove unnecessary moving of drm_i915_private from patch 1
> >
> > Signed-off-by: Juston Li <juston.li@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 29 ++++++++++----------
> >  include/drm/drm_dp_helper.h                  |  2 +-
> >  2 files changed, 16 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > index d1397af97f69..cd183944bc5a 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > @@ -475,11 +475,10 @@ int intel_dp_hdcp2_write_msg(struct
> > intel_digital_port *dig_port,  }
> >
> >  static
> > -ssize_t get_receiver_id_list_size(struct intel_digital_port
> > *dig_port)
> > +ssize_t get_receiver_id_list_rx_info(struct intel_digital_port
> > +*dig_port, u32 *dev_cnt, u8 *byte)
> >  {
> > -	u8 rx_info[HDCP_2_2_RXINFO_LEN];
> > -	u32 dev_cnt;
> >  	ssize_t ret;
> > +	u8 *rx_info = byte;
> >
> >  	ret = drm_dp_dpcd_read(&dig_port->dp.aux,
> >  			       DP_HDCP_2_2_REG_RXINFO_OFFSET, @@ -
> > 487,15 +486,11 @@ ssize_t get_receiver_id_list_size(struct
> > intel_digital_port *dig_port)
> >  	if (ret != HDCP_2_2_RXINFO_LEN)
> >  		return ret >= 0 ? -EIO : ret;
> >
> > -	dev_cnt = (HDCP_2_2_DEV_COUNT_HI(rx_info[0]) << 4 |
> > +	*dev_cnt = (HDCP_2_2_DEV_COUNT_HI(rx_info[0]) << 4 |
> >  		   HDCP_2_2_DEV_COUNT_LO(rx_info[1]));
> >
> > -	if (dev_cnt > HDCP_2_2_MAX_DEVICE_COUNT)
> > -		dev_cnt = HDCP_2_2_MAX_DEVICE_COUNT;
> > -
> > -	ret = sizeof(struct hdcp2_rep_send_receiverid_list) -
> > -		HDCP_2_2_RECEIVER_IDS_MAX_LEN +
> > -		(dev_cnt * HDCP_2_2_RECEIVER_ID_LEN);
> > +	if (*dev_cnt > HDCP_2_2_MAX_DEVICE_COUNT)
> > +		*dev_cnt = HDCP_2_2_MAX_DEVICE_COUNT;
> >
> >  	return ret;
> >  }
> > @@ -511,6 +506,7 @@ int intel_dp_hdcp2_read_msg(struct
> > intel_digital_port *dig_port,
> >  	u8 *byte = buf;
> >  	ssize_t ret, bytes_to_recv, len;
> >  	const struct hdcp2_dp_msg_data *hdcp2_msg_data;
> > +	u32 dev_cnt;
> >
> >  	hdcp2_msg_data = get_hdcp2_dp_msg_data(msg_id);
> >  	if (!hdcp2_msg_data)
> > @@ -523,17 +519,22 @@ int intel_dp_hdcp2_read_msg(struct
> > intel_digital_port *dig_port,
> >
> >  	hdcp->cp_irq_count_cached = atomic_read(&hdcp->cp_irq_count);
> >
> > +	/* DP adaptation msgs has no msg_id */
> > +	byte++;
> > +
> >  	if (msg_id == HDCP_2_2_REP_SEND_RECVID_LIST) {
> > -		ret = get_receiver_id_list_size(dig_port);
> > +		ret = get_receiver_id_list_rx_info(dig_port, &dev_cnt,
> > byte);
> >  		if (ret < 0)
> >  			return ret;
> >
> > -		size = ret;
> > +		byte += ret;
> > +		size = sizeof(struct hdcp2_rep_send_receiverid_list) -
> > +		HDCP_2_2_RXINFO_LEN -
> > HDCP_2_2_RECEIVER_IDS_MAX_LEN +
> > +		(dev_cnt * HDCP_2_2_RECEIVER_ID_LEN);
> >  	}
> > -	bytes_to_recv = size - 1;
> >
> >  	/* DP adaptation msgs has no msg_id */
> Please remove this comment.
> With that
> Acked-by: Anshuman Gupta <anshuman.gupta@intel.com>
> > -	byte++;
> > +	bytes_to_recv = size - 1;
> >
> >  	while (bytes_to_recv) {
> >  		len = bytes_to_recv > DP_AUX_MAX_PAYLOAD_BYTES ?
> > diff --git a/include/drm/drm_dp_helper.h
> b/include/drm/drm_dp_helper.h
> > index edffd1dcca3e..3b42392394ba 100644
> > --- a/include/drm/drm_dp_helper.h
> > +++ b/include/drm/drm_dp_helper.h
> > @@ -1388,7 +1388,7 @@ enum drm_dp_phy {  #define
> > DP_HDCP_2_2_LC_INIT_OFFSET
> > 	DP_HDCP_2_2_REG_RN_OFFSET
> >  #define DP_HDCP_2_2_LC_SEND_LPRIME_OFFSET
> > 	DP_HDCP_2_2_REG_LPRIME_OFFSET
> >  #define DP_HDCP_2_2_SKE_SEND_EKS_OFFSET
> > 	DP_HDCP_2_2_REG_EDKEY_KS_OFFSET
> > -#define DP_HDCP_2_2_REP_SEND_RECVID_LIST_OFFSET
> > 	DP_HDCP_2_2_REG_RXINFO_OFFSET
> > +#define DP_HDCP_2_2_REP_SEND_RECVID_LIST_OFFSET
> > 	DP_HDCP_2_2_REG_SEQ_NUM_V_OFFSET
> >  #define DP_HDCP_2_2_REP_SEND_ACK_OFFSET
> > 	DP_HDCP_2_2_REG_V_OFFSET
> >  #define DP_HDCP_2_2_REP_STREAM_MANAGE_OFFSET
> > 	DP_HDCP_2_2_REG_SEQ_NUM_M_OFFSET
> >  #define DP_HDCP_2_2_REP_STREAM_READY_OFFSET
> > 	DP_HDCP_2_2_REG_MPRIME_OFFSET
> > --
> > 2.29.2

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

WARNING: multiple messages have this Message-ID (diff)
From: "Gupta, Anshuman" <anshuman.gupta@intel.com>
To: "Li, Juston" <juston.li@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "seanpaul@chromium.org" <seanpaul@chromium.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: RE: [PATCH v2 3/4] drm/i915/hdcp: read RxInfo once when reading Send_Pairing_Info
Date: Wed, 27 Jan 2021 08:52:44 +0000	[thread overview]
Message-ID: <489d8233cf60425b86e7fc21d193486e@intel.com> (raw)
In-Reply-To: <7976a4bd85224f44bf893e5cda00aeeb@intel.com>

Please also send this patch to dri-devel@lists.freedesktop.org as well because this is a drm change.

> -----Original Message-----
> From: Gupta, Anshuman
> Sent: Wednesday, January 27, 2021 12:55 PM
> To: Li, Juston <juston.li@intel.com>; intel-gfx@lists.freedesktop.org
> Cc: seanpaul@chromium.org; C, Ramalingam <ramalingam.c@intel.com>
> Subject: RE: [PATCH v2 3/4] drm/i915/hdcp: read RxInfo once when reading
> Send_Pairing_Info
> 
> 
> 
> > -----Original Message-----
> > From: Li, Juston <juston.li@intel.com>
> > Sent: Wednesday, January 27, 2021 12:21 PM
> > To: intel-gfx@lists.freedesktop.org
> > Cc: seanpaul@chromium.org; Gupta, Anshuman
> <anshuman.gupta@intel.com>;
> > C, Ramalingam <ramalingam.c@intel.com>; Li, Juston
> > <juston.li@intel.com>
> > Subject: [PATCH v2 3/4] drm/i915/hdcp: read RxInfo once when reading
> > Send_Pairing_Info
> >
> > Previously when reading Send_Pairing_Info, RxInfo by itself was read
> > once to retrieve the DEVICE_COUNT and then a second time when reading
> > the RepeaterAuth_Send_ReceiverID_List which contains RxInfo.
> >
> > On a couple HDCP 2.2 docks, this second read attempt on RxInfo fails
> > due to no Ack response. This behavior doesn't seem to be defined but
> > regardless we can fix it by reading RxInfo once and storing it before
> > reading the rest of RepeaterAuth_Send_ReceiverID_List once we know the
> size.
> >
> > Modify get_receiver_id_list_size() to read and store RxInfo in the
> > message buffer and also parse DEVICE_COUNT so we know the size of
> > RepeaterAuth_Send_ReceiverID_List.
> >
> > Afterwards, retrieve the rest of the message at the offset for seq_num_V.
> >
> > Changes in v2:
> > - remove unnecessary moving of drm_i915_private from patch 1
> >
> > Signed-off-by: Juston Li <juston.li@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 29 ++++++++++----------
> >  include/drm/drm_dp_helper.h                  |  2 +-
> >  2 files changed, 16 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > index d1397af97f69..cd183944bc5a 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > @@ -475,11 +475,10 @@ int intel_dp_hdcp2_write_msg(struct
> > intel_digital_port *dig_port,  }
> >
> >  static
> > -ssize_t get_receiver_id_list_size(struct intel_digital_port
> > *dig_port)
> > +ssize_t get_receiver_id_list_rx_info(struct intel_digital_port
> > +*dig_port, u32 *dev_cnt, u8 *byte)
> >  {
> > -	u8 rx_info[HDCP_2_2_RXINFO_LEN];
> > -	u32 dev_cnt;
> >  	ssize_t ret;
> > +	u8 *rx_info = byte;
> >
> >  	ret = drm_dp_dpcd_read(&dig_port->dp.aux,
> >  			       DP_HDCP_2_2_REG_RXINFO_OFFSET, @@ -
> > 487,15 +486,11 @@ ssize_t get_receiver_id_list_size(struct
> > intel_digital_port *dig_port)
> >  	if (ret != HDCP_2_2_RXINFO_LEN)
> >  		return ret >= 0 ? -EIO : ret;
> >
> > -	dev_cnt = (HDCP_2_2_DEV_COUNT_HI(rx_info[0]) << 4 |
> > +	*dev_cnt = (HDCP_2_2_DEV_COUNT_HI(rx_info[0]) << 4 |
> >  		   HDCP_2_2_DEV_COUNT_LO(rx_info[1]));
> >
> > -	if (dev_cnt > HDCP_2_2_MAX_DEVICE_COUNT)
> > -		dev_cnt = HDCP_2_2_MAX_DEVICE_COUNT;
> > -
> > -	ret = sizeof(struct hdcp2_rep_send_receiverid_list) -
> > -		HDCP_2_2_RECEIVER_IDS_MAX_LEN +
> > -		(dev_cnt * HDCP_2_2_RECEIVER_ID_LEN);
> > +	if (*dev_cnt > HDCP_2_2_MAX_DEVICE_COUNT)
> > +		*dev_cnt = HDCP_2_2_MAX_DEVICE_COUNT;
> >
> >  	return ret;
> >  }
> > @@ -511,6 +506,7 @@ int intel_dp_hdcp2_read_msg(struct
> > intel_digital_port *dig_port,
> >  	u8 *byte = buf;
> >  	ssize_t ret, bytes_to_recv, len;
> >  	const struct hdcp2_dp_msg_data *hdcp2_msg_data;
> > +	u32 dev_cnt;
> >
> >  	hdcp2_msg_data = get_hdcp2_dp_msg_data(msg_id);
> >  	if (!hdcp2_msg_data)
> > @@ -523,17 +519,22 @@ int intel_dp_hdcp2_read_msg(struct
> > intel_digital_port *dig_port,
> >
> >  	hdcp->cp_irq_count_cached = atomic_read(&hdcp->cp_irq_count);
> >
> > +	/* DP adaptation msgs has no msg_id */
> > +	byte++;
> > +
> >  	if (msg_id == HDCP_2_2_REP_SEND_RECVID_LIST) {
> > -		ret = get_receiver_id_list_size(dig_port);
> > +		ret = get_receiver_id_list_rx_info(dig_port, &dev_cnt,
> > byte);
> >  		if (ret < 0)
> >  			return ret;
> >
> > -		size = ret;
> > +		byte += ret;
> > +		size = sizeof(struct hdcp2_rep_send_receiverid_list) -
> > +		HDCP_2_2_RXINFO_LEN -
> > HDCP_2_2_RECEIVER_IDS_MAX_LEN +
> > +		(dev_cnt * HDCP_2_2_RECEIVER_ID_LEN);
> >  	}
> > -	bytes_to_recv = size - 1;
> >
> >  	/* DP adaptation msgs has no msg_id */
> Please remove this comment.
> With that
> Acked-by: Anshuman Gupta <anshuman.gupta@intel.com>
> > -	byte++;
> > +	bytes_to_recv = size - 1;
> >
> >  	while (bytes_to_recv) {
> >  		len = bytes_to_recv > DP_AUX_MAX_PAYLOAD_BYTES ?
> > diff --git a/include/drm/drm_dp_helper.h
> b/include/drm/drm_dp_helper.h
> > index edffd1dcca3e..3b42392394ba 100644
> > --- a/include/drm/drm_dp_helper.h
> > +++ b/include/drm/drm_dp_helper.h
> > @@ -1388,7 +1388,7 @@ enum drm_dp_phy {  #define
> > DP_HDCP_2_2_LC_INIT_OFFSET
> > 	DP_HDCP_2_2_REG_RN_OFFSET
> >  #define DP_HDCP_2_2_LC_SEND_LPRIME_OFFSET
> > 	DP_HDCP_2_2_REG_LPRIME_OFFSET
> >  #define DP_HDCP_2_2_SKE_SEND_EKS_OFFSET
> > 	DP_HDCP_2_2_REG_EDKEY_KS_OFFSET
> > -#define DP_HDCP_2_2_REP_SEND_RECVID_LIST_OFFSET
> > 	DP_HDCP_2_2_REG_RXINFO_OFFSET
> > +#define DP_HDCP_2_2_REP_SEND_RECVID_LIST_OFFSET
> > 	DP_HDCP_2_2_REG_SEQ_NUM_V_OFFSET
> >  #define DP_HDCP_2_2_REP_SEND_ACK_OFFSET
> > 	DP_HDCP_2_2_REG_V_OFFSET
> >  #define DP_HDCP_2_2_REP_STREAM_MANAGE_OFFSET
> > 	DP_HDCP_2_2_REG_SEQ_NUM_M_OFFSET
> >  #define DP_HDCP_2_2_REP_STREAM_READY_OFFSET
> > 	DP_HDCP_2_2_REG_MPRIME_OFFSET
> > --
> > 2.29.2

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

  reply	other threads:[~2021-01-27  8:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27  6:50 [Intel-gfx] [PATCH v2 1/4] drm/i915/hdcp: Disable the QSES check for HDCP 1.4 over MST Juston Li
2021-01-27  6:50 ` [Intel-gfx] [PATCH v2 2/4] drm/i915/hdcp: update cp_irq_count_cached in intel_dp_hdcp2_read_msg() Juston Li
2021-01-27  7:17   ` Gupta, Anshuman
2021-01-27  6:50 ` [Intel-gfx] [PATCH v2 3/4] drm/i915/hdcp: read RxInfo once when reading Send_Pairing_Info Juston Li
2021-01-27  7:24   ` Gupta, Anshuman
2021-01-27  8:52     ` Gupta, Anshuman [this message]
2021-01-27  8:52       ` Gupta, Anshuman
2021-01-27  6:50 ` [Intel-gfx] [PATCH v2 4/4] drm/i915/hdcp: disable the QSES check for HDCP2.2 over MST Juston Li
2021-01-27  7:28   ` Gupta, Anshuman
2021-01-27  7:17 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [v2,1/4] drm/i915/hdcp: Disable the QSES check for HDCP 1.4 " Patchwork
2021-01-27  7:46 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-01-27 11:14   ` Gupta, Anshuman
2021-01-27 17:53     ` Vudum, Lakshminarayana
2021-01-27 17:05 ` Patchwork
2021-01-27 17:34 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-01-27 21:08 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=489d8233cf60425b86e7fc21d193486e@intel.com \
    --to=anshuman.gupta@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=juston.li@intel.com \
    --cc=seanpaul@chromium.org \
    /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.