Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4365595ioa; Wed, 27 Apr 2022 02:03:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2dYJ2V9ZrkkMAraRCNjwcPBlGki9d3FSHCdKnS1rbYjMhlLhUICppKa7U6I4wkNmOvs9C X-Received: by 2002:a17:902:d70e:b0:156:1b99:e909 with SMTP id w14-20020a170902d70e00b001561b99e909mr28188311ply.155.1651050237936; Wed, 27 Apr 2022 02:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651050237; cv=none; d=google.com; s=arc-20160816; b=nHrS8POxI0qwZ6avLco5mlYguUWQnt60FT4blHEYl3v/16HGy/EBDTJgf9U5czYIls FE9lZfr0tUG7f0gJbNngq0VgQlpJJeEdQToHu0rqSLm2Pj64GmGcdh+fXq3+rd2ZvOKN RGlN3Ok1Wwto0EHtcz4l1r0RFjeWy4UzAP4dvhDD1HU3w76tt7/57TByvE0EYj8gBmaO NCRPAXNbHvgbyFO+Mf1jdsYZ6lO5QcEn2CJTdiALUF7rsQMoQhuq4bELF+Tcirg0D3RB ogMYA2RuopnROv/PkgwlCgxMvFL2H0e6D+m5xn4FVaaRUaeWekDK1k7capyGtnNtZ2lv QkDQ== 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=wcuzNqcB1SxU1p5bv0TDQVQLLuO8MvdzJSExj5KTPlM=; b=uo9GWndc2uzT42RKAIg9gqTLmhg3O9Tpatl5vkEmzxwEGObYtXJtAVtuilbdcGbiF9 bnoWS2YxJDfvidRQ9AIZVgRqubR7q4TRGp6dDO/mbH/+0lnVzbq67G2sDVS/txylDtke ziGKl9AaddrchVYsqBL/k2Zh/iLazXTfx+YmcYzbhoe+RT3YxyK/8kK9M1BBfYT4AkkE Z2kqgu3rcSNR3+sdseJ/D8n5NKOaBiTZ63I+/NW1HLEKiWHOaLKydn0DHjW2VAnPbd5D 6nlGdSrC47/MYlBjSqaeDZ4CGpnV2BCSb1Z7kszyNSk4Mm2hCov81KJCyKtXN5jTrq/6 yeXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1M5N9kg+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m2-20020a635802000000b003ab421132b0si960604pgb.235.2022.04.27.02.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 02:03:57 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1M5N9kg+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A4B9D1EC627; Wed, 27 Apr 2022 01:59:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346850AbiDZJJQ (ORCPT + 99 others); Tue, 26 Apr 2022 05:09:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346315AbiDZIuB (ORCPT ); Tue, 26 Apr 2022 04:50:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7960FC8BCE; Tue, 26 Apr 2022 01:38:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 33F1DB81CFA; Tue, 26 Apr 2022 08:38:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 823F7C385A4; Tue, 26 Apr 2022 08:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962284; bh=mtv+VgBzDjnbTuKpFHhkxzk0FgNmf/fS99cTFIUNMfs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1M5N9kg+GFgS6J2J7GpZKC3lqfbXjU8nwojMQHm6sW53X0b+4d8bFW5j6sebYc40V M3iZdA8VTwzQDLXK088mCfbMJeiv0onNCyChdaiReiLFLdXqGYhaTtsmXAJUE+K0Fj jc4SLx25MmBoV45ny+RV9+TXarctddxxmAQEI/+o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Jouni=20H=C3=B6gander?= , =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= , Joonas Lahtinen , Sasha Levin Subject: [PATCH 5.15 046/124] drm/i915/display/psr: Unset enable_psr2_sel_fetch if other checks in intel_psr2_config_valid() fails Date: Tue, 26 Apr 2022 10:20:47 +0200 Message-Id: <20220426081748.611187531@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: José Roberto de Souza [ Upstream commit bb02330408a7bde33b5f46aa14fd5d7bfe6093b7 ] If any of the PSR2 checks after intel_psr2_sel_fetch_config_valid() fails, enable_psr2_sel_fetch will be kept enabled causing problems in the functions that only checks for it and not for has_psr2. So here moving the check that do not depend on enable_psr2_sel_fetch and for the remaning ones jumping to a section that unset enable_psr2_sel_fetch in case of failure to support PSR2. Fixes: 6e43e276b8c9 ("drm/i915: Initial implementation of PSR2 selective fetch") Cc: Jouni Högander Reviewed-by: Jouni Högander Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220414151118.21980-1-jose.souza@intel.com (cherry picked from commit 554ae8dce1268789e72767a67f0635cb743b3cea) Signed-off-by: Joonas Lahtinen Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/display/intel_psr.c | 38 +++++++++++++----------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 1b0daf649e82..a3d0c57ec0f0 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -936,6 +936,20 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp, return false; } + /* Wa_16011303918:adl-p */ + if (crtc_state->vrr.enable && + IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) { + drm_dbg_kms(&dev_priv->drm, + "PSR2 not enabled, not compatible with HW stepping + VRR\n"); + return false; + } + + if (!_compute_psr2_sdp_prior_scanline_indication(intel_dp, crtc_state)) { + drm_dbg_kms(&dev_priv->drm, + "PSR2 not enabled, PSR2 SDP indication do not fit in hblank\n"); + return false; + } + if (HAS_PSR2_SEL_FETCH(dev_priv)) { if (!intel_psr2_sel_fetch_config_valid(intel_dp, crtc_state) && !HAS_PSR_HW_TRACKING(dev_priv)) { @@ -949,12 +963,12 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp, if (!crtc_state->enable_psr2_sel_fetch && IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_C0)) { drm_dbg_kms(&dev_priv->drm, "PSR2 HW tracking is not supported this Display stepping\n"); - return false; + goto unsupported; } if (!psr2_granularity_check(intel_dp, crtc_state)) { drm_dbg_kms(&dev_priv->drm, "PSR2 not enabled, SU granularity not compatible\n"); - return false; + goto unsupported; } if (!crtc_state->enable_psr2_sel_fetch && @@ -963,25 +977,15 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp, "PSR2 not enabled, resolution %dx%d > max supported %dx%d\n", crtc_hdisplay, crtc_vdisplay, psr_max_h, psr_max_v); - return false; - } - - if (!_compute_psr2_sdp_prior_scanline_indication(intel_dp, crtc_state)) { - drm_dbg_kms(&dev_priv->drm, - "PSR2 not enabled, PSR2 SDP indication do not fit in hblank\n"); - return false; - } - - /* Wa_16011303918:adl-p */ - if (crtc_state->vrr.enable && - IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) { - drm_dbg_kms(&dev_priv->drm, - "PSR2 not enabled, not compatible with HW stepping + VRR\n"); - return false; + goto unsupported; } tgl_dc3co_exitline_compute_config(intel_dp, crtc_state); return true; + +unsupported: + crtc_state->enable_psr2_sel_fetch = false; + return false; } void intel_psr_compute_config(struct intel_dp *intel_dp, -- 2.35.1