aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Kleiner <mario.kleiner.de@gmail.com>2016-07-19 14:58:57 -0400
committerEric Anholt <eric@anholt.net>2016-08-19 22:05:43 -0400
commite2298350de58d5c956131003606bfa4995f26933 (patch)
treeb749130c810be0dc027ede79230fd3edb05933d4
parent29b4817d4018df78086157ea3a55c1d9424a7cfc (diff)
drm/vc4: Disallow interlaced modes on DPI.
We already don't expose such modes to userspace, but make sure userspace can't sneak some interlaced mode in. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r--drivers/gpu/drm/vc4/vc4_dpi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index 275fedbdbd9e..1e1f6b8184d0 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -340,9 +340,20 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
340 } 340 }
341} 341}
342 342
343static bool vc4_dpi_encoder_mode_fixup(struct drm_encoder *encoder,
344 const struct drm_display_mode *mode,
345 struct drm_display_mode *adjusted_mode)
346{
347 if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE)
348 return false;
349
350 return true;
351}
352
343static const struct drm_encoder_helper_funcs vc4_dpi_encoder_helper_funcs = { 353static const struct drm_encoder_helper_funcs vc4_dpi_encoder_helper_funcs = {
344 .disable = vc4_dpi_encoder_disable, 354 .disable = vc4_dpi_encoder_disable,
345 .enable = vc4_dpi_encoder_enable, 355 .enable = vc4_dpi_encoder_enable,
356 .mode_fixup = vc4_dpi_encoder_mode_fixup,
346}; 357};
347 358
348static const struct of_device_id vc4_dpi_dt_match[] = { 359static const struct of_device_id vc4_dpi_dt_match[] = {