Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3119587pxm; Mon, 28 Feb 2022 12:26:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMtw3HE7JoY2xaBtJmW8zOI9GbDrzQUQqzeUkJro3cl0RLn+DezZq7NkFc5kPUIHTU7nd+ X-Received: by 2002:a17:902:d482:b0:151:7777:856f with SMTP id c2-20020a170902d48200b001517777856fmr2207330plg.165.1646079974439; Mon, 28 Feb 2022 12:26:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079974; cv=none; d=google.com; s=arc-20160816; b=pEb4A2jRZz9+OLzU4ZnDXKYuMSZCaWCCY8uFCURBA3DZ5krGQpUZRy9M7ss/Tfxnkn ntcPWr+W6TaTKYZewY++xMbBgTbHG0dalThL5LKegAsk5QrWFf8wo0gIkNdMv9U1aw/P w551q3I5mFs6LOGRP7BEaBdXgBMxYlCyixpx0MI159ISkMtD+eT8XjQPM6EpAmgBSFQ0 mWJgejzFF7re0afXDrxcTmg8ykB2oA5Pu6XjvBITtMPEd1RlCWGVFxXMaolBu66/PY5t oQXQHsprpzgqtIHuD+IfoDzqzqJHnuCZ7/9LaLlMWAekgWGRWZUQokXQkRD96xsJTH1T BNbA== 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=egY6qhYy7WGBNBfuvYlt+OimlVCAQ+b5DIYifRowqGU=; b=lX9zvEM0Zcyn599CUVh2nq9SmiACnQsQaKyWRDwRpNrMYeacCeZ4XV981jw+NATReK XNkTM5vVMwubkDL5rGo0QeDlZM8omMFCXYyzlC0tHgxlwKDsSX4cCAMbL5pWUtFs4R4z BQze/EiIj3VXwM46Cs3R9sxXsIITsiXFLcoxrYzdE5czt8hvQBQJmyDJ6KRy+ExzvkQA i6qZvGbHd7vz+F6oX+xqs41i4iRcAsWL2mI7H50yeDWMzE4YYdaHJ6yzx5WFmvUUBrJW n/U3wAIz/jIt4QIgWqNgt0tLHOFYr2ZmAR5rGyju36Pob1qVJC82ADNK2P/He/SknofX L+cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Gs3HRtX5; 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 u26-20020a056a00099a00b004f3dc22771fsi8903227pfg.20.2022.02.28.12.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:26:14 -0800 (PST) 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=Gs3HRtX5; 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 730C61E7A60; Mon, 28 Feb 2022 11:44:19 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239045AbiB1Ru7 (ORCPT + 99 others); Mon, 28 Feb 2022 12:50:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239743AbiB1Roc (ORCPT ); Mon, 28 Feb 2022 12:44:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0192989CCE; Mon, 28 Feb 2022 09:37:03 -0800 (PST) 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 17874B815AB; Mon, 28 Feb 2022 17:36:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F50AC340E7; Mon, 28 Feb 2022 17:36:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646069814; bh=8H3ilQxvEFSiNZJR4VwvS7wdjepomJp/3DHWHpzouf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gs3HRtX5JlJ36Na0+99Q2vLcVZeDPRzkZqvWN92U2teoZRdjoegkUPCpeQtJMd2y5 AOblxkS9+83tauHooXVTJEcE2XoZvblqlUctCKKVIxfyemSnLMAzv8mEUUditlHlmS EC0XnUMvXjLZQDjnN33f4ugvKqPxgfwM7ypTx5hI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stanislav Lisovskiy , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Tvrtko Ursulin Subject: [PATCH 5.15 022/139] drm/i915: Correctly populate use_sagv_wm for all pipes Date: Mon, 28 Feb 2022 18:23:16 +0100 Message-Id: <20220228172350.165308597@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172347.614588246@linuxfoundation.org> References: <20220228172347.614588246@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.4 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,T_SCC_BODY_TEXT_LINE 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: Ville Syrjälä commit afc189df6bcc6be65961deb54e15ec60e7f85337 upstream. When changing between SAGV vs. no SAGV on tgl+ we have to update the use_sagv_wm flag for all the crtcs or else an active pipe not already in the state will end up using the wrong watermarks. That is especially bad when we end up with the tighter non-SAGV watermarks with SAGV enabled. Usually ends up in underruns. Cc: stable@vger.kernel.org Reviewed-by: Stanislav Lisovskiy Fixes: 7241c57d3140 ("drm/i915: Add TGL+ SAGV support") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218064039.12834-2-ville.syrjala@linux.intel.com (cherry picked from commit 8dd8ffb824ca7b897ce9f2082ffa7e64831c22dc) Signed-off-by: Tvrtko Ursulin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/intel_pm.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -4020,6 +4020,17 @@ static int intel_compute_sagv_mask(struc return ret; } + if (intel_can_enable_sagv(dev_priv, new_bw_state) != + intel_can_enable_sagv(dev_priv, old_bw_state)) { + ret = intel_atomic_serialize_global_state(&new_bw_state->base); + if (ret) + return ret; + } else if (new_bw_state->pipe_sagv_reject != old_bw_state->pipe_sagv_reject) { + ret = intel_atomic_lock_global_state(&new_bw_state->base); + if (ret) + return ret; + } + for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) { struct skl_pipe_wm *pipe_wm = &new_crtc_state->wm.skl.optimal; @@ -4035,17 +4046,6 @@ static int intel_compute_sagv_mask(struc intel_can_enable_sagv(dev_priv, new_bw_state); } - if (intel_can_enable_sagv(dev_priv, new_bw_state) != - intel_can_enable_sagv(dev_priv, old_bw_state)) { - ret = intel_atomic_serialize_global_state(&new_bw_state->base); - if (ret) - return ret; - } else if (new_bw_state->pipe_sagv_reject != old_bw_state->pipe_sagv_reject) { - ret = intel_atomic_lock_global_state(&new_bw_state->base); - if (ret) - return ret; - } - return 0; }