From patchwork Thu Apr 7 16:45:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthew Auld X-Patchwork-Id: 12805507 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 0876CC433EF for ; Thu, 7 Apr 2022 16:46:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EA7A310EBA9; Thu, 7 Apr 2022 16:46:34 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 47EC110E290; Thu, 7 Apr 2022 16:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649349993; x=1680885993; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DBMCO4V0RJ/UUY2J1irP3zA6T34+ts+T70cp8fvTGQI=; b=i1hUGajKFCfS9vXQyzkaBlmPPhJD4E+cxx0EPbHdiK95mOwo5Bl2apb6 Y21vfZvDanDgSnmd9srxKoZ6aFspW/139W7L0tiza/DQxxESykUQrI3YL 4EeOnklQecTenI7sSF/LkOJsH0TSwU/eW23dEMoVZrgJihZD5n+/FsxBu xIkHJCMtx9a599MeUJcou4uTvorlbO3KhmTyxLquN4pyPOm8w9HerbtN0 5tTxsqaY8uQ4CFDlTECxg8J/Y1pNwo1Mr1J4tgWg3GSwJMTIgEBaXyqfI xbr3fY7Toc4gFUTPZOIWlXOWk7d5eogMLgIbma5aXKpJRaPB+JEAsfweP w==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="261072539" X-IronPort-AV: E=Sophos;i="5.90,242,1643702400"; d="scan'208";a="261072539" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 09:46:32 -0700 X-IronPort-AV: E=Sophos;i="5.90,242,1643702400"; d="scan'208";a="571134188" Received: from doboyle-mobl1.ger.corp.intel.com (HELO mwauld-desk1.intel.com) ([10.252.21.221]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 09:46:31 -0700 From: Matthew Auld To: intel-gfx@lists.freedesktop.org Date: Thu, 7 Apr 2022 17:45:31 +0100 Message-Id: <20220407164532.1242578-1-matthew.auld@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/2] drm/i915: fix broken build 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: , Cc: Daniel Vetter , =?utf-8?q?Christian_K=C3=B6nig?= , dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" I guess this was missed in the conversion or something. Fixes: 7bc80a5462c3 ("dma-buf: add enum dma_resv_usage v4") Signed-off-by: Matthew Auld Cc: Christian König Cc: Daniel Vetter --- drivers/gpu/drm/i915/i915_deps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_deps.c b/drivers/gpu/drm/i915/i915_deps.c index 999210b37325..297b8e4e42ee 100644 --- a/drivers/gpu/drm/i915/i915_deps.c +++ b/drivers/gpu/drm/i915/i915_deps.c @@ -226,7 +226,7 @@ int i915_deps_add_resv(struct i915_deps *deps, struct dma_resv *resv, struct dma_fence *fence; dma_resv_assert_held(resv); - dma_resv_for_each_fence(&iter, resv, true, fence) { + dma_resv_for_each_fence(&iter, resv, dma_resv_usage_rw(true), fence) { int ret = i915_deps_add_dependency(deps, fence, ctx); if (ret) From patchwork Thu Apr 7 16:45:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthew Auld X-Patchwork-Id: 12805508 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 7D03EC433F5 for ; Thu, 7 Apr 2022 16:46:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A28810EBB0; Thu, 7 Apr 2022 16:46:36 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 310C810EBB8; Thu, 7 Apr 2022 16:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649349995; x=1680885995; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pxnLBsZkLxM5FIR2EQVi8iRUo6Zc0poGZ/FgPcXoFEs=; b=i/1AtBfljBWI3oyJpBh8H6OBNPgKUUWP6PMNG/5/qTXQ5TcorrmLOqyw XPBFmN+mHRFuvko6nQKLM94D4eDu/34WdOz1nITMIRljZOFJFAIC2TaUK nEYZelwoqLT5LtORc0GNbRNZKh0zrKHNJY9GMxc/Uc/lgwtUxSzMHUxPD tSShK8tuae40tC581oYqXIAuyqg+4t8/2WgJcobUZNdV0+33FgBNGjeZT crF3VPJMF7H5GVS469G5fOEV35aS3f4+71fXR/6GdOmgReD//xTNimbTV 8/bDiQXS8wwh9iNq/3RWGX1UD9YfXPlTU/x0AQrhlrpYcGJnhLmfQb9IX A==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="261072557" X-IronPort-AV: E=Sophos;i="5.90,242,1643702400"; d="scan'208";a="261072557" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 09:46:35 -0700 X-IronPort-AV: E=Sophos;i="5.90,242,1643702400"; d="scan'208";a="571134198" Received: from doboyle-mobl1.ger.corp.intel.com (HELO mwauld-desk1.intel.com) ([10.252.21.221]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 09:46:33 -0700 From: Matthew Auld To: intel-gfx@lists.freedesktop.org Date: Thu, 7 Apr 2022 17:45:32 +0100 Message-Id: <20220407164532.1242578-2-matthew.auld@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220407164532.1242578-1-matthew.auld@intel.com> References: <20220407164532.1242578-1-matthew.auld@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/2] drm/i915: fix i915_gem_object_wait_moving_fence 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: , Cc: Daniel Vetter , =?utf-8?q?Christian_K=C3=B6nig?= , dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" All of CI is just failing with the following, which prevents loading of the module: i915 0000:03:00.0: [drm] *ERROR* Scratch setup failed Best guess is that this comes from the pin_map() for the scratch page, which does an i915_gem_object_wait_moving_fence() somewhere. It looks like this now calls into dma_resv_wait_timeout() which can return the remaining timeout, leading to the caller thinking this is an error. Fixes: 1d7f5e6c5240 ("drm/i915: drop bo->moving dependency") Signed-off-by: Matthew Auld Cc: Christian König Cc: Daniel Vetter Acked-by: Lucas De Marchi --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c index 2998d895a6b3..1c88d4121658 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c @@ -772,9 +772,14 @@ int i915_gem_object_get_moving_fence(struct drm_i915_gem_object *obj, int i915_gem_object_wait_moving_fence(struct drm_i915_gem_object *obj, bool intr) { + long ret; + assert_object_held(obj); - return dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL, - intr, MAX_SCHEDULE_TIMEOUT); + + ret = dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL, + intr, MAX_SCHEDULE_TIMEOUT); + + return ret < 0 ? ret : 0; } #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)