Skip to contentSkip to conversation

drm/amdgpu/vce4: workaround VCE ring test slow issue

PATCH In review Xiangliang Yu 2 participants 3 messages Apr 11, 2017 – Apr 12, 2017 2 messages not in the archive

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

PATCH 2/3 drm/amdgpu/vce4: workaround VCE ring test slow issue

Add VCE ring test slow workaround for SRIOV.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +7 -3
index e43c83f..cdff938 100644
@@ -955,7 +955,11 @@ int amdgpu_vce_ring_test_ring(struct amdgpu_ring *ring)
 	struct amdgpu_device *adev = ring->adev;
 	uint32_t rptr = amdgpu_ring_get_rptr(ring);
 	unsigned i;
-	int r;
+	int r, timeout = adev->usec_timeout;
+
+	/* workaround VCE ring test slow issue for sriov*/
+	if (amdgpu_sriov_vf(adev))
+		timeout *= 10;
 
 	/* TODO: remove it if VCE can work for sriov */
 	if (amdgpu_sriov_vf(adev))
@@ -970,13 +974,13 @@ int amdgpu_vce_ring_test_ring(struct amdgpu_ring *ring)
 	amdgpu_ring_write(ring, VCE_CMD_END);
 	amdgpu_ring_commit(ring);
 
-	for (i = 0; i < adev->usec_timeout; i++) {
+	for (i = 0; i < timeout; i++) {
 		if (amdgpu_ring_get_rptr(ring) != rptr)
 			break;
 		DRM_UDELAY(1);
 	}
 
-	if (i < adev->usec_timeout) {
+	if (i < timeout) {
 		DRM_INFO("ring test on %d succeeded in %d usecs\n",
 			 ring->idx, i);
 	} else {
Signature · 6 lines
2.7.4

_______________________________________________
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): 1491895867-6031-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 23 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Xiangliang Yu
Sent: Tuesday, April 11, 2017 3:31 AM
To: [email protected]
Cc: Min, Frank; Yu, Xiangliang
Subject: [PATCH 2/3] drm/amdgpu/vce4: workaround VCE ring test slow issue

Add VCE ring test slow workaround for SRIOV.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +0 -0
index e43c83f..cdff938 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c int amdgpu_vce_ring_test_ring(struct amdgpu_ring · line 959

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +1 -1
@@ -955,7 +955,11 @@ int amdgpu_vce_ring_test_ring(struct amdgpu_ring
 *ring)
 	struct amdgpu_device *adev = ring->adev;
 	uint32_t rptr = amdgpu_ring_get_rptr(ring);
 	unsigned i;
-	int r;
+	int r, timeout = adev->usec_timeout;

Do you need longer timeouts elsewhere as well? If so, it might make more sense to just change the default setting for adev->usec_timeout for SR-IOV.

Alex

Quoted 27 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +4 -0
+
+	/* workaround VCE ring test slow issue for sriov*/
+	if (amdgpu_sriov_vf(adev))
+		timeout *= 10;
 
 	/* TODO: remove it if VCE can work for sriov */
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +2 -2
 	if (amdgpu_sriov_vf(adev))
@@ -970,13 +974,13 @@ int amdgpu_vce_ring_test_ring(struct
 amdgpu_ring *ring)
 	amdgpu_ring_write(ring, VCE_CMD_END);
 	amdgpu_ring_commit(ring);
 
-	for (i = 0; i < adev->usec_timeout; i++) {
+	for (i = 0; i < timeout; i++) {
 		if (amdgpu_ring_get_rptr(ring) != rptr)
 			break;
 		DRM_UDELAY(1);
 	}
 
-	if (i < adev->usec_timeout) {
+	if (i < timeout) {
 		DRM_INFO("ring test on %d succeeded in %d usecs\n",
 			 ring->idx, i);

} else {
--
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1652C2404BD43635D46D1393F7000-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw
Quoted 24 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c int amdgpu_vce_ring_test_ring(struct

Quoted 23 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Xiangliang Yu
Sent: Tuesday, April 11, 2017 3:31 AM
To: [email protected]
Cc: Min, Frank; Yu, Xiangliang
Subject: [PATCH 2/3] drm/amdgpu/vce4: workaround VCE ring test slow issue

Add VCE ring test slow workaround for SRIOV.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +0 -0
index e43c83f..cdff938 100644
@@ -955,7 +955,11 @@ int amdgpu_vce_ring_test_ring(struct

amdgpu_ring

Quoted 9 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c int amdgpu_vce_ring_test_ring(struct amdgpu_ring *ring) · line 958

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +1 -1
 *ring)
 	struct amdgpu_device *adev = ring->adev;
 	uint32_t rptr = amdgpu_ring_get_rptr(ring);
 	unsigned i;
-	int r;
+	int r, timeout = adev->usec_timeout;

Do you need longer timeouts elsewhere as well? If so, it might make more sense to just change the default setting for adev->usec_timeout for SR-IOV.

No, just this case for temporarily.

Quoted 29 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c int amdgpu_vce_ring_test_ring(struct

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +4 -0
+
+	/* workaround VCE ring test slow issue for sriov*/
+	if (amdgpu_sriov_vf(adev))
+		timeout *= 10;
 
 	/* TODO: remove it if VCE can work for sriov */
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +0 -0
 	if (amdgpu_sriov_vf(adev))
@@ -970,13 +974,13 @@ int amdgpu_vce_ring_test_ring(struct

amdgpu_ring

Quoted 19 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +2 -2
 *ring)
 	amdgpu_ring_write(ring, VCE_CMD_END);
 	amdgpu_ring_commit(ring);
 
-	for (i = 0; i < adev->usec_timeout; i++) {
+	for (i = 0; i < timeout; i++) {
 		if (amdgpu_ring_get_rptr(ring) != rptr)
 			break;
 		DRM_UDELAY(1);
 	}
 
-	if (i < adev->usec_timeout) {
+	if (i < timeout) {
 		DRM_INFO("ring test on %d succeeded in %d usecs\n",
 			 ring->idx, i);

} else {
--
2.7.4

Quoted 4 lines
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