<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 2021-12-14 12:03 p.m., Andrey
      Grodzovsky wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:20f336a4-0bfd-9988-ee3b-a8206f045f7e@amd.com">
      <blockquote type="cite" style="color: #007cff;">-
        <br>
        -    if (job != NULL) {
        <br>
        -        /* mark this fence has a parent job */
        <br>
        -        set_bit(AMDGPU_FENCE_FLAG_EMBED_IN_JOB_BIT,
        &fence->flags);
        <br>
        +        if (job)
        <br>
        +            dma_fence_init(fence, &amdgpu_job_fence_ops,
        <br>
        +                       &ring->fence_drv.lock,
        <br>
        +                       adev->fence_context + ring->idx,
        seq);
        <br>
        +        else
        <br>
        +            dma_fence_init(fence, &amdgpu_fence_ops,
        <br>
        +                       &ring->fence_drv.lock,
        <br>
        +                       adev->fence_context + ring->idx,
        seq);
        <br>
              }
        <br>
      </blockquote>
      <br>
      <br>
      It's probably me missing something but why can't we just move
      setting of AMDGPU_FENCE_FLAG_EMBED_IN_JOB_BIT
      <br>
      to before dma_fence_init here or even into amdgpu_job_alloc
      instead of all the refactoring ?
      <br>
      <br>
      Andrey
    </blockquote>
    <p><br>
    </p>
    <p>My bad, I see now that dma_fence_init just overrides flags to 0
      and immediately call the trace .<br>
      But why then can't we add dma_fence_init_with_flags wrapper to
      dma-fence ?</p>
    <p>Andrey<br>
    </p>
  </body>
</html>