From nobody Sun Oct 5 03:38:54 2025 Received: from lelvem-ot02.ext.ti.com (lelvem-ot02.ext.ti.com [198.47.23.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D73182DAFA9 for ; Mon, 11 Aug 2025 08:00:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.235 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754899221; cv=none; b=mZnFmlFxE7NxJGqm86JC7maJypwaeW0/YoHJiPW8WfhM32dwU8tilSs5d9j9/oJeMyRKh35gVSRrzmV9rz5RmAKxlRByDaLS5lloso4+3OTB/RsgNNRoGU2Um/+NpFkTxoXyBtIXvuKcOSsqsM8Bh5a/88cdVTP7ySeAJtVNJI8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754899221; c=relaxed/simple; bh=D34kq3r7k+H6q6dNbv0C7/Aqz9VAOIRBun7toR5ws5U=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NzujEDqSQa9zPjnjMXDOcBX9HfXltibtdHD+545jRcky1jbOD/2f1qrc2zO0m4oZL32LePy5WxYzBmDyDP+f0E+uTDyRvoKUxOcYVTw1cBy7nc4TJ8HiugWHuKpQSPvRrkyXIK6z3MaSP4rKhkUDL/922xLBmkeIMqNBgmT1qyY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=qEkpcc5y; arc=none smtp.client-ip=198.47.23.235 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="qEkpcc5y" Received: from lelvem-sh01.itg.ti.com ([10.180.77.71]) by lelvem-ot02.ext.ti.com (8.15.2/8.15.2) with ESMTP id 57B7xu411564151; Mon, 11 Aug 2025 02:59:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1754899197; bh=7PfiPykHsTbwLkTcmOnffcGjkDy3xo0UuxzokO5rkK8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qEkpcc5ym9E/+sTPiKbpwNWFx+aOzHKrRuRzH+no/ya1rwhG8FqPuAlJj2Evhhi7B 83Medxk0/dr4xA5ZunsWLQ0wFRWMG0vBBr7DXEuqXNnJPXHS/9+m8WJnQO2IIu5tEn vBkf2rwR4/jlPAhSC8UbFdh6jQaLLX8cgQa/Mn+M= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelvem-sh01.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 57B7xuph2515611 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Mon, 11 Aug 2025 02:59:56 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Mon, 11 Aug 2025 02:59:56 -0500 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Mon, 11 Aug 2025 02:59:56 -0500 Received: from hkshenoy.dhcp.ti.com (hkshenoy.dhcp.ti.com [172.24.235.208]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 57B7x5D02817433; Mon, 11 Aug 2025 02:59:49 -0500 From: Harikrishna Shenoy To: , , , , , , , , CC: , , , , , , , , , , , , , , , , , Subject: [PATCH v5 6/6] drm/bridge: cadence: cdns-mhdp8546-core: Handle HDCP state in bridge atomic check Date: Mon, 11 Aug 2025 13:29:04 +0530 Message-ID: <20250811075904.1613519-7-h-shenoy@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250811075904.1613519-1-h-shenoy@ti.com> References: <20250811075904.1613519-1-h-shenoy@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" Now that we have DBANC framework and legacy connector functions removed, handle the HDCP disabling in bridge atomic check rather than in connector atomic check previously. Signed-off-by: Harikrishna Shenoy --- .../drm/bridge/cadence/cdns-mhdp8546-core.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/= gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index 4fb1db3e030c..af41b2908a74 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -1960,6 +1960,10 @@ static int cdns_mhdp_atomic_check(struct drm_bridge = *bridge, { struct cdns_mhdp_device *mhdp =3D bridge_to_mhdp(bridge); const struct drm_display_mode *mode =3D &crtc_state->adjusted_mode; + struct drm_connector_state *old_state, *new_state; + struct drm_atomic_state *state =3D crtc_state->state; + struct drm_connector *conn =3D mhdp->connector; + u64 old_cp, new_cp; =20 mutex_lock(&mhdp->link_mutex); =20 @@ -1979,6 +1983,25 @@ static int cdns_mhdp_atomic_check(struct drm_bridge = *bridge, if (mhdp->info) bridge_state->input_bus_cfg.flags =3D *mhdp->info->input_bus_flags; =20 + if (conn && mhdp->hdcp_supported) { + old_state =3D drm_atomic_get_old_connector_state(state, conn); + new_state =3D drm_atomic_get_new_connector_state(state, conn); + old_cp =3D old_state->content_protection; + new_cp =3D new_state->content_protection; + + if (old_state->hdcp_content_type !=3D new_state->hdcp_content_type && + new_cp !=3D DRM_MODE_CONTENT_PROTECTION_UNDESIRED) { + new_state->content_protection =3D DRM_MODE_CONTENT_PROTECTION_DESIRED; + crtc_state =3D drm_atomic_get_new_crtc_state(state, new_state->crtc); + crtc_state->mode_changed =3D true; + } + + if (!new_state->crtc) { + if (old_cp =3D=3D DRM_MODE_CONTENT_PROTECTION_ENABLED) + new_state->content_protection =3D DRM_MODE_CONTENT_PROTECTION_DESIRED; + } + } + mutex_unlock(&mhdp->link_mutex); return 0; } --=20 2.34.1