From patchwork Wed Nov 2 11:11:46 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: 14185 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3556573wru; Wed, 2 Nov 2022 04:17:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5YtW9Ok0Fm6E8Yo29UL76J4PbNfH8Ci+TX5vVDVJ7ZB6ehxESU53qbGwHCtMUqlVfgidAx X-Received: by 2002:a17:902:c209:b0:186:67b0:b1d0 with SMTP id 9-20020a170902c20900b0018667b0b1d0mr24818072pll.129.1667387840183; Wed, 02 Nov 2022 04:17:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667387840; cv=none; d=google.com; s=arc-20160816; b=Nb6PyVJvAtmZN3zXiOBwU88+6H6eY+KmFwM8mwizP8A9aDA7cdVI/uw8Zi484ANWj+ lDeN+WuDa1/M5a+DobmGF605YZqEnW0is183bgfCY/j7NF/DazGVndbzLYFRUiRQNrRf PohuWAIw6VJfKK0UJfmopqLz4BYTqiZv+R9dZRVRIO6X4sFESQzjZcz2+nBfHWVTAiQd 98cIID0Ih+l8US005F+SeRWUWTw2J9m75UHasplFSeAce+w2gqGhPaPRLjVQ1sDplXU4 fK4YGW988ZRZGY6nRw1Bxk3FRmQErfzhD88e/CTJIGzAjEjVQH036jcp7LSh1YoW3hL1 NcDw== 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=m6/hZVhtIbefUcknBjEFg5/f3s1Nad05i+KmCMBOS8c=; b=eK2+FP2hZGhyq9OB7qWJqnWFRdxw53wS1UNgKm7r1iRkKeoCvVbt87PJhx1EJkSiyO jZ9Cc831l+An+EgUiSc8wdQzkhShzCqxwlVQjwoD3H6p7HqN1UI/23xLsixY5cJ25B8n ASlsB57amoVcBuq6FGRo39NA5cxrp8nivvrZsWWdn+yRRlay28Hc+rpeTheGDxrB7bjn 6OQBPhfOmYXw4qrUb9YbQotR4LEpLkjDTIkBehBbrzt+YrnDTfbXO0xDbwqvTclB0+OZ pFmzhozXB9yh40M4/Tn3nZ06YhR8nGSyWL+Zy6GYNh4LLilTr6KUO8Pua9TIoaNB94Me 2DKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hLqMyKDm; 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 d10-20020a056a00244a00b0056d2ae385desi15039746pfj.381.2022.11.02.04.17.08; Wed, 02 Nov 2022 04:17:20 -0700 (PDT) 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=hLqMyKDm; 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 S230420AbiKBLNP (ORCPT + 99 others); Wed, 2 Nov 2022 07:13:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiKBLNG (ORCPT ); Wed, 2 Nov 2022 07:13:06 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39E7F27177 for ; Wed, 2 Nov 2022 04:12:53 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id y203so1967843pfb.4 for ; Wed, 02 Nov 2022 04:12:53 -0700 (PDT) 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=m6/hZVhtIbefUcknBjEFg5/f3s1Nad05i+KmCMBOS8c=; b=hLqMyKDmts+cb/C7xAVLTNi71pVTv0NmTjToGpyRqd3vLx6TVav4fQClcyMCmXKQ+M V0QchhfeV47Z7tL2eUrc/PnSv1h5PRFm0jfFOGKDt7ZV307lBwFKobmmgCXtmyh7wdiY ZlH0wfU8MoQKyZG6ENvTSh9ZDEX09jvMX9ZbA= 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=m6/hZVhtIbefUcknBjEFg5/f3s1Nad05i+KmCMBOS8c=; b=6o1dWL/D6gmdv/y9YY++A7SGPfBiUEubmvcm4qRA4mblhq8+b+FmiQ8C2TV2X0wsdd KN5dKPDIZhBf8+yz7bFjMonM224ZiLsLuB6NnTacBem7f+BwOeOUD2LTYRSnvS115+Je OsvcfVX+RAgP7lDAmf+OCYBoJHKvSaPnQu68P+thfjYmyIJONmq5nTLof0sGMqnH2IXl kiJODYQl2v3P4GfMmlLh3ms9MHzWnzs1932z2Sab5uoTsSsKvwAVcFvWsdw14RX27unt oVMrzUz/vT1LefdxftVtA5ratq3RoN9l7UyaD6RHjhQ4lW4LktSlL6Wd1mfsMg3CWEuS kK2w== X-Gm-Message-State: ACrzQf0fa13+G5SldXiab+pHcFzgJ/790qlWOZ3d4LdEIEpEUiYA5yWJ DY66B53uJ1g2RbnffR+ygBtfgg== X-Received: by 2002:a05:6a00:230f:b0:53e:2c2c:5c03 with SMTP id h15-20020a056a00230f00b0053e2c2c5c03mr24447199pfh.11.1667387512828; Wed, 02 Nov 2022 04:11:52 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:c30f:38e9:6ba:158b]) by smtp.gmail.com with ESMTPSA id z20-20020aa79f94000000b0056246403534sm8251048pfr.88.2022.11.02.04.11.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 04:11:52 -0700 (PDT) From: Hsin-Yi Wang To: Douglas Anderson , Sean Paul Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] drm_bridge: register content protect property Date: Wed, 2 Nov 2022 19:11:46 +0800 Message-Id: <20221102111148.1810314-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog MIME-Version: 1.0 X-Spam-Status: No, score=-3.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?1748382871961477022?= X-GMAIL-MSGID: =?utf-8?q?1748382871961477022?= 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 --- v2->v3: Only register the property when there exists any bridge that supports hdcp. --- 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 1c7d936523df5..b4fb5da0b963f 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_ENABLED(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 6b65b0dfb4fb4..1d2ab70f3436a 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. */ From patchwork Wed Nov 2 11:11:47 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: 14184 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3556565wru; Wed, 2 Nov 2022 04:17:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6bkVCQlAcBUZx9PGX3DjRrR5SlIpqs8zp2UffP9sz+IrE8d/1IswFCAMkSvlf+TJ4IjaIp X-Received: by 2002:a17:902:7294:b0:187:146c:316f with SMTP id d20-20020a170902729400b00187146c316fmr18608240pll.149.1667387839001; Wed, 02 Nov 2022 04:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667387838; cv=none; d=google.com; s=arc-20160816; b=JPml/9SRECkw+J8xkXnM51ZIOOTVnk/9eyxF5+6JvQTjiQWtAfinVn9qAyUsYkYVAT IbbCR8q2zl2iVxSFCyR0v7SOb2c+6L2BeMpHRvhb7oWfMG/QyLAruX/D/w1jEY2cw+CY +yjrFTvWwMxiHAVm5wixIND5i0kFXsNVsVVRka0Bta7J7AtQBZS1wZam/Evod1NQr6Dr DNcpsXb3LhIbtrtz1xGXDefGoQSxZLuWzTxAt9D1tYG77OYHYOKVko+HY9pS5suhvVJz pnlcwzJv4sS9bjrog3cFhvAOSpTrnsgF2taUJfjbQvG+jTwAf1LmyBMDIJgjinC5ILDd g5Fw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1OuwW2usJdNl/cGqK4nMOpD/moR27gN+SLRJ4Leuu4k=; b=ErvACvww6OyiQRT37Lw6yfsNjFU7pljr4GSPvrCI/NNulvz0cy9leoiukZXzVZ1HGr x96NJ7L3vvMaKJXjNAnJrA7zRD6P2agay7tdKqvePbVW7vxqVWypCFZ1Bj6Hgk9CN47s TwLtDk3jymO+x/HifzXE2FXAMHJQiNASuO7Lor/+up7en4G0PFRjFzplTVkj5x4wSi24 d6+EftwEoN/gnlOiDEvuMqwmC6OOinDyRq0oXgLr7UgknEWI+klc0nxBCmgnC5FN0X0H ciTvrJ523KSzyd6joQp42KsHHF+JanjuTEBnZ41ntQbZg5jS2QIohZWU+L+I9+4NjU8Z qkpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dRw3oxn3; 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 d12-20020a056a00198c00b005632b7b5e41si16559889pfl.136.2022.11.02.04.17.06; Wed, 02 Nov 2022 04:17:18 -0700 (PDT) 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=dRw3oxn3; 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 S229996AbiKBLNM (ORCPT + 99 others); Wed, 2 Nov 2022 07:13:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229598AbiKBLNG (ORCPT ); Wed, 2 Nov 2022 07:13:06 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DA722793E for ; Wed, 2 Nov 2022 04:12:53 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id v17so13228650plo.1 for ; Wed, 02 Nov 2022 04:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1OuwW2usJdNl/cGqK4nMOpD/moR27gN+SLRJ4Leuu4k=; b=dRw3oxn3H53aACjL3GYfw7dtwdvsMK1880QSOHc59/ENT8bkAlKRHZT/hOalamoG8/ 9lc50vfEbZWhSJJZjkhZLOmtLUSU31heslpkhmNAjYYxFkXjS8j/5WSP4db2CM/uG950 Hl4ntpNuQxjSezhjmi+JIW4nge0sJbjJM0mrk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1OuwW2usJdNl/cGqK4nMOpD/moR27gN+SLRJ4Leuu4k=; b=Jo1IsgZ0QsVoa7uKl3d5Bijqbf8J48CbeXpQEDB+5vcyqoZkl3RqRBbE0AgAUx28zP sY/CeKOUwI9Lj41vvCpTffjMZulE3zgcMuQBfYMmhtL6BXUo5k9JMXUB1WGABdEihTQw 7bpSUsR5E8GibfqyuCbZtoNBFDvTAluVEkC4pYl3W4tBg/3ID48LdcNqIhrN9rttCrEE ts5LtX9MzuCFTGbAP9QzIGNWuWgropJyAZRcrteaWPbeKy+oynsJLWHrvt6MYz/h5NyZ /155gbyPt/CidbNpW/r3x6MtrZmiGOWP76VGQtZmMxKlQ0AVh3xetCscaAs7yGqzu5p/ MpoQ== X-Gm-Message-State: ACrzQf3wWGsSrMVxUrL29slfALNPEr2BQHKfP0Irm0uYhZtbhvW2GCz5 zn+4ur0NH7L37RGCfsmSQef+gQ== X-Received: by 2002:a17:90a:ca13:b0:213:b85a:3bdb with SMTP id x19-20020a17090aca1300b00213b85a3bdbmr21181722pjt.97.1667387514709; Wed, 02 Nov 2022 04:11:54 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:c30f:38e9:6ba:158b]) by smtp.gmail.com with ESMTPSA id z20-20020aa79f94000000b0056246403534sm8251048pfr.88.2022.11.02.04.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 04:11:54 -0700 (PDT) From: Hsin-Yi Wang To: Douglas Anderson , Sean Paul Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] drm/bridge: anx7625: register content protect property Date: Wed, 2 Nov 2022 19:11:47 +0800 Message-Id: <20221102111148.1810314-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog In-Reply-To: <20221102111148.1810314-1-hsinyi@chromium.org> References: <20221102111148.1810314-1-hsinyi@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-3.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?1748382870768604483?= X-GMAIL-MSGID: =?utf-8?q?1748382870768604483?= Set support_hdcp so the connector can register content protect proterty when it's initializing. Signed-off-by: Hsin-Yi Wang Reviewed-by: Sean Paul --- drivers/gpu/drm/bridge/analogix/anx7625.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index b0ff1ecb80a50..0636ac59c7399 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -2680,6 +2680,7 @@ static int anx7625_i2c_probe(struct i2c_client *client, platform->bridge.type = platform->pdata.panel_bridge ? DRM_MODE_CONNECTOR_eDP : DRM_MODE_CONNECTOR_DisplayPort; + platform->bridge.support_hdcp = true; drm_bridge_add(&platform->bridge);