[PATCH 1/6] drm/ttm: cleanup and optimize ttm_bo_mem_compat

Christian König deathsimple at vodafone.de
Thu Mar 30 08:41:37 UTC 2017


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.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) &&
>
> ?

Good idea.

Christian.



More information about the amd-gfx mailing list