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,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 10/10] drm/i915: uevent for HDCP status change
Date: Wed, 27 Mar 2019 12:06:39 +0100	[thread overview]
Message-ID: <20190327110639.GH2665@phenom.ffwll.local> (raw)
In-Reply-To: <20190322004448.14045-11-ramalingam.c@intel.com>

On Fri, Mar 22, 2019 at 06:14:48AM +0530, Ramalingam C wrote:
> Invoking the uevent generator for the content protection property state
> change of a connector. This helps the userspace to detect the new state
> change without polling the property val.
> 
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hdcp.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
> index 1eea553cdf81..1c38026f4de7 100644
> --- a/drivers/gpu/drm/i915/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/intel_hdcp.c
> @@ -8,6 +8,7 @@
>  
>  #include <drm/drm_hdcp.h>
>  #include <drm/i915_component.h>
> +#include <drm/drm_sysfs.h>
>  #include <linux/i2c.h>
>  #include <linux/random.h>
>  #include <linux/component.h>
> @@ -19,6 +20,14 @@
>  #define ENCRYPT_STATUS_CHANGE_TIMEOUT_MS	50
>  #define HDCP2_LC_RETRY_CNT			3
>  
> +static inline
> +void intel_hdcp_state_change_event(struct drm_connector *connector)
> +{
> +	struct drm_property *property = connector->content_protection_property;
> +
> +	drm_sysfs_connector_status_event(connector, property);
> +}
> +
>  static
>  bool intel_hdcp_is_ksv_valid(u8 *ksv)
>  {
> @@ -943,6 +952,7 @@ static void intel_hdcp_prop_work(struct work_struct *work)
>  	if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
>  		state = connector->base.state;
>  		state->content_protection = hdcp->value;
> +		intel_hdcp_state_change_event(&connector->base);

I think it'd be good to have a helper to update both
state->content_protection and send out the event. Locking is a bit
complicated, so we also need a lockdep assert to make sure
dev->mode_config.connection_mutex is held.

That way I hope that any update in the property will actually result in
the event being sent out, and not accidentally forgotten.

>  	}
>  
>  	mutex_unlock(&hdcp->mutex);
> @@ -2206,6 +2216,7 @@ int intel_hdcp_disable(struct intel_connector *connector)
>  			ret = _intel_hdcp2_disable(connector);
>  		else if (hdcp->hdcp_encrypted)
>  			ret = _intel_hdcp_disable(connector);
> +		intel_hdcp_state_change_event(&connector->base);

Why do we need this here? We don't update the property here ...
-Daniel

>  	}
>  
>  	mutex_unlock(&hdcp->mutex);
> -- 
> 2.19.1
> 

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

  reply	other threads:[~2019-03-27 11:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22  0:44 [PATCH v3 00/10] HDCP2.2 Phase II Ramalingam C
2019-03-22  0:44 ` [PATCH v3 01/10] drm/i915: debugfs: HDCP2.2 capability read Ramalingam C
2019-03-27  9:51   ` Daniel Vetter
2019-03-22  0:44 ` [PATCH v3 02/10] drm: Add Content protection type property Ramalingam C
2019-03-27  9:56   ` Daniel Vetter
2019-03-27 13:34     ` Ramalingam C
2019-03-22  0:44 ` [PATCH v3 03/10] drm/i915: Attach content " Ramalingam C
2019-03-27 10:00   ` Daniel Vetter
2019-03-27 13:39     ` Ramalingam C
2019-03-22  0:44 ` [PATCH v3 04/10] drm/i915: HDCP SRM parsing and revocation check Ramalingam C
2019-03-27 10:16   ` Daniel Vetter
2019-03-27 13:48     ` Ramalingam C
2019-03-22  0:44 ` [PATCH v3 05/10] drm/i915/sysfs: Node for hdcp srm Ramalingam C
2019-03-22  0:44 ` [PATCH v3 06/10] drm: Add CP downstream_info property Ramalingam C
2019-03-27 10:25   ` Daniel Vetter
2019-03-27 14:00     ` Ramalingam C
2019-03-27 14:22       ` Daniel Vetter
2019-03-22  0:44 ` [PATCH v3 07/10] drm/i915: Populate downstream info for HDCP1.4 Ramalingam C
2019-03-27 10:28   ` Daniel Vetter
2019-03-22  0:44 ` [PATCH v3 08/10] drm/i915: Populate downstream info for HDCP2.2 Ramalingam C
2019-03-27 10:31   ` Daniel Vetter
2019-03-27 14:49     ` Ramalingam C
2019-03-27 17:44       ` Daniel Vetter
2019-03-22  0:44 ` [PATCH v3 09/10] drm: uevent for connector status change Ramalingam C
2019-03-27 11:00   ` Daniel Vetter
2019-03-27 11:01   ` Daniel Vetter
2019-03-27 14:40     ` Ramalingam C
2019-03-22  0:44 ` [PATCH v3 10/10] drm/i915: uevent for HDCP " Ramalingam C
2019-03-27 11:06   ` Daniel Vetter [this message]
2019-03-27 14:37     ` Ramalingam C
2019-03-27 17:47       ` Daniel Vetter
2019-03-22  3:26 ` ✗ Fi.CI.CHECKPATCH: warning for HDCP2.2 Phase II (rev4) Patchwork
2019-03-22  3:33 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-22  3:54 ` ✓ Fi.CI.BAT: success " Patchwork
2019-03-22 23:31 ` ✓ Fi.CI.IGT: " 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=20190327110639.GH2665@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --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.