From mboxrd@z Thu Jan 1 00:00:00 1970 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 03DEFCD80A6 for ; Tue, 10 Oct 2023 11:07:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3E9010E337; Tue, 10 Oct 2023 11:07:30 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5037D10E337 for ; Tue, 10 Oct 2023 11:07:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696936048; x=1728472048; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=QxXQQWZWBTgoHWxNIzYtzxSyI//KODspr3b2Uu8Gjsc=; b=NWhBzvrzQAZUOQLzgX+vh8G3BENgXfeDzJmnQETyFM5QdNBmJiEUXgo6 EPgw1mYYbqZ9MmBw2b5N0CAxxj3pt/Tr8+15PzFICL+QC8qSnXrwrUccg knIhCr+qtJBAF2Am3VRs+mQ0CVqhkDDf2pmBYHE/DU50+++v1Py6nD8zQ wk+eVoA0E4tJFbx/A52oxwdgk1G6O5SChsOZJf4yhTrvjHMVaU3ExLs+D aYtTu6D7QFmJjwtIgLfu4TEXkgdp42W5XzI2kSJ61wFX7dnyz9dCTABUU poNqv+Cr10utOiJPi/gEOGgmobmUfFbHRuNQOGBwOgC8bmK8/pOdZcG/k A==; X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="387204040" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="387204040" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 04:07:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="757074839" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="757074839" Received: from agargas-mobl.ger.corp.intel.com (HELO fedora..) ([10.249.254.164]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 04:07:27 -0700 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= To: intel-xe@lists.freedesktop.org Date: Tue, 10 Oct 2023 13:07:09 +0200 Message-ID: <20231010110711.25616-9-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231010110711.25616-1-thomas.hellstrom@linux.intel.com> References: <20231010110711.25616-1-thomas.hellstrom@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Intel-xe] [CI 09/11] drm/gpuvm: Local fixes X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Fixes to v6 where we anticipate change. Signed-off-by: Thomas Hellström --- drivers/gpu/drm/drm_gpuvm.c | 14 +++++++------- drivers/gpu/drm/xe/xe_vm.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index c0d41ad236a5..e089d030d771 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -1068,8 +1068,10 @@ drm_gpuvm_prepare_objects_locked(struct drm_gpuvm *gpuvm, if (ret) break; - if (vm_bo->evicted) + if (vm_bo->evicted) { drm_gpuvm_bo_list_add(vm_bo, evict, false); + vm_bo->evicted = false; + } } return ret; @@ -1387,7 +1389,7 @@ drm_gpuvm_resv_add_fence(struct drm_gpuvm *gpuvm, dma_resv_assert_held(obj->resv); dma_resv_add_fence(obj->resv, fence, drm_gpuvm_is_extobj(gpuvm, obj) ? - private_usage : extobj_usage); + extobj_usage : private_usage); } } EXPORT_SYMBOL_GPL(drm_gpuvm_resv_add_fence); @@ -1626,11 +1628,9 @@ drm_gpuvm_bo_evict(struct drm_gpuvm_bo *vm_bo, bool evict) dma_resv_assert_held(obj->resv); - if (drm_gpuvm_is_extobj(gpuvm, obj)) { - vm_bo->evicted = evict; - - if (!lock) - return; + if (evict && !lock && drm_gpuvm_is_extobj(gpuvm, obj)) { + vm_bo->evicted = true; + return; } if (evict) diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index 31223531cdfe..f44677194cfb 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -1234,7 +1234,7 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags) goto err_no_resv; } - drm_gpuvm_init(&vm->gpuvm, vm_resv_obj, "Xe VM", 0, 0, vm->size, + drm_gpuvm_init(&vm->gpuvm, vm_resv_obj, "Xe VM", 0, vm->size, 0, 0, &gpuvm_ops); -- 2.41.0