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 CCAEACD8C81 for ; Thu, 4 Jun 2026 16:07:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8628011A175; Thu, 4 Jun 2026 16:07:13 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=lankhorst.se header.i=@lankhorst.se header.b="Syi+Anjz"; dkim-atps=neutral Received: from lankhorst.se (unknown [141.105.120.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id CC50611A167 for ; Thu, 4 Jun 2026 16:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lankhorst.se; s=default; t=1780589227; bh=KY98ggLgnGTP7jx1Nl3XEByNSSt5W8DrXzDyKFI0rLU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Syi+Anjz+kkC9SI5r/7BybfQyyL4+QfqAdl/at+OYs/d3oVF5CD+xfOu6vsxoKm57 1sx2iJXXhHVZacObP/RR1Jx4B7JX6CAxfzu6IvU1ONJSPf0ysQhmNzoIpEkXq0zxcp VUusORljSMiki8q9tM2DLCbOgYiqe6fOv9YPXu5jZT/5EEC0gkus6VOGuoAFoZq7y1 zZmxp/a59KgRG4/NzqArh7i7MPfx4e8fj+Z5yZ6bWEnUQ/MyhyxjnDbAfnaItb5sTh IoUHs34GxOITbKEbJJQL4M6QuIhEXBDFv43l9pamoxwbh3WPPVBgdGaCGfmwLO4SjL U80Lm4aG9FVLA== From: Maarten Lankhorst To: intel-xe@lists.freedesktop.org Subject: [CI 21/24] drm/xe: Add ULLS migration job support to ring ops Date: Thu, 4 Jun 2026 18:06:50 +0200 Message-ID: <20260604160655.50036-22-dev@lankhorst.se> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260604160655.50036-1-dev@lankhorst.se> References: <20260604160655.50036-1-dev@lankhorst.se> 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" From: Matthew Brost Add preamble and postamble for ULLS migrations jobs. Preamble clears current semaphore for reuse. Postamble waits on next semaphore which is set upon next job submission. The last ULLS migration job skips BB submission and postamble (clear current semaphore, write seqno, exit ULLS). Signed-off-by: Matthew Brost Link: https://patch.msgid.link/20260228013501.106680-23-matthew.brost@intel.com Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/xe/xe_ring_ops.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_ring_ops.c b/drivers/gpu/drm/xe/xe_ring_ops.c index 39a670e91ba72..88352c1e4911f 100644 --- a/drivers/gpu/drm/xe/xe_ring_ops.c +++ b/drivers/gpu/drm/xe/xe_ring_ops.c @@ -494,6 +494,27 @@ static void __emit_job_gen12_render_compute(struct xe_sched_job *job, xe_lrc_write_ring(lrc, dw, i * sizeof(*dw)); } +static int emit_ulls_preamble(struct xe_lrc *lrc, u32 *dw, int i, u32 seqno) +{ + u32 addr = xe_lrc_ulls_semaphore_ggtt_addr(lrc, seqno); + + return emit_store_imm_ggtt(addr, LRC_MIGRATION_ULLS_SEMAPORE_CLEAR, + dw, i); +} + +static int emit_ulls_postamble(struct xe_lrc *lrc, u32 *dw, int i, u32 seqno) +{ + dw[i++] = MI_SEMAPHORE_WAIT | + MI_SEMW_GGTT | + MI_SEMW_POLL | + MI_SEMW_COMPARE(SAD_EQ_SDD); + dw[i++] = LRC_MIGRATION_ULLS_SEMAPORE_SIGNAL; + dw[i++] = xe_lrc_ulls_semaphore_ggtt_addr(lrc, seqno + 1); + dw[i++] = 0; + + return i; +} + static void emit_migration_job_gen12(struct xe_sched_job *job, struct xe_lrc *lrc, u32 *head, u32 seqno) @@ -507,10 +528,16 @@ static void emit_migration_job_gen12(struct xe_sched_job *job, xe_gt_assert(gt, !job->ring_ops_force_reset); + if (job->is_ulls) + i = emit_ulls_preamble(lrc, dw, i, seqno); + i = emit_copy_timestamp(xe, lrc, dw, i); i = emit_store_imm_ggtt(saddr, seqno, dw, i); + if (job->is_ulls_last || job->is_ulls_first) + goto seqno_write; + dw[i++] = MI_ARB_ON_OFF | MI_ARB_DISABLE; /* Enabled again below */ i = emit_bb_start(job->ptrs[0].batch_addr, BIT(8), dw, i); @@ -521,12 +548,16 @@ static void emit_migration_job_gen12(struct xe_sched_job *job, i = emit_bb_start(job->ptrs[1].batch_addr, BIT(8), dw, i); +seqno_write: i = emit_flush_imm_ggtt(xe_lrc_seqno_ggtt_addr(lrc), seqno, job->migrate_flush_flags, dw, i); i = emit_user_interrupt(dw, i); + if (job->is_ulls && !job->is_ulls_last) + i = emit_ulls_postamble(lrc, dw, i, seqno); + xe_gt_assert(job->q->gt, i <= MAX_JOB_SIZE_DW); xe_lrc_write_ring(lrc, dw, i * sizeof(*dw)); -- 2.53.0