From patchwork Tue Nov 15 06:28:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 20207 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2549535wru; Mon, 14 Nov 2022 22:30:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf4FKSKPag14fd5ctU+k1qZTUTwTkDF3ldPsLw79eCoYeEvdRzKnt5Uj3gcsQH232SjSh4pS X-Received: by 2002:a17:90a:990d:b0:213:1e05:f991 with SMTP id b13-20020a17090a990d00b002131e05f991mr679215pjp.216.1668493857350; Mon, 14 Nov 2022 22:30:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668493857; cv=none; d=google.com; s=arc-20160816; b=nj8TYsGVwO/3XA4iKA00G6gHnk9Ha6zLe0lq5OC/yXjQPHknrbPLVX6Qmmzvra/2mz 9Bmnc1e/GrokoVx0/MQSmfV3tK0TgtmyhalShZXre38MFYK9z5QTpWaUn3KzbE5lo8c0 qgWQ9qy517E8ZQPUWbpIXyKqHalRRy+iUt1Nd5jTq9kjvhNGwmnKTPdtVXJ3rm4SzJkc oLIgH1+PM3vbFxaNBGhHA4il+Y4R1IMt5cqFhdgN9XoYPsdAX1XR63ynVHJwGzGCrzgZ umnhUwPCT2Wd8HJWFQ9XjDf+ziCsM0T+5bYpKX8ZY7WlhRXYGByPDGX4s04qve7d/90M QQqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=jYF/Js/yiLI83Zy9sWN0PENTbwz1/nvxpqAaN81AAww=; b=fisn0HuKCmR9Xnd7zDoObN+bVlVrg+EpkQkNrX74vyoM+aAu8N+CmSwpO3J4haKm/S P/ZYmyDVtTuVdMUSnc2LwIO8SZkmYD/1VaKYVwEoe18+/0PZlEhyuSLksgkbnXTQTFBC QpeBWHgVHIAdy7VGc9nXy/k0LOcyqNdC7bBg/ZgA6tKzsdrbT+fqWUa2bEyUl5YxAiDA z6M1B16xCFBV/RoOMU6nOsDbuq50T8HJJdZoxpmFQWTpGx7scdwU9E2ITzWr88WObmBk TnLFhf6HlrZWP217sHTCKARtAmW6ukx5UGGyJxWjjlR3KW395DLBcTVRpOomS/op08Jd 8Yfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Po3X0rFR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a170902d34500b00188881adcd7si10274387plk.550.2022.11.14.22.30.18; Mon, 14 Nov 2022 22:30:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Po3X0rFR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232217AbiKOG27 (ORCPT + 99 others); Tue, 15 Nov 2022 01:28:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232085AbiKOG2m (ORCPT ); Tue, 15 Nov 2022 01:28:42 -0500 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA67CEA for ; Mon, 14 Nov 2022 22:28:41 -0800 (PST) Received: by mail-pg1-x529.google.com with SMTP id o13so12400393pgu.7 for ; Mon, 14 Nov 2022 22:28:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jYF/Js/yiLI83Zy9sWN0PENTbwz1/nvxpqAaN81AAww=; b=Po3X0rFRnkmXUSuWki6spsmGHe32wlGY0z2bgPRVq1Tc0tzYKF81Dga33krFcwc8yL OCWKk6lm+vccRWTPaB55QNVqzfiWma0lZ3lbY3jrh7cucnDby7HfBBf4RIdNWCnWIrX7 TTh8Ka5JMep8/45EfFJJbpgNaNQlUgtO0eTOw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jYF/Js/yiLI83Zy9sWN0PENTbwz1/nvxpqAaN81AAww=; b=gBg5HlPwoLE7QNJsVzliuZlUKO/UaHZSOUSXDWVY1vtPiP/76E8LCdhl/wYVxIJHZu 7Vy1MdKKWdMGXXuSiDrNGxpdX9W24JqUMHoySyUqqmwbf46eQmpGJQ6l0ueF3o8LcQYp SNE/nY0hPDtVZ53WOdyDAV0cEqeaGizyxYSr5yFRpHnPTAbKI2XJOi+2yKAi/6KoMyx3 EocrDO+f06NzVTkxnkeqo1Daf/ZOCbhRfIH/yCoTKAEE+Ec7vZV209jFc04nQooJWQz2 wVBpnyE8LuXNo6DHFFyiXmQO+T1gem94geAFXYwk3SG/72xefsuZ4squhl5raUrTnLz2 2v+g== X-Gm-Message-State: ANoB5pkGiytYvjFyCw+UQQTlu+jN3/8gBKouxehZy4MBLHA4L8Bnzrjw T7ridZgyLPG0EylvCO1Q8ySk6w== X-Received: by 2002:a63:eb4e:0:b0:45f:f8df:108e with SMTP id b14-20020a63eb4e000000b0045ff8df108emr14451107pgk.127.1668493720852; Mon, 14 Nov 2022 22:28:40 -0800 (PST) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:17d2:e181:950d:967a]) by smtp.gmail.com with ESMTPSA id b22-20020a630c16000000b004351358f056sm6956372pgl.85.2022.11.14.22.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 22:28:40 -0800 (PST) From: Hsin-Yi Wang To: Sean Paul , Douglas Anderson , Robert Foss Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Allen Chen , David Airlie Subject: [PATCH v5 1/3] drm_bridge: register content protect property Date: Tue, 15 Nov 2022 14:28:33 +0800 Message-Id: <20221115062835.3785083-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749542615161356299?= X-GMAIL-MSGID: =?utf-8?q?1749542615161356299?= Some bridges are able to update HDCP status from userspace request if they support HDCP. HDCP property is the same as other connector properties that needs to be created after the connecter is initialized and before the connector is registered. If there exists a bridge that supports HDCP, add the property to the bridge connector. Signed-off-by: Hsin-Yi Wang Reviewed-by: Sean Paul Reported-by: kernel test robot --- v4->v5: fix compile warning when CONFIG_DRM_DISPLAY_HELPER=m --- drivers/gpu/drm/drm_bridge_connector.c | 8 ++++++++ include/drm/drm_bridge.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c index 1c7d936523df..16d038c2982f 100644 --- a/drivers/gpu/drm/drm_bridge_connector.c +++ b/drivers/gpu/drm/drm_bridge_connector.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -333,6 +334,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, struct i2c_adapter *ddc = NULL; struct drm_bridge *bridge, *panel_bridge = NULL; int connector_type; + bool support_hdcp = false; bridge_connector = kzalloc(sizeof(*bridge_connector), GFP_KERNEL); if (!bridge_connector) @@ -376,6 +378,9 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, if (drm_bridge_is_panel(bridge)) panel_bridge = bridge; + + if (bridge->support_hdcp) + support_hdcp = true; } if (connector_type == DRM_MODE_CONNECTOR_Unknown) { @@ -398,6 +403,9 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, if (panel_bridge) drm_panel_bridge_set_orientation(connector, panel_bridge); + if (support_hdcp && IS_REACHABLE(CONFIG_DRM_DISPLAY_HDCP_HELPER)) + drm_connector_attach_content_protection_property(connector, true); + return connector; } EXPORT_SYMBOL_GPL(drm_bridge_connector_init); diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 6b65b0dfb4fb..1d2ab70f3436 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -768,6 +768,10 @@ struct drm_bridge { * modes. */ bool interlace_allowed; + /** + * @support_hdcp: Indicate that the bridge supports HDCP. + */ + bool support_hdcp; /** * @ddc: Associated I2C adapter for DDC access, if any. */