aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJayesh Choudhary <[email protected]>2024-06-13 14:08:05 +0530
committerMaxime Ripard <[email protected]>2024-06-13 17:36:44 +0200
commit9324410846e13595d453b7f34508b1f6b15fb1a7 (patch)
treef93e0db87c7b45b7fc4e6adf999d2a017f9c03ec
parent96fddae126327a87bf67edfa8a1c94ce21c18dfe (diff)
drm/bridge: sii902x: 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 <[email protected]> Reviewed-by: Aradhya Bhatia <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
-rw-r--r--drivers/gpu/drm/bridge/sii902x.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index 00a8c469f553..7f91b0db161e 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -496,6 +496,10 @@ 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 ||
+ crtc_state->mode.clock > SII902X_MAX_PIXEL_CLOCK_KHZ)
+ return -EINVAL;
+
/*
* There might be flags negotiation supported in future but
* set the bus flags in atomic_check statically for now.