From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969972AbdAEBMx (ORCPT ); Wed, 4 Jan 2017 20:12:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56118 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753408AbdAEBMu (ORCPT ); Wed, 4 Jan 2017 20:12:50 -0500 From: Lyude To: intel-gfx@lists.freedesktop.org Cc: Lyude , Chris Wilson , Daniel Vetter , Jani Nikula , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Daniel Vetter , Jani Nikula , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/i915/dp: Stop enabling limited color ranges for everything Date: Wed, 4 Jan 2017 20:11:36 -0500 Message-Id: <20170105011137.20209-1-lyude@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 05 Jan 2017 01:12:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Until now, it seems we've been erroneously enabling limited color ranges for the vast majority of DisplayPort monitors. I noticed this after writing a frame dump comparison test for the Chamelium and noticing that every i915 device I had was failing, while amdgpu machines were fine: https://people.freedesktop.org/~lyudess/archive/01-03-2017/ It looks like this is because the DisplayPort spec tells us to use limited color ranges whenever we detect a CEA mode in use. However, from the looks of it there's another rather confusing part of the spec that got missed: source devices are allowed to use the full range of values for pixels -even- if the sink device declares that it's using a CEA mode. It's up to the sink device to limit the pixel range to the CEA ranges if it needs. Signed-off-by: Lyude Cc: Chris Wilson Cc: Daniel Vetter Cc: Jani Nikula Cc: Ville Syrjälä --- I'm really surprised that this bug would have been around as long as it looks like it has been without anyone noticing it, so I figured I'd just send a patch to the mailing list so you guys can point out whether or not this is really the correct thing to do. drivers/gpu/drm/i915/intel_dp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index d9bc19b..6642abd 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1649,12 +1649,15 @@ intel_dp_compute_config(struct intel_encoder *encoder, found: if (intel_dp->color_range_auto) { /* + * We are required to use the limited CEA RGB range when a CEA + * mode is declared in the EDID. However, limiting the pixel + * value range is up to the sink, not the source. So, just + * don't enable limited color ranges. * See: * CEA-861-E - 5.1 Default Encoding Parameters * VESA DisplayPort Ver.1.2a - 5.1.1.1 Video Colorimetry */ - pipe_config->limited_color_range = - bpp != 18 && drm_match_cea_mode(adjusted_mode) > 1; + pipe_config->limited_color_range = false; } else { pipe_config->limited_color_range = intel_dp->limited_color_range; -- 2.9.3