intel: fix for a semantic change in libdrm 2.4.57 and later
When a client does
xglInitAndEnumerateGpus();
xglCreateDevice();
// do something
// reinitialize without xglDestroyDevice() first!
xglInitAndEnumerateGpus();
xglCreateDevice();
// do something else
the driver will
open()
close()
open()
close()
on the DRM device. The problem is that the two open()s may return the same
value and confuse libdrm since 2.4.57 (specifically, commit 743af59669).
Making intel_winsys intel_gpu-owned allows the driver to do this instead
open()
intel_winsys_create_for_fd()
intel_winsys_destroy()
close()
open()
intel_winsys_create_for_fd()
intel_winsys_destroy()
close()
diff --git a/icd/intel/gpu.h b/icd/intel/gpu.h
index b143333..4ed336a 100644
--- a/icd/intel/gpu.h
+++ b/icd/intel/gpu.h
@@ -48,6 +48,7 @@
INTEL_GPU_ENGINE_COUNT
};
+struct intel_winsys;
struct intel_wsi_x11;
/*
@@ -79,7 +80,7 @@
struct intel_wsi_x11 *x11;
#endif
- int device_fd;
+ struct intel_winsys *winsys;
};
static inline struct intel_gpu *intel_gpu(XGL_PHYSICAL_GPU gpu)