0515-drm-vc4-Disallow-interlaced-modes-on-DPI.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 069acde1ae77a0807062df0b009a51809cb3aa2a Mon Sep 17 00:00:00 2001
  2. From: Mario Kleiner <mario.kleiner.de@gmail.com>
  3. Date: Tue, 19 Jul 2016 20:58:57 +0200
  4. Subject: [PATCH] drm/vc4: Disallow interlaced modes on DPI.
  5. We already don't expose such modes to userspace, but make
  6. sure userspace can't sneak some interlaced mode in.
  7. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
  8. Signed-off-by: Eric Anholt <eric@anholt.net>
  9. ---
  10. drivers/gpu/drm/vc4/vc4_dpi.c | 11 +++++++++++
  11. 1 file changed, 11 insertions(+)
  12. --- a/drivers/gpu/drm/vc4/vc4_dpi.c
  13. +++ b/drivers/gpu/drm/vc4/vc4_dpi.c
  14. @@ -349,9 +349,20 @@ static void vc4_dpi_encoder_enable(struc
  15. }
  16. }
  17. +static bool vc4_dpi_encoder_mode_fixup(struct drm_encoder *encoder,
  18. + const struct drm_display_mode *mode,
  19. + struct drm_display_mode *adjusted_mode)
  20. +{
  21. + if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE)
  22. + return false;
  23. +
  24. + return true;
  25. +}
  26. +
  27. static const struct drm_encoder_helper_funcs vc4_dpi_encoder_helper_funcs = {
  28. .disable = vc4_dpi_encoder_disable,
  29. .enable = vc4_dpi_encoder_enable,
  30. + .mode_fixup = vc4_dpi_encoder_mode_fixup,
  31. };
  32. static const struct of_device_id vc4_dpi_dt_match[] = {