Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3108790pxm; Mon, 28 Feb 2022 12:11:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzr5P9iK+ZB159ynOf8IVC8ABPT4ZB9u2u7wxsLFp8vYEPhonMDZZC/zl4kCjviefsB3WDI X-Received: by 2002:a17:902:76ca:b0:14d:8c80:dbda with SMTP id j10-20020a17090276ca00b0014d8c80dbdamr22816986plt.152.1646079073478; Mon, 28 Feb 2022 12:11:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079073; cv=none; d=google.com; s=arc-20160816; b=BrxGh1yU0VaCv9M8qGOpAu5qxHCGQ5KUhgfq1tzVk+x9Z/N9oYcxk/usK69ddFzH6F jPyo6kmWqxpwbQ/YRdwQXOM06tQOb3XVwDmxi+u2iYpVHhUQdzMLNIVLPqAou1nh9mdD X7YhoEn5X26vDEMuE3myu3g/zR4SaCPQ8d0AND3bp5l9olv6Ctn4/nrYDko8qclOXvtR jKm1nFeTpyIzub06gkVMBzh+jfvL+DkTppCCNDyaqLcPytO6B98tVxnP8ni6+j77gido wZVBLuIhfzmUj1VultuBW31z3vwXJ8mC8KwZDEK9vJxZuikJGNrvfRJOMKf6jlrSZwqB N9Nw== 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=pwGviaoT1V1pI2+XegetNvX1fQJxVpY80hUPdWjTOyc=; b=y6gu+MFdeF1bfGscrEgfmeMEACX7NARCcIQNs7Tt+9Ulr4lJpPU+GGKp7l6v7X+M/0 sIFC50QhOh9TTQM6ABL/T1iKmmqz/rqjnp8KeN0vr+sKOA51xu+Q/ICqwgTyKhjdyflJ qfbRcdNKkFALl8KltanenyW2HbB3W1cDvR8qQEwjKj8XcHvYFpS7y8g2NDIMS561v+1u C4WLNYCDJ0UaX55UwYb2Jmy+jSRy5GXW5BlkQqnyUNDaOqxHTAjJe0hMV4Ib0KKmLvKB si3jelKyeKvoo5PBAD/PInFI/69YJ92AKIN3bb6UjcLrzYHImYaW4glHq3pedLNbGcGF IB9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C6aDWtSF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t4-20020a17090a024400b001bca5dbbcd5si366370pje.107.2022.02.28.12.11.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:11:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C6aDWtSF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 277B9151C71; Mon, 28 Feb 2022 11:34:52 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233770AbiB1SFt (ORCPT + 99 others); Mon, 28 Feb 2022 13:05:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239983AbiB1R7J (ORCPT ); Mon, 28 Feb 2022 12:59:09 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A22785B3E6; Mon, 28 Feb 2022 09:45:15 -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 sin.source.kernel.org (Postfix) with ESMTPS id 547C4CE17D1; Mon, 28 Feb 2022 17:45:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 648B9C340E7; Mon, 28 Feb 2022 17:45:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070308; bh=0+G/jHiDBvpeRX0yJRZinnxdfXV2KZtk2TgUzypQAWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C6aDWtSFOEWNrapkbjNYsCTIEBObqTi32EOs+lfB6gf0kDtZfeUy+k0SDKsLcOjB9 qr/hM15WnXzB+1vmds9oAo0euODU+a3TSdiKRo8Y29AitxoBrZf///sbKkWdP3D5uM MrCy6xPxYFQRfrPZOzA51A/pV+EH36RqsHhrWSEU= 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.16 025/164] drm/i915: Correctly populate use_sagv_wm for all pipes Date: Mon, 28 Feb 2022 18:23:07 +0100 Message-Id: <20220228172402.400359034@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172359.567256961@linuxfoundation.org> References: <20220228172359.567256961@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 @@ -4019,6 +4019,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; @@ -4034,17 +4045,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; }