sna: Account for extra guard pages around snooped BO in aperture checks

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-10-28 11:28:01 +00:00
parent f7d1da8ca5
commit 671e4b44b2
1 changed files with 2 additions and 0 deletions

View File

@ -4643,6 +4643,8 @@ static bool aperture_check(struct kgem *kgem, unsigned num_pages)
aperture.aper_available_size -= 4 * 1024 * 1024;
if (kgem->gen < 040)
aperture.aper_available_size -= kgem->aperture_fenced * PAGE_SIZE;
if (!kgem->has_llc)
aperture.aper_available_size -= 2 * kgem->nexec * PAGE_SIZE;
if (num_pages < aperture.aper_available_size / PAGE_SIZE)
return true;