From patchwork Tue Jun 20 13:03:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 13285818 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B6DEEB64D7 for ; Tue, 20 Jun 2023 13:03:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB8C210E2E1; Tue, 20 Jun 2023 13:03:38 +0000 (UTC) Received: from mblankhorst.nl (lankhorst.se [IPv6:2a02:2308:0:7ec:e79c:4e97:b6c4:f0ae]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8DCAC10E18C for ; Tue, 20 Jun 2023 13:03:36 +0000 (UTC) From: Maarten Lankhorst To: intel-gfx@lists.freedesktop.org Date: Tue, 20 Jun 2023 15:03:29 +0200 Message-Id: <20230620130329.133473-1-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm/i915: Unbind display fb immediately X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Share the pain with xe to test if it hits the same bugs.. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_fb_pin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_fb_pin.c b/drivers/gpu/drm/i915/display/intel_fb_pin.c index fffd568070d41..d89f3d243c7be 100644 --- a/drivers/gpu/drm/i915/display/intel_fb_pin.c +++ b/drivers/gpu/drm/i915/display/intel_fb_pin.c @@ -232,6 +232,11 @@ void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags) if (flags & PLANE_HAS_FENCE) i915_vma_unpin_fence(vma); i915_vma_unpin(vma); + if (!i915_vma_is_pinned(vma)) { + int err = i915_vma_unbind(vma); + if (err) + drm_info(vma->obj->base.dev, "Unpin failed with %i", err); + } i915_vma_put(vma); }