Skip to content

Commit b2f59e9

Browse files
Andi Shytitursulin
authored andcommitted
drm/i915: Add the gen12_needs_ccs_aux_inv helper
We always assumed that a device might either have AUX or FLAT CCS, but this is an approximation that is not always true, e.g. PVC represents an exception. Set the basis for future finer selection by implementing a boolean gen12_needs_ccs_aux_inv() function that tells whether aux invalidation is needed or not. Currently PVC is the only exception to the above mentioned rule. Requires: 059ae7ae2a1c ("drm/i915/gt: Cleanup aux invalidation registers") Signed-off-by: Andi Shyti <[email protected]> Cc: Matt Roper <[email protected]> Cc: Jonathan Cavitt <[email protected]> Cc: <[email protected]> # v5.8+ Reviewed-by: Matt Roper <[email protected]> Reviewed-by: Andrzej Hajda <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit c827655) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent d14560a commit b2f59e9

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@ static u32 preparser_disable(bool state)
165165
return MI_ARB_CHECK | 1 << 8 | state;
166166
}
167167

168+
static bool gen12_needs_ccs_aux_inv(struct intel_engine_cs *engine)
169+
{
170+
if (IS_PONTEVECCHIO(engine->i915))
171+
return false;
172+
173+
/*
174+
* so far platforms supported by i915 having
175+
* flat ccs do not require AUX invalidation
176+
*/
177+
return !HAS_FLAT_CCS(engine->i915);
178+
}
179+
168180
u32 *gen12_emit_aux_table_inv(struct intel_gt *gt, u32 *cs, const i915_reg_t inv_reg)
169181
{
170182
u32 gsi_offset = gt->uncore->gsi_offset;
@@ -267,7 +279,7 @@ int gen12_emit_flush_rcs(struct i915_request *rq, u32 mode)
267279
else if (engine->class == COMPUTE_CLASS)
268280
flags &= ~PIPE_CONTROL_3D_ENGINE_FLAGS;
269281

270-
if (!HAS_FLAT_CCS(rq->engine->i915))
282+
if (gen12_needs_ccs_aux_inv(rq->engine))
271283
count = 8 + 4;
272284
else
273285
count = 8;
@@ -285,7 +297,7 @@ int gen12_emit_flush_rcs(struct i915_request *rq, u32 mode)
285297

286298
cs = gen8_emit_pipe_control(cs, flags, LRC_PPHWSP_SCRATCH_ADDR);
287299

288-
if (!HAS_FLAT_CCS(rq->engine->i915)) {
300+
if (gen12_needs_ccs_aux_inv(rq->engine)) {
289301
/* hsdes: 1809175790 */
290302
cs = gen12_emit_aux_table_inv(rq->engine->gt, cs,
291303
GEN12_CCS_AUX_INV);
@@ -307,7 +319,7 @@ int gen12_emit_flush_xcs(struct i915_request *rq, u32 mode)
307319
if (mode & EMIT_INVALIDATE) {
308320
cmd += 2;
309321

310-
if (!HAS_FLAT_CCS(rq->engine->i915) &&
322+
if (gen12_needs_ccs_aux_inv(rq->engine) &&
311323
(rq->engine->class == VIDEO_DECODE_CLASS ||
312324
rq->engine->class == VIDEO_ENHANCEMENT_CLASS)) {
313325
aux_inv = rq->engine->mask &

0 commit comments

Comments
 (0)