[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240524073305.107293-3-j-choudhary@ti.com>
Date: Fri, 24 May 2024 13:03:05 +0530
From: Jayesh Choudhary <j-choudhary@...com>
To: <linux-kernel@...r.kernel.org>, <andrzej.hajda@...el.com>,
<neil.armstrong@...aro.org>, <rfoss@...nel.org>,
<Laurent.pinchart@...asonboard.com>, <mripard@...nel.org>,
<dri-devel@...ts.freedesktop.org>, <j-choudhary@...com>
CC: <jonas@...boo.se>, <jernej.skrabec@...il.com>,
<maarten.lankhorst@...ux.intel.com>, <tzimmermann@...e.de>,
<airlied@...il.com>, <daniel@...ll.ch>, <a-bhatia1@...com>
Subject: [PATCH v2 2/2] drm/bridge: Add pixel clock check in atomic_check
Check the pixel clock for the mode in atomic_check and ensure that
it is within the range supported by the bridge.
Signed-off-by: Jayesh Choudhary <j-choudhary@...com>
---
drivers/gpu/drm/bridge/sii902x.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index ef7c3ab3386c..a5b7ee1e3bbe 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -517,11 +517,16 @@ static int sii902x_bridge_atomic_check(struct drm_bridge *bridge,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state)
{
+ if (crtc_state->mode.clock < SII902X_MIN_PIXEL_CLOCK_KHZ)
+ return MODE_CLOCK_LOW;
+
+ if (crtc_state->mode.clock > SII902X_MAX_PIXEL_CLOCK_KHZ)
+ return MODE_CLOCK_HIGH;
+
/*
* There might be flags negotiation supported in future but
* set the bus flags in atomic_check statically for now.
*/
-
bridge_state->input_bus_cfg.flags = bridge->timings->input_bus_flags;
return 0;
--
2.25.1
Powered by blists - more mailing lists