diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-09-14 16:35:19 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-09-14 22:06:14 -0400 |
commit | 1b7ce582ceac74c7c5f1989c611b4f01a2a18434 (patch) | |
tree | 55eac831a8bad59103c2329de166a0ebe9d1c751 | |
parent | 9d9cb8553c945fac15421770da233fb3e38396e0 (diff) |
intel: Mark bo's exported to prime as not reusable
It's the same situation as flink and we need take the same precautions.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
-rw-r--r-- | intel/intel_bufmgr_gem.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 3bcc8497..898008d7 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -2472,8 +2472,15 @@ 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; + + if (drmPrimeHandleToFD(bufmgr_gem->fd, bo_gem->gem_handle, + DRM_CLOEXEC, prime_fd) != 0) + return -errno; - return drmPrimeHandleToFD(bufmgr_gem->fd, bo_gem->gem_handle, DRM_CLOEXEC, prime_fd); + bo_gem->reusable = false; + + return 0; } static int |