Skip to contentSkip to conversation

drm/radeon: fix possible lack of synchronization btw ttm and other ring

PATCH In review [email protected] 4 participants 5 messages May 3, 2012 – May 4, 2012

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

PATCH 1/1 drm/radeon: fix possible lack of synchronization btw ttm and other ring

From: Jerome Glisse <[email protected]>

We need to sync with the GFX ring as ttm might have schedule bo move on it and new command scheduled for other ring need to wait for bo data to be in place.

---
 drivers/gpu/drm/radeon/radeon_cs.c |   12 ++++++------
 include/drm/radeon_drm.h           |    1 -
 2 files changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/radeon/radeon_cs.c +6 -6
index 82f2e7b0..e5f8e17 100644
@@ -122,15 +122,15 @@ static int radeon_cs_sync_rings(struct radeon_cs_parser *p)
 	int i, r;
 
 	for (i = 0; i < p->nrelocs; i++) {
+		struct radeon_fence *fence;
+
 		if (!p->relocs[i].robj || !p->relocs[i].robj->tbo.sync_obj)
 			continue;
 
-		if (!(p->relocs[i].flags & RADEON_RELOC_DONT_SYNC)) {
-			struct radeon_fence *fence = p->relocs[i].robj->tbo.sync_obj;
-			if (fence->ring != p->ring && !radeon_fence_signaled(fence)) {
-				sync_to_ring[fence->ring] = true;
-				need_sync = true;
-			}
+		fence = p->relocs[i].robj->tbo.sync_obj;
+		if (fence->ring != p->ring && !radeon_fence_signaled(fence)) {
+			sync_to_ring[fence->ring] = true;
+			need_sync = true;
 		}
 	}
 
include/drm/radeon_drm.h +0 -1
index 7c491b4..5805686 100644
@@ -926,7 +926,6 @@ struct drm_radeon_cs_chunk {
 };
 
 /* drm_radeon_cs_reloc.flags */
-#define RADEON_RELOC_DONT_SYNC		0x01
 
 struct drm_radeon_cs_reloc {
 	uint32_t		handle;
Signature · 1 line
1.7.7.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Thu, May 3, 2012 at 1:44 PM, <[email protected]> wrote:

From: Jerome Glisse <[email protected]>

We need to sync with the GFX ring as ttm might have schedule bo move on it and new command scheduled for other ring need to wait for bo data to be in place.

Quoted 50 lines

---
 drivers/gpu/drm/radeon/radeon_cs.c |   12 ++++++------ include/drm/radeon_drm.h           |    1 -

 2 files changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/radeon/radeon_cs.c +6 -6
index 82f2e7b0..e5f8e17 100644
@@ -122,15 +122,15 @@ static int radeon_cs_sync_rings(struct radeon_cs_parser *p)
        int i, r;
 
        for (i = 0; i < p->nrelocs; i++) {
+               struct radeon_fence *fence;
+
                if (!p->relocs[i].robj || !p->relocs[i].robj->tbo.sync_obj)
                        continue;
 
-               if (!(p->relocs[i].flags & RADEON_RELOC_DONT_SYNC)) {
-                       struct radeon_fence *fence = p->relocs[i].robj->tbo.sync_obj;
-                       if (fence->ring != p->ring && !radeon_fence_signaled(fence)) {
-                               sync_to_ring[fence->ring] = true;
-                               need_sync = true;
-                       }
+               fence = p->relocs[i].robj->tbo.sync_obj;
+               if (fence->ring != p->ring && !radeon_fence_signaled(fence)) {
+                       sync_to_ring[fence->ring] = true;
+                       need_sync = true;
                }
        }
 
include/drm/radeon_drm.h +0 -2
index 7c491b4..5805686 100644
@@ -926,7 +926,6 @@ struct drm_radeon_cs_chunk {
  };
 
  /* drm_radeon_cs_reloc.flags */
-#define RADEON_RELOC_DONT_SYNC         0x01
 
  struct drm_radeon_cs_reloc {
        uint32_t                handle;
--

1.7.7.6

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

Reviewed-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 7 lines · On 03.05.2012 19:44, [email protected] wrote:

From: Jerome Glisse<[email protected]>

We need to sync with the GFX ring as ttm might have schedule bo move on it and new command scheduled for other ring need to wait for bo data to be in place.

Quoted 43 lines
---
  drivers/gpu/drm/radeon/radeon_cs.c |   12 ++++++------
  include/drm/radeon_drm.h           |    1 -
  2 files changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/radeon/radeon_cs.c +6 -6
index 82f2e7b0..e5f8e17 100644
@@ -122,15 +122,15 @@ static int radeon_cs_sync_rings(struct radeon_cs_parser *p)
  	int i, r;
 
  	for (i = 0; i<  p->nrelocs; i++) {
+		struct radeon_fence *fence;
+
  		if (!p->relocs[i].robj || !p->relocs[i].robj->tbo.sync_obj)
  			continue;
 
-		if (!(p->relocs[i].flags&  RADEON_RELOC_DONT_SYNC)) {
-			struct radeon_fence *fence = p->relocs[i].robj->tbo.sync_obj;
-			if (fence->ring != p->ring&&  !radeon_fence_signaled(fence)) {
-				sync_to_ring[fence->ring] = true;
-				need_sync = true;
-			}
+		fence = p->relocs[i].robj->tbo.sync_obj;
+		if (fence->ring != p->ring&&  !radeon_fence_signaled(fence)) {
+			sync_to_ring[fence->ring] = true;
+			need_sync = true;
  		}
  	}
 
include/drm/radeon_drm.h +0 -1
index 7c491b4..5805686 100644
@@ -926,7 +926,6 @@ struct drm_radeon_cs_chunk {
  };
 
  /* drm_radeon_cs_reloc.flags */
-#define RADEON_RELOC_DONT_SYNC		0x01
 
  struct drm_radeon_cs_reloc {
  	uint32_t		handle;
maintainer
#3 lore raw
Quoted 7 lines
Quoted 7 lines

From: Jerome Glisse<[email protected]>

We need to sync with the GFX ring as ttm might have schedule bo move on it and new command scheduled for other ring need to wait for bo data to be in place.

Is this required for -fixes? if so it doesn't apply clean.

Dave.

#4 lore raw
Quoted 7 lines · Dave Airlie
Quoted 6 lines
Quoted 6 lines

From: Jerome Glisse<[email protected]>

We need to sync with the GFX ring as ttm might have schedule bo move on it and new command scheduled for other ring need to wait for bo data to be in place.

Is this required for -fixes? if so it doesn't apply clean.

Nope, only drm-next, since there isn't any public available client that makes use of it.

Christian.