0513-drm-vc4-Fix-up-the-limited-range-RGB-output-commit.patch 1.1 KB

1234567891011121314151617181920212223242526272829
  1. From b66013edab6e2149beb55eb1021926fd7ea26da7 Mon Sep 17 00:00:00 2001
  2. From: Eric Anholt <eric@anholt.net>
  3. Date: Thu, 15 Sep 2016 17:52:17 +0100
  4. Subject: [PATCH] drm/vc4: Fix up the limited range RGB output commit.
  5. CEA mode #1 is the only one that doesn't do limited range, thus the
  6. strange pattern in other drivers.
  7. Signed-off-by: Eric Anholt <eric@anholt.net>
  8. ---
  9. drivers/gpu/drm/vc4/vc4_hdmi.c | 7 +++++--
  10. 1 file changed, 5 insertions(+), 2 deletions(-)
  11. --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
  12. +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
  13. @@ -343,8 +343,11 @@ static void vc4_hdmi_encoder_mode_set(st
  14. csc_ctl = VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR,
  15. VC4_HD_CSC_CTL_ORDER);
  16. - if (vc4_encoder->hdmi_monitor && drm_match_cea_mode(mode) != 0) {
  17. - /* Enable limited range RGB output. This matrix is:
  18. + if (vc4_encoder->hdmi_monitor && drm_match_cea_mode(mode) > 1) {
  19. + /* CEA VICs other than #1 requre limited range RGB
  20. + * output. Apply a colorspace conversion to squash
  21. + * 0-255 down to 16-235. The matrix here is:
  22. + *
  23. * [ 0 0 0.8594 16]
  24. * [ 0 0.8594 0 16]
  25. * [ 0.8594 0 0 16]