On 29/03/17 09:55 PM, Christian König wrote: > From: Christian König <christian.koenig at 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.koenig at 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) && ? -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer