<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi Chris, for some reason I didn’t receive the review email, so I copied your comments from patchwork and faked this email.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">>> static void execlists_dequeue(struct intel_engine_cs *engine)<o:p></o:p></p>
<p class="MsoNormal">>> {<o:p></o:p></p>
<p class="MsoNormal">>> struct intel_engine_execlists * const execlists = &engine->execlists;<o:p></o:p></p>
<p class="MsoNormal">>> @@ -1538,6 +1566,16 @@ static void execlists_dequeue(struct intel_engine_cs *engine)<o:p></o:p></p>
<p class="MsoNormal">>> }<o:p></o:p></p>
<p class="MsoNormal">>> <o:p></o:p></p>
<p class="MsoNormal">>> if (__i915_request_submit(rq)) {<o:p></o:p></p>
<p class="MsoNormal">>> + /* hsdes: 1809175790 */<o:p></o:p></p>
<p class="MsoNormal">>> + if ((GRAPHICS_VER(engine->i915) == 12) &&<o:p></o:p></p>
<p class="MsoNormal">>> + rq->vd_ve_aux_inv &&<o:p></o:p></p>
<p class="MsoNormal">>> + (engine->class == VIDEO_DECODE_CLASS ||<o:p></o:p></p>
<p class="MsoNormal">>> + engine->class == VIDEO_ENHANCEMENT_CLASS)) {<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> We do not need the extra checks here; we just do as we are told. We only<o:p></o:p></p>
<p class="MsoNormal">> tell ourselves to apply the fixup when required.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Without checking GRAPHICS_VER, I’m seeing a lot of regressions on older platforms in the CI result.<o:p></o:p></p>
<p class="MsoNormal">This workaround was only implemented for gen12 (gen12_emit_flush_xcs).<o:p></o:p></p>
<p class="MsoNormal">Without checking engine->class, I’m seeing boot issues due to GEM_BUG_ON() in aux_inv_reg().<o:p></o:p></p>
<p class="MsoNormal">Any rq will go through this code regardless of engine class and gen version, so the checking seems to be<o:p></o:p></p>
<p class="MsoNormal">necessary. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">>> + *rq->vd_ve_aux_inv = i915_mmio_reg_offset<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> Likewise, vd_ve is overspecific, aux_inv_fixup or aux_inv_wa (or<o:p></o:p></p>
<p class="MsoNormal">> wa_aux_iv, fixup_aux_inv).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I wanted to be specific because the workaround was only implemented for vd/ve engines.<o:p></o:p></p>
<p class="MsoNormal">But I’m ok with your proposal.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">>> + (aux_inv_reg(engine));<o:p></o:p></p>
<p class="MsoNormal">>> + rq->vd_ve_aux_inv = NULL;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> Move this to i915_request initialisation so that we only set aux_inv<o:p></o:p></p>
<p class="MsoNormal">> when required, which probably explains the extra defence.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The pointer is currently initialized with 0x5a5a. I set it to NULL in gen12_emit_flush_xcs, otherwise the rq will<o:p></o:p></p>
<p class="MsoNormal">enter that if-statement with an invalid pointer.<o:p></o:p></p>
<p class="MsoNormal">I’m not familiar with the code, there seems to be multiple functions allocating the structure. I agree it’s better<o:p></o:p></p>
<p class="MsoNormal">to set it to NULL at initialization, but need some guidance on where is the best place to do so.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">>> + rq->execution_mask = engine->mask;<o:p></o:p></p>
<p class="MsoNormal">>> + }<o:p></o:p></p>
<p class="MsoNormal">>> if (!merge) {<o:p></o:p></p>
<p class="MsoNormal">>> *port++ = i915_request_get(last);<o:p></o:p></p>
<p class="MsoNormal">>> last = NULL;<o:p></o:p></p>
<p class="MsoNormal">>> diff --git a/drivers/gpu/drm/i915/i915_request.h b/drivers/gpu/drm/i915/i915_request.h<o:p></o:p></p>
<p class="MsoNormal">>> index 28b1f9db5487..69de32e5e15d 100644<o:p></o:p></p>
<p class="MsoNormal">>> --- a/drivers/gpu/drm/i915/i915_request.h<o:p></o:p></p>
<p class="MsoNormal">>> +++ b/drivers/gpu/drm/i915/i915_request.h<o:p></o:p></p>
<p class="MsoNormal">>> @@ -350,6 +350,8 @@ struct i915_request {<o:p></o:p></p>
<p class="MsoNormal">>> struct list_head link;<o:p></o:p></p>
<p class="MsoNormal">>> unsigned long delay;<o:p></o:p></p>
<p class="MsoNormal">>> } mock;)<o:p></o:p></p>
<p class="MsoNormal">>> +<o:p></o:p></p>
<p class="MsoNormal">>> + u32 *vd_ve_aux_inv;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> Not at the end of the struct; that's where we put things in the dungeon.<o:p></o:p></p>
<p class="MsoNormal">> The selftest struct should be last; I do hope no one has been putting<o:p></o:p></p>
<p class="MsoNormal">> things at random places in the struct without considering the layout and<o:p></o:p></p>
<p class="MsoNormal">> semantics. From the flow, this is akin to batch, capture_list; before<o:p></o:p></p>
<p class="MsoNormal">> emitted_jiffies would be a good spot.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Got it, will change. I thought adding at the end would be safer, thanks for the explanation.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> -Chris<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>