From patchwork Fri Mar 22 00:44:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramalingam C X-Patchwork-Id: 10864731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8EFD8139A for ; Fri, 22 Mar 2019 00:43:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D2FF2A58F for ; Fri, 22 Mar 2019 00:43:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A0282A4D9; Fri, 22 Mar 2019 00:43:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1D4952A55E for ; Fri, 22 Mar 2019 00:43:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 42F056E209; Fri, 22 Mar 2019 00:43:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 32E8C6E21D; Fri, 22 Mar 2019 00:43:25 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2019 17:43:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,254,1549958400"; d="scan'208";a="142773753" Received: from nuc.iind.intel.com ([10.99.66.149]) by FMSMGA003.fm.intel.com with ESMTP; 21 Mar 2019 17:43:23 -0700 From: Ramalingam C To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch Subject: [PATCH v3 10/10] drm/i915: uevent for HDCP status change Date: Fri, 22 Mar 2019 06:14:48 +0530 Message-Id: <20190322004448.14045-11-ramalingam.c@intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322004448.14045-1-ramalingam.c@intel.com> References: <20190322004448.14045-1-ramalingam.c@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 #include +#include #include #include #include @@ -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); } 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); } mutex_unlock(&hdcp->mutex);