Re: [PATCH 35/43] drm/i915: Enable HDCP version that is best capable

Chris Wilson
2018-02-14T14:42:21Z

Quoting Ramalingam C (2018-02-14 14:13:50)
> hdcp_enable_work is extended to choose the better hdcp version based
> on the system and panel capability.
>
> And intel_hdcp_disable will find the version that is inforce, if any.
> And corresponding version specific disable function alone called.
>
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> ---
> drivers/gpu/drm/i915/intel_hdcp.c | 112 ++++++++++++++++++++++++++++++++++----
> 1 file changed, 100 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
> index 69ae47eaff49..2fe73f7eb6dd 100644
> --- a/drivers/gpu/drm/i915/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/intel_hdcp.c
> @@ -27,6 +27,43 @@ static int _intel_hdcp2_disable(struct intel_hdcp *hdcp);
> static void intel_hdcp2_check_work(struct work_struct *work);
> static int intel_hdcp2_check_link(struct intel_hdcp *hdcp);
>
> +static inline bool intel_hdcp1_supported(struct intel_hdcp *hdcp)
> +{
> + return (hdcp->plat_cap & HDCP_CAPABILITY &&
> + hdcp->panel_cap & HDCP_CAPABILITY);
> +}
> +
> +static inline bool intel_hdcp2_supported(struct intel_hdcp *hdcp)
> +{
> + return (hdcp->plat_cap & HDCP2_CAPABILITY &&
> + hdcp->panel_cap & HDCP2_CAPABILITY);
> +}
> +
> +static inline bool intel_hdcp_in_force(struct intel_hdcp *hdcp)
> +{
> + struct drm_i915_private *dev_priv = to_i915(hdcp->connector->base.dev);
> + enum port port = hdcp->connector->encoder->port;
> + u32 reg;
> +
> + reg = I915_READ(PORT_HDCP_STATUS(port));
> + if (reg & HDCP_STATUS_AUTH || reg & HDCP_STATUS_ENC)
> + return true;
> + return false;

return reg & (HDCP_STATUS_AUTH | HDCP_STATUS_ENC);

> +
> +}
> +
> +static inline bool intel_hdcp2_in_force(struct intel_hdcp *hdcp)
> +{
> + struct drm_i915_private *dev_priv = to_i915(hdcp->connector->base.dev);
> + enum port port = hdcp->connector->encoder->port;
> + u32 reg;
> +
> + reg = I915_READ(HDCP2_STATUS_DDI(port));
> + if (reg & LINK_ENCRYPTION_STATUS || reg & LINK_AUTH_STATUS)
> + return true;
> + return false;

return reg & (LINK_ENCRYPTION_STATUS | LINK_AUTH_STATUS);

> @@ -1437,7 +1525,7 @@ static int _intel_hdcp2_disable(struct intel_hdcp *hdcp)
> {
> int ret;
>
> - DRM_ERROR("[%s:%d] HDCP2.2 is being Disabled\n",
> + DRM_INFO("[%s:%d] HDCP2.2 is being Disabled\n",
> hdcp->connector->base.name, hdcp->connector->base.base.id);

Will there be a third patch making this DEBUG_KMS?
-Chris