From nobody Fri Oct 17 10:31:35 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D872C4332F for ; Wed, 19 Oct 2022 10:47:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233661AbiJSKre (ORCPT ); Wed, 19 Oct 2022 06:47:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232715AbiJSKpU (ORCPT ); Wed, 19 Oct 2022 06:45:20 -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 3CE6D118766; Wed, 19 Oct 2022 03:21:29 -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 B44B5B82315; Wed, 19 Oct 2022 08:46:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED665C433B5; Wed, 19 Oct 2022 08:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169195; bh=EvVp/KIs4ddef+5+zGPr/+WMP5WJiBafZuZGyLqw2bM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YAobm5eErV2G13MdTFgTS5Onx0F+4QXR32AEkBxgi2mri6UaeCgmphT0z+tTGajLg uNmi2YTDbC8CmNqZxO0MADpNPia1fxBbTw4JL/zwUnYDToqfgmkC3GH0NckIsoyZ4N r0HuDpoXEj+HUb2miN6C5ot+M42FeMG+zkYxSr5U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Matthew Auld , intel-gfx@lists.freedesktop.org, David de Sousa , Andrzej Hajda , Tvrtko Ursulin , Kevin Boulain Subject: [PATCH 6.0 189/862] drm/i915: Fix display problems after resume Date: Wed, 19 Oct 2022 10:24:36 +0200 Message-Id: <20221019083258.329800967@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Hellstr=C3=B6m commit 6c482c62a635aa4f534d2439fbf8afa37452b986 upstream. Commit 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt binding / unbinding") introduced a regression that due to the vma resource tracking of the binding state, dpt ptes were not correctly repopulated. Fix this by clearing the vma resource state before repopulating. The state will subsequently be restored by the bind_vma operation. Fixes: 39a2bd34c933 ("drm/i915: Use the vma resource as argument for gtt bi= nding / unbinding") Signed-off-by: Thomas Hellstr=C3=B6m Link: https://patchwork.freedesktop.org/patch/msgid/20220912121957.31310-1-= thomas.hellstrom@linux.intel.com Cc: Matthew Auld Cc: intel-gfx@lists.freedesktop.org Cc: # v5.18+ Reported-and-tested-by: Kevin Boulain Tested-by: David de Sousa Reviewed-by: Matthew Auld Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20221005121159.340245-1= -thomas.hellstrom@linux.intel.com (cherry picked from commit bc2472538c0d1cce334ffc9e97df0614cd2b1469) Signed-off-by: Tvrtko Ursulin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/gt/intel_ggtt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c @@ -1267,10 +1267,16 @@ bool i915_ggtt_resume_vm(struct i915_add atomic_read(&vma->flags) & I915_VMA_BIND_MASK; =20 GEM_BUG_ON(!was_bound); - if (!retained_ptes) + if (!retained_ptes) { + /* + * Clear the bound flags of the vma resource to allow + * ptes to be repopulated. + */ + vma->resource->bound_flags =3D 0; vma->ops->bind_vma(vm, NULL, vma->resource, obj ? obj->cache_level : 0, was_bound); + } if (obj) { /* only used during resume =3D> exclusive access */ write_domain_objs |=3D fetch_and_zero(&obj->write_domain); obj->read_domains |=3D I915_GEM_DOMAIN_GTT;