<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Am 30.07.2014 um 19:24 schrieb Jerome
      Glisse:<br>
    </div>
    <blockquote
cite="mid:CAH3drwY=wNi4z1=ryjXpv900PRRiqjEpi4jXuDK5PpVbqY82Vg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Wed, Jul 30, 2014 at 11:54 AM,
            Alex Deucher <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div class="">On Wed, Jul 30, 2014 at 11:18 AM, Christian
                König<br>
                <<a moz-do-not-send="true"
                  href="mailto:deathsimple@vodafone.de">deathsimple@vodafone.de</a>>
                wrote:<br>
                > From: Christian König <<a moz-do-not-send="true"
                  href="mailto:christian.koenig@amd.com">christian.koenig@amd.com</a>><br>
                ><br>
                > Seems to make VM flushes more stable on SI and CIK.<br>
                ><br>
                > v2: only use the PFP on the GFX ring on CIK<br>
                ><br>
                > Signed-off-by: Christian König <<a
                  moz-do-not-send="true"
                  href="mailto:christian.koenig@amd.com">christian.koenig@amd.com</a>><br>
                > Cc: <a moz-do-not-send="true"
                  href="mailto:stable@vger.kernel.org">stable@vger.kernel.org</a><br>
                <br>
              </div>
              Applied to my 3.17 tree.  We should use PFP whenever
              possible for all packets.<br>
            </blockquote>
            <div><br>
            </div>
            <div>Can all this be explained with more words ? What are
              the choice ? What are the difference ? What we gain ?<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    The PFP is responsible of fetching the data the CP executes from
    memory, classify them and if necessary forward them to the ME. The
    ME is the part where normally all the juicy stuff happens, e.g.
    register writes, most type3 packet execution etc...<br>
    <br>
    What we did before was setting the VM base address with the ME
    instead of the PFP, but since the PFP needs to fetch the IB data we
    inserted an "Wait for ME" packet into the command stream to let the
    ME catch up to the PFP before proceeding.<br>
    <br>
    The problem is that this is sometimes not enough, e.g. on CIK it
    could happen that the IB read goes out while the the page table base
    address wasn't updated yet with the obviously bad consequences.<br>
    <br>
    Compute rings don't have a PFP on CIK so this won't work there.<br>
    <br>
    Regards,<br>
    Christian.<br>
    <br>
    <blockquote
cite="mid:CAH3drwY=wNi4z1=ryjXpv900PRRiqjEpi4jXuDK5PpVbqY82Vg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>
            </div>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <span class="HOEnZb"><font color="#888888"><br>
                  Alex<br>
                </font></span>
              <div class="HOEnZb">
                <div class="h5"><br>
                  > ---<br>
                  >  drivers/gpu/drm/radeon/cik.c | 5 +++--<br>
                  >  drivers/gpu/drm/radeon/si.c  | 2 +-<br>
                  >  2 files changed, 4 insertions(+), 3 deletions(-)<br>
                  ><br>
                  > diff --git a/drivers/gpu/drm/radeon/cik.c
                  b/drivers/gpu/drm/radeon/cik.c<br>
                  > index cc1f02f..db53616 100644<br>
                  > --- a/drivers/gpu/drm/radeon/cik.c<br>
                  > +++ b/drivers/gpu/drm/radeon/cik.c<br>
                  > @@ -5641,12 +5641,13 @@ static void
                  cik_vm_decode_fault(struct radeon_device *rdev,<br>
                  >  void cik_vm_flush(struct radeon_device *rdev,
                  int ridx, struct radeon_vm *vm)<br>
                  >  {<br>
                  >         struct radeon_ring *ring =
                  &rdev->ring[ridx];<br>
                  > +       int usepfp = (ridx ==
                  RADEON_RING_TYPE_GFX_INDEX);<br>
                  ><br>
                  >         if (vm == NULL)<br>
                  >                 return;<br>
                  ><br>
                  >         radeon_ring_write(ring,
                  PACKET3(PACKET3_WRITE_DATA, 3));<br>
                  > -       radeon_ring_write(ring,
                  (WRITE_DATA_ENGINE_SEL(0) |<br>
                  > +       radeon_ring_write(ring,
                  (WRITE_DATA_ENGINE_SEL(usepfp) |<br>
                  >                                
                   WRITE_DATA_DST_SEL(0)));<br>
                  >         if (vm->id < 8) {<br>
                  >                 radeon_ring_write(ring,<br>
                  > @@ -5696,7 +5697,7 @@ void cik_vm_flush(struct
                  radeon_device *rdev, int ridx, struct radeon_vm *vm)<br>
                  >         radeon_ring_write(ring, 1 <<
                  vm->id);<br>
                  ><br>
                  >         /* compute doesn't have PFP */<br>
                  > -       if (ridx == RADEON_RING_TYPE_GFX_INDEX) {<br>
                  > +       if (usepfp) {<br>
                  >                 /* sync PFP to ME, otherwise we
                  might get invalid PFP reads */<br>
                  >                 radeon_ring_write(ring,
                  PACKET3(PACKET3_PFP_SYNC_ME, 0));<br>
                  >                 radeon_ring_write(ring, 0x0);<br>
                  > diff --git a/drivers/gpu/drm/radeon/si.c
                  b/drivers/gpu/drm/radeon/si.c<br>
                  > index 9e854fd..f87d82a 100644<br>
                  > --- a/drivers/gpu/drm/radeon/si.c<br>
                  > +++ b/drivers/gpu/drm/radeon/si.c<br>
                  > @@ -4815,7 +4815,7 @@ void si_vm_flush(struct
                  radeon_device *rdev, int ridx, struct radeon_vm *vm)<br>
                  ><br>
                  >         /* write new base address */<br>
                  >         radeon_ring_write(ring,
                  PACKET3(PACKET3_WRITE_DATA, 3));<br>
                  > -       radeon_ring_write(ring,
                  (WRITE_DATA_ENGINE_SEL(0) |<br>
                  > +       radeon_ring_write(ring,
                  (WRITE_DATA_ENGINE_SEL(1) |<br>
                  >                                
                   WRITE_DATA_DST_SEL(0)));<br>
                  ><br>
                  >         if (vm->id < 8) {<br>
                  > --<br>
                  > 1.9.1<br>
                  ><br>
                  _______________________________________________<br>
                  dri-devel mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
                  <a moz-do-not-send="true"
                    href="http://lists.freedesktop.org/mailman/listinfo/dri-devel"
                    target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>