From patchwork Wed Jul 12 08:28:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramalingam C X-Patchwork-Id: 9836225 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7DF5660363 for ; Wed, 12 Jul 2017 08:29:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F78F1FF2D for ; Wed, 12 Jul 2017 08:29:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64057284FE; Wed, 12 Jul 2017 08:29:26 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham 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 D098B1FF2D for ; Wed, 12 Jul 2017 08:29:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C0C96E371; Wed, 12 Jul 2017 08:29:23 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E9DD6E372; Wed, 12 Jul 2017 08:29:22 +0000 (UTC) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2017 01:29:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,349,1496127600"; d="scan'208";a="126134982" Received: from mint-dev.iind.intel.com ([10.223.25.164]) by fmsmga006.fm.intel.com with ESMTP; 12 Jul 2017 01:29:19 -0700 From: Ramalingam C To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@intel.com Date: Wed, 12 Jul 2017 13:58:45 +0530 Message-Id: <1499848144-8456-2-git-send-email-ramalingam.c@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499848144-8456-1-git-send-email-ramalingam.c@intel.com> References: <1499848144-8456-1-git-send-email-ramalingam.c@intel.com> Subject: [Intel-gfx] [RFC v1 01/20] drm/hdcp: HDCP bitmask property for connectors X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP DRM connector property is created as bitmask to receive HDCP enable/disable request along with content type. And also there are Read only status bits for 1. HDCP spec capability of the connector + panel 2. HDCP encryption status of the connector Signed-off-by: Ramalingam C --- drivers/gpu/drm/drm_connector.c | 30 +++++++++++++++++++++ include/drm/drm_hdcp.h | 58 +++++++++++++++++++++++++++++++++++++++++ include/drm/drm_mode_config.h | 5 ++++ 3 files changed, 93 insertions(+) create mode 100644 include/drm/drm_hdcp.h diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 8072e6e..04f8cf8 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "drm_crtc_internal.h" #include "drm_internal.h" @@ -617,6 +618,28 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = { }; DRM_ENUM_NAME_FN(drm_get_link_status_name, drm_link_status_enum_list) +static const struct drm_prop_enum_list drm_hdcp_enum_list[] = { + { __builtin_ffs(DRM_HDCP_ENABLE) - 1, + "Enable HDCP Encryption" }, + { __builtin_ffs(DRM_HDCP_TYPE_BIT0) - 1, + "HDCP Content type bit0" }, + { __builtin_ffs(DRM_HDCP_TYPE_BIT1) - 1, + "HDCP Content type bit1" }, + { __builtin_ffs(DRM_HDCP1_SUPPORTED) - 1, + "HDCP1.x Supported" }, + { __builtin_ffs(DRM_HDCP2_SUPPORTED) - 1, + "HDCP2.x Supported" }, + { __builtin_ffs(DRM_HDCP_WIP) - 1, + "HDCP work in progress" }, + { __builtin_ffs(DRM_HDCP_AUTH_FAILED) - 1, + "HDCP Authentication Failed" }, + { __builtin_ffs(DRM_HDCP_LINK_INTEGRITY_FAILED) - 1, + "HDCP Link Integrity Failed" }, + { __builtin_ffs(DRM_HDCP_REAUTH_REQUESTED) - 1, + "HDCP Reauthentication Requested" }, +}; +DRM_ENUM_NAME_FN(drm_get_hdcp_name, drm_hdcp_enum_list) + /** * drm_display_info_set_bus_formats - set the supported bus formats * @info: display info to store bus formats in @@ -789,6 +812,13 @@ int drm_connector_create_standard_properties(struct drm_device *dev) return -ENOMEM; dev->mode_config.link_status_property = prop; + prop = drm_property_create_bitmask(dev, 0, "hdcp", drm_hdcp_enum_list, + ARRAY_SIZE(drm_hdcp_enum_list), + DRM_HDCP_PROP_SUPPORTED_BITS); + if (!prop) + return -ENOMEM; + dev->mode_config.hdcp_property = prop; + return 0; } diff --git a/include/drm/drm_hdcp.h b/include/drm/drm_hdcp.h new file mode 100644 index 0000000..7cebf0f --- /dev/null +++ b/include/drm/drm_hdcp.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2017 Intel Corporation + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * Header for HDCP specific data + */ + +#ifndef __DRM_HDCP_H__ +#define __DRM_HDCP_H__ + +/** + * HDCP property related information + */ +/* RW: HDCP Encryption Requests and Status bits */ +#define DRM_HDCP_ENABLE BIT(0) +#define DRM_HDCP_TYPE_BIT0 BIT(4) +#define DRM_HDCP_TYPE_BIT1 BIT(5) + +/* RO: HDCP Version supported on Platform + panel */ +#define DRM_HDCP1_SUPPORTED BIT(12) +#define DRM_HDCP2_SUPPORTED BIT(13) + +/* RO: Status of the requested operations */ +#define DRM_HDCP_WIP BIT(20) +#define DRM_HDCP_AUTH_FAILED BIT(21) + +/* RO: Error Status From HDCP sink */ +#define DRM_HDCP_LINK_INTEGRITY_FAILED BIT(22) +#define DRM_HDCP_REAUTH_REQUESTED BIT(23) + +#define DRM_HDCP_PROP_SUPPORTED_BITS (DRM_HDCP_ENABLE | DRM_HDCP_TYPE_BIT0 \ + | DRM_HDCP_TYPE_BIT1 | \ + DRM_HDCP1_SUPPORTED | \ + DRM_HDCP2_SUPPORTED | DRM_HDCP_WIP | \ + DRM_HDCP_AUTH_FAILED | \ + DRM_HDCP_LINK_INTEGRITY_FAILED | \ + DRM_HDCP_REAUTH_REQUESTED) + +#endif /* __DRM_HDCP_H__ */ diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 4298171..0c5bb90 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -538,6 +538,11 @@ struct drm_mode_config { */ struct drm_property *link_status_property; /** + * @hdcp_property: Default connector property for HDCP + * of a connector + */ + struct drm_property *hdcp_property; + /** * @plane_type_property: Default plane property to differentiate * CURSOR, PRIMARY and OVERLAY legacy uses of planes. */