From patchwork Sat Feb 29 05:41:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 11413727 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6438414E3 for ; Sat, 29 Feb 2020 05:42:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 381FD246AE for ; Sat, 29 Feb 2020 05:42:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="u3lSnIqC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 381FD246AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CF3E6E069; Sat, 29 Feb 2020 05:42:02 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2F7C26E069; Sat, 29 Feb 2020 05:42:01 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id x7so5771447wrr.0; Fri, 28 Feb 2020 21:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YuOVGNypQMql+jSAKLP8qQUYQA/QyE7yGHxy4q4E/l8=; b=u3lSnIqCHBFyWiZIIekqVGfo6955kUAPMSsfbwUDnb98PBEwD3DgQQ8VyQEiCccoVU U6z4n0VCE81aEhfOn5YfH27/IXiwrVBI78HlhyL/v8U/+ZP0L0miQjCQvP7JWSeFbNYR UxnPrZLbs2vetHKxP0/XdTTOdZFFDRnXjswAluuZ36TYUFntg/9W78LUEgpqlJb1ytwR rQLiPMeE3IH6BejGb1M4BB8aiWiTdv4Xk8Qu5VfQY5eb/o1pG3FlTqTnT7KVVMRidQjo vtyG+hnfZYsJCPFJ6yb1Oxcz99fR52ImKKlT+CeTTkJTCRyh5dCHnQSfzl1QJd8XOWTF 5+GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YuOVGNypQMql+jSAKLP8qQUYQA/QyE7yGHxy4q4E/l8=; b=gM6jPLg9v1QpI8bqcdScrlvGRwkWg6LvKj3XVU9c0SCjCqgXsTr/ZGprTg5Y5VwpFZ hLow+4g5DhK5jJsko0N2L4QoL9CdjwowEBefA9CdDTH3MGjAi7ND2AP2lkuKaaPqeeT/ 5CZidKuYQzzLzMMzB91HTDHWpsxXW97+pwBJKdPKhVG7L1G449kes7Y+unDXAC061wai 5XHuepNE7HF7pgkfTRcyCBDcS1fFRE44ndsxXdjn9vyirLt5iBr6LImacS/zdsbdQ3tf xoyzo/VFnLcwHloZyJ0SCX6aoV1Qoan/voiAsBVnRX6Xth6GVZO8xpHdrh26y7+Tz07x SXrg== X-Gm-Message-State: APjAAAX100q4Ge9UXHCeDjhIuOqW8Hj7tEatIVaG3BCFXtUVOdM6jfUj xql6sHNIZdqX4UHbG0QznhFwpVh2 X-Google-Smtp-Source: APXvYqwchuzQwbP0HG53EpYW+c6/T19uSdF1Ksjsuhi6XWVPxV17jAwAAJfkIJeQ1+/JbGVLGDwgCA== X-Received: by 2002:a5d:568f:: with SMTP id f15mr8817507wrv.202.1582954919608; Fri, 28 Feb 2020 21:41:59 -0800 (PST) Received: from groovy.localdomain (dynamic-2a01-0c22-c836-dd00-74aa-9e10-e4ef-a81b.c22.pool.telefonica.de. [2a01:c22:c836:dd00:74aa:9e10:e4ef:a81b]) by smtp.gmail.com with ESMTPSA id b10sm15671093wrw.61.2020.02.28.21.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2020 21:41:59 -0800 (PST) From: Mario Kleiner To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Sat, 29 Feb 2020 06:41:08 +0100 Message-Id: <20200229054108.2781-1-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm/i915/dp: Add dpcd link_rate quirk for Apple 15" MBP 2017 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jani Nikula Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This fixes a problem found on the MacBookPro 2017 Retina panel. The panel reports 10 bpc color depth in its EDID, and the firmware chooses link settings at boot which support enough bandwidth for 10 bpc (324000 kbit/sec = multiplier 0xc), but the DP_MAX_LINK_RATE dpcd register only reports 2.7 Gbps (multiplier value 0xa) as possible, in direct contradiction of what the firmware successfully set up. This restricts the panel to 8 bpc, not providing the full color depth of the panel. This patch adds a quirk specific to the MBP 2017 15" Retina panel to add the additiional 324000 kbps link rate during edp setup. Link to previous discussion of a different attempted fix with Ville and Jani: https://patchwork.kernel.org/patch/11325935/ Signed-off-by: Mario Kleiner Cc: Ville Syrjälä Cc: Jani Nikula --- drivers/gpu/drm/drm_dp_helper.c | 2 ++ drivers/gpu/drm/i915/display/intel_dp.c | 7 +++++++ include/drm/drm_dp_helper.h | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 5a103e9b3c86..36a371c016cb 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1179,6 +1179,8 @@ static const struct dpcd_quirk dpcd_quirk_list[] = { { OUI(0x00, 0x00, 0x00), DEVICE_ID('C', 'H', '7', '5', '1', '1'), false, BIT(DP_DPCD_QUIRK_NO_SINK_COUNT) }, /* Synaptics DP1.4 MST hubs can support DSC without virtual DPCD */ { OUI(0x90, 0xCC, 0x24), DEVICE_ID_ANY, true, BIT(DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD) }, + /* Apple MacBookPro 2017 15 inch eDP Retina panel reports too low DP_MAX_LINK_RATE */ + { OUI(0x00, 0x10, 0xfa), DEVICE_ID(101, 68, 21, 101, 98, 97), false, BIT(DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS) }, }; #undef OUI diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 4074d83b1a5f..1f6bd659ad41 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -178,6 +178,13 @@ static void intel_dp_set_sink_rates(struct intel_dp *intel_dp) } intel_dp->num_sink_rates = i; + + if (drm_dp_has_quirk(&intel_dp->desc, + DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS)) { + /* Needed for Apple MBP 2017, 15 inch eDP Retina panel */ + intel_dp->sink_rates[i] = 324000; + intel_dp->num_sink_rates++; + } } /* Get length of rates array potentially limited by max_rate. */ diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 262faf9e5e94..4b86a1f2a559 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1532,6 +1532,13 @@ enum drm_dp_quirk { * The DSC caps can be read from the physical aux instead. */ DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD, + /** + * @DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS: + * + * The device supports a link rate of 3.24 Gbps (multiplier 0xc) despite + * the DP_MAX_LINK_RATE register reporting a lower max multiplier. + */ + DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS, }; /**