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 6757EC369A3 for ; Thu, 3 Apr 2025 19:03:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 29DEF10EA5D; Thu, 3 Apr 2025 19:03:29 +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="azLSINx+"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by gabe.freedesktop.org (Postfix) with ESMTPS id 47AE910EA43 for ; Thu, 3 Apr 2025 19:03:26 +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=nybvdvFy8305WwPwULzNWNdE3zNHtL+yqyS7bc3+86w=; b=azLSINx+T55OEXZPR8GRaZVCkW Wf4wOaIXq36hxpnRx3lgb7K+PaHobLk0Sut3zMbfnMfGI9Jzo1ygu/vp9/R0n/EceaLw24NKx6X5C SPy2sykjJOouunykrtFXnzJQIcshRlQtB4gZg7sG1MMAnbdIXIPiw5566BcSY0r04DO3XmJmZxqGl oPBF7uws8FU7jweL1UnelGn32d6yIPUr6PuURU7oombFhs7F+1SZHnJclWw1CKIQRL0R9+I96U9E8 YsllkuWy4Siahxj5QqgxA6HxTHnNgJIqCV65yGuO4zIuNjJTLRjUX0ltSC8/Qu4TTOpKyRLFeeFe7 Zr3rso7A==; Received: from [90.241.98.187] (helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1u0PqW-00Axm4-Iu; Thu, 03 Apr 2025 21:03:24 +0200 From: Tvrtko Ursulin To: intel-xe@lists.freedesktop.org Cc: kernel-dev@igalia.com, Tvrtko Ursulin Subject: [PATCH v5 05/16] drm/xe/xelp: Quiesce memory traffic before invalidating auxccs Date: Thu, 3 Apr 2025 20:03:05 +0100 Message-ID: <20250403190317.6064-6-tvrtko.ursulin@igalia.com> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250403190317.6064-1-tvrtko.ursulin@igalia.com> References: <20250403190317.6064-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" According to i915 before invalidating auxccs we must quiesce the memory traffic by an extra flush. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/xe/xe_ring_ops.c | 14 ++++++++++---- drivers/gpu/drm/xe/xe_ring_ops_types.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_ring_ops.c b/drivers/gpu/drm/xe/xe_ring_ops.c index 61295f93ffb7..3f075dd36c86 100644 --- a/drivers/gpu/drm/xe/xe_ring_ops.c +++ b/drivers/gpu/drm/xe/xe_ring_ops.c @@ -172,7 +172,8 @@ static int emit_store_imm_ppgtt_posted(u64 addr, u64 value, return i; } -static int emit_render_cache_flush(struct xe_sched_job *job, u32 *dw, int i) +static int emit_render_cache_flush(struct xe_sched_job *job, bool flush_l3, + u32 *dw, int i) { struct xe_gt *gt = job->q->gt; struct xe_device *xe = gt_to_xe(gt); @@ -204,7 +205,7 @@ static int emit_render_cache_flush(struct xe_sched_job *job, u32 *dw, int i) * deals with Protected Memory which is not needed for * AUX CCS invalidation and lead to unwanted side effects. */ - if (GRAPHICS_VERx100(xe) < 1270) + if (flush_l3 && GRAPHICS_VERx100(xe) < 1270) flags |= PIPE_CONTROL_FLUSH_L3; if (lacks_render) @@ -370,10 +371,15 @@ static void __emit_job_gen12_render_compute(struct xe_sched_job *job, struct xe_gt *gt = job->q->gt; struct xe_device *xe = gt_to_xe(gt); bool lacks_render = !(gt->info.engine_mask & XE_HW_ENGINE_RCS_MASK); + const bool aux_ccs = has_aux_ccs(xe); u32 mask_flags = 0; i = emit_copy_timestamp(lrc, dw, i); + /* hsdes: 1809175790 */ + if (aux_ccs) + i = emit_render_cache_flush(job, 0, dw, i); + dw[i++] = preparser_disable(true); if (lacks_render) mask_flags = PIPE_CONTROL_3D_ARCH_FLAGS; @@ -384,7 +390,7 @@ static void __emit_job_gen12_render_compute(struct xe_sched_job *job, i = emit_pipe_invalidate(mask_flags, job->ring_ops_flush_tlb, dw, i); /* hsdes: 1809175790 */ - if (has_aux_ccs(xe)) + if (aux_ccs) i = emit_aux_table_inv(gt, CCS_AUX_INV, dw, i); dw[i++] = preparser_disable(false); @@ -394,7 +400,7 @@ static void __emit_job_gen12_render_compute(struct xe_sched_job *job, i = emit_bb_start(batch_addr, ppgtt_flag, dw, i); - i = emit_render_cache_flush(job, dw, i); + i = emit_render_cache_flush(job, true, dw, i); if (job->user_fence.used) i = emit_store_imm_ppgtt_posted(job->user_fence.addr, diff --git a/drivers/gpu/drm/xe/xe_ring_ops_types.h b/drivers/gpu/drm/xe/xe_ring_ops_types.h index d7e3e150a9a5..477dc7defd72 100644 --- a/drivers/gpu/drm/xe/xe_ring_ops_types.h +++ b/drivers/gpu/drm/xe/xe_ring_ops_types.h @@ -8,7 +8,7 @@ struct xe_sched_job; -#define MAX_JOB_SIZE_DW 58 +#define MAX_JOB_SIZE_DW 70 #define MAX_JOB_SIZE_BYTES (MAX_JOB_SIZE_DW * 4) /** -- 2.48.0