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 2B6F6F53D6F for ; Mon, 16 Mar 2026 15:29:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D1F8210E39E; Mon, 16 Mar 2026 15:29:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="gw4LdZYP"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 827FE10E325 for ; Mon, 16 Mar 2026 15:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=nsxRhOFXATaLSH6/mVq2uZ/P4unVhF5G2dQD869N8DY=; b=gw4LdZYPxeh+AerJrbIJ5UdEaJ VfJmWI2WGFRi0SxFapKoGhs5Vbf/3ZPp49w4H9g1ILDU26wq8Hx/fPB2BM2pOqq1N3QN0f3gHDM6V 7hel1lGr0byys8o3BMBCqEu2/J/m5weMt0abuGZGcnS1brJqXBXmSWNcp90nZtT8LZIX4yeGCWPrT 3I+jCNWzMlw6CsOkm7i54+lR23mOVwgTdBM630p4SN/ABrvl5qnmnotW9UYGQSn9h9vvtOivCp21V RCULH+t0SEwY8pp50wCXNivk4AdvXGJPXzzZg4C4zJbMCxCSDLHtqc95Tx8SjxyOcxKwNrHdQZpyk rWJpAPHA==; Received: from [90.240.106.137] (helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1w29st-00GZ2h-Qp; Mon, 16 Mar 2026 16:29:35 +0100 From: Tvrtko Ursulin To: intel-xe@lists.freedesktop.org Cc: kernel-dev@igalia.com, Uma Shankar , Tvrtko Ursulin , Rodrigo Vivi Subject: [PATCH v22 07/12] drm/xe/xelp: Add AuxCCS invalidation to the indirect context workarounds Date: Mon, 16 Mar 2026 15:29:27 +0000 Message-ID: <20260316152929.1247-8-tvrtko.ursulin@igalia.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260316152929.1247-1-tvrtko.ursulin@igalia.com> References: <20260316152929.1247-1-tvrtko.ursulin@igalia.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" Following from the i915 reference implementation, we add the AuxCCS invalidation to the indirect context workarounds page. Signed-off-by: Tvrtko Ursulin Cc: Rodrigo Vivi Reviewed-by: Rodrigo Vivi --- v2: * Reworked to accomodate aux invalidation becoming part of ring_ops. --- drivers/gpu/drm/xe/xe_lrc.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c index aa26c71ae34f..f04680d08217 100644 --- a/drivers/gpu/drm/xe/xe_lrc.c +++ b/drivers/gpu/drm/xe/xe_lrc.c @@ -28,6 +28,7 @@ #include "xe_map.h" #include "xe_memirq.h" #include "xe_mmio.h" +#include "xe_ring_ops.h" #include "xe_sriov.h" #include "xe_trace_lrc.h" #include "xe_vm.h" @@ -94,6 +95,9 @@ gt_engine_needs_indirect_ctx(struct xe_gt *gt, enum xe_engine_class class) class, NULL)) return true; + if (gt->ring_ops[class]->emit_aux_table_inv) + return true; + return false; } @@ -1217,6 +1221,23 @@ static ssize_t setup_invalidate_state_cache_wa(struct xe_lrc *lrc, return cmd - batch; } +static ssize_t setup_invalidate_auxccs_wa(struct xe_lrc *lrc, + struct xe_hw_engine *hwe, + u32 *batch, size_t max_len) +{ + struct xe_gt *gt = lrc->gt; + u32 *(*emit)(struct xe_gt *gt, u32 *cmd) = + gt->ring_ops[hwe->class]->emit_aux_table_inv; + + if (!emit) + return 0; + + if (xe_gt_WARN_ON(gt, max_len < 8)) + return -ENOSPC; + + return emit(gt, batch) - batch; +} + struct bo_setup { ssize_t (*setup)(struct xe_lrc *lrc, struct xe_hw_engine *hwe, u32 *batch, size_t max_size); @@ -1349,9 +1370,11 @@ setup_indirect_ctx(struct xe_lrc *lrc, struct xe_hw_engine *hwe) { static const struct bo_setup rcs_funcs[] = { { .setup = setup_timestamp_wa }, + { .setup = setup_invalidate_auxccs_wa }, { .setup = setup_configfs_mid_ctx_restore_bb }, }; static const struct bo_setup xcs_funcs[] = { + { .setup = setup_invalidate_auxccs_wa }, { .setup = setup_configfs_mid_ctx_restore_bb }, }; struct bo_setup_state state = { -- 2.52.0