<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <br>
    <div class="moz-cite-prefix">On 2017年05月11日 10:41, Deucher,
      Alexander wrote:<br>
    </div>
    <blockquote
cite="mid:BN6PR12MB1652A074AABF32DDD7F559F7F7ED0@BN6PR12MB1652.namprd12.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Exchange Server">
      <!-- converted from text -->
      <style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
      <font size="2"><span style="font-size:10pt;">
          <div class="PlainText">> -----Original Message-----<br>
            > From: Deucher, Alexander<br>
            > Sent: Wednesday, May 10, 2017 10:38 PM<br>
            > To: Huang, Ray; <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>; Koenig,
            Christian<br>
            > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin;
            Huang, Ray<br>
            > Subject: RE: [PATCH 2/2] drm/amdgpu: export test ring
            debugfs interface<br>
            > <br>
            > > -----Original Message-----<br>
            > > From: Huang Rui [<a moz-do-not-send="true"
              href="mailto:ray.huang@amd.com">mailto:ray.huang@amd.com</a>]<br>
            > > Sent: Wednesday, May 10, 2017 10:29 PM<br>
            > > To: <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>; Deucher,
            Alexander; Koenig, Christian<br>
            > > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin;
            Huang, Ray<br>
            > > Subject: [PATCH 2/2] drm/amdgpu: export test ring
            debugfs interface<br>
            > ><br>
            > > Signed-off-by: Huang Rui <a class="moz-txt-link-rfc2396E" href="mailto:ray.huang@amd.com"><ray.huang@amd.com></a><br>
            > <br>
            > Reviewed-by: Alex Deucher
            <a class="moz-txt-link-rfc2396E" href="mailto:alexander.deucher@amd.com"><alexander.deucher@amd.com></a><br>
            <br>
            Not sure if it's important for this since it's debugfs, but
            we don't have any sort of ring locks anymore (since
            everything should go through the scheduler once it's
            started) so we could theoretically get collisions if there
            are active apps using the GPU and you run these tests.<br>
          </div>
        </span></font></blockquote>
    <font size="2">Yes, agree. So patch#1 for ib test should use
      scheduler, but which could be a big change and Christian doesn't
      like to use scheduler for ib test case, consider this is only for
      test case, the problem isn't big:).<br>
      <br>
      btw: I think patch#2 isn't need if patch#1 is landed, since when
      you use this sys interface, the amdgpu driver must be loaded
      successfully, ring test is meaningless.<br>
      <br>
      Regards,<br>
      David Zhou<br>
    </font>
    <blockquote
cite="mid:BN6PR12MB1652A074AABF32DDD7F559F7F7ED0@BN6PR12MB1652.namprd12.prod.outlook.com"
      type="cite"><font size="2"><span style="font-size:10pt;">
          <div class="PlainText">
            <br>
            Alex<br>
            <br>
            > <br>
            > > ---<br>
            > >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 44<br>
            > > ++++++++++++++++++++++++++++--<br>
            > >  1 file changed, 42 insertions(+), 2 deletions(-)<br>
            > ><br>
            > > diff --git
            a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
            > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
            > > index 7becf11..3637396 100644<br>
            > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
            > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
            > > @@ -3625,14 +3625,54 @@ static int
            amdgpu_debugfs_test_ib(struct<br>
            > > seq_file *m, void *data)<br>
            > >      return 0;<br>
            > >  }<br>
            > ><br>
            > > +static int amdgpu_ring_tests(struct amdgpu_device
            *adev)<br>
            > > +{<br>
            > > +   unsigned i;<br>
            > > +   int r = 0;<br>
            > > +<br>
            > > +   for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {<br>
            > > +           struct amdgpu_ring *ring =
            adev->rings[i];<br>
            > > +<br>
            > > +           if (!ring || !ring->ready)<br>
            > > +                   continue;<br>
            > > +<br>
            > > +           r = amdgpu_ring_test_ring(ring);<br>
            > > +           if (r) {<br>
            > > +                   ring->ready = false;<br>
            > > +                   DRM_ERROR("amdgpu: failed to
            test ring %d<br>
            > > (%d).\n",<br>
            > > +                             i, r);<br>
            > > +           }<br>
            > > +   }<br>
            > > +<br>
            > > +   return r;<br>
            > > +}<br>
            > > +<br>
            > > +static int amdgpu_debugfs_test_ring(struct
            seq_file *m, void *data)<br>
            > > +{<br>
            > > +   struct drm_info_node *node = (struct
            drm_info_node *) m-<br>
            > > >private;<br>
            > > +   struct drm_device *dev =
            node->minor->dev;<br>
            > > +   struct amdgpu_device *adev =
            dev->dev_private;<br>
            > > +   int r = 0;<br>
            > > +<br>
            > > +   seq_printf(m, "run ring test:\n");<br>
            > > +   r = amdgpu_ring_tests(adev);<br>
            > > +   if (r)<br>
            > > +           seq_printf(m, "ring tests failed
            (%d).\n", r);<br>
            > > +   else<br>
            > > +           seq_printf(m, "ring tests passed.\n");<br>
            > > +<br>
            > > +   return 0;<br>
            > > +}<br>
            > > +<br>
            > >  static const struct drm_info_list
            amdgpu_debugfs_test_ib_ring_list[] = {<br>
            > > -   {"amdgpu_test_ib",
            &amdgpu_debugfs_test_ib}<br>
            > > +   {"amdgpu_test_ib",
            &amdgpu_debugfs_test_ib},<br>
            > > +   {"amdgpu_test_ring",
            &amdgpu_debugfs_test_ring}<br>
            > >  };<br>
            > ><br>
            > >  static int
            amdgpu_debugfs_test_ib_ring_init(struct amdgpu_device<br>
            > *adev)<br>
            > >  {<br>
            > >      return amdgpu_debugfs_add_files(adev,<br>
            > > -                                  
            amdgpu_debugfs_test_ib_ring_list,<br>
            > > 1);<br>
            > > +                                  
            amdgpu_debugfs_test_ib_ring_list,<br>
            > > 2);<br>
            > >  }<br>
            > ><br>
            > >  int amdgpu_debugfs_init(struct drm_minor *minor)<br>
            > > --<br>
            > > 2.7.4<br>
            <br>
          </div>
        </span></font>
    </blockquote>
    <br>
  </body>
</html>