aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-02-07 14:52:33 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-06-26 06:03:25 -0400
commit92fbdfcd7d6b9db6b0a738c5bd85a4a9d731629d (patch)
tree78ca1e767c6045558514455d3a7bbb0475a99887
parent713456db179356c6b32a50ea1910fc509615c457 (diff)
drm/i2c: tda998x: add some basic mode validation
The TDA998x can't handle modes with clocks above 150MHz, or resolutions larger than 8192x2048. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/gpu/drm/i2c/tda998x_drv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index 3ff7d0713bfb..5a738ad0c241 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -810,6 +810,12 @@ static int
810tda998x_encoder_mode_valid(struct drm_encoder *encoder, 810tda998x_encoder_mode_valid(struct drm_encoder *encoder,
811 struct drm_display_mode *mode) 811 struct drm_display_mode *mode)
812{ 812{
813 if (mode->clock > 150000)
814 return MODE_CLOCK_HIGH;
815 if (mode->htotal >= BIT(13))
816 return MODE_BAD_HVALUE;
817 if (mode->vtotal >= BIT(11))
818 return MODE_BAD_VVALUE;
813 return MODE_OK; 819 return MODE_OK;
814} 820}
815 821