Skip to content

Commit 592b228

Browse files
Andi Shytitursulin
authored andcommitted
drm/i915/gt: Rename flags with bit_group_X according to the datasheet
In preparation of the next patch align with the datasheet (BSPEC 47112) with the naming of the pipe control set of flag values. The variable "flags" in gen12_emit_flush_rcs() is applied as a set of flags called Bit Group 1. Define also the Bit Group 0 as bit_group_0 where currently only PIPE_CONTROL0_HDC_PIPELINE_FLUSH bit is set. Signed-off-by: Andi Shyti <[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 f2dcd21) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent 78a6ccd commit 592b228

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -219,40 +219,42 @@ int gen12_emit_flush_rcs(struct i915_request *rq, u32 mode)
219219
* table requires quiescing memory traffic beforehand
220220
*/
221221
if (mode & EMIT_FLUSH || gen12_needs_ccs_aux_inv(engine)) {
222-
u32 flags = 0;
222+
u32 bit_group_0 = 0;
223+
u32 bit_group_1 = 0;
223224
int err;
224225
u32 *cs;
225226

226227
err = mtl_dummy_pipe_control(rq);
227228
if (err)
228229
return err;
229230

230-
flags |= PIPE_CONTROL_TILE_CACHE_FLUSH;
231-
flags |= PIPE_CONTROL_FLUSH_L3;
232-
flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
233-
flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
231+
bit_group_0 |= PIPE_CONTROL0_HDC_PIPELINE_FLUSH;
232+
233+
bit_group_1 |= PIPE_CONTROL_TILE_CACHE_FLUSH;
234+
bit_group_1 |= PIPE_CONTROL_FLUSH_L3;
235+
bit_group_1 |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
236+
bit_group_1 |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
234237
/* Wa_1409600907:tgl,adl-p */
235-
flags |= PIPE_CONTROL_DEPTH_STALL;
236-
flags |= PIPE_CONTROL_DC_FLUSH_ENABLE;
237-
flags |= PIPE_CONTROL_FLUSH_ENABLE;
238+
bit_group_1 |= PIPE_CONTROL_DEPTH_STALL;
239+
bit_group_1 |= PIPE_CONTROL_DC_FLUSH_ENABLE;
240+
bit_group_1 |= PIPE_CONTROL_FLUSH_ENABLE;
238241

239-
flags |= PIPE_CONTROL_STORE_DATA_INDEX;
240-
flags |= PIPE_CONTROL_QW_WRITE;
242+
bit_group_1 |= PIPE_CONTROL_STORE_DATA_INDEX;
243+
bit_group_1 |= PIPE_CONTROL_QW_WRITE;
241244

242-
flags |= PIPE_CONTROL_CS_STALL;
245+
bit_group_1 |= PIPE_CONTROL_CS_STALL;
243246

244247
if (!HAS_3D_PIPELINE(engine->i915))
245-
flags &= ~PIPE_CONTROL_3D_ARCH_FLAGS;
248+
bit_group_1 &= ~PIPE_CONTROL_3D_ARCH_FLAGS;
246249
else if (engine->class == COMPUTE_CLASS)
247-
flags &= ~PIPE_CONTROL_3D_ENGINE_FLAGS;
250+
bit_group_1 &= ~PIPE_CONTROL_3D_ENGINE_FLAGS;
248251

249252
cs = intel_ring_begin(rq, 6);
250253
if (IS_ERR(cs))
251254
return PTR_ERR(cs);
252255

253-
cs = gen12_emit_pipe_control(cs,
254-
PIPE_CONTROL0_HDC_PIPELINE_FLUSH,
255-
flags, LRC_PPHWSP_SCRATCH_ADDR);
256+
cs = gen12_emit_pipe_control(cs, bit_group_0, bit_group_1,
257+
LRC_PPHWSP_SCRATCH_ADDR);
256258
intel_ring_advance(rq, cs);
257259
}
258260

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,29 @@ u32 *gen12_emit_fini_breadcrumb_rcs(struct i915_request *rq, u32 *cs);
4949
u32 *gen12_emit_aux_table_inv(struct intel_gt *gt, u32 *cs, const i915_reg_t inv_reg);
5050

5151
static inline u32 *
52-
__gen8_emit_pipe_control(u32 *batch, u32 flags0, u32 flags1, u32 offset)
52+
__gen8_emit_pipe_control(u32 *batch, u32 bit_group_0,
53+
u32 bit_group_1, u32 offset)
5354
{
5455
memset(batch, 0, 6 * sizeof(u32));
5556

56-
batch[0] = GFX_OP_PIPE_CONTROL(6) | flags0;
57-
batch[1] = flags1;
57+
batch[0] = GFX_OP_PIPE_CONTROL(6) | bit_group_0;
58+
batch[1] = bit_group_1;
5859
batch[2] = offset;
5960

6061
return batch + 6;
6162
}
6263

63-
static inline u32 *gen8_emit_pipe_control(u32 *batch, u32 flags, u32 offset)
64+
static inline u32 *gen8_emit_pipe_control(u32 *batch,
65+
u32 bit_group_1, u32 offset)
6466
{
65-
return __gen8_emit_pipe_control(batch, 0, flags, offset);
67+
return __gen8_emit_pipe_control(batch, 0, bit_group_1, offset);
6668
}
6769

68-
static inline u32 *gen12_emit_pipe_control(u32 *batch, u32 flags0, u32 flags1, u32 offset)
70+
static inline u32 *gen12_emit_pipe_control(u32 *batch, u32 bit_group_0,
71+
u32 bit_group_1, u32 offset)
6972
{
70-
return __gen8_emit_pipe_control(batch, flags0, flags1, offset);
73+
return __gen8_emit_pipe_control(batch, bit_group_0,
74+
bit_group_1, offset);
7175
}
7276

7377
static inline u32 *

0 commit comments

Comments
 (0)