[PATCH] intel: Mark bo's exported to prime as not reusable

Kristian Høgsberg krh at bitplanet.net
Fri Sep 14 13:37:53 PDT 2012


It's the same situation as flink and we need take the same pre-cautions.
---
 intel/intel_bufmgr_gem.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 3bcc849..92c0444 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -2472,8 +2472,14 @@ drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd)
 {
 	drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
 	drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
+	int ret;
 
-	return drmPrimeHandleToFD(bufmgr_gem->fd, bo_gem->gem_handle, DRM_CLOEXEC, prime_fd);
+	ret = drmPrimeHandleToFD(bufmgr_gem->fd, bo_gem->gem_handle,
+				 DRM_CLOEXEC, prime_fd);
+	if (ret == 0)
+		bo_gem->reusable = false;
+
+	return ret;
 }
 
 static int
-- 
1.7.10.2



More information about the dri-devel mailing list