Skip to contentSkip to conversation

drm/ttm: Don't skip fpfn check if lpfn is 0 in ttm_bo_mem_compat

PATCH In review Michel Dänzer 3 participants 3 messages Oct 9, 2014 – Oct 13, 2014

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

PATCH 1/1 drm/ttm: Don't skip fpfn check if lpfn is 0 in ttm_bo_mem_compat

From: Michel Dänzer <[email protected]>

---
 drivers/gpu/drm/ttm/ttm_bo.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +4 -4
index 407fa2d..d395b0b 100644
@@ -1008,9 +1008,9 @@ static bool ttm_bo_mem_compat(struct ttm_placement *placement,
 
 	for (i = 0; i < placement->num_placement; i++) {
 		const struct ttm_place *heap = &placement->placement[i];
-		if (mem->mm_node && heap->lpfn != 0 &&
+		if (mem->mm_node &&
 		    (mem->start < heap->fpfn ||
-		     mem->start + mem->num_pages > heap->lpfn))
+		     (heap->lpfn != 0 && (mem->start + mem->num_pages) > heap->lpfn)))
 			continue;
 
 		*new_flags = heap->flags;
@@ -1021,9 +1021,9 @@ static bool ttm_bo_mem_compat(struct ttm_placement *placement,
 
 	for (i = 0; i < placement->num_busy_placement; i++) {
 		const struct ttm_place *heap = &placement->busy_placement[i];
-		if (mem->mm_node && heap->lpfn != 0 &&
+		if (mem->mm_node &&
 		    (mem->start < heap->fpfn ||
-		     mem->start + mem->num_pages > heap->lpfn))
+		     (heap->lpfn != 0 && (mem->start + mem->num_pages) > heap->lpfn)))
 			continue;
 
 		*new_flags = heap->flags;
Signature · 6 lines
2.1.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Am 09.10.2014 um 08:03 schrieb Michel Dänzer:

Quoted 3 lines

From: Michel Dänzer <[email protected]>

Quoted 22 lines
---
  drivers/gpu/drm/ttm/ttm_bo.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -2
index 407fa2d..d395b0b 100644
@@ -1008,9 +1008,9 @@ static bool ttm_bo_mem_compat(struct ttm_placement *placement,
 
  	for (i = 0; i < placement->num_placement; i++) {
  		const struct ttm_place *heap = &placement->placement[i];
-		if (mem->mm_node && heap->lpfn != 0 &&
+		if (mem->mm_node &&
  		    (mem->start < heap->fpfn ||
-		     mem->start + mem->num_pages > heap->lpfn))
+		     (heap->lpfn != 0 && (mem->start + mem->num_pages) > heap->lpfn)))
  			continue;
 
  		*new_flags = heap->flags;
@@ -1021,9 +1021,9 @@ static bool ttm_bo_mem_compat(struct ttm_placement *placement,
 

drivers/gpu/drm/ttm/ttm_bo.c static bool ttm_bo_mem_compat(struct ttm_placement *placement, · line 1029

Quoted 10 lines
drivers/gpu/drm/ttm/ttm_bo.c +2 -2
  	for (i = 0; i < placement->num_busy_placement; i++) {
  		const struct ttm_place *heap = &placement->busy_placement[i];
-		if (mem->mm_node && heap->lpfn != 0 &&
+		if (mem->mm_node &&
  		    (mem->start < heap->fpfn ||
-		     mem->start + mem->num_pages > heap->lpfn))
+		     (heap->lpfn != 0 && (mem->start + mem->num_pages) > heap->lpfn)))
  			continue;
 
  		*new_flags = heap->flags;

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

#2 lore raw
Quoted 10 lines · Christian König

Am 09.10.2014 um 08:03 schrieb Michel Dänzer:

Quoted 4 lines

From: Michel Dänzer <[email protected]>

Thomas, do you want to pull this through the ttm tree or can I take it through radeon?

Alex

Quoted 31 lines
Quoted 31 lines
---
  drivers/gpu/drm/ttm/ttm_bo.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +4 -4
index 407fa2d..d395b0b 100644
@@ -1008,9 +1008,9 @@ static bool ttm_bo_mem_compat(struct ttm_placement
 *placement,
        for (i = 0; i < placement->num_placement; i++) {
                const struct ttm_place *heap = &placement->placement[i];
-               if (mem->mm_node && heap->lpfn != 0 &&
+               if (mem->mm_node &&
                    (mem->start < heap->fpfn ||
-                    mem->start + mem->num_pages > heap->lpfn))
+                    (heap->lpfn != 0 && (mem->start + mem->num_pages) >
 heap->lpfn)))
                        continue;
                *new_flags = heap->flags;
@@ -1021,9 +1021,9 @@ static bool ttm_bo_mem_compat(struct ttm_placement
 *placement,
        for (i = 0; i < placement->num_busy_placement; i++) {
                const struct ttm_place *heap =
 &placement->busy_placement[i];
-               if (mem->mm_node && heap->lpfn != 0 &&
+               if (mem->mm_node &&
                    (mem->start < heap->fpfn ||
-                    mem->start + mem->num_pages > heap->lpfn))
+                    (heap->lpfn != 0 && (mem->start + mem->num_pages) >
 heap->lpfn)))
Quoted 8 lines
Quoted 2 lines
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
                        continue;
                *new_flags = heap->flags;

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

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