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 355A31099B26 for ; Fri, 20 Mar 2026 17:02:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D32EF10EB05; Fri, 20 Mar 2026 17:02:32 +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="Cfx4j0rh"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7EAEC10EAFA for ; Fri, 20 Mar 2026 17:02:31 +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=h/8YLbbKOjqlGestzWci26tyPP9+7+YN79436yE+CbI=; b=Cfx4j0rhP2Ldz8QbZ6nMtKhyxX Pl2ADGfn/ZyW6/na3dGy8RfU64fe7f5REu+TCHy7dy5w7nnejq62/1K5Xd5+xKIhwAIGP7AnOoEYU JG5xrkW2a431iM5EQIfYSXs/GCzn2o81xmXWE+aQ9kZFenpO/O+PkSSBJTQRT5D0vTwT1GUGyGDsn bFLuAOL6iDN8bxlS/hi/QLvdrJA0ZOXYPzhQGC2E9thPg+ieTT1eTCKdwKl+7snCTnmJ5OZtbeXVl o2/8U7gN5xJQ2RBzQL9gng4Zf5+44HFF6zrxHehp8M9je2SSjOaTDWRlKif50TJdXEABEa4TwUuhc JWKT9POw==; 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 1w3dEz-003trm-Oo; Fri, 20 Mar 2026 18:02:29 +0100 From: Tvrtko Ursulin To: intel-xe@lists.freedesktop.org Cc: kernel-dev@igalia.com, Uma Shankar , Tvrtko Ursulin , Rodrigo Vivi Subject: [PATCH v24 07/12] drm/xe/xelp: Add AuxCCS invalidation to the indirect context workarounds Date: Fri, 20 Mar 2026 17:02:17 +0000 Message-ID: <20260320170222.88625-8-tvrtko.ursulin@igalia.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260320170222.88625-1-tvrtko.ursulin@igalia.com> References: <20260320170222.88625-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 c5cfd8f75a94..e104af26015c 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