All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ramalingam C <ramalingam.c@intel.com>
Cc: daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 4/4] drm/i915/debugfs: hdcp capability of a sink
Date: Mon, 22 Oct 2018 17:20:15 +0200	[thread overview]
Message-ID: <20181022152015.GH324@phenom.ffwll.local> (raw)
In-Reply-To: <1540217765-10460-5-git-send-email-ramalingam.c@intel.com>

On Mon, Oct 22, 2018 at 07:46:05PM +0530, Ramalingam C wrote:
> Add a debugfs entry for providing the hdcp capabilities of the sink
> connected to the HDCP capable connectors.
> 
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 29 +++++++++++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_hdmi.c   | 16 +++++++++++++++-
>  2 files changed, 44 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 5f3c639522fa..6d09af66da0f 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -4946,6 +4946,28 @@ static int i915_panel_show(struct seq_file *m, void *data)
>  }
>  DEFINE_SHOW_ATTRIBUTE(i915_panel);
>  
> +static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data)
> +{
> +	struct drm_connector *connector = m->private;
> +	struct intel_connector *intel_connector = to_intel_connector(connector);
> +
> +	if (connector->status != connector_status_connected)
> +		return -ENODEV;
> +
> +	/* HDCP is supported by connector */
> +	if (!intel_connector->hdcp_shim)
> +		return -EINVAL;
> +
> +	seq_printf(m, "%s:%d HDCP version: ", connector->name,
> +		   connector->base.id);
> +	seq_printf(m, "%s ", !intel_hdcp_capable(intel_connector) ?
> +		   "None" : "HDCP1.4");
> +	seq_puts(m, "\n");
> +
> +	return 0;
> +}
> +DEFINE_SHOW_ATTRIBUTE(i915_hdcp_sink_capability);
> +
>  /**
>   * i915_debugfs_connector_add - add i915 specific connector debugfs files
>   * @connector: pointer to a registered drm_connector
> @@ -4975,5 +4997,12 @@ int i915_debugfs_connector_add(struct drm_connector *connector)
>  				    connector, &i915_psr_sink_status_fops);
>  	}
>  
> +	if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
> +	    connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> +	    connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) {
> +		debugfs_create_file("i915_hdcp_sink_capability", S_IRUGO, root,
> +				    connector, &i915_hdcp_sink_capability_fops);
> +	}
> +
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 89d5e3984452..72e8a73dfa1c 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -2072,6 +2072,20 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder,
>  	chv_phy_release_cl2_override(encoder);
>  }
>  
> +static int
> +intel_hdmi_connector_register(struct drm_connector *connector)
> +{
> +	int ret;
> +
> +	ret = intel_connector_register(connector);
> +	if (ret)
> +		return ret;
> +
> +	i915_debugfs_connector_add(connector);
> +
> +	return ret;
> +}
> +
>  static void intel_hdmi_destroy(struct drm_connector *connector)
>  {
>  	if (intel_attached_hdmi(connector)->cec_notifier)
> @@ -2086,7 +2100,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = {
>  	.fill_modes = drm_helper_probe_single_connector_modes,
>  	.atomic_get_property = intel_digital_connector_atomic_get_property,
>  	.atomic_set_property = intel_digital_connector_atomic_set_property,
> -	.late_register = intel_connector_register,
> +	.late_register = intel_hdmi_connector_register,

lgtm. I'll wait with the r-b to see how you squashed in patch 2.

Cheers, Daniel

>  	.early_unregister = intel_connector_unregister,
>  	.destroy = intel_hdmi_destroy,
>  	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> -- 
> 2.7.4
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-10-22 15:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22 14:16 [PATCH v3 0/4] Enabling the IGT for HDCP1.4 Ramalingam C
2018-10-22 14:16 ` [PATCH v3 1/4] drm/i915: Pullout the bksv read and validation Ramalingam C
2018-10-22 15:11   ` Daniel Vetter
2018-10-22 14:16 ` [PATCH v3 2/4] drm/i915: Detect the hdcp capability of sink and src Ramalingam C
2018-10-22 15:19   ` Daniel Vetter
2018-10-22 14:16 ` [PATCH v3 3/4] drm/i915: hdcp_check_link only on CP_IRQ Ramalingam C
2018-10-22 15:19   ` Daniel Vetter
2018-10-22 14:16 ` [PATCH v3 4/4] drm/i915/debugfs: hdcp capability of a sink Ramalingam C
2018-10-22 15:20   ` Daniel Vetter [this message]
2018-10-22 15:56 ` ✗ Fi.CI.CHECKPATCH: warning for Enabling the IGT for HDCP1.4 (rev3) Patchwork
2018-10-22 16:21 ` ✗ Fi.CI.BAT: failure " 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=20181022152015.GH324@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ramalingam.c@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 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.