Skip to contentSkip to conversation

drm/syncobj: remove boring message

PATCH In review Chunming Zhou 6 participants 10 messages Jul 29, 2019 – Aug 2, 2019

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

PATCH 1/1 drm/syncobj: remove boring message

It is normal that binary syncobj replaces the underlying fence.

---
 drivers/gpu/drm/drm_syncobj.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_syncobj.c +0 -3
index 929f7c64f9a2..bc7ec1679e4d 100644
@@ -151,9 +151,6 @@ void drm_syncobj_add_point(struct drm_syncobj *syncobj,
 	spin_lock(&syncobj->lock);
 
 	prev = drm_syncobj_fence_get(syncobj);
-	/* You are adding an unorder point to timeline, which could cause payload returned from query_ioctl is 0! */
-	if (prev && prev->seqno >= point)
-		DRM_ERROR("You are adding an unorder point to timeline!\n");
 	dma_fence_chain_init(chain, prev, fence, point);
 	rcu_assign_pointer(syncobj->fence, &chain->base);
 
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 3 lines · Chunming Zhou

It is normal that binary syncobj replaces the underlying fence.

Do we hit this with one of the syncobj igts?
-Daniel

Quoted 25 lines
---
 drivers/gpu/drm/drm_syncobj.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_syncobj.c +0 -3
index 929f7c64f9a2..bc7ec1679e4d 100644
@@ -151,9 +151,6 @@ void drm_syncobj_add_point(struct drm_syncobj *syncobj,
 	spin_lock(&syncobj->lock);
 
 	prev = drm_syncobj_fence_get(syncobj);
-	/* You are adding an unorder point to timeline, which could cause payload returned from query_ioctl is 0! */
-	if (prev && prev->seqno >= point)
-		DRM_ERROR("You are adding an unorder point to timeline!\n");
 	dma_fence_chain_init(chain, prev, fence, point);
 	rcu_assign_pointer(syncobj->fence, &chain->base);
 
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 6 lines · Daniel Vetter
Quoted 3 lines · Chunming Zhou

It is normal that binary syncobj replaces the underlying fence.

Do we hit this with one of the syncobj igts?
-Daniel

With one of the tests sitting on the mailing list waiting for review, yes.

-Lionel

Quoted 19 lines
Quoted 19 lines
---
  drivers/gpu/drm/drm_syncobj.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_syncobj.c +0 -3
index 929f7c64f9a2..bc7ec1679e4d 100644
@@ -151,9 +151,6 @@ void drm_syncobj_add_point(struct drm_syncobj *syncobj,
  	spin_lock(&syncobj->lock);
 
  	prev = drm_syncobj_fence_get(syncobj);
-	/* You are adding an unorder point to timeline, which could cause payload returned from query_ioctl is 0! */
-	if (prev && prev->seqno >= point)
-		DRM_ERROR("You are adding an unorder point to timeline!\n");
  	dma_fence_chain_init(chain, prev, fence, point);
  	rcu_assign_pointer(syncobj->fence, &chain->base);
 
Quoted 7 lines
Quoted 7 lines
Signature · 6 lines
2.17.1

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

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

#3 lore raw
In reply to Daniel Vetter
Quoted 5 lines · Daniel Vetter
Quoted 3 lines · Chunming Zhou

It is normal that binary syncobj replaces the underlying fence.

Do we hit this with one of the syncobj igts?

Unforturnately, No, It's only hit in AMDGPU path, which combines timeline and binary to same path when timeline is enabled.

-David

Quoted 20 lines

-Daniel

Quoted 18 lines
---
  drivers/gpu/drm/drm_syncobj.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_syncobj.c +0 -3
index 929f7c64f9a2..bc7ec1679e4d 100644
@@ -151,9 +151,6 @@ void drm_syncobj_add_point(struct drm_syncobj *syncobj,
  	spin_lock(&syncobj->lock);
 
  	prev = drm_syncobj_fence_get(syncobj);
-	/* You are adding an unorder point to timeline, which could cause payload returned from query_ioctl is 0! */
-	if (prev && prev->seqno >= point)
-		DRM_ERROR("You are adding an unorder point to timeline!\n");
  	dma_fence_chain_init(chain, prev, fence, point);
  	rcu_assign_pointer(syncobj->fence, &chain->base);
 
Quoted 7 lines
Quoted 7 lines
Signature · 6 lines
2.17.1

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

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

#4 lore raw
Quoted 10 lines · On Tue, Jul 30, 2019 at 05:31:26PM +0800, zhoucm1 wrote:
Quoted 5 lines · Daniel Vetter
Quoted 3 lines · Chunming Zhou

It is normal that binary syncobj replaces the underlying fence.

Do we hit this with one of the syncobj igts?

Unforturnately, No, It's only hit in AMDGPU path, which combines timeline and binary to same path when timeline is enabled.

Looks like lionel has something, maybe help review that? -Daniel

Quoted 28 lines

-David

Quoted 25 lines

-Daniel

Quoted 23 lines
---
  drivers/gpu/drm/drm_syncobj.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_syncobj.c +0 -3
index 929f7c64f9a2..bc7ec1679e4d 100644
@@ -151,9 +151,6 @@ void drm_syncobj_add_point(struct drm_syncobj *syncobj,
  	spin_lock(&syncobj->lock);
  	prev = drm_syncobj_fence_get(syncobj);
-	/* You are adding an unorder point to timeline, which could cause payload returned from query_ioctl is 0! */
-	if (prev && prev->seqno >= point)
-		DRM_ERROR("You are adding an unorder point to timeline!\n");
  	dma_fence_chain_init(chain, prev, fence, point);
  	rcu_assign_pointer(syncobj->fence, &chain->base);
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · On Tue, Jul 30, 2019 at 05:31:26PM +0800, zhoucm1 wrote:
Quoted 5 lines · Daniel Vetter
Quoted 3 lines · Chunming Zhou

It is normal that binary syncobj replaces the underlying fence.

Do we hit this with one of the syncobj igts?

Unforturnately, No, It's only hit in AMDGPU path, which combines timeline and binary to same path when timeline is enabled.

We can totally build that case with sw_fences which is what one of the IGT tests does.

-Lionel

Quoted 25 lines

Looks like lionel has something, maybe help review that? -Daniel

Quoted 22 lines

-David

Quoted 21 lines

-Daniel

Quoted 19 lines
---
   drivers/gpu/drm/drm_syncobj.c | 3 ---
   1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_syncobj.c +0 -3
index 929f7c64f9a2..bc7ec1679e4d 100644
@@ -151,9 +151,6 @@ void drm_syncobj_add_point(struct drm_syncobj *syncobj,
   	spin_lock(&syncobj->lock);
   	prev = drm_syncobj_fence_get(syncobj);
-	/* You are adding an unorder point to timeline, which could cause payload returned from query_ioctl is 0! */
-	if (prev && prev->seqno >= point)
-		DRM_ERROR("You are adding an unorder point to timeline!\n");
   	dma_fence_chain_init(chain, prev, fence, point);
   	rcu_assign_pointer(syncobj->fence, &chain->base);
Signature · 1 line
2.17.1
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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

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

#6 lore raw
Quoted 7 lines · Lionel Landwerlin
Quoted 6 lines · Daniel Vetter
Quoted 5 lines · On Tue, Jul 30, 2019 at 05:31:26PM +0800, zhoucm1 wrote:
Quoted 3 lines · Daniel Vetter
Quoted 2 lines · Chunming Zhou

It is normal that binary syncobj replaces the underlying fence.

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

Do we hit this with one of the syncobj igts?

Unforturnately, No, It's only hit in AMDGPU path, which combines timeline and binary to same path when timeline is enabled.

We can totally build that case with sw_fences which is what one of the IGT tests does.

OK, Thank you.

-David

Quoted 32 lines

-Lionel

Quoted 27 lines

Looks like lionel has something, maybe help review that? -Daniel

Quoted 24 lines

-David

Quoted 23 lines

-Daniel

Quoted 21 lines

---
   drivers/gpu/drm/drm_syncobj.c | 3 ---

   1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_syncobj.c +0 -1
index 929f7c64f9a2..bc7ec1679e4d 100644
@@ -151,9 +151,6 @@ void drm_syncobj_add_point(struct drm_syncobj 
 *syncobj,
        spin_lock(&syncobj->lock);
        prev = drm_syncobj_fence_get(syncobj);
-    /* You are adding an unorder point to timeline, which could 

cause payload returned from query_ioctl is 0! */
-    if (prev && prev->seqno >= point)
-        DRM_ERROR("You are adding an unorder point to timeline!\n"); dma_fence_chain_init(chain, prev, fence, point); rcu_assign_pointer(syncobj->fence, &chain->base);

Signature · 1 line
2.17.1
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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

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

#7 lore raw
In reply to Chunming Zhou

Just had a few exchanges with Chris about this.
Chris suggests that if we're about to add a point to the timeline in an unordered fashion, actually better not add it at all.

What's your take on this?
I'm fine with this, but rather than add another variant of add_point() maybe we change change the existing.

Thanks,

-Lionel

Quoted 12 lines · Chunming Zhou

It is normal that binary syncobj replaces the underlying fence.

---
  drivers/gpu/drm/drm_syncobj.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_syncobj.c +0 -0
index 929f7c64f9a2..bc7ec1679e4d 100644

drivers/gpu/drm/drm_syncobj.c void drm_syncobj_add_point(struct drm_syncobj *syncobj, · line 156

Quoted 9 lines
drivers/gpu/drm/drm_syncobj.c +0 -3
@@ -151,9 +151,6 @@ void drm_syncobj_add_point(struct drm_syncobj *syncobj,
  	spin_lock(&syncobj->lock);
 
  	prev = drm_syncobj_fence_get(syncobj);
-	/* You are adding an unorder point to timeline, which could cause payload returned from query_ioctl is 0! */
-	if (prev && prev->seqno >= point)
-		DRM_ERROR("You are adding an unorder point to timeline!\n");
  	dma_fence_chain_init(chain, prev, fence, point);
  	rcu_assign_pointer(syncobj->fence, &chain->base);
 

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

#8 lore raw

Am 01.08.19 um 15:45 schrieb Lionel Landwerlin:

Quoted 5 lines

Just had a few exchanges with Chris about this.
Chris suggests that if we're about to add a point to the timeline in an unordered fashion, actually better not add it at all.

What's your take on this?

That is a clear NAK. See not adding a point at all means we lose some synchronization and that is not something we can do here.

In other words syncing to much if userspace does something nasty is ok and defensive programmed, but not syncing at all could have unforeseen consequences.

Another idea would be to add the fence, but also set an error flag and deny any further signaling on that syncobj.

Regards,
Christian.

Quoted 15 lines

I'm fine with this, but rather than add another variant of add_point() maybe we change change the existing.

Thanks,

-Lionel

Quoted 7 lines · Chunming Zhou

It is normal that binary syncobj replaces the underlying fence.

---
  drivers/gpu/drm/drm_syncobj.c | 3 ---

  1 file changed, 3 deletions(-)
Quoted 17 lines
Quoted 10 lines
drivers/gpu/drm/drm_syncobj.c +0 -1
index 929f7c64f9a2..bc7ec1679e4d 100644
@@ -151,9 +151,6 @@ void drm_syncobj_add_point(struct drm_syncobj 
 *syncobj,
       spin_lock(&syncobj->lock);
         prev = drm_syncobj_fence_get(syncobj);
-    /* You are adding an unorder point to timeline, which could 
Quoted 5 lines

cause payload returned from query_ioctl is 0! */
-    if (prev && prev->seqno >= point)
-        DRM_ERROR("You are adding an unorder point to timeline!\n"); dma_fence_chain_init(chain, prev, fence, point); rcu_assign_pointer(syncobj->fence, &chain->base);

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

#9 lore raw
Quoted 5 lines · Christian

Am 01.08.19 um 15:45 schrieb Lionel Landwerlin:

Quoted 4 lines

Just had a few exchanges with Chris about this.
Chris suggests that if we're about to add a point to the timeline in an unordered fashion, actually better not add it at all.

Quoted 9 lines
Quoted 1 line

What's your take on this?

That is a clear NAK. See not adding a point at all means we lose some synchronization and that is not something we can do here.

In other words syncing to much if userspace does something nasty is ok and defensive programmed, but not syncing at all could have unforeseen consequences.

So if process A signals 7, process B detects that and signals 3 and then process A tries to insert something which waits on 7 and signals 8, what happens? My understanding is that it "breaks" the timeline and so, from the perspective of process A, its signal operation on 7 is gone and it's attempt to wait on 7 will either -EINVAL because the kernel can't find the time point or else just sit there. Am I understanding this correctly? If so, it sounds more like an attack vector than defensive programming to me.

Yes, more syncornization is generally better than less. However, if you're screwing up your syncronization from userspace and getting wrong rendering results, that's your fault. If you're causing your compositor to suddenly start seeing -EINVAL which gets turned into VK_ERROR_DEVICE_LOST, that's a lot worse IMO. I'm not saying that we shouldn't try to be robust in this case; I'm just concerned that the suggest solution isn't.

--Jason

Quoted 39 lines

Another idea would be to add the fence, but also set an error flag and deny any further signaling on that syncobj.

Regards,
Christian.

Quoted 15 lines

I'm fine with this, but rather than add another variant of add_point() maybe we change change the existing.

Thanks,

-Lionel

Quoted 7 lines · Chunming Zhou

It is normal that binary syncobj replaces the underlying fence.

---
  drivers/gpu/drm/drm_syncobj.c | 3 ---
  1 file changed, 3 deletions(-)
Quoted 17 lines
Quoted 11 lines
drivers/gpu/drm/drm_syncobj.c +0 -1
index 929f7c64f9a2..bc7ec1679e4d 100644
@@ -151,9 +151,6 @@ void drm_syncobj_add_point(struct drm_syncobj
 *syncobj,
      spin_lock(&syncobj->lock);
        prev = drm_syncobj_fence_get(syncobj);
-    /* You are adding an unorder point to timeline, which could

cause payload returned from query_ioctl is 0! */

drivers/gpu/drm/drm_syncobj.c void drm_syncobj_add_point(struct drm_syncobj *syncobj, · line 155

Quoted 4 lines
drivers/gpu/drm/drm_syncobj.c +0 -2
-    if (prev && prev->seqno >= point)
-        DRM_ERROR("You are adding an unorder point to timeline!\n");
      dma_fence_chain_init(chain, prev, fence, point);
      rcu_assign_pointer(syncobj->fence, &chain->base);
Quoted 4 lines

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

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