All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: export test ib debugfs interface
@ 2017-05-11  2:29 Huang Rui
       [not found] ` <1494469757-25784-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Huang Rui @ 2017-05-11  2:29 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Alex Deucher,
	Christian König
  Cc: Chunming Zhou, Huang Rui, Alvin Huan, Ken Wang

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 <ray.huang@amd.com>
---
 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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
       [not found] ` <1494469757-25784-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
@ 2017-05-11  2:29   ` Huang Rui
       [not found]     ` <1494469757-25784-2-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
  2017-05-11  2:33   ` [PATCH 1/2] drm/amdgpu: export test ib " Deucher, Alexander
  1 sibling, 1 reply; 10+ messages in thread
From: Huang Rui @ 2017-05-11  2:29 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Alex Deucher,
	Christian König
  Cc: Chunming Zhou, Huang Rui, Alvin Huan, Ken Wang

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 44 ++++++++++++++++++++++++++++--
 1 file changed, 42 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 7becf11..3637396 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3625,14 +3625,54 @@ static int amdgpu_debugfs_test_ib(struct seq_file *m, void *data)
 	return 0;
 }
 
+static int amdgpu_ring_tests(struct amdgpu_device *adev)
+{
+	unsigned i;
+	int r = 0;
+
+	for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
+		struct amdgpu_ring *ring = adev->rings[i];
+
+		if (!ring || !ring->ready)
+			continue;
+
+		r = amdgpu_ring_test_ring(ring);
+		if (r) {
+			ring->ready = false;
+			DRM_ERROR("amdgpu: failed to test ring %d (%d).\n",
+				  i, r);
+		}
+	}
+
+	return r;
+}
+
+static int amdgpu_debugfs_test_ring(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 ring test:\n");
+	r = amdgpu_ring_tests(adev);
+	if (r)
+		seq_printf(m, "ring tests failed (%d).\n", r);
+	else
+		seq_printf(m, "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}
+	{"amdgpu_test_ib", &amdgpu_debugfs_test_ib},
+	{"amdgpu_test_ring", &amdgpu_debugfs_test_ring}
 };
 
 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);
+					amdgpu_debugfs_test_ib_ring_list, 2);
 }
 
 int amdgpu_debugfs_init(struct drm_minor *minor)
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* RE: [PATCH 1/2] drm/amdgpu: export test ib debugfs interface
       [not found] ` <1494469757-25784-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
  2017-05-11  2:29   ` [PATCH 2/2] drm/amdgpu: export test ring " Huang Rui
@ 2017-05-11  2:33   ` Deucher, Alexander
  1 sibling, 0 replies; 10+ messages in thread
From: Deucher, Alexander @ 2017-05-11  2:33 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Koenig, Christian
  Cc: Zhou, David(ChunMing), Wang, Ken, Huang, Ray, Huan, Alvin

> -----Original Message-----
> From: Huang Rui [mailto:ray.huang@amd.com]
> Sent: Wednesday, May 10, 2017 10:29 PM
> To: amd-gfx@lists.freedesktop.org; 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 <ray.huang@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
       [not found]     ` <1494469757-25784-2-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
@ 2017-05-11  2:38       ` Deucher, Alexander
       [not found]         ` <BN6PR12MB16521EA7A33D9718734FD83EF7ED0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Deucher, Alexander @ 2017-05-11  2:38 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Koenig, Christian
  Cc: Zhou, David(ChunMing), Wang, Ken, Huang, Ray, Huan, Alvin

> -----Original Message-----
> From: Huang Rui [mailto:ray.huang@amd.com]
> Sent: Wednesday, May 10, 2017 10:29 PM
> To: amd-gfx@lists.freedesktop.org; Deucher, Alexander; Koenig, Christian
> Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
> Subject: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
> 
> Signed-off-by: Huang Rui <ray.huang@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 44
> ++++++++++++++++++++++++++++--
>  1 file changed, 42 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 7becf11..3637396 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3625,14 +3625,54 @@ static int amdgpu_debugfs_test_ib(struct
> seq_file *m, void *data)
>  	return 0;
>  }
> 
> +static int amdgpu_ring_tests(struct amdgpu_device *adev)
> +{
> +	unsigned i;
> +	int r = 0;
> +
> +	for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
> +		struct amdgpu_ring *ring = adev->rings[i];
> +
> +		if (!ring || !ring->ready)
> +			continue;
> +
> +		r = amdgpu_ring_test_ring(ring);
> +		if (r) {
> +			ring->ready = false;
> +			DRM_ERROR("amdgpu: failed to test ring %d
> (%d).\n",
> +				  i, r);
> +		}
> +	}
> +
> +	return r;
> +}
> +
> +static int amdgpu_debugfs_test_ring(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 ring test:\n");
> +	r = amdgpu_ring_tests(adev);
> +	if (r)
> +		seq_printf(m, "ring tests failed (%d).\n", r);
> +	else
> +		seq_printf(m, "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}
> +	{"amdgpu_test_ib", &amdgpu_debugfs_test_ib},
> +	{"amdgpu_test_ring", &amdgpu_debugfs_test_ring}
>  };
> 
>  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);
> +					amdgpu_debugfs_test_ib_ring_list,
> 2);
>  }
> 
>  int amdgpu_debugfs_init(struct drm_minor *minor)
> --
> 2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
       [not found]         ` <BN6PR12MB16521EA7A33D9718734FD83EF7ED0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-05-11  2:41           ` Deucher, Alexander
       [not found]             ` <BN6PR12MB1652A074AABF32DDD7F559F7F7ED0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Deucher, Alexander @ 2017-05-11  2:41 UTC (permalink / raw)
  To: 'amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org',
	Koenig, Christian
  Cc: Zhou, David(ChunMing), Wang, Ken, Huang, Ray, Huan, Alvin

> -----Original Message-----
> From: Deucher, Alexander
> Sent: Wednesday, May 10, 2017 10:38 PM
> To: Huang, Ray; amd-gfx@lists.freedesktop.org; Koenig, Christian
> Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
> Subject: RE: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
> 
> > -----Original Message-----
> > From: Huang Rui [mailto:ray.huang@amd.com]
> > Sent: Wednesday, May 10, 2017 10:29 PM
> > To: amd-gfx@lists.freedesktop.org; Deucher, Alexander; Koenig, Christian
> > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
> > Subject: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
> >
> > Signed-off-by: Huang Rui <ray.huang@amd.com>
> 
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

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.

Alex

> 
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 44
> > ++++++++++++++++++++++++++++--
> >  1 file changed, 42 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > index 7becf11..3637396 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > @@ -3625,14 +3625,54 @@ static int amdgpu_debugfs_test_ib(struct
> > seq_file *m, void *data)
> >  	return 0;
> >  }
> >
> > +static int amdgpu_ring_tests(struct amdgpu_device *adev)
> > +{
> > +	unsigned i;
> > +	int r = 0;
> > +
> > +	for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
> > +		struct amdgpu_ring *ring = adev->rings[i];
> > +
> > +		if (!ring || !ring->ready)
> > +			continue;
> > +
> > +		r = amdgpu_ring_test_ring(ring);
> > +		if (r) {
> > +			ring->ready = false;
> > +			DRM_ERROR("amdgpu: failed to test ring %d
> > (%d).\n",
> > +				  i, r);
> > +		}
> > +	}
> > +
> > +	return r;
> > +}
> > +
> > +static int amdgpu_debugfs_test_ring(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 ring test:\n");
> > +	r = amdgpu_ring_tests(adev);
> > +	if (r)
> > +		seq_printf(m, "ring tests failed (%d).\n", r);
> > +	else
> > +		seq_printf(m, "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}
> > +	{"amdgpu_test_ib", &amdgpu_debugfs_test_ib},
> > +	{"amdgpu_test_ring", &amdgpu_debugfs_test_ring}
> >  };
> >
> >  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);
> > +					amdgpu_debugfs_test_ib_ring_list,
> > 2);
> >  }
> >
> >  int amdgpu_debugfs_init(struct drm_minor *minor)
> > --
> > 2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
       [not found]             ` <BN6PR12MB1652A074AABF32DDD7F559F7F7ED0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-05-11  2:50               ` zhoucm1
       [not found]                 ` <5913D169.6000304-5C7GfCeVMHo@public.gmane.org>
  2017-05-11  2:56               ` Huang Rui
  1 sibling, 1 reply; 10+ messages in thread
From: zhoucm1 @ 2017-05-11  2:50 UTC (permalink / raw)
  To: Deucher, Alexander, Huang, Ray,
	'amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org',
	Koenig, Christian
  Cc: Huan, Alvin, Wang, Ken


[-- Attachment #1.1: Type: text/plain, Size: 4093 bytes --]



On 2017年05月11日 10:41, Deucher, Alexander wrote:
> > -----Original Message-----
> > From: Deucher, Alexander
> > Sent: Wednesday, May 10, 2017 10:38 PM
> > To: Huang, Ray; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; Koenig, Christian
> > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
> > Subject: RE: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
> >
> > > -----Original Message-----
> > > From: Huang Rui [mailto:ray.huang-5C7GfCeVMHo@public.gmane.org]
> > > Sent: Wednesday, May 10, 2017 10:29 PM
> > > To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; Deucher, Alexander; Koenig, 
> Christian
> > > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
> > > Subject: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
> > >
> > > Signed-off-by: Huang Rui <ray.huang-5C7GfCeVMHo@public.gmane.org>
> >
> > Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>
> 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.
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:).

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.

Regards,
David Zhou
>
> Alex
>
> >
> > > ---
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 44
> > > ++++++++++++++++++++++++++++--
> > >  1 file changed, 42 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > index 7becf11..3637396 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > @@ -3625,14 +3625,54 @@ static int amdgpu_debugfs_test_ib(struct
> > > seq_file *m, void *data)
> > >      return 0;
> > >  }
> > >
> > > +static int amdgpu_ring_tests(struct amdgpu_device *adev)
> > > +{
> > > +   unsigned i;
> > > +   int r = 0;
> > > +
> > > +   for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
> > > +           struct amdgpu_ring *ring = adev->rings[i];
> > > +
> > > +           if (!ring || !ring->ready)
> > > +                   continue;
> > > +
> > > +           r = amdgpu_ring_test_ring(ring);
> > > +           if (r) {
> > > +                   ring->ready = false;
> > > +                   DRM_ERROR("amdgpu: failed to test ring %d
> > > (%d).\n",
> > > +                             i, r);
> > > +           }
> > > +   }
> > > +
> > > +   return r;
> > > +}
> > > +
> > > +static int amdgpu_debugfs_test_ring(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 ring test:\n");
> > > +   r = amdgpu_ring_tests(adev);
> > > +   if (r)
> > > +           seq_printf(m, "ring tests failed (%d).\n", r);
> > > +   else
> > > +           seq_printf(m, "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}
> > > +   {"amdgpu_test_ib", &amdgpu_debugfs_test_ib},
> > > +   {"amdgpu_test_ring", &amdgpu_debugfs_test_ring}
> > >  };
> > >
> > >  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);
> > > + amdgpu_debugfs_test_ib_ring_list,
> > > 2);
> > >  }
> > >
> > >  int amdgpu_debugfs_init(struct drm_minor *minor)
> > > --
> > > 2.7.4
>


[-- Attachment #1.2: Type: text/html, Size: 8444 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
       [not found]             ` <BN6PR12MB1652A074AABF32DDD7F559F7F7ED0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  2017-05-11  2:50               ` zhoucm1
@ 2017-05-11  2:56               ` Huang Rui
  2017-05-11  3:00                 ` Alex Deucher
  1 sibling, 1 reply; 10+ messages in thread
From: Huang Rui @ 2017-05-11  2:56 UTC (permalink / raw)
  To: Deucher, Alexander, g
  Cc: Zhou, David(ChunMing),
	Wang, Ken, Koenig, Christian,
	'amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org',
	Huan, Alvin

On Thu, May 11, 2017 at 10:41:42AM +0800, Deucher, Alexander wrote:
> > -----Original Message-----
> > From: Deucher, Alexander
> > Sent: Wednesday, May 10, 2017 10:38 PM
> > To: Huang, Ray; amd-gfx@lists.freedesktop.org; Koenig, Christian
> > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
> > Subject: RE: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
> >
> > > -----Original Message-----
> > > From: Huang Rui [mailto:ray.huang@amd.com]
> > > Sent: Wednesday, May 10, 2017 10:29 PM
> > > To: amd-gfx@lists.freedesktop.org; Deucher, Alexander; Koenig, Christian
> > > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
> > > Subject: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
> > >
> > > Signed-off-by: Huang Rui <ray.huang@amd.com>
> >
> > Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> 
> 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.
> 

Right. Any idea to hold on scheduler when I try to run this test?

Thanks,
Rui
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
  2017-05-11  2:56               ` Huang Rui
@ 2017-05-11  3:00                 ` Alex Deucher
  0 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2017-05-11  3:00 UTC (permalink / raw)
  To: Huang Rui
  Cc: Zhou, David(ChunMing),
	Huan, Alvin, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Deucher,
	Alexander, Wang, Ken, Koenig, Christian

On Wed, May 10, 2017 at 10:56 PM, Huang Rui <ray.huang@amd.com> wrote:
> On Thu, May 11, 2017 at 10:41:42AM +0800, Deucher, Alexander wrote:
>> > -----Original Message-----
>> > From: Deucher, Alexander
>> > Sent: Wednesday, May 10, 2017 10:38 PM
>> > To: Huang, Ray; amd-gfx@lists.freedesktop.org; Koenig, Christian
>> > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
>> > Subject: RE: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
>> >
>> > > -----Original Message-----
>> > > From: Huang Rui [mailto:ray.huang@amd.com]
>> > > Sent: Wednesday, May 10, 2017 10:29 PM
>> > > To: amd-gfx@lists.freedesktop.org; Deucher, Alexander; Koenig, Christian
>> > > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
>> > > Subject: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
>> > >
>> > > Signed-off-by: Huang Rui <ray.huang@amd.com>
>> >
>> > Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>>
>> 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.
>>
>
> Right. Any idea to hold on scheduler when I try to run this test?

Park the scheduler thread for each ring like we do for GPU reset?
That said, I think the expectation is that you should only run these
tests when the GPU is idle.

Alex
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
  2017-05-11  3:03                   ` Huang Rui
@ 2017-05-11  3:02                     ` zhoucm1
  0 siblings, 0 replies; 10+ messages in thread
From: zhoucm1 @ 2017-05-11  3:02 UTC (permalink / raw)
  To: Huang Rui
  Cc: Deucher, Alexander, Huan, Alvin, Wang, Ken, Koenig, Christian,
	'amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org'



On 2017年05月11日 11:03, Huang Rui wrote:
> On Thu, May 11, 2017 at 10:50:17AM +0800, Zhou, David(ChunMing) wrote:
>>
>> On 2017年05月11日 10:41, Deucher, Alexander wrote:
>>
>>      > -----Original Message-----
>>      > From: Deucher, Alexander
>>      > Sent: Wednesday, May 10, 2017 10:38 PM
>>      > To: Huang, Ray; amd-gfx@lists.freedesktop.org; Koenig, Christian
>>      > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
>>      > Subject: RE: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
>>      >
>>      > > -----Original Message-----
>>      > > From: Huang Rui [mailto:ray.huang@amd.com]
>>      > > Sent: Wednesday, May 10, 2017 10:29 PM
>>      > > To: amd-gfx@lists.freedesktop.org; Deucher, Alexander; Koenig,
>>      Christian
>>      > > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
>>      > > Subject: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
>>      > >
>>      > > Signed-off-by: Huang Rui <ray.huang@amd.com>
>>      >
>>      > Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>>
>>      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.
>>
>> 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:).
> Do you know any method to hold on the scheduler?
like Alex suggested, park scheduler, and then do your things.

Regards,
David Zhou
>
>> 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.
>>
> In normal case, ring tests&ib tests must be passed during boot&resume&reset
> phase. Is there anything that will break the ring test at runtime?
>
> Thanks,
> Rui

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
       [not found]                 ` <5913D169.6000304-5C7GfCeVMHo@public.gmane.org>
@ 2017-05-11  3:03                   ` Huang Rui
  2017-05-11  3:02                     ` zhoucm1
  0 siblings, 1 reply; 10+ messages in thread
From: Huang Rui @ 2017-05-11  3:03 UTC (permalink / raw)
  To: Zhou, David(ChunMing)
  Cc: Deucher, Alexander, Huan, Alvin, Wang, Ken, Koenig, Christian,
	'amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org'

On Thu, May 11, 2017 at 10:50:17AM +0800, Zhou, David(ChunMing) wrote:
> 
> 
> On 2017年05月11日 10:41, Deucher, Alexander wrote:
> 
>     > -----Original Message-----
>     > From: Deucher, Alexander
>     > Sent: Wednesday, May 10, 2017 10:38 PM
>     > To: Huang, Ray; amd-gfx@lists.freedesktop.org; Koenig, Christian
>     > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
>     > Subject: RE: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
>     >
>     > > -----Original Message-----
>     > > From: Huang Rui [mailto:ray.huang@amd.com]
>     > > Sent: Wednesday, May 10, 2017 10:29 PM
>     > > To: amd-gfx@lists.freedesktop.org; Deucher, Alexander; Koenig,
>     Christian
>     > > Cc: Zhou, David(ChunMing); Wang, Ken; Huan, Alvin; Huang, Ray
>     > > Subject: [PATCH 2/2] drm/amdgpu: export test ring debugfs interface
>     > >
>     > > Signed-off-by: Huang Rui <ray.huang@amd.com>
>     >
>     > Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> 
>     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.
> 
> 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:).

Do you know any method to hold on the scheduler?

> 
> 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.
> 

In normal case, ring tests&ib tests must be passed during boot&resume&reset
phase. Is there anything that will break the ring test at runtime?

Thanks,
Rui
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-05-11  3:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-11  2:29 [PATCH 1/2] drm/amdgpu: export test ib debugfs interface Huang Rui
     [not found] ` <1494469757-25784-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2017-05-11  2:29   ` [PATCH 2/2] drm/amdgpu: export test ring " Huang Rui
     [not found]     ` <1494469757-25784-2-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2017-05-11  2:38       ` Deucher, Alexander
     [not found]         ` <BN6PR12MB16521EA7A33D9718734FD83EF7ED0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-05-11  2:41           ` Deucher, Alexander
     [not found]             ` <BN6PR12MB1652A074AABF32DDD7F559F7F7ED0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-05-11  2:50               ` zhoucm1
     [not found]                 ` <5913D169.6000304-5C7GfCeVMHo@public.gmane.org>
2017-05-11  3:03                   ` Huang Rui
2017-05-11  3:02                     ` zhoucm1
2017-05-11  2:56               ` Huang Rui
2017-05-11  3:00                 ` Alex Deucher
2017-05-11  2:33   ` [PATCH 1/2] drm/amdgpu: export test ib " Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.