Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Anshuman Gupta <anshuman.gupta@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Sean Paul <seanpaul@chromium.org>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/hdcp: mst streams type1 capability check
Date: Tue, 16 Mar 2021 18:36:24 +0530	[thread overview]
Message-ID: <03ec2274-dc85-a13d-8c47-20a2bc42b8c9@intel.com> (raw)
In-Reply-To: <955b8a9b-14ed-2252-c564-b095413e6615@intel.com>

Sorry my mistake, I did not take into account the endianness.

Patch looks good to me.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>


On 3/16/2021 6:20 PM, Nautiyal, Ankit K wrote:
> Hi Anshuman,
>
> I agree with the patch. Overall looks good.
>
> There is a correction suggested below:
>
> On 1/27/2021 3:30 PM, Anshuman Gupta wrote:
>> It requires to check streams type1 capability in mst topology
>> by checking Rxinfo instead connector HDCP2.x capability in
>> order to enforce type0 stream encryption in a mix of
>> HDCP {1.x,2.x} mst topology.
>> Rxcaps always shows HDCP 2.x capability of immediate downstream
>> connector. Let's use Rxinfo HDCP1_DEVICE_DOWNSTREAM bit to
>> detect a HDCP {1.x,2.x} mix mst topology.
>>
>> Cc: Sean Paul <seanpaul@chromium.org>
>> Cc: Ramalingam C <ramalingam.c@intel.com>
>> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
>> ---
>>   .../drm/i915/display/intel_display_types.h    |  4 ++
>>   drivers/gpu/drm/i915/display/intel_dp_hdcp.c  | 39 +++++++++++++++++++
>>   drivers/gpu/drm/i915/display/intel_hdcp.c     | 17 +++++++-
>>   3 files changed, 59 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h 
>> b/drivers/gpu/drm/i915/display/intel_display_types.h
>> index 39397748b4b0..cfc9ec82f117 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
>> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
>> @@ -373,6 +373,10 @@ struct intel_hdcp_shim {
>>       int (*hdcp_2_2_capable)(struct intel_digital_port *dig_port,
>>                   bool *capable);
>>   +    /* Detects whether a HDCP 1.4 sink connected in MST topology */
>> +    int (*streams_type1_capable)(struct intel_connector *connector,
>> +                     bool *capable);
>> +
>>       /* Write HDCP2.2 messages */
>>       int (*write_2_2_msg)(struct intel_digital_port *dig_port,
>>                    void *buf, size_t size);
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c 
>> b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
>> index f372e25edab4..35e3b0e4c740 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
>> @@ -478,6 +478,23 @@ int intel_dp_hdcp2_write_msg(struct 
>> intel_digital_port *dig_port,
>>       return size;
>>   }
>>   +static int
>> +get_rxinfo_hdcp_1_dev_downstream(struct intel_digital_port 
>> *dig_port, bool *hdcp_1_x)
>> +{
>> +    u8 rx_info[HDCP_2_2_RXINFO_LEN];
>> +    int ret;
>> +
>> +    ret = drm_dp_dpcd_read(&dig_port->dp.aux,
>> +                   DP_HDCP_2_2_REG_RXINFO_OFFSET,
>> +                   (void *)rx_info, HDCP_2_2_RXINFO_LEN);
>> +
>> +    if (ret != HDCP_2_2_RXINFO_LEN)
>> +        return ret >= 0 ? -EIO : ret;
>> +
>> +    *hdcp_1_x = HDCP_2_2_HDCP1_DEVICE_CONNECTED(rx_info[1]) ? true : 
>> false;
>
> I think this should be rx_info[0] as we are checking for bit 0 of the 
> first byte as per rxInfo bit field definitions.
>
> Regards,
>
> Ankit
>
>
>> +    return 0;
>> +}
>> +
>>   static
>>   ssize_t get_receiver_id_list_size(struct intel_digital_port *dig_port)
>>   {
>> @@ -626,6 +643,27 @@ int intel_dp_hdcp2_capable(struct 
>> intel_digital_port *dig_port,
>>       return 0;
>>   }
>>   +static
>> +int intel_dp_mst_streams_type1_capable(struct intel_connector 
>> *connector,
>> +                       bool *capable)
>> +{
>> +    struct intel_digital_port *dig_port = 
>> intel_attached_dig_port(connector);
>> +    struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
>> +    int ret;
>> +    bool hdcp_1_x;
>> +
>> +    ret = get_rxinfo_hdcp_1_dev_downstream(dig_port, &hdcp_1_x);
>> +    if (ret) {
>> +        drm_dbg_kms(&i915->drm,
>> +                "[%s:%d] failed to read RxInfo ret=%d\n",
>> +                connector->base.name, connector->base.base.id, ret);
>> +        return ret;
>> +    }
>> +
>> +    *capable = !hdcp_1_x;
>> +    return 0;
>> +}
>> +
>>   static const struct intel_hdcp_shim intel_dp_hdcp_shim = {
>>       .write_an_aksv = intel_dp_hdcp_write_an_aksv,
>>       .read_bksv = intel_dp_hdcp_read_bksv,
>> @@ -813,6 +851,7 @@ static const struct intel_hdcp_shim 
>> intel_dp_mst_hdcp_shim = {
>>       .stream_2_2_encryption = intel_dp_mst_hdcp2_stream_encryption,
>>       .check_2_2_link = intel_dp_mst_hdcp2_check_link,
>>       .hdcp_2_2_capable = intel_dp_hdcp2_capable,
>> +    .streams_type1_capable = intel_dp_mst_streams_type1_capable,
>>       .protocol = HDCP_PROTOCOL_DP,
>>   };
>>   diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c 
>> b/drivers/gpu/drm/i915/display/intel_hdcp.c
>> index ae1371c36a32..5b2e2625779b 100644
>> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
>> @@ -32,6 +32,21 @@ static int intel_conn_to_vcpi(struct 
>> intel_connector *connector)
>>       return connector->port    ? connector->port->vcpi.vcpi : 0;
>>   }
>>   +static bool
>> +intel_streams_type1_capable(struct intel_connector *connector)
>> +{
>> +    const struct intel_hdcp_shim *shim = connector->hdcp.shim;
>> +    bool capable = false;
>> +
>> +    if (!shim)
>> +        return capable;
>> +
>> +    if (shim->streams_type1_capable)
>> +        shim->streams_type1_capable(connector, &capable);
>> +
>> +    return capable;
>> +}
>> +
>>   /*
>>    * intel_hdcp_required_content_stream selects the most highest 
>> common possible HDCP
>>    * content_type for all streams in DP MST topology because security 
>> f/w doesn't
>> @@ -70,7 +85,7 @@ intel_hdcp_required_content_stream(struct 
>> intel_digital_port *dig_port)
>>           if (conn_dig_port != dig_port)
>>               continue;
>>   -        if (!enforce_type0 && !intel_hdcp2_capable(connector))
>> +        if (!enforce_type0 && !intel_streams_type1_capable(connector))
>>               enforce_type0 = true;
>>             data->streams[data->k].stream_id = 
>> intel_conn_to_vcpi(connector);
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-03-16 13:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 10:00 [Intel-gfx] [PATCH] drm/i915/hdcp: mst streams type1 capability check Anshuman Gupta
2021-01-27 14:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-01-27 17:55 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-03-16 12:50 ` [Intel-gfx] [PATCH] " Nautiyal, Ankit K
2021-03-16 13:06   ` Nautiyal, Ankit K [this message]
2021-03-19  9:17 ` Anshuman Gupta
2021-03-19 10:55 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/hdcp: mst streams type1 capability check (rev2) Patchwork
2021-03-22  5:05   ` Gupta, Anshuman
2021-03-19 11:24 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-03-19 13:26 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-03-22  5:19   ` Anshuman Gupta
2021-03-22  6:43     ` Gupta, Anshuman
2021-03-22 16:13 ` [Intel-gfx] ✓ Fi.CI.IGT: success " 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=03ec2274-dc85-a13d-8c47-20a2bc42b8c9@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox