sna: Add a pair of asserts to validate fls()/cache_bucket()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
f9d2730974
commit
2bd6e4dcd4
|
|
@ -603,11 +603,15 @@ static void __kgem_request_free(struct kgem_request *rq)
|
|||
|
||||
static struct list *inactive(struct kgem *kgem, int num_pages)
|
||||
{
|
||||
assert(num_pages < MAX_CACHE_SIZE / PAGE_SIZE);
|
||||
assert(cache_bucket(num_pages) < NUM_CACHE_BUCKETS);
|
||||
return &kgem->inactive[cache_bucket(num_pages)];
|
||||
}
|
||||
|
||||
static struct list *active(struct kgem *kgem, int num_pages, int tiling)
|
||||
{
|
||||
assert(num_pages < MAX_CACHE_SIZE / PAGE_SIZE);
|
||||
assert(cache_bucket(num_pages) < NUM_CACHE_BUCKETS);
|
||||
return &kgem->active[cache_bucket(num_pages)][tiling];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue