[v5,10/12] drm/i915: update the hdcp state with uevent

Submitted by Ramalingam C on April 18, 2019, 8:58 a.m.

Details

Message ID 20190418085805.5648-11-ramalingam.c@intel.com
State New
Headers show
Series "HDCP2.2 Phase II" ( rev: 7 6 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Ramalingam C April 18, 2019, 8:58 a.m.
drm function to update the content protection property state and to
generate a uevent is invoked from the intel hdcp property work.

Hence whenever kernel changes the property state, userspace will be
updated with a uevent.

v2:
  state update is moved into drm function [daniel]

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/i915/intel_hdcp.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
index de634f3fbd1b..84ac23ea75af 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -866,7 +866,6 @@  static void intel_hdcp_prop_work(struct work_struct *work)
 					       prop_work);
 	struct intel_connector *connector = intel_hdcp_to_connector(hdcp);
 	struct drm_device *dev = connector->base.dev;
-	struct drm_connector_state *state;
 
 	drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
 	mutex_lock(&hdcp->mutex);
@@ -876,10 +875,9 @@  static void intel_hdcp_prop_work(struct work_struct *work)
 	 * those to UNDESIRED is handled by core. If value == UNDESIRED,
 	 * we're running just after hdcp has been disabled, so just exit
 	 */
-	if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
-		state = connector->base.state;
-		state->content_protection = hdcp->value;
-	}
+	if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
+		drm_hdcp_update_content_protection(&connector->base,
+						   hdcp->value);
 
 	mutex_unlock(&hdcp->mutex);
 	drm_modeset_unlock(&dev->mode_config.connection_mutex);

Comments

On Thu, Apr 18, 2019 at 02:28:03PM +0530, Ramalingam C wrote:
> drm function to update the content protection property state and to
> generate a uevent is invoked from the intel hdcp property work.
> 
> Hence whenever kernel changes the property state, userspace will be
> updated with a uevent.
> 
> v2:
>   state update is moved into drm function [daniel]
> 
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/intel_hdcp.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
> index de634f3fbd1b..84ac23ea75af 100644
> --- a/drivers/gpu/drm/i915/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/intel_hdcp.c
> @@ -866,7 +866,6 @@ static void intel_hdcp_prop_work(struct work_struct *work)
>  					       prop_work);
>  	struct intel_connector *connector = intel_hdcp_to_connector(hdcp);
>  	struct drm_device *dev = connector->base.dev;
> -	struct drm_connector_state *state;
>  
>  	drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
>  	mutex_lock(&hdcp->mutex);
> @@ -876,10 +875,9 @@ static void intel_hdcp_prop_work(struct work_struct *work)
>  	 * those to UNDESIRED is handled by core. If value == UNDESIRED,
>  	 * we're running just after hdcp has been disabled, so just exit
>  	 */
> -	if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
> -		state = connector->base.state;
> -		state->content_protection = hdcp->value;
> -	}
> +	if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
> +		drm_hdcp_update_content_protection(&connector->base,
> +						   hdcp->value);
>  
>  	mutex_unlock(&hdcp->mutex);
>  	drm_modeset_unlock(&dev->mode_config.connection_mutex);
> -- 
> 2.19.1
>