uxa: Cap the maximum number of VMA cached

Since we can not keep an unlimited number of vma cached due to the hard
per-process limits on the number of mappings and recreating mappings is
slow due to excruciatingly slow GTT pagefaults, we need to compromise
and keep a small MRU cache of inactive mmaps.

This uses the new API in libdrm-2.4.29 to specify the limit upon the VMA
cache maintained by libdrm.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-12-13 11:30:05 +00:00
parent 1128825efb
commit 5d5b2b8ee2
2 changed files with 2 additions and 1 deletions

View File

@ -187,7 +187,7 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Obtain compiler/linker options for the driver dependencies
PKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_xserver_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES])
PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.28])
PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.29])
PKG_CHECK_MODULES(DRI, [xf86driproto], , DRI=no)
PKG_CHECK_MODULES(DRI2, [dri2proto >= 2.6],, DRI2=no)
PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])

View File

@ -413,6 +413,7 @@ static int intel_init_bufmgr(intel_screen_private *intel)
return FALSE;
drm_intel_bufmgr_gem_enable_reuse(intel->bufmgr);
drm_intel_bufmgr_gem_set_vma_cache_size(intel->bufmgr, 512);
drm_intel_bufmgr_gem_enable_fenced_relocs(intel->bufmgr);
list_init(&intel->batch_pixmaps);