xf86-video-intel: 2 commits - src/sna/kgem.c src/sna/kgem.h

Chris Wilson ickle at kemper.freedesktop.org
Fri Aug 9 03:10:17 PDT 2013


 src/sna/kgem.c |    8 ++++++++
 src/sna/kgem.h |    2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit ab445c23079a76eaa2a7d499ec4755599012bd2f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Aug 9 10:39:22 2013 +0100

    sna: Rewrite the can-mmap-cpu test to handle stolen unclaimed bo
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 4ea8596..e08f842 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -580,7 +580,7 @@ static inline bool kgem_bo_can_map__cpu(struct kgem *kgem,
 					struct kgem_bo *bo,
 					bool write)
 {
-	if (bo->scanout && (write || bo->purged))
+	if (bo->purged || (bo->scanout && write))
 		return false;
 
 	if (kgem->has_llc)
commit f1d3d1f8c677b938362eee8b9f4e81f5463bc16a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Aug 9 10:07:59 2013 +0100

    sna: Check for EINVAL after mmapping
    
    I want to catch this error as it happens to see which (stolen) bo is
    being erroneously mmapped.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index a04b954..fea7dcb 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -335,6 +335,8 @@ retry_gtt:
 	if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg)) {
 		int err = errno;
 
+		assert(err != EINVAL);
+
 		(void)__kgem_throttle_retire(kgem, 0);
 		if (kgem_expire_cache(kgem))
 			goto retry_gtt;
@@ -355,6 +357,8 @@ retry_mmap:
 	if (ptr == MAP_FAILED) {
 		int err = errno;
 
+		assert(err != EINVAL);
+
 		if (__kgem_throttle_retire(kgem, 0))
 			goto retry_mmap;
 
@@ -5056,6 +5060,8 @@ retry:
 	if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg)) {
 		int err = errno;
 
+		assert(err != EINVAL);
+
 		if (__kgem_throttle_retire(kgem, 0))
 			goto retry;
 
@@ -5098,6 +5104,8 @@ retry:
 	if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg)) {
 		int err = errno;
 
+		assert(err != EINVAL);
+
 		if (__kgem_throttle_retire(kgem, 0))
 			goto retry;
 


More information about the xorg-commit mailing list