dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Sharma, Shashank" <shashank.sharma@intel.com>
To: Ramalingam C <ramalingam.c@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	tomas.winkler@intel.com,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v9 1/6] drm/i915: mei_hdcp: I915 sends ddi index as per ME FW
Date: Tue, 27 Aug 2019 10:13:25 +0530	[thread overview]
Message-ID: <7692130c-84ae-bd89-72f7-07ff6a235f65@intel.com> (raw)
In-Reply-To: <20190827043350.GA3428@intel.com>

Regards

Shashank

On 8/27/2019 10:03 AM, Ramalingam C wrote:
> On 2019-08-27 at 09:54:18 +0530, Sharma, Shashank wrote:
>> Hello Ram,
>>
>> On 8/22/2019 8:48 PM, Ramalingam C wrote:
>>> I915 converts it's port value into ddi index defiend by ME FW
>>> and pass it as a member of hdcp_port_data structure.
>>>
>>> Hence expose the enum mei_fw_ddi to I915 through
>>> i915_mei_interface.h.
>>>
>>> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
>>> Acked-by: Jani Nikula <jani.nikula@intel.com>
>>> ---
>>>    drivers/gpu/drm/i915/display/intel_hdcp.c | 15 +++++++++-
>>>    drivers/misc/mei/hdcp/mei_hdcp.c          | 34 ++++++++---------------
>>>    drivers/misc/mei/hdcp/mei_hdcp.h          | 12 --------
>>>    include/drm/i915_mei_hdcp_interface.h     | 16 +++++++++--
>>>    4 files changed, 39 insertions(+), 38 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
>>> index 6ec5ceeab601..534832f435dc 100644
>>> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
>>> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
>>> @@ -1749,13 +1749,26 @@ static const struct component_ops i915_hdcp_component_ops = {
>>>    	.unbind = i915_hdcp_component_unbind,
>>>    };
>>> +static inline
>>> +enum mei_fw_ddi intel_get_mei_fw_ddi_index(enum port port)
>>> +{
>>> +	switch (port) {
>>> +	case PORT_A:
>>> +		return MEI_DDI_A;
>>> +	case PORT_B ... PORT_F:
>>> +		return (enum mei_fw_ddi)port;
>>> +	default:
>>> +		return MEI_DDI_INVALID_PORT;
>>> +	}
>>> +}
>>> +
>>>    static inline int initialize_hdcp_port_data(struct intel_connector *connector,
>>>    					    const struct intel_hdcp_shim *shim)
>>>    {
>>>    	struct intel_hdcp *hdcp = &connector->hdcp;
>>>    	struct hdcp_port_data *data = &hdcp->port_data;
>>> -	data->port = connector->encoder->port;
>>> +	data->fw_ddi = intel_get_mei_fw_ddi_index(connector->encoder->port);
>>>    	data->port_type = (u8)HDCP_PORT_TYPE_INTEGRATED;
>>>    	data->protocol = (u8)shim->protocol;
>>> diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c
>>> index c681f6fab342..3638c77eba26 100644
>>> --- a/drivers/misc/mei/hdcp/mei_hdcp.c
>>> +++ b/drivers/misc/mei/hdcp/mei_hdcp.c
>>> @@ -27,18 +27,6 @@
>>>    #include "mei_hdcp.h"
>>> -static inline u8 mei_get_ddi_index(enum port port)
>>> -{
>>> -	switch (port) {
>>> -	case PORT_A:
>>> -		return MEI_DDI_A;
>>> -	case PORT_B ... PORT_F:
>>> -		return (u8)port;
>>> -	default:
>>> -		return MEI_DDI_INVALID_PORT;
>>> -	}
>>> -}
>>> -
>>>    /**
>>>     * mei_hdcp_initiate_session() - Initiate a Wired HDCP2.2 Tx Session in ME FW
>>>     * @dev: device corresponding to the mei_cl_device
>>> @@ -69,7 +57,7 @@ mei_hdcp_initiate_session(struct device *dev, struct hdcp_port_data *data,
>>>    				WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN;
>>>    	session_init_in.port.integrated_port_type = data->port_type;
>>> -	session_init_in.port.physical_port = mei_get_ddi_index(data->port);
>>> +	session_init_in.port.physical_port = (u8)data->fw_ddi;
>>>    	session_init_in.protocol = data->protocol;
>>>    	byte = mei_cldev_send(cldev, (u8 *)&session_init_in,
>>> @@ -138,7 +126,7 @@ mei_hdcp_verify_receiver_cert_prepare_km(struct device *dev,
>>>    				WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_IN;
>>>    	verify_rxcert_in.port.integrated_port_type = data->port_type;
>>> -	verify_rxcert_in.port.physical_port = mei_get_ddi_index(data->port);
>>> +	verify_rxcert_in.port.physical_port = (u8)data->fw_ddi;
>>>    	verify_rxcert_in.cert_rx = rx_cert->cert_rx;
>>>    	memcpy(verify_rxcert_in.r_rx, &rx_cert->r_rx, HDCP_2_2_RRX_LEN);
>>> @@ -208,7 +196,7 @@ mei_hdcp_verify_hprime(struct device *dev, struct hdcp_port_data *data,
>>>    	send_hprime_in.header.buffer_len = WIRED_CMD_BUF_LEN_AKE_SEND_HPRIME_IN;
>>>    	send_hprime_in.port.integrated_port_type = data->port_type;
>>> -	send_hprime_in.port.physical_port = mei_get_ddi_index(data->port);
>>> +	send_hprime_in.port.physical_port = (u8)data->fw_ddi;
>>>    	memcpy(send_hprime_in.h_prime, rx_hprime->h_prime,
>>>    	       HDCP_2_2_H_PRIME_LEN);
>>> @@ -265,7 +253,7 @@ mei_hdcp_store_pairing_info(struct device *dev, struct hdcp_port_data *data,
>>>    					WIRED_CMD_BUF_LEN_SEND_PAIRING_INFO_IN;
>>>    	pairing_info_in.port.integrated_port_type = data->port_type;
>>> -	pairing_info_in.port.physical_port = mei_get_ddi_index(data->port);
>>> +	pairing_info_in.port.physical_port = (u8)data->fw_ddi;
>>>    	memcpy(pairing_info_in.e_kh_km, pairing_info->e_kh_km,
>>>    	       HDCP_2_2_E_KH_KM_LEN);
>>> @@ -323,7 +311,7 @@ mei_hdcp_initiate_locality_check(struct device *dev,
>>>    	lc_init_in.header.buffer_len = WIRED_CMD_BUF_LEN_INIT_LOCALITY_CHECK_IN;
>>>    	lc_init_in.port.integrated_port_type = data->port_type;
>>> -	lc_init_in.port.physical_port = mei_get_ddi_index(data->port);
>>> +	lc_init_in.port.physical_port = (u8)data->fw_ddi;
>>>    	byte = mei_cldev_send(cldev, (u8 *)&lc_init_in, sizeof(lc_init_in));
>>>    	if (byte < 0) {
>>> @@ -378,7 +366,7 @@ mei_hdcp_verify_lprime(struct device *dev, struct hdcp_port_data *data,
>>>    					WIRED_CMD_BUF_LEN_VALIDATE_LOCALITY_IN;
>>>    	verify_lprime_in.port.integrated_port_type = data->port_type;
>>> -	verify_lprime_in.port.physical_port = mei_get_ddi_index(data->port);
>>> +	verify_lprime_in.port.physical_port = (u8)data->fw_ddi;
>>>    	memcpy(verify_lprime_in.l_prime, rx_lprime->l_prime,
>>>    	       HDCP_2_2_L_PRIME_LEN);
>>> @@ -435,7 +423,7 @@ static int mei_hdcp_get_session_key(struct device *dev,
>>>    	get_skey_in.header.buffer_len = WIRED_CMD_BUF_LEN_GET_SESSION_KEY_IN;
>>>    	get_skey_in.port.integrated_port_type = data->port_type;
>>> -	get_skey_in.port.physical_port = mei_get_ddi_index(data->port);
>>> +	get_skey_in.port.physical_port = (u8)data->fw_ddi;
>>>    	byte = mei_cldev_send(cldev, (u8 *)&get_skey_in, sizeof(get_skey_in));
>>>    	if (byte < 0) {
>>> @@ -499,7 +487,7 @@ mei_hdcp_repeater_check_flow_prepare_ack(struct device *dev,
>>>    					WIRED_CMD_BUF_LEN_VERIFY_REPEATER_IN;
>>>    	verify_repeater_in.port.integrated_port_type = data->port_type;
>>> -	verify_repeater_in.port.physical_port = mei_get_ddi_index(data->port);
>>> +	verify_repeater_in.port.physical_port = (u8)data->fw_ddi;
>>>    	memcpy(verify_repeater_in.rx_info, rep_topology->rx_info,
>>>    	       HDCP_2_2_RXINFO_LEN);
>>> @@ -569,7 +557,7 @@ static int mei_hdcp_verify_mprime(struct device *dev,
>>>    			WIRED_CMD_BUF_LEN_REPEATER_AUTH_STREAM_REQ_MIN_IN;
>>>    	verify_mprime_in.port.integrated_port_type = data->port_type;
>>> -	verify_mprime_in.port.physical_port = mei_get_ddi_index(data->port);
>>> +	verify_mprime_in.port.physical_port = (u8)data->fw_ddi;
>>>    	memcpy(verify_mprime_in.m_prime, stream_ready->m_prime,
>>>    	       HDCP_2_2_MPRIME_LEN);
>>> @@ -630,7 +618,7 @@ static int mei_hdcp_enable_authentication(struct device *dev,
>>>    	enable_auth_in.header.buffer_len = WIRED_CMD_BUF_LEN_ENABLE_AUTH_IN;
>>>    	enable_auth_in.port.integrated_port_type = data->port_type;
>>> -	enable_auth_in.port.physical_port = mei_get_ddi_index(data->port);
>>> +	enable_auth_in.port.physical_port = (u8)data->fw_ddi;
>>>    	enable_auth_in.stream_type = data->streams[0].stream_type;
>>>    	byte = mei_cldev_send(cldev, (u8 *)&enable_auth_in,
>>> @@ -684,7 +672,7 @@ mei_hdcp_close_session(struct device *dev, struct hdcp_port_data *data)
>>>    				WIRED_CMD_BUF_LEN_CLOSE_SESSION_IN;
>>>    	session_close_in.port.integrated_port_type = data->port_type;
>>> -	session_close_in.port.physical_port = mei_get_ddi_index(data->port);
>>> +	session_close_in.port.physical_port = (u8)data->fw_ddi;
>>>    	byte = mei_cldev_send(cldev, (u8 *)&session_close_in,
>>>    			      sizeof(session_close_in));
>>> diff --git a/drivers/misc/mei/hdcp/mei_hdcp.h b/drivers/misc/mei/hdcp/mei_hdcp.h
>>> index e4b1cd54c853..e60282eb2d48 100644
>>> --- a/drivers/misc/mei/hdcp/mei_hdcp.h
>>> +++ b/drivers/misc/mei/hdcp/mei_hdcp.h
>>> @@ -362,16 +362,4 @@ struct wired_cmd_repeater_auth_stream_req_out {
>>>    	struct hdcp_cmd_header	header;
>>>    	struct hdcp_port_id	port;
>>>    } __packed;
>>> -
>>> -enum mei_fw_ddi {
>>> -	MEI_DDI_INVALID_PORT = 0x0,
>>> -
>>> -	MEI_DDI_B = 1,
>>> -	MEI_DDI_C,
>>> -	MEI_DDI_D,
>>> -	MEI_DDI_E,
>>> -	MEI_DDI_F,
>>> -	MEI_DDI_A = 7,
>>> -	MEI_DDI_RANGE_END = MEI_DDI_A,
>>> -};
>>>    #endif /* __MEI_HDCP_H__ */
>>> diff --git a/include/drm/i915_mei_hdcp_interface.h b/include/drm/i915_mei_hdcp_interface.h
>>> index 8c344255146a..a97acf1c9710 100644
>>> --- a/include/drm/i915_mei_hdcp_interface.h
>>> +++ b/include/drm/i915_mei_hdcp_interface.h
>>> @@ -42,9 +42,21 @@ enum hdcp_wired_protocol {
>>>    	HDCP_PROTOCOL_DP
>>>    };
>>> +enum mei_fw_ddi {
>>> +	MEI_DDI_INVALID_PORT = 0x0,
>>> +
>>> +	MEI_DDI_B = 1,
>>> +	MEI_DDI_C,
>>> +	MEI_DDI_D,
>>> +	MEI_DDI_E,
>>> +	MEI_DDI_F,
>>> +	MEI_DDI_A = 7,
>>> +	MEI_DDI_RANGE_END = MEI_DDI_A,
>>> +};
>>> +
>> I am seeing that the definition of above enum is moved from mei_hdcp.h to
>> i915_mei_hdcp_interface.h, but we have not added this header in any of the
>> mei_ files. Does this mean no one was using the enum in mei interface ? Or
>> that would be added in some upcoming patches of the series ?
> This is used in intel_hdcp.c to convert the enum port to enum mei_fw_ddi
> and assign the value to fw_ddi of the hdcp_port_data.
>
> This I915 change also part of this patch.

I meant when we moved the definition to another header, we dint include 
the new header in mei_hdcp.c/h, which suggests, this enum was not 
directly being used by this. But as you mentioned I think its being used 
via the I915 HDCP interface.

Looks good to me otherwise.

Please feel free to use: Reviewed-by: Shashank Sharma 
<shashank.sharma@intel.com>

> -Ram
>> - Shashank
>>
>>>    /**
>>>     * struct hdcp_port_data - intel specific HDCP port data
>>> - * @port: port index as per I915
>>> + * @fw_ddi: ddi index as per ME FW
>>>     * @port_type: HDCP port type as per ME FW classification
>>>     * @protocol: HDCP adaptation as per ME FW
>>>     * @k: No of streams transmitted on a port. Only on DP MST this is != 1
>>> @@ -56,7 +68,7 @@ enum hdcp_wired_protocol {
>>>     *	     streams
>>>     */
>>>    struct hdcp_port_data {
>>> -	enum port port;
>>> +	enum mei_fw_ddi fw_ddi;
>>>    	u8 port_type;
>>>    	u8 protocol;
>>>    	u16 k;
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-08-27  4:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 15:18 [PATCH v9 0/6] drm/i915: Enable HDCP 1.4 and 2.2 on Gen12+ Ramalingam C
2019-08-22 15:18 ` [PATCH v9 1/6] drm/i915: mei_hdcp: I915 sends ddi index as per ME FW Ramalingam C
2019-08-27  4:24   ` Sharma, Shashank
2019-08-27  4:33     ` Ramalingam C
2019-08-27  4:43       ` Sharma, Shashank [this message]
2019-08-22 15:19 ` [PATCH v9 2/6] drm: Move port definition back to i915 header Ramalingam C
2019-08-27  4:39   ` Sharma, Shashank
2019-08-22 15:19 ` [PATCH v9 3/6] drm: Extend I915 mei interface for transcoder info Ramalingam C
2019-08-27  4:48   ` Sharma, Shashank
2019-08-27  5:19     ` Ramalingam C
2019-08-27  5:06   ` Sharma, Shashank
2019-08-27  5:21     ` Ramalingam C
2019-08-22 15:19 ` [PATCH v9 4/6] misc/mei/hdcp: Fill transcoder index in port info Ramalingam C
2019-08-27  5:12   ` Sharma, Shashank
2019-08-27  5:17     ` Ramalingam C
2019-08-27  5:21       ` Sharma, Shashank
2019-08-22 15:19 ` [PATCH v9 5/6] drm/i915/hdcp: update current transcoder into intel_hdcp Ramalingam C
2019-08-27  5:19   ` Sharma, Shashank
2019-08-27  5:27     ` Ramalingam C
2019-08-27  5:33       ` Sharma, Shashank
2019-08-22 15:19 ` [PATCH v9 6/6] drm/i915/hdcp: Enable HDCP 1.4 and 2.2 on Gen12+ Ramalingam C
2019-08-27 10:01   ` Sharma, Shashank

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=7692130c-84ae-bd89-72f7-07ff6a235f65@intel.com \
    --to=shashank.sharma@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=ramalingam.c@intel.com \
    --cc=tomas.winkler@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox