From patchwork Wed Nov 27 03:02:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Ji X-Patchwork-Id: 13886519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10049D66BAD for ; Wed, 27 Nov 2024 03:02:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C7ED10E00B; Wed, 27 Nov 2024 03:02:54 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=analogixsemi.com header.i=@analogixsemi.com header.b="aecidKi4"; dkim-atps=neutral Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2097.outbound.protection.outlook.com [40.107.236.97]) by gabe.freedesktop.org (Postfix) with ESMTPS id F24CB10E00B for ; Wed, 27 Nov 2024 03:02:52 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=atgaRAnVsIpuKYE8WS7qOqjS5LSFLl11cDifjrZ3LS71AmZqlFRbwMkrnC/CmShr1rjSTleo4P0mYb6HN9GbabNDBhAhaUZ5CRHFE7y00OFas6AjTyktsnOA2m3nRJRqanUvV8MwvRvWmNOz9JMfdHFm1/EsAiXkg87aSpYK+4n71/JpvoZWo3sV6TQL6aV8YNjygaAz5ckdgEaeFyhO8Xy6OTuFa1l/WhZ5IV6XEaMENs7HA65b/jS3Nt8SHIL/XpeVb+0NaQhWE7CQapX1l2wxGBAcHsKywX73JxqBb7XWGQAwhnPsRPSAWTkRZr7obt4DnbI1l5H/NB2hBA5liw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zc0zghJEIJ9tuwMrzJqK++e6YUeQjFmFrkBSd4Em4Z4=; b=qBAXQoF2UXg7Ckty4OCQ4mmJS26Y7KzA3x9U6ZwdWeSv08XEyVBPiIJyMvxSC+ibexxOagQPG96dC7+w+vvgcbCUgJaTyG9Onv7qszP9dmatGd59/rsAqfrVkougvQx06ujqep0+zpvItB6kVyG7ZeWSXIgA3lB1wXeHsH4JBdFskgQtY00FC9zwmDBA6PRSw1aooFNzKbIGd4fsE7H+/YHVO/OQvm0lfO94migaPlPTe7QjBoGq6kq5rgILI66g+VUTYhK9vzHsg4Wgk7LnDuogaRcA4Kb9oR1lqcYm+aFKUMN4nLeueYaU8Xh4ZWwDBSVEQiSQJQ+8T+5BwHgVJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=analogixsemi.com; dmarc=pass action=none header.from=analogixsemi.com; dkim=pass header.d=analogixsemi.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analogixsemi.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zc0zghJEIJ9tuwMrzJqK++e6YUeQjFmFrkBSd4Em4Z4=; b=aecidKi4E+mHJGDMkCehv2LBF55y0Fi02HkycSlJLp7FpYW4nK/y8oczCRPJ2FxHvr8l8XkkL5FkpfXSSys44fqX90d+UIcKoIONBcukj25h6OCqIbschih0GwReAqtY1DHjgiMlCY5rRDZ/pdSGWmkkzDIdXL387lzXIcQ5mUQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=analogixsemi.com; Received: from BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) by IA3PR04MB9677.namprd04.prod.outlook.com (2603:10b6:208:502::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.21; Wed, 27 Nov 2024 03:02:49 +0000 Received: from BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::5a7e:9e8c:138f:1815]) by BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::5a7e:9e8c:138f:1815%6]) with mapi id 15.20.8182.019; Wed, 27 Nov 2024 03:02:48 +0000 From: Xin Ji To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: bliang@analogixsemi.com, qwen@analogixsemi.com, treapking@google.com, Xin Ji , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/bridge:anx7625: Update HDCP status at atomic_disable() Date: Wed, 27 Nov 2024 11:02:20 +0800 Message-Id: <20241127030221.1586352-1-xji@analogixsemi.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: TPYP295CA0052.TWNP295.PROD.OUTLOOK.COM (2603:1096:7d0:8::18) To BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR04MB6739:EE_|IA3PR04MB9677:EE_ X-MS-Office365-Filtering-Correlation-Id: 30e51d49-4a84-4bb1-0b86-08dd0e8ff995 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|52116014|7416014|376014|38350700014|921020; X-Microsoft-Antispam-Message-Info: 23uWpzcx9OGUhYA0fP66rIFviNDVb8+7V3yUgivFVS6a3FsUc/dExq+r1Ft17ti8TDz0rtjFaERRGjwvIK0vPBnIDMdY65EAWK+Y+L6r3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nZsFhs01k/OJYAXispsJJAmtyKwZuXUyBB/7/IpWGEgaz9niQtcnngQAW0Hv/SgiOFOXXUlps05qOQFhGzV0EA+S5MjRQ5xJfd/bFg8cQTmc7HgvrdH6fwb91YBRyfy7iuEJ2ZII/vIBnPRMOeca+oypMtT50JOxtOuDwcWWsHFUfyqAFb2zuME9qtZHvFGG/17FdOM4qvbsGjbw8WWarqBq0BK7Dk1isvKYF3jsj4g+M/QUTOW7JDM4vWdILndIoR3orKOqVy1/2tc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR04MB6739.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(52116014)(7416014)(376014)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SIZOYU068v8nJTSyprq/5u1B6ubk1klDtrPXuYeYb67GXIgYbDtmt5YZXaUyRwxErjjZRfWz29GL2GCKTa5loERzQJmXIP8snzJyS4yyLj9e6gY8/VRfLwbgaRXqMPy6M7jnvxYcoLPxNbsf71IIvSfWR3S7y3RboQgNXcICtk10a1M+f0cKeI4tLhNr03TtPnwWF89SDzb9XlJ8K85eiNZACs+3+QoWvRB/5jdaf0h6d3wjHTVikYsjKK/7oKVlboDbLcg+sH5H53iu76WBQviiCSHhxu6d1mcTi4zPYlUnwl3DVvwhg57VW8cVuUQIdIZzFQkP8aZmFrOABlim1WAf//mDVYOkeC2SqWYiZjiE24StixNo0IKVNEqWz7HaSpmknOszXX/XAckddD+PL5b/oPeIfSngEik5CPWb2bwia4U+DH6EH3bKz88vdgNnC4VNBygNZMgbsm3nscP9ei4e/++GpfbqWzFmWA7wlXug6nE304KMp/AZXNHV7EqtWRZUHl104qGAdhU4w6YzDlFZrA4xXlV+Nd8vW8D9ENVvsknWjFAebFKp8cc9zKZadbUYJlg9SRdry0+nQ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 X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2024 03:02:48.7941 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b099b0b4-f26c-4cf5-9a0f-d5be9acab205 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RmcVeV7fRIpUE4KHazRmoAKRo6PBOD+rFPGLm8pAzp2CRDWrE6dR4doMBI36W71ao1+VPbIHMRqjs3juo0U8Ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA3PR04MB9677 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" Update HDCP content_protection to DRM_MODE_CONTENT_PROTECTION_UNDESIRED in bridge .atomic_disable(). Signed-off-by: Xin Ji Tested-by: Pin-yen Lin --- drivers/gpu/drm/bridge/analogix/anx7625.c | 25 ++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index a2675b121fe4..a75f519ddcb8 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -861,6 +861,22 @@ static int anx7625_hdcp_disable(struct anx7625_data *ctx) TX_HDCP_CTRL0, ~HARD_AUTH_EN & 0xFF); } +static void anx7625_hdcp_disable_and_update_cp(struct anx7625_data *ctx) +{ + struct device *dev = ctx->dev; + + if (!ctx->connector) + return; + + anx7625_hdcp_disable(ctx); + + ctx->hdcp_cp = DRM_MODE_CONTENT_PROTECTION_UNDESIRED; + drm_hdcp_update_content_protection(ctx->connector, + ctx->hdcp_cp); + + dev_dbg(dev, "update CP to UNDESIRE\n"); +} + static int anx7625_hdcp_enable(struct anx7625_data *ctx) { u8 bcap; @@ -2165,11 +2181,8 @@ static int anx7625_connector_atomic_check(struct anx7625_data *ctx, dev_err(dev, "current CP is not ENABLED\n"); return -EINVAL; } - anx7625_hdcp_disable(ctx); - ctx->hdcp_cp = DRM_MODE_CONTENT_PROTECTION_UNDESIRED; - drm_hdcp_update_content_protection(ctx->connector, - ctx->hdcp_cp); - dev_dbg(dev, "update CP to UNDESIRE\n"); + + anx7625_hdcp_disable_and_update_cp(ctx); } if (cp == DRM_MODE_CONTENT_PROTECTION_ENABLED) { @@ -2449,6 +2462,8 @@ static void anx7625_bridge_atomic_disable(struct drm_bridge *bridge, dev_dbg(dev, "drm atomic disable\n"); + anx7625_hdcp_disable_and_update_cp(ctx); + ctx->connector = NULL; anx7625_dp_stop(ctx);