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 3DEB4C79F86 for ; Fri, 4 Sep 2026 02:22:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC83910F846; Fri, 4 Sep 2026 02:22:23 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="ZGzBpqI7"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by gabe.freedesktop.org (Postfix) with ESMTPS id B13D110F81B for ; Fri, 4 Sep 2026 02:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1788488536; x=1820024536; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=Ic9s6mNoJFXioPYgZCgz5bN7h1kIG//EkMGnKGPeS2U=; b=ZGzBpqI7kD+JUxT++dCSRHU0tjoxo1WywuWcM1yQjtJpsh6NcLXpkIFW gtXXiohWdMf8FVIOxoczfFONk88reg1ydljB89BXAOF+U3R0LEVcdHVwt 5O8aIh8rs7VM+RO4M8jWIRFqhkyTekFsAV4OZ0Rtrf2oO15rOt8Pmkr8/ fLWFQryE3iHW5PmeFCIvPIHXfcfV9TdCCsTzPFDm8zq+Kva8PDTjaaWcO XY8JclSIm6m5K9hvv+Mms9NfrIA3Ksauvv1v5R/tXujmmZxaOnsoDArxl VyNL+WJnex17M5AVYjLLDqFVNuwYyJKZWIJkjdIqZ0PbotH48fqt+Xuwr Q==; X-CSE-ConnectionGUID: iBCBY7FcSMyS6XUV77zXqQ== X-CSE-MsgGUID: GNn2rtxmSW+dtd6P/H3h6A== X-IronPort-AV: E=McAfee;i="6800,10657,11895"; a="106506294" X-IronPort-AV: E=Sophos;i="6.25,260,1779174000"; d="scan'208";a="106506294" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2026 19:22:16 -0700 X-CSE-ConnectionGUID: 9/Iv2nGaRty46+UwXfdHbg== X-CSE-MsgGUID: zhA3/A9cShKjwT4HY0UMrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,260,1779174000"; d="scan'208";a="275185139" Received: from gsse-cloud1.jf.intel.com ([10.54.39.91]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2026 19:22:15 -0700 From: Matthew Brost To: intel-xe@lists.freedesktop.org Subject: [PATCH v5 22/25] drm/xe: Add ULLS migration job support to GuC submission Date: Thu, 3 Sep 2026 19:22:04 -0700 Message-Id: <20260904022207.3490018-23-matthew.brost@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260904022207.3490018-1-matthew.brost@intel.com> References: <20260904022207.3490018-1-matthew.brost@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" Add ULLS migration job support to GuC submission backend. Changes required: - On migration queue, reduce max jobs to the number of ULLS semaphores minus one - Directly set the hardware engine tail via a MMIO write for ULLS jobs except for first ULLS job - Set ULLS sempahore for current job releasing last job except for first ULLS job - Suppress submit H2G for ULLS except for first ULLS job Signed-off-by: Matthew Brost Link: https://patch.msgid.link/20260228013501.106680-24-matthew.brost@intel.com Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/xe/xe_guc_submit.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index dcb4b8a4f3b7..1578d80b01b8 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -1207,6 +1207,11 @@ static void submit_exec_queue(struct xe_exec_queue *q, struct xe_sched_job *job) if (exec_queue_suspended(q)) return; + if (job->is_ulls && !job->is_ulls_first) { + xe_hw_engine_write_ring_tail(q->hwe, lrc->ring.tail); + xe_lrc_set_ulls_semaphore(lrc, xe_sched_job_lrc_seqno(job)); + } + if (!exec_queue_enabled(q)) { action[len++] = XE_GUC_ACTION_SCHED_CONTEXT_MODE_SET; action[len++] = q->guc->id; @@ -1220,13 +1225,14 @@ static void submit_exec_queue(struct xe_exec_queue *q, struct xe_sched_job *job) set_exec_queue_pending_enable(q); set_exec_queue_enabled(q); trace_xe_exec_queue_scheduling_enable(q); - } else { + } else if (!job->is_ulls || job->is_ulls_first) { action[len++] = XE_GUC_ACTION_SCHED_CONTEXT; action[len++] = q->guc->id; trace_xe_exec_queue_submit(q); } - xe_guc_ct_send(&guc->ct, action, len, g2h_len, num_g2h); + if (!job->is_ulls || job->is_ulls_first || num_g2h) + xe_guc_ct_send(&guc->ct, action, len, g2h_len, num_g2h); if (extra_submit) { len = 0; @@ -2088,6 +2094,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) struct xe_guc_exec_queue *ge; long timeout; int err, i; + int max_jobs = (xe_lrc_ring_size() / MAX_JOB_SIZE_BYTES); xe_gt_assert(guc_to_gt(guc), xe_device_uc_enabled(guc_to_xe(guc))); @@ -2127,8 +2134,11 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) submit_wq = primary->guc->sched.base.submit_wq; } + if (q->vm && q->vm->flags & XE_VM_FLAG_MIGRATION) + max_jobs = min(max_jobs, LRC_MIGRATION_ULLS_SEMAPHORE_COUNT - 1); + err = xe_sched_init(&ge->sched, &drm_sched_ops, &xe_sched_ops, - submit_wq, xe_lrc_ring_size() / MAX_JOB_SIZE_BYTES, 64, + submit_wq, max_jobs, 64, timeout, guc_to_gt(guc)->ordered_wq, NULL, ge->name, gt_to_xe(q->gt)->drm.dev); if (err) -- 2.34.1