drm/i915/cnl: WaPipeControlBefore3DStateSamplePattern
Subsystems (2)
PATCH v2 1/1 drm/i915/cnl: WaPipeControlBefore3DStateSamplePattern
This workaround should prevent a bug that can be hit on a context restore. To avoid the issue, we must emit a PIPE_CONTROL with CS stall (0x7a000004 0x00100000 0x00000000 0x00000000) followed by 12DW's of NOOP(0x0) in the indirect context batch buffer, to ensure the engine is idle prior to programming 3DSTATE_SAMPLE_PATTERN.
References: HSD#1939868
v2:
- More descriptive changelog and comments.
- Fix math when counting dwords.
--- drivers/gpu/drm/i915/intel_lrc.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_lrc.c +33 -1
@@ -1366,6 +1366,36 @@ static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch)return batch; } +static u32 *gen10_init_indirectctx_bb (struct intel_engine_cs *engine,u32 *batch) +{ +int i; + +/* +* WaPipeControlBefore3DStateSamplePattern: cnl +* +* Ensure the engine is idle prior to programming a +* 3DSTATE_SAMPLE_PATTERN during a context restore. +*/ + batch =gen8_emit_pipe_control (batch, +PIPE_CONTROL_CS_STALL , +0 ); +/* +* WaPipeControlBefore3DStateSamplePattern says we need 4 dwords for +* the PIPE_CONTROL followed by 12 dwords of 0x0, so 16 dwords in +* total. Since gen8_emit_pipe_control() already advances the batch by +* 6 dwords, we advance the other 10 here. +*/ +for (i =0 ; i <10 ; i++) + *batch++ =MI_NOOP ; + +/* Pad to end of cacheline */ +while ((unsigned long )batch %CACHELINE_BYTES ) + *batch++ =MI_NOOP ; + +return batch; +} + +#define CTX_WA_BB_OBJ_SIZE (PAGE_SIZE)static int lrc_setup_wa_ctx (struct intel_engine_cs *engine)
@@ -1419,7 +1449,9 @@ static int intel_init_workaround_bb(struct intel_engine_cs *engine)switch (INTEL_GEN (engine->i915)) {case 10 : -return 0 ; + wa_bb_fn[0 ] = gen10_init_indirectctx_bb; + wa_bb_fn[1 ] =NULL ; +break ;case 9 : wa_bb_fn[0 ] = gen9_init_indirectctx_bb; wa_bb_fn[1 ] =NULL ;
Signature · 6 lines
2.14.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Rafael Antognolli (2018-01-26 23:05:24)
Quoted 37 lines
This workaround should prevent a bug that can be hit on a context restore. To avoid the issue, we must emit a
PIPE_CONTROLwith CS stall (0x7a0000040x001000000x000000000x00000000) followed by 12DW's of NOOP(0x0) in the indirect context batch buffer, to ensure the engine is idle prior to programming 3DSTATE_SAMPLE_PATTERN.References: HSD#1939868
v2:
- More descriptive changelog and comments.
- Fix math when counting dwords.Signed-off-by Rafael Antognolli <[email protected]>Cc Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/intel_lrc.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_lrc.c +11
-0@@ -1366,6 +1366,36 @@ static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch)return batch; } +static u32 *gen10_init_indirectctx_bb (struct intel_engine_cs *engine,u32 *batch) +{ +int i; + +/* +* WaPipeControlBefore3DStateSamplePattern: cnl +* +* Ensure the engine is idle prior to programming a +* 3DSTATE_SAMPLE_PATTERN during a context restore. +*/ + batch = gen8_emit_pipe_control(batch,
drivers/gpu/drm/i915/intel_lrc.c static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch) · line 1389
Quoted 10 lines
drivers/gpu/drm/i915/intel_lrc.c +10
-0+PIPE_CONTROL_CS_STALL , + 0); +/* +* WaPipeControlBefore3DStateSamplePattern says we need 4 dwords for +* the PIPE_CONTROL followed by 12 dwords of 0x0, so 16 dwords in +* total. Since gen8_emit_pipe_control() already advances the batch by +* 6 dwords, we advance the other 10 here. +*/ +for (i =0 ; i <10 ; i++) + *batch++ =MI_NOOP ;
If the spec says emit 12 nops, emit 12 nops. Otherwise if we add another w/a here it may break this magic.
I am not going to ask what the magic nops do, it just gives a 72 cycle delay in the CS parser. My guess is that they are trying to isolate a cacheline, in which case they are expecting the pipecontrol to be cacheline aligned. (I would get that clarified and add an assert to document such a requirement.) Or they just mean that the indirect ctx is cacheline aligned and the nops are just the normal padding and nothing to do with the w/a.
s/10/12/ here and tweak the comment to remove the assumed cacheline tail, but please see if someone can clarify if the nops are indeed part of the w/a or just the normal filler.
With s/10/12/,
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 43 lines · Chris Wilson
Quoting Rafael Antognolli (2018-01-26 23:05:24)
Quoted 42 lines
This workaround should prevent a bug that can be hit on a context restore. To avoid the issue, we must emit a
PIPE_CONTROLwith CS stall (0x7a0000040x001000000x000000000x00000000) followed by 12DW's of NOOP(0x0) in the indirect context batch buffer, to ensure the engine is idle prior to programming 3DSTATE_SAMPLE_PATTERN.References: HSD#1939868
v2:
- More descriptive changelog and comments.
- Fix math when counting dwords.Signed-off-by Rafael Antognolli <[email protected]>Cc Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/intel_lrc.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_lrc.c +16
-0@@ -1366,6 +1366,36 @@ static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch)return batch; } +static u32 *gen10_init_indirectctx_bb (struct intel_engine_cs *engine,u32 *batch) +{ +int i; + +/* +* WaPipeControlBefore3DStateSamplePattern: cnl +* +* Ensure the engine is idle prior to programming a +* 3DSTATE_SAMPLE_PATTERN during a context restore. +*/ + batch =gen8_emit_pipe_control (batch, +PIPE_CONTROL_CS_STALL , +0 ); +/* +* WaPipeControlBefore3DStateSamplePattern says we need 4 dwords for +* the PIPE_CONTROL followed by 12 dwords of 0x0, so 16 dwords in
Quoted 8 lines
drivers/gpu/drm/i915/intel_lrc.c static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch) · line 1389
Quoted 5 lines
drivers/gpu/drm/i915/intel_lrc.c +5
-0+* total. Since gen8_emit_pipe_control() already advances the batch by +* 6 dwords, we advance the other 10 here. +*/ +for (i =0 ; i <10 ; i++) + *batch++ =MI_NOOP ;If the spec says emit 12 nops, emit 12 nops. Otherwise if we add another w/a here it may break this magic.
So, in the bspec, there's the following text:
"The address above needs to be a GGTT address and contain a pipe control with CS stall(0x7a000004 0x00100000 0x00000000 0x00000000)followed by 12DW’s of NOOP(0x00000000)"
while on an internal ticket pointed by it, it is:
"The address above needs to be a GGTT address.. It would contain the following value: 7A000004 00100000 followed by 14 DW’s of zero."
That's why I think it is really 16 DW's in total. And gen8_emit_pipe_control() already emits 6 of them. How are we supposed to emit 12 after that?
I don't know if they expect the pipe control to be cacheline aligned, but I can ask and try to find out.
Quoted 8 lines
I am not going to ask what the magic nops do, it just gives a 72 cycle delay in the CS parser. My guess is that they are trying to isolate a cacheline, in which case they are expecting the pipecontrol to be cacheline aligned. (I would get that clarified and add an assert to document such a requirement.) Or they just mean that the indirect ctx is cacheline aligned and the nops are just the normal padding and nothing to do with the w/a.
Quoted 6 lines
s/10/12/ here and tweak the comment to remove the assumed cacheline tail, but please see if someone can clarify if the nops are indeed part of the w/a or just the normal filler.
With s/10/12/,Acked-by Chris Wilson <[email protected]>-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915/cnl: WaPipeControlBefore3DStateSamplePattern (rev2)
In reply to Rafael Antognolli== Series Details ==
== Series Details ==
Series: drm/i915/cnl: WaPipeControlBefore3DStateSamplePattern (rev2)
URL : https://patchwork.freedesktop.org/series/37148/
State : success
== Summary ==
Series 37148v2 drm/i915/cnl: WaPipeControlBefore3DStateSamplePattern
https://patchwork.freedesktop.org/api/1.0/series/37148/revisions/2/mbox/
Test debugfs_test:
Subgroup read_all_entries:
dmesg-fail -> DMESG-WARN (fi-elk-e7500) fdo#103989
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
pass -> INCOMPLETE (fi-snb-2520m) fdo#103713fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:422s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:426s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:371s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:490s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:281s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:480s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:488s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:470s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:465s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:572s fi-cnl-y2 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:530s fi-elk-e7500 total:224 pass:168 dwarn:10 dfail:0 fail:0 skip:45 fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:294s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:516s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:392s fi-hsw-4770r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:401s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:423s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:457s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:414s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:459s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:502s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:456s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:501s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:578s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:433s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:510s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:533s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:498s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:483s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:418s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:431s fi-snb-2520m total:245 pass:211 dwarn:0 dfail:0 fail:0 skip:33 fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:401s
Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:480s
59275f1cec1d31adab39ddb6ab948519ac8ddffb drm-tip: 2018y-01m-26d-13h-05m-14s UTC integration manifest 7b8180832a9f drm/i915/cnl: WaPipeControlBefore3DStateSamplePattern
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7796/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915/cnl: WaPipeControlBefore3DStateSamplePattern (rev2)
In reply to Rafael Antognolli== Series Details ==
== Series Details ==
Series: drm/i915/cnl: WaPipeControlBefore3DStateSamplePattern (rev2)
URL : https://patchwork.freedesktop.org/series/37148/
State : success
== Summary ==
Warning: bzip CI_DRM_3686/shard-glkb6/results14.json.bz2 wasn't in correct JSON format Test kms_flip:
Subgroup plain-flip-fb-recreate-interruptible:
pass -> FAIL (shard-hsw) fdo#100368
Test kms_sysfs_edid_timing:
warn -> PASS (shard-apl) fdo#100047
Test kms_mmap_write_crc:
skip -> PASS (shard-apl)
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-offscren-pri-shrfb-draw-blt:
fail -> PASS (shard-snb) fdo#101623
Test perf:
Subgroup enable-disable:
fail -> PASS (shard-apl) fdo#103715fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715
shard-apl total:2678 pass:1668 dwarn:1 dfail:0 fail:20 skip:989 time:11995s shard-hsw total:2838 pass:1735 dwarn:1 dfail:0 fail:11 skip:1090 time:12054s shard-snb total:2838 pass:1330 dwarn:1 dfail:0 fail:10 skip:1497 time:6658s
Blacklisted hosts:
shard-kbl total:2825 pass:1854 dwarn:5 dfail:0 fail:22 skip:943 time:9539s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7796/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx