It is a drm related bug. As the drm driver changed the time to free their test
userptr to bufmgr destroy(30921483c70c6939f017476eac13da6aa26b3b3c), we need
anothr order to release our driver to make sure the test userptr can be freed
with a valid fd.

Signed-off-by: Pan Xiuli <[email protected]>
---
 src/intel/intel_driver.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
index 507c910..035a103 100644
--- a/src/intel/intel_driver.c
+++ b/src/intel/intel_driver.c
@@ -85,8 +85,6 @@ intel_driver_delete(intel_driver_t *driver)
   if (driver == NULL)
     return;
 
-  if (driver->bufmgr)
-    drm_intel_bufmgr_destroy(driver->bufmgr);
   cl_free(driver);
 }
 
@@ -257,6 +255,10 @@ intel_driver_open(intel_driver_t *intel, cl_context_prop 
props)
 static void
 intel_driver_close(intel_driver_t *intel)
 {
+  //Due to the drm change about the test usrptr, we need to destroy the bufmgr
+  //befor the driver was closed, otherwise the test usrptr will not be freed.
+  if (intel->bufmgr)
+    drm_intel_bufmgr_destroy(intel->bufmgr);
 #ifdef HAS_X11
   if(intel->dri_ctx) dri_state_release(intel->dri_ctx);
   if(intel->x11_display) XCloseDisplay(intel->x11_display);
-- 
2.1.4

_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to