> -----Original Message-----
> From: Huang Rui [mailto:[email protected]]
> Sent: Wednesday, May 10, 2017 10:29 PM
> To: [email protected]; Deucher, Alexander; Koenig, Christian
> Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
> Subject: [PATCH 1/2] drm/amdgpu: export test ib debugfs interface
> 
> As Christian and David's suggestion, submit the test ib ring debug interfaces.
> It's useful for debugging with the command submission without VM case.
> 
> Signed-off-by: Huang Rui <[email protected]>

Reviewed-by: Alex Deucher <[email protected]>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 36
> ++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index b93356b..7becf11 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -59,6 +59,7 @@
> 
>  static int amdgpu_debugfs_regs_init(struct amdgpu_device *adev);
>  static void amdgpu_debugfs_regs_cleanup(struct amdgpu_device *adev);
> +static int amdgpu_debugfs_test_ib_ring_init(struct amdgpu_device *adev);
> 
>  static const char *amdgpu_asic_name[] = {
>       "TAHITI",
> @@ -2083,6 +2084,10 @@ int amdgpu_device_init(struct amdgpu_device
> *adev,
>       if (r)
>               DRM_ERROR("registering register debugfs failed (%d).\n", r);
> 
> +     r = amdgpu_debugfs_test_ib_ring_init(adev);
> +     if (r)
> +             DRM_ERROR("registering register test ib ring debugfs failed
> (%d).\n", r);
> +
>       r = amdgpu_debugfs_firmware_init(adev);
>       if (r)
>               DRM_ERROR("registering firmware debugfs failed (%d).\n",
> r);
> @@ -3603,6 +3608,33 @@ static void amdgpu_debugfs_regs_cleanup(struct
> amdgpu_device *adev)
>       }
>  }
> 
> +static int amdgpu_debugfs_test_ib(struct seq_file *m, void *data)
> +{
> +     struct drm_info_node *node = (struct drm_info_node *) m-
> >private;
> +     struct drm_device *dev = node->minor->dev;
> +     struct amdgpu_device *adev = dev->dev_private;
> +     int r = 0;
> +
> +     seq_printf(m, "run ib test:\n");
> +     r = amdgpu_ib_ring_tests(adev);
> +     if (r)
> +             seq_printf(m, "ib ring tests failed (%d).\n", r);
> +     else
> +             seq_printf(m, "ib ring tests passed.\n");
> +
> +     return 0;
> +}
> +
> +static const struct drm_info_list amdgpu_debugfs_test_ib_ring_list[] = {
> +     {"amdgpu_test_ib", &amdgpu_debugfs_test_ib}
> +};
> +
> +static int amdgpu_debugfs_test_ib_ring_init(struct amdgpu_device *adev)
> +{
> +     return amdgpu_debugfs_add_files(adev,
> +                                     amdgpu_debugfs_test_ib_ring_list,
> 1);
> +}
> +
>  int amdgpu_debugfs_init(struct drm_minor *minor)
>  {
>       return 0;
> @@ -3612,6 +3644,10 @@ void amdgpu_debugfs_cleanup(struct drm_minor
> *minor)
>  {
>  }
>  #else
> +static int amdgpu_debugfs_test_ib_init(struct amdgpu_device *adev)
> +{
> +     return 0;
> +}
>  static int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)
>  {
>       return 0;
> --
> 2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to