From 3b19b50cb5cd31e60eb03e99dd1109b6d0f5b8a3 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Sun, 21 Oct 2007 12:20:56 +0200 Subject: Remove the need for the hardware lock in the buffer manager. Add interface entry cleaning a memory type without touching NO_EVICT buffers. --- libdrm/xf86drm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libdrm/xf86drm.c') diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index b61c2250..ee0043cb 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -2820,14 +2820,15 @@ int drmMMTakedown(int fd, unsigned memType) * the buffer manager is NOT locked. */ -int drmMMLock(int fd, unsigned memType, int lockBM) +int drmMMLock(int fd, unsigned memType, int lockBM, int ignoreNoEvict) { struct drm_mm_type_arg arg; int ret; memset(&arg, 0, sizeof(arg)); arg.mem_type = memType; - arg.lock_unlock_bm = lock_bm; + arg.lock_flags |= (lockBM) ? DRM_BO_LOCK_UNLOCK_BM : 0; + arg.lock_flags |= (ignoreNoEvict) = DRM_BO_LOCK_IGNORE_NO_EVICT; do{ ret = ioctl(fd, DRM_IOCTL_MM_LOCK, &arg); @@ -2844,7 +2845,7 @@ int drmMMUnlock(int fd, unsigned memType, int unlockBM) memset(&arg, 0, sizeof(arg)); arg.mem_type = memType; - arg.lock_unlock_bm = unlockBM; + arg.lock_flags |= (unlockBM) ? DRM_BO_LOCK_UNLOCK_BM : 0; do{ ret = ioctl(fd, DRM_IOCTL_MM_UNLOCK, &arg); -- cgit v1.2.3