Skip to content

Commit 6639fab

Browse files
committed
drm/i915/xehp: Drop aux table invalidation on FlatCCS platforms
Platforms with FlatCCS do not use auxiliary planes for compression control data and thus do not need traditional aux table invalidation (and the registers no longer even exist). Original-author: CQ Tang Signed-off-by: Matt Roper <[email protected]> Reviewed-by: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 2ed38ce commit 6639fab

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

drivers/gpu/drm/i915/gt/gen8_engine_cs.c

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ int gen12_emit_flush_rcs(struct i915_request *rq, u32 mode)
236236

237237
if (mode & EMIT_INVALIDATE) {
238238
u32 flags = 0;
239-
u32 *cs;
239+
u32 *cs, count;
240240

241241
flags |= PIPE_CONTROL_COMMAND_CACHE_INVALIDATE;
242242
flags |= PIPE_CONTROL_TLB_INVALIDATE;
@@ -254,7 +254,12 @@ int gen12_emit_flush_rcs(struct i915_request *rq, u32 mode)
254254
if (engine->class == COMPUTE_CLASS)
255255
flags &= ~PIPE_CONTROL_3D_FLAGS;
256256

257-
cs = intel_ring_begin(rq, 8 + 4);
257+
if (!HAS_FLAT_CCS(rq->engine->i915))
258+
count = 8 + 4;
259+
else
260+
count = 8;
261+
262+
cs = intel_ring_begin(rq, count);
258263
if (IS_ERR(cs))
259264
return PTR_ERR(cs);
260265

@@ -267,8 +272,10 @@ int gen12_emit_flush_rcs(struct i915_request *rq, u32 mode)
267272

268273
cs = gen8_emit_pipe_control(cs, flags, LRC_PPHWSP_SCRATCH_ADDR);
269274

270-
/* hsdes: 1809175790 */
271-
cs = gen12_emit_aux_table_inv(GEN12_GFX_CCS_AUX_NV, cs);
275+
if (!HAS_FLAT_CCS(rq->engine->i915)) {
276+
/* hsdes: 1809175790 */
277+
cs = gen12_emit_aux_table_inv(GEN12_GFX_CCS_AUX_NV, cs);
278+
}
272279

273280
*cs++ = preparser_disable(false);
274281
intel_ring_advance(rq, cs);
@@ -283,12 +290,15 @@ int gen12_emit_flush_xcs(struct i915_request *rq, u32 mode)
283290
u32 cmd, *cs;
284291

285292
cmd = 4;
286-
if (mode & EMIT_INVALIDATE)
293+
if (mode & EMIT_INVALIDATE) {
287294
cmd += 2;
288-
if (mode & EMIT_INVALIDATE)
289-
aux_inv = rq->engine->mask & ~BIT(BCS0);
290-
if (aux_inv)
291-
cmd += 2 * hweight32(aux_inv) + 2;
295+
296+
if (!HAS_FLAT_CCS(rq->engine->i915)) {
297+
aux_inv = rq->engine->mask & ~BIT(BCS0);
298+
if (aux_inv)
299+
cmd += 2 * hweight32(aux_inv) + 2;
300+
}
301+
}
292302

293303
cs = intel_ring_begin(rq, cmd);
294304
if (IS_ERR(cs))

0 commit comments

Comments
 (0)