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

2018-02-14 Thread Ramalingam C



On Wednesday 14 February 2018 08:30 PM, Chris Wilson wrote:

Quoting Ramalingam C (2018-02-14 14:51:10)


On Wednesday 14 February 2018 08:12 PM, Chris Wilson wrote:

Quoting Ramalingam C (2018-02-14 14:13:50)

@@ -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

Thanks Chris!

Will address these comments. No, I feel its could to have DRM_INFO for
state transition logs.
In practical HDCP logs will not be that frequent. If needed I will
change them into DEBUG in upcoming versions :)

Treat everything above DEBUG as communicating with the user. For the
user, this information is already available via the connector property.
-Chris

In that case, I will convert them into DEBUG logs
Thanks,
--Ram

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


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

2018-02-14 Thread Chris Wilson
Quoting Ramalingam C (2018-02-14 14:51:10)
> 
> 
> On Wednesday 14 February 2018 08:12 PM, Chris Wilson wrote:
> > Quoting Ramalingam C (2018-02-14 14:13:50)
> >> @@ -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
> Thanks Chris!
> 
> Will address these comments. No, I feel its could to have DRM_INFO for 
> state transition logs.
> In practical HDCP logs will not be that frequent. If needed I will 
> change them into DEBUG in upcoming versions :)

Treat everything above DEBUG as communicating with the user. For the
user, this information is already available via the connector property.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


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

2018-02-14 Thread Ramalingam C



On Wednesday 14 February 2018 08:12 PM, Chris Wilson wrote:

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 
---
  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

Thanks Chris!

Will address these comments. No, I feel its could to have DRM_INFO for 
state transition logs.
In practical HDCP logs will not be that frequent. If needed I will 
change them into DEBUG in upcoming versions :)


--Ram

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


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

2018-02-14 Thread Chris Wilson
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 
> ---
>  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
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx