Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3134169pxj; Mon, 17 May 2021 18:41:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGDS49dxppkNAJWQzaarXmJo1CsCs0pK7wlftduleKZ7nxOvJF2yTN4ija6MRK9yjk5p1Y X-Received: by 2002:a5e:a604:: with SMTP id q4mr2421584ioi.178.1621302073365; Mon, 17 May 2021 18:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621302073; cv=none; d=google.com; s=arc-20160816; b=O6MDYUj8w2pxWdiVh6sdamTCizEjS1Y0C8u2nuqfMTIO2Bc7VlbEqxGGcchsDxrbYc FDwHxcut0IRCHQtikJkzUub83vOu81F7UiTKNKRN/JG4LvI92rm/FRbRmWwMdKH1cevK ZfHczX33cwQ5Ee3FFEKCVs58OZ4PherR8HLUEhnFaFZDlnMWfyF+yq+2L9YkqkpPLwaG T/nRadBF/+pPSgFpOvGeTUMEXgyDQxsisySFpD+aLH4+F19ChZCCk2zuzVMfm6D8esxE 5jgzMm0MZKQgaTz6Ayl3imK7WpPujPLvv/teuWSFtiHvAQsCkizzc5TkT7MWdTsjGx2g k6rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bHrzDWj1YRAc0RcqyTRxOReBeyErTD5vEsFfQOmN4BI=; b=xQJknu2EjdO9XZi90tufe4//zzrImsdd0MmTCeb+MiNYx/UALMc7NZYI4bYCxw/H27 98M6Hj7xm4QDmAspjIxkBiUoH+JgT7z60I/Q0NKgp42MzhEzznQdtkZ+bOklIEKThJw4 +aaPdGGLwxDzFxXMzViVHLinWYW7i+DMo2df1aqypVudpjxA+j1sA9OdHUqAApjmQry4 MMSjHt3RvOo2BZfxVBEfCEkA2H2wVkA1797HUBuaTsMuEU99h8eNF0GvSNLoDRP/YR2I 2GyRIy6l5gKtolv48bgQ+kW9HU/TaUpuv84crhM96TY8+M4eceah1ZQqss95mM0elb1P 7QLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cFdSoScq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si23583083ilu.88.2021.05.17.18.41.00; Mon, 17 May 2021 18:41:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cFdSoScq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240208AbhEQOgZ (ORCPT + 99 others); Mon, 17 May 2021 10:36:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:43786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239959AbhEQObv (ORCPT ); Mon, 17 May 2021 10:31:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 961C3613E1; Mon, 17 May 2021 14:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260944; bh=nx11xL8CuWTnWQiIfxjPr8UVxD5TotRu0UoYZvTy9Uo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cFdSoScqzE7cY2ZDNiTioEoqEVLCb8Hm9Luje1HoNOd9YS+8BmfEcs1+SvoIJ2mNC IbT38Whhu8754lzQYEgCvKoPsnR4x6onGVELzh1XjRSlK24POItx3EIKZTokTe2y9e 4ja6+t53ztQjz2zcoSpyrJ7ZabSpvO3Vu2L36Zko= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai-Heng Feng , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Jani Nikula Subject: [PATCH 5.12 272/363] drm/i915/dp: Use slow and wide link training for everything Date: Mon, 17 May 2021 16:02:18 +0200 Message-Id: <20210517140311.812995043@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kai-Heng Feng commit a5c936add6a23c15c6ae538ab7a12f80751fdf0f upstream. Screen flickers on Innolux eDP 1.3 panel when clock rate 540000 is in use. According to the panel vendor, though clock rate 540000 is advertised, but the max clock rate it really supports is 270000. Ville Syrjälä mentioned that fast and narrow also breaks some eDP 1.4 panel, so use slow and wide training for all panels to resolve the issue. User also confirmed that the new strategy doesn't introduce any regression on XPS 9380. v2: - Use slow and wide for everything. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3384 Signed-off-by: Kai-Heng Feng Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210421052054.1434718-1-kai.heng.feng@canonical.com (cherry picked from commit acca7762eb71bc05a8f28d29320d193150051f79) Fixes: 2bbd6dba84d4 ("drm/i915: Try to use fast+narrow link on eDP again and fall back to the old max strategy on failure") Cc: # v5.12+ Signed-off-by: Jani Nikula Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/display/intel_dp.c | 59 ++------------------------------ 1 file changed, 5 insertions(+), 54 deletions(-) --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -1174,44 +1174,6 @@ intel_dp_compute_link_config_wide(struct return -EINVAL; } -/* Optimize link config in order: max bpp, min lanes, min clock */ -static int -intel_dp_compute_link_config_fast(struct intel_dp *intel_dp, - struct intel_crtc_state *pipe_config, - const struct link_config_limits *limits) -{ - const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; - int bpp, clock, lane_count; - int mode_rate, link_clock, link_avail; - - for (bpp = limits->max_bpp; bpp >= limits->min_bpp; bpp -= 2 * 3) { - int output_bpp = intel_dp_output_bpp(pipe_config->output_format, bpp); - - mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock, - output_bpp); - - for (lane_count = limits->min_lane_count; - lane_count <= limits->max_lane_count; - lane_count <<= 1) { - for (clock = limits->min_clock; clock <= limits->max_clock; clock++) { - link_clock = intel_dp->common_rates[clock]; - link_avail = intel_dp_max_data_rate(link_clock, - lane_count); - - if (mode_rate <= link_avail) { - pipe_config->lane_count = lane_count; - pipe_config->pipe_bpp = bpp; - pipe_config->port_clock = link_clock; - - return 0; - } - } - } - } - - return -EINVAL; -} - static int intel_dp_dsc_compute_bpp(struct intel_dp *intel_dp, u8 dsc_max_bpc) { int i, num_bpc; @@ -1461,22 +1423,11 @@ intel_dp_compute_link_config(struct inte intel_dp_can_bigjoiner(intel_dp)) pipe_config->bigjoiner = true; - if (intel_dp_is_edp(intel_dp)) - /* - * Optimize for fast and narrow. eDP 1.3 section 3.3 and eDP 1.4 - * section A.1: "It is recommended that the minimum number of - * lanes be used, using the minimum link rate allowed for that - * lane configuration." - * - * Note that we fall back to the max clock and lane count for eDP - * panels that fail with the fast optimal settings (see - * intel_dp->use_max_params), in which case the fast vs. wide - * choice doesn't matter. - */ - ret = intel_dp_compute_link_config_fast(intel_dp, pipe_config, &limits); - else - /* Optimize for slow and wide. */ - ret = intel_dp_compute_link_config_wide(intel_dp, pipe_config, &limits); + /* + * Optimize for slow and wide for everything, because there are some + * eDP 1.3 and 1.4 panels don't work well with fast and narrow. + */ + ret = intel_dp_compute_link_config_wide(intel_dp, pipe_config, &limits); /* enable compression if the mode doesn't fit available BW */ drm_dbg_kms(&i915->drm, "Force DSC en = %d\n", intel_dp->force_dsc_en);