Skip to contentSkip to conversation

drm/amdgpu: wait for IB test on first device open

PATCH In review Christian König 3 participants 5 messages Nov 2, 2018 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: wait for IB test on first device open

Instead of delaying that to the first query. Otherwise we could try to use the SDMA for VM updates before the IB tests are done.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -3
index 08d04f68dfeb..f87f717cc905 100644
@@ -467,9 +467,6 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
 	if (!info->return_size || !info->return_pointer)
 		return -EINVAL;
 
-	/* Ensure IB tests are run on ring */
-	flush_delayed_work(&adev->late_init_work);
-
 	switch (info->query) {
 	case AMDGPU_INFO_ACCEL_WORKING:
 		ui32 = adev->accel_working;
@@ -950,6 +947,9 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 	struct amdgpu_fpriv *fpriv;
 	int r, pasid;
 
+	/* Ensure IB tests are run on ring */
+	flush_delayed_work(&adev->late_init_work);
+
 	file_priv->driver_priv = NULL;
 
 	r = pm_runtime_get_sync(dev->dev);
Signature · 6 lines
2.17.1

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

A message that is not in the archive (sent off-list or not yet received): 20181102084431.5979-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

Reviewed-by Chunming Zhou
#2 lore raw
Quoted 45 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian K?nig
Sent: Friday, November 02, 2018 4:45 PM
To: [email protected]
Subject: [PATCH] drm/amdgpu: wait for IB test on first device open

Instead of delaying that to the first query. Otherwise we could try to use the SDMA for VM updates before the IB tests are done.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
index 08d04f68dfeb..f87f717cc905 100644
@@ -467,9 +467,6 @@ static int amdgpu_info_ioctl(struct drm_device *dev,

void *data, struct drm_file

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -3
 	if (!info->return_size || !info->return_pointer)
 		return -EINVAL;
 
-	/* Ensure IB tests are run on ring */
-	flush_delayed_work(&adev->late_init_work);
-
 	switch (info->query) {
 	case AMDGPU_INFO_ACCEL_WORKING:
 		ui32 = adev->accel_working;
@@ -950,6 +947,9 @@ int amdgpu_driver_open_kms(struct drm_device
 *dev, struct drm_file *file_priv)
 	struct amdgpu_fpriv *fpriv;
 	int r, pasid;
 
+	/* Ensure IB tests are run on ring */
+	flush_delayed_work(&adev->late_init_work);
+
 	file_priv->driver_priv = NULL;
 

r = pm_runtime_get_sync(dev->dev);
--
2.17.1

Quoted 4 lines

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

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

#3 lore raw
In reply to a message not in the archive
Quoted 2 lines · Christian König

Instead of delaying that to the first query. Otherwise we could try to use the SDMA for VM updates before the IB tests are done.

Be curious:
Does that happen when App opens dri node without libdrm? since device init always queries info at first.

Regards,
Jerry

Quoted 21 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -3
index 08d04f68dfeb..f87f717cc905 100644
@@ -467,9 +467,6 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
  	if (!info->return_size || !info->return_pointer)
  		return -EINVAL;
 
-	/* Ensure IB tests are run on ring */
-	flush_delayed_work(&adev->late_init_work);
-
  	switch (info->query) {
  	case AMDGPU_INFO_ACCEL_WORKING:
  		ui32 = adev->accel_working;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) · line 955

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
@@ -950,6 +947,9 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
  	struct amdgpu_fpriv *fpriv;
  	int r, pasid;
 
+	/* Ensure IB tests are run on ring */
+	flush_delayed_work(&adev->late_init_work);
+
  	file_priv->driver_priv = NULL;
 
  	r = pm_runtime_get_sync(dev->dev);

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

A message that is not in the archive (sent off-list or not yet received): 9b392658-4e13-9261-3637-3e91af51295d-5C7GfCeVMHo@public.gmane.org

#5 lore raw

Am 02.11.18 um 10:19 schrieb Zhang, Jerry(Junwei):

Quoted 7 lines · Christian König
Quoted 2 lines

Instead of delaying that to the first query. Otherwise we could try to use the SDMA for VM updates before the IB tests are done.

Be curious:
Does that happen when App opens dri node without libdrm? since device init always queries info at first.

The problem is at this point we have already created the root PD and cleared it using the SDMA.

So we can end up with the sequence root PD clear -> IB test.

Not much of an issue, but I just noticed this during one of my tests.

Christian.

Quoted 24 lines

Regards,
Jerry

Quoted 21 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 +++---

  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
index 08d04f68dfeb..f87f717cc905 100644
@@ -467,9 +467,6 @@ static int amdgpu_info_ioctl(struct drm_device 
 *dev, void *data, struct drm_file
       if (!info->return_size || !info->return_pointer)
           return -EINVAL;

  -    /* Ensure IB tests are run on ring */
-    flush_delayed_work(&adev->late_init_work);
-
      switch (info->query) {
      case AMDGPU_INFO_ACCEL_WORKING:
          ui32 = adev->accel_working;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
@@ -950,6 +947,9 @@ int amdgpu_driver_open_kms(struct drm_device 
Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
 *dev, struct drm_file *file_priv)
       struct amdgpu_fpriv *fpriv;
       int r, pasid;

  +    /* Ensure IB tests are run on ring */
+    flush_delayed_work(&adev->late_init_work);
+
      file_priv->driver_priv = NULL;
        r = pm_runtime_get_sync(dev->dev);

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

A message that is not in the archive (sent off-list or not yet received): b3d40d8b-acee-8cc7-7599-b3e12c2a1713-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Reviewed-by Junwei Zhang
#7 lore raw
Quoted 9 lines · Christian König

Am 02.11.18 um 10:19 schrieb Zhang, Jerry(Junwei):

Quoted 7 lines · Christian König
Quoted 2 lines

Instead of delaying that to the first query. Otherwise we could try to use the SDMA for VM updates before the IB tests are done.

Be curious:
Does that happen when App opens dri node without libdrm? since device init always queries info at first.

Quoted 5 lines

The problem is at this point we have already created the root PD and cleared it using the SDMA.

So we can end up with the sequence root PD clear -> IB test.

Not much of an issue, but I just noticed this during one of my tests.

Yeah, indeed.
Hope that delay work is executed prior to later root PD clear operation.

Anyway, feel free to add

Jerry

Quoted 37 lines

Christian.

Quoted 33 lines

Regards,
Jerry

Quoted 29 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 +++---

  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
index 08d04f68dfeb..f87f717cc905 100644
@@ -467,9 +467,6 @@ static int amdgpu_info_ioctl(struct drm_device 
 *dev, void *data, struct drm_file
       if (!info->return_size || !info->return_pointer)
           return -EINVAL;

  -    /* Ensure IB tests are run on ring */
-    flush_delayed_work(&adev->late_init_work);
-
      switch (info->query) {
      case AMDGPU_INFO_ACCEL_WORKING:
          ui32 = adev->accel_working;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
@@ -950,6 +947,9 @@ int amdgpu_driver_open_kms(struct drm_device 
 *dev, struct drm_file *file_priv)
       struct amdgpu_fpriv *fpriv;
       int r, pasid;

  +    /* Ensure IB tests are run on ring */
+    flush_delayed_work(&adev->late_init_work);
+
      file_priv->driver_priv = NULL;
        r = pm_runtime_get_sync(dev->dev);

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