From patchwork Mon Jul 24 18:12:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramalingam C X-Patchwork-Id: 9859991 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 9F7AC601A1 for ; Mon, 24 Jul 2017 18:13:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9185B26E3E for ; Mon, 24 Jul 2017 18:13:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8597C285A7; Mon, 24 Jul 2017 18:13:20 +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=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 14A35285BB for ; Mon, 24 Jul 2017 18:13:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4107B6E32C; Mon, 24 Jul 2017 18:13:16 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id A3A716E32B; Mon, 24 Jul 2017 18:13:14 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2017 11:13:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.40,408,1496127600"; d="scan'208"; a="1198851468" Received: from mint-dev.iind.intel.com ([10.223.25.164]) by fmsmga002.fm.intel.com with ESMTP; 24 Jul 2017 11:12:33 -0700 From: Ramalingam C To: daniel.vetter@intel.com, seanpaul@chromium.org Date: Mon, 24 Jul 2017 23:42:01 +0530 Message-Id: <1500919921-9662-1-git-send-email-ramalingam.c@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [RFC v3] drm/hdcp: drm enum property for CP State 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 to represent the content protection state of the connector and to configure the same. Content protection states defined: DRM_MODE_CONTENT_PROTECTION_UNSUPPORTED - Unsupported DRM_MODE_CONTENT_PROTECTION_DISABLE - Disabled DRM_MODE_CONTENT_PROTECTION_ENABLE - Enabled v2: Redesigned the property to match with CP needs of CrOS [Sean]. v3: Renamed the state names. Header is removed [sean]. Signed-off-by: Ramalingam C --- drivers/gpu/drm/drm_connector.c | 14 ++++++++++++++ include/drm/drm_mode_config.h | 5 +++++ include/uapi/drm/drm_mode.h | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 5cd61af..d6aaa08 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -617,6 +617,13 @@ 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_cp_enum_list[] = { + { DRM_MODE_CONTENT_PROTECTION_UNSUPPORTED, "Unsupported" }, + { DRM_MODE_CONTENT_PROTECTION_DISABLE, "Disabled" }, + { DRM_MODE_CONTENT_PROTECTION_ENABLE, "Enabled" }, +}; +DRM_ENUM_NAME_FN(drm_get_cp_status_name, drm_cp_enum_list) + /** * drm_display_info_set_bus_formats - set the supported bus formats * @info: display info to store bus formats in @@ -789,6 +796,13 @@ int drm_connector_create_standard_properties(struct drm_device *dev) return -ENOMEM; dev->mode_config.link_status_property = prop; + prop = drm_property_create_enum(dev, 0, "Content Protection", + drm_cp_enum_list, + ARRAY_SIZE(drm_cp_enum_list)); + if (!prop) + return -ENOMEM; + dev->mode_config.cp_property = prop; + return 0; } diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 4298171..7acb8b2 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; /** + * @cp_property: Default connector property for CP + * of a connector + */ + struct drm_property *cp_property; + /** * @plane_type_property: Default plane property to differentiate * CURSOR, PRIMARY and OVERLAY legacy uses of planes. */ diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 403339f..554a770 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -127,6 +127,11 @@ extern "C" { #define DRM_MODE_LINK_STATUS_GOOD 0 #define DRM_MODE_LINK_STATUS_BAD 1 +/* Content Protection options */ +#define DRM_MODE_CONTENT_PROTECTION_UNSUPPORTED 0 +#define DRM_MODE_CONTENT_PROTECTION_DISABLE 1 +#define DRM_MODE_CONTENT_PROTECTION_ENABLE 2 + /* * DRM_MODE_ROTATE_ *