drm/ttm: Don't skip fpfn check if lpfn is 0 in ttm_bo_mem_compat
authorMichel Dänzer <michel.daenzer@amd.com>
Thu, 9 Oct 2014 06:03:03 +0000 (15:03 +0900)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 16 Oct 2014 22:34:08 +0000 (18:34 -0400)
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/ttm/ttm_bo.c

index 8f5cec6..ba74a11 100644 (file)
@@ -994,9 +994,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;
@@ -1007,9 +1007,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;