From nobody Wed Oct 1 23:46:54 2025 Received: from fllvem-ot04.ext.ti.com (fllvem-ot04.ext.ti.com [198.47.19.246]) (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 172C321CC79 for ; Mon, 29 Sep 2025 10:04:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.246 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759140259; cv=none; b=RRpaFpx3nycE/UCSVpVd+SGC50ihyaGL4nD9NDcWdHRH+PsyIhbXhoAzqjc1glg6FeorlSaW/LSuTAalk8J3qZ/fNBClMHoDGTompM1GI0d3LKqSluKblwXptVoCp3XLNJNMDtGNXjo5tlrhh68aXiUGoapGkWsjIu6pIsVCJaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759140259; c=relaxed/simple; bh=2Db6JK+9qU6+n6xzou5MYcl981d9OTnJrXHGLT+GgQY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YllKQ8q4DR9rPDMzzXz2AEfMcsQ+o13eEoppCeM98mSW222RJ420SUOORkbDQgTL4JvLvxAo602Eaz+Bsh9DyQJG3jMTHTNYdozAZSZDQPM0yToP+3z4GDc1dDGeoKQuLKzmLnlfRgXIWmDUX8uUM0zoOEYfZKul4LaN+d0bQSQ= 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=ha/2/fMp; arc=none smtp.client-ip=198.47.19.246 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="ha/2/fMp" Received: from lelvem-sh01.itg.ti.com ([10.180.77.71]) by fllvem-ot04.ext.ti.com (8.15.2/8.15.2) with ESMTP id 58T8eRhO2600120; Mon, 29 Sep 2025 03:40:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1759135227; bh=VApXdUO/9O99aqmwI5WYjzoN2cC9O/Qt6WvdtIHKInM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ha/2/fMpq7akLW/ZWYu0Xl2MOSaQyWicnsdG1CT8M3xrZNhY09xppjwrsxORPFEFN PwcDFzoDn9rnPUegu8ceG4+ata5waMrf8KSP7nkj4S71+J9myHiOnE9Zvs+u4ZuD9d W198Htq8xdyDja83tclsO4Z+DLsNpbjTVdOFhzTE= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by lelvem-sh01.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 58T8eRxt1216611 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Mon, 29 Sep 2025 03:40:27 -0500 Received: from DFLE203.ent.ti.com (10.64.6.61) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Mon, 29 Sep 2025 03:40:27 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE203.ent.ti.com (10.64.6.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Mon, 29 Sep 2025 03:40:27 -0500 Received: from hkshenoy.dhcp.ti.com (hkshenoy.dhcp.ti.com [172.24.235.208] (may be forged)) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 58T8daaT927539; Mon, 29 Sep 2025 03:40:20 -0500 From: Harikrishna Shenoy To: , , , , , , , , , , , , , , , , , , , , , , , , CC: , Subject: [PATCH v7 6/6] drm/bridge: cadence: cdns-mhdp8546-core: Handle HDCP state in bridge atomic check Date: Mon, 29 Sep 2025 14:09:36 +0530 Message-ID: <20250929083936.1575685-7-h-shenoy@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250929083936.1575685-1-h-shenoy@ti.com> References: <20250929083936.1575685-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 in !(DBANC) usecase. 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