diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-10-21 12:20:56 +0200 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-10-21 12:20:56 +0200 |
commit | 3b19b50cb5cd31e60eb03e99dd1109b6d0f5b8a3 (patch) | |
tree | d117764ba0985fccb1398beb9613ba5d6d066467 /libdrm | |
parent | 48b5eaf303b60077faed09db77785d7a544ac335 (diff) |
Remove the need for the hardware lock in the buffer manager.
Add interface entry cleaning a memory type without touching NO_EVICT buffers.
Diffstat (limited to 'libdrm')
-rw-r--r-- | libdrm/xf86drm.c | 7 | ||||
-rw-r--r-- | libdrm/xf86mm.h | 4 |
2 files changed, 6 insertions, 5 deletions
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); diff --git a/libdrm/xf86mm.h b/libdrm/xf86mm.h index f8ec1d75..0516bd32 100644 --- a/libdrm/xf86mm.h +++ b/libdrm/xf86mm.h @@ -172,8 +172,8 @@ extern int drmBOWaitIdle(int fd, drmBO *buf, unsigned hint); extern int drmMMInit(int fd, unsigned long pOffset, unsigned long pSize, unsigned memType); extern int drmMMTakedown(int fd, unsigned memType); -extern int drmMMLock(int fd, unsigned memType); -extern int drmMMUnlock(int fd, unsigned memType); +extern int drmMMLock(int fd, unsigned memType, int lockBM, int ignoreNoEvict); +extern int drmMMUnlock(int fd, unsigned memType, int unlockBM); #endif |