From nobody Tue Oct 14 01:19:26 2025 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (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 3B5FC1DB55D for ; Sat, 29 Mar 2025 11:40:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743248422; cv=none; b=EiV+UgpsrkCbX2PlZqUgZkIck06D65l/pHhe0+WcUUZZ+kZ9We0Q8mDRDdRbTL8qwL2ped9s45UkTWTnbSOmBlFz4A5E5NNPoQue3YQkRVEI+ZMV0Q7X0fhRA1WZS7cQq0g74Qu9i0mPAt33fTxUIpMGzcfuN1UMOaFA48/PXOM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743248422; c=relaxed/simple; bh=B1u6as5B/YLySIR9zZ2tbCm0ywzwHkJM4XWzLgpc5io=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ekZfdC9SApbOZ7TUJ0Y8X+BpEXY7JM6PKlF5TLgN7vK5oC/bmtu7EQ2cQm7TrPd5XOG0pG1VG4H6js5QCZImDmtyVfqptxbofwxf5QSaaZb3sM5XKJMK4tH9F4l7sm2rKz0lc0OzigXuZsyiiBEkvFjcdjWRE8d/FU18qkD7Hf4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=OSoZ3ISe; arc=none smtp.client-ip=91.218.175.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="OSoZ3ISe" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1743248418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rIk50ETauNoMoUpyiJL6wIEyxdPfToBDa+Clu3JgPXw=; b=OSoZ3ISevVyyRaRnfEtlnClKQSf3zwCB/FgQO9xVsL31sBU0AsrRKEH7naLAN5SKHWgrq3 jQYDGu6CtYOZH3nDq5fx9wHDjpgmcq0zFM0NitYxey24me2q0u4XUbS3G9ZnPszAugVkTS oVK3O2UmBwsQ8WDLA7GEoBXfK0+5+So= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , Alexander Sverdlin , Dominik Haller , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v11 08/14] drm/bridge: cdns-dsi: Add input format negotiation Date: Sat, 29 Mar 2025 17:09:19 +0530 Message-Id: <20250329113925.68204-9-aradhya.bhatia@linux.dev> In-Reply-To: <20250329113925.68204-1-aradhya.bhatia@linux.dev> References: <20250329113925.68204-1-aradhya.bhatia@linux.dev> 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-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Add support for the input format negotiation hook, that uses the helper drm_mipi_dsi_get_input_bus_fmt() for dsi hosts, to figure out the required input format. Reviewed-by: Dmitry Baryshkov Reviewed-by: Tomi Valkeinen Tested-by: Tomi Valkeinen Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- .../gpu/drm/bridge/cadence/cdns-dsi-core.c | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index 89a3f3efc522..c333b5c025d9 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -936,6 +936,33 @@ static void cdns_dsi_bridge_atomic_pre_enable(struct d= rm_bridge *bridge, cdns_dsi_hs_init(dsi); } =20 +static u32 *cdns_dsi_bridge_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + struct cdns_dsi_input *input =3D bridge_to_cdns_dsi_input(bridge); + struct cdns_dsi *dsi =3D input_to_dsi(input); + struct cdns_dsi_output *output =3D &dsi->output; + u32 *input_fmts; + + *num_input_fmts =3D 0; + + input_fmts =3D kzalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + input_fmts[0] =3D drm_mipi_dsi_get_input_bus_fmt(output->dev->format); + if (!input_fmts[0]) + return NULL; + + *num_input_fmts =3D 1; + + return input_fmts; +} + static const struct drm_bridge_funcs cdns_dsi_bridge_funcs =3D { .attach =3D cdns_dsi_bridge_attach, .mode_valid =3D cdns_dsi_bridge_mode_valid, @@ -946,6 +973,7 @@ static const struct drm_bridge_funcs cdns_dsi_bridge_fu= ncs =3D { .atomic_reset =3D drm_atomic_helper_bridge_reset, .atomic_duplicate_state =3D drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state =3D drm_atomic_helper_bridge_destroy_state, + .atomic_get_input_bus_fmts =3D cdns_dsi_bridge_get_input_bus_fmts, }; =20 static int cdns_dsi_attach(struct mipi_dsi_host *host, --=20 2.34.1