From patchwork Wed Oct 19 08:24:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5100 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp250180wrs; Wed, 19 Oct 2022 03:48:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4mjl5T8VaZiB7yilxQlDDrem+fZtgVugTiOXXeillcpwWXyFiEwtbqtSXaJwVWlGD7qgNo X-Received: by 2002:a17:907:7ea7:b0:78d:3638:9018 with SMTP id qb39-20020a1709077ea700b0078d36389018mr6254831ejc.236.1666176502461; Wed, 19 Oct 2022 03:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666176502; cv=none; d=google.com; s=arc-20160816; b=czgjsYVMElS1toQXQO/46+XCqb6xciZ5UwkemCvpSUIMAgoTMkdaDdgRgXsVRoWR5C 7w+PpezpKmeA4qKgYbfELXfYoqfpi9VOGUU6DjXNTb7RE+rfEKRfuZKXlOVu3Y9kev98 f5qEnCIBT/SfE9zAVF6YCArxENzsFt3+osHUpAP3Yfj5N1gWPjCY7hnb8V7j+H3/DJcT cbaZow+l9mXxYeM4ql/p64Bu2Mnw4TiQR8UQGrN7zdp+tX0UmgE0pJlA6ZDKMHDCuXTZ Py5BJFwBhmv8yTTa9Lf7bAEBB/XF6N+wuQ3jOLH9RL/lh1O+zAJkfxjouCC+oIr6ZFcF Zf6w== 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=+FF6tR55L9skBGVg/rJD2lSKl2v9tnGDn1Luhfp2Hmo=; b=BDC4Xtf1B3bZL2W+hwj3SyvSHLB9y/6bhnoeD2ZmbySgFhZL8AArwNhh7nR42rXMsR e7Zbu+to39HK+LxylRsVKRIG83lwxo3SZnz+N194nHMnbyQ6ZZJrmqhPpsy0hsadXTMk P74rf1URY2X1MqHWsF2e0BGTJmDBZW4+aVdR1uJMFQSxKAN8wBZuSRX9sl1yv0CbnDLk hLNcHetk+V0NLhgGPYTu3Y8mG8hxoBL59hbonr1LlR2LX70Jl4CtubOxpdulBJlyxn44 pbGalYytwYZ0OodMHoFmmetMzQ6JbszeJCIzmg50zPaSmpmwbZf8kOuKhiqTubDuTWBj AKWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YAobm5eE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd17-20020a1709069b9100b0077cfec3a52fsi15241121ejc.839.2022.10.19.03.47.54; Wed, 19 Oct 2022 03:48:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YAobm5eE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233627AbiJSKrb (ORCPT + 99 others); Wed, 19 Oct 2022 06:47:31 -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_Hellstr=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 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747112692412260724?= X-GMAIL-MSGID: =?utf-8?q?1747112692412260724?= From: Thomas Hellström 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 binding / unbinding") Signed-off-by: Thomas Hellström 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; 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 = 0; vma->ops->bind_vma(vm, NULL, vma->resource, obj ? obj->cache_level : 0, was_bound); + } if (obj) { /* only used during resume => exclusive access */ write_domain_objs |= fetch_and_zero(&obj->write_domain); obj->read_domains |= I915_GEM_DOMAIN_GTT;