Skip to contentSkip to conversation

libdrm_intel: Fix return from drm_intel_gem_bo_busy

PATCH New Tvrtko Ursulin 1 participant 1 message Jan 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libdrm_intel: Fix return from drm_intel_gem_bo_busy

From: Tvrtko Ursulin <[email protected]>

Return path from this function got confused in:

commit 02f93c21e6e1c3dad9d99349989daa84a8c0b5fb
Author: Eric Anholt <[email protected]>
Date: Wed Jan 15 00:38:39 2014 -0800

intel: Track whether a buffer is idle to avoid trips to the kernel.

Consolidate the return paths and stop leaking out the internal driver state since the API was intended to be a boolean.

Cc Eric Anholt <[email protected]>
Cc Kenneth Graunke <[email protected]>
Cc Chris Wilson <[email protected]>
---
 intel/intel_bufmgr_gem.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
intel/intel_bufmgr_gem.c +3 -4
index dc28200ffecc..2f8bad88166a 100644
@@ -663,11 +663,10 @@ drm_intel_gem_bo_busy(drm_intel_bo *bo)
 	ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_BUSY, &busy);
 	if (ret == 0) {
 		bo_gem->idle = !busy.busy;
-		return busy.busy;
-	} else {
-		return false;
+		return !bo_gem->idle;
 	}
-	return (ret == 0 && busy.busy);
+
+	return false;
 }
 
 static int
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx