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 ADA9FE7E632 for ; Tue, 26 Sep 2023 13:03:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 823BF10E3E1; Tue, 26 Sep 2023 13:03:07 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id DF2FB10E3E2 for ; Tue, 26 Sep 2023 13:03:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695733383; x=1727269383; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pxWiebBYRgKoN5BN231bLTbKsYxoY7H3nNj94ceFIY0=; b=i3dbBKkZoUxggpD4NYV7iSSkPWNK6+TFDSRn+MiqUwbhNrcAD1TUkcsK KgmbwUfAZXCxwU1CrfjzBIfp/R6awgPPXaBAI1NXbob1to1Z6jjgVUqMs EB230OSFKoefv+bfiM1Cb1+xomOkdmkDbIFKpwoK0ELcw/lQnl3ZJ5fBQ A4HUQHaNWSYHvY2259TFIiABaryDHyow1spTq8Rvj/3/dWL0EXtqv/6yd J/M9TFUFtpNx5o2HQG8vGcXPFTjbIxA/tSfoTzjKEt0h3Ufkp4cIE/a1I ybBDGsGUAXdHk2gj2t+9le6SDfpGjX9NsrbqXSTSH7vzUX1uUCO/AXhuT g==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="366617127" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="366617127" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 05:56:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="139560" Received: from hblancoa-mobl2.ger.corp.intel.com (HELO localhost.localdomain) ([10.252.50.200]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 05:56:08 -0700 From: Francois Dugast To: intel-xe@lists.freedesktop.org Date: Tue, 26 Sep 2023 12:55:19 +0000 Message-Id: <20230926125540.7-10-francois.dugast@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230926125540.7-1-francois.dugast@intel.com> References: <20230926125540.7-1-francois.dugast@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Intel-xe] [PATCH v3 09/30] drm/xe: Rename exec_queue_kill_compute to xe_vm_remove_compute_exec_queue 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: , Cc: Rodrigo Vivi Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" From: Matthew Brost Much better name and aligns with xe_vm_add_compute_exec_queue. As part of the rename, move the implementation from xe_exec_queue.c to xe_vm.c. Suggested-by: Niranjana Vishwanathapura Signed-off-by: Matthew Brost Reviewed-by: Niranjana Vishwanathapura Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/xe/xe_exec_queue.c | 20 ++------------------ drivers/gpu/drm/xe/xe_vm.c | 21 +++++++++++++++++++++ drivers/gpu/drm/xe/xe_vm.h | 1 + 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c index 68cd2234acf5..170d9d9c48d2 100644 --- a/drivers/gpu/drm/xe/xe_exec_queue.c +++ b/drivers/gpu/drm/xe/xe_exec_queue.c @@ -775,22 +775,6 @@ int xe_exec_queue_get_property_ioctl(struct drm_device *dev, void *data, return ret; } -static void exec_queue_kill_compute(struct xe_exec_queue *q) -{ - if (!xe_vm_in_compute_mode(q->vm)) - return; - - down_write(&q->vm->lock); - list_del(&q->compute.link); - --q->vm->preempt.num_exec_queues; - if (q->compute.pfence) { - dma_fence_enable_sw_signaling(q->compute.pfence); - dma_fence_put(q->compute.pfence); - q->compute.pfence = NULL; - } - up_write(&q->vm->lock); -} - /** * xe_exec_queue_is_lr() - Whether an exec_queue is long-running * @q: The exec_queue @@ -861,11 +845,11 @@ void xe_exec_queue_kill(struct xe_exec_queue *q) list_for_each_entry_safe(eq, next, &eq->multi_gt_list, multi_gt_link) { q->ops->kill(eq); - exec_queue_kill_compute(eq); + xe_vm_remove_compute_exec_queue(q->vm, eq); } q->ops->kill(q); - exec_queue_kill_compute(q); + xe_vm_remove_compute_exec_queue(q->vm, q); } int xe_exec_queue_destroy_ioctl(struct drm_device *dev, void *data, diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index e84002555d34..8f00f979d5b5 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -381,6 +381,27 @@ int xe_vm_add_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q) return err; } +/** + * xe_vm_remove_compute_exec_queue() - Remove compute exec queue from VM + * @vm: The VM. + * @q: The exec_queue + */ +void xe_vm_remove_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q) +{ + if (!xe_vm_in_compute_mode(vm)) + return; + + down_write(&vm->lock); + list_del(&q->compute.link); + --vm->preempt.num_exec_queues; + if (q->compute.pfence) { + dma_fence_enable_sw_signaling(q->compute.pfence); + dma_fence_put(q->compute.pfence); + q->compute.pfence = NULL; + } + up_write(&vm->lock); +} + /** * __xe_vm_userptr_needs_repin() - Check whether the VM does have userptrs * that need repinning. diff --git a/drivers/gpu/drm/xe/xe_vm.h b/drivers/gpu/drm/xe/xe_vm.h index f966ed39b711..ceae9c1be697 100644 --- a/drivers/gpu/drm/xe/xe_vm.h +++ b/drivers/gpu/drm/xe/xe_vm.h @@ -168,6 +168,7 @@ static inline bool xe_vm_no_dma_fences(struct xe_vm *vm) } int xe_vm_add_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q); +void xe_vm_remove_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q); int xe_vm_userptr_pin(struct xe_vm *vm); -- 2.34.1