From patchwork Sun Oct 20 18:21:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11201077 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 4BFE0112B for ; Sun, 20 Oct 2019 18:21:43 +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 34B03218BA for ; Sun, 20 Oct 2019 18:21:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34B03218BA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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 129AB89A83; Sun, 20 Oct 2019 18:21:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF67489A67 for ; Sun, 20 Oct 2019 18:21:39 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-360-hcP5lqbfNemgu0Ft-01t3w-1; Sun, 20 Oct 2019 14:21:35 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 569491800D9B; Sun, 20 Oct 2019 18:21:34 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3D6F60C18; Sun, 20 Oct 2019 18:21:32 +0000 (UTC) From: Hans de Goede To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= Date: Sun, 20 Oct 2019 20:21:32 +0200 Message-Id: <20191020182132.54945-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: hcP5lqbfNemgu0Ft-01t3w-1 X-Mimecast-Spam-Score: 0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571595699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qC4M6KrtTIVEF80h9m03lQjm8Dvnhw/KF4JbqOSt4VM=; b=Gpi9CD14CU09AeWc1JS2gx9cHLXm4Q5Hh96lsZbAUSTAF/+FR2LCdu1qlX4v3yJdkByXVj Ajgq3v7TeLd9XfXXiwES1hMd8EHxI7hCO15KG5d9UutD2itzVvLHtgvew1Rb8AkEMhq2s9 6ip/PdMk57TFpZER+m/mYmAYQSfFqCw= Subject: [Intel-gfx] [PATCH] drm/i915: Try to re-use GOP / previous M-N-P settings for vlv DSI PLL X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx , dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Fastboot is not working on an Asus T100HA, it gives the following relevant messages / errors: dsi pll div 000201e6, ctrl 80080100 fastset mismatch in dsi_pll.ctrl (expected 0x80100100, found 0x80080100) fastset mismatch in dsi_pll.div (expected 0x0002008e, found 0x000201e6) The problem seems to be that the GOP picks 5 for the P divisor, where as we end up picking 4. This commit fixes this by first checking of the currently configured DSI PLL settings match the desired pclk and if they do, stick with the currently configured PLL settings. Note that vlv_dsi_get_pclk() stores the read ctrl and div values inside config->dsi_pll, so they are set to the GOP / previous values after calling it. Signed-off-by: Hans de Goede --- drivers/gpu/drm/i915/display/vlv_dsi_pll.c | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c index 95f39cd0ce02..4a09edecd597 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c @@ -119,15 +119,25 @@ int vlv_dsi_pll_compute(struct intel_encoder *encoder, struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); int ret; - u32 dsi_clk; - - dsi_clk = dsi_clk_from_pclk(intel_dsi->pclk, intel_dsi->pixel_format, - intel_dsi->lane_count); + u32 dsi_clk, current_pclk; - ret = dsi_calc_mnp(dev_priv, config, dsi_clk); - if (ret) { - DRM_DEBUG_KMS("dsi_calc_mnp failed\n"); - return ret; + /* + * For exact matches, the GOP may pick another set of divisors + * then we do, if the GOP settings are an exact match keep them. + */ + current_pclk = vlv_dsi_get_pclk(encoder, config); + if (current_pclk == intel_dsi->pclk) { + config->dsi_pll.ctrl &= DSI_PLL_P1_POST_DIV_MASK; + } else { + dsi_clk = dsi_clk_from_pclk(intel_dsi->pclk, + intel_dsi->pixel_format, + intel_dsi->lane_count); + + ret = dsi_calc_mnp(dev_priv, config, dsi_clk); + if (ret) { + DRM_DEBUG_KMS("dsi_calc_mnp failed\n"); + return ret; + } } if (intel_dsi->ports & (1 << PORT_A))