Am 30.03.2017 um 08:38 schrieb Michel Dänzer:
On 29/03/17 09:55 PM, Christian König wrote:
From: Christian König <christian.koe...@amd.com>

No need to implement the same logic twice. Also check if the busy placements
are identical to the already scanned placements before checking them.

Signed-off-by: Christian König <christian.koe...@amd.com>
[...]

@@ -1077,6 +1065,23 @@ bool ttm_bo_mem_compat(struct ttm_placement *placement,
                    (*new_flags & mem->placement & TTM_PL_MASK_MEM))
                        return true;
        }
+       return false;
+}
+
+bool ttm_bo_mem_compat(struct ttm_placement *placement,
+                      struct ttm_mem_reg *mem,
+                      uint32_t *new_flags)
+{
+       if (ttm_bo_places_compat(placement->placement, placement->num_placement,
+                                mem, new_flags))
+               return true;
+
+       if ((placement->busy_placement != placement->placement ||
+            placement->num_busy_placement != placement->num_placement) &&
             placement->num_busy_placement > placement->num_placement) &&

?

Good idea.

Christian.

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to