intel: overhaul the internal WSI interface
The goal is to hide X11 details from the rest of the driver and move closer to
upstream WSI extensions that are still in development. As a result hiding X11
details, ENABLE_WSI_X11 is unnecessary and is removed.
To move closer to upstream WSI extensions, intel_gpu_associate_x11() is
removed. The X11 connection is available much later in upstream WSI
extensions.
There is also a bug fix. When a fence is used like this
xglQueuePresent(..., fence);
xglQueueSubmit(..., fence);
xglWaitForFences(..., &fence);
it will (correctly) wait for the present to finish before waiting for the
command buffer.
diff --git a/icd/intel/gpu.h b/icd/intel/gpu.h
index b82c0b3..431d21d 100644
--- a/icd/intel/gpu.h
+++ b/icd/intel/gpu.h
@@ -50,7 +50,6 @@
struct intel_instance;
struct intel_winsys;
-struct intel_wsi_x11;
/*
* intel_gpu is the only object that does not inherit from intel_base.
@@ -77,11 +76,9 @@
int primary_fd_internal;
int render_fd_internal;
-#ifdef ENABLE_WSI_X11
- struct intel_wsi_x11 *x11;
-#endif
-
struct intel_winsys *winsys;
+
+ void *wsi_data;
};
static inline struct intel_gpu *intel_gpu(XGL_PHYSICAL_GPU gpu)
@@ -116,11 +113,10 @@
int intel_gpu_get_max_threads(const struct intel_gpu *gpu,
XGL_PIPELINE_SHADER_STAGE stage);
-void intel_gpu_associate_x11(struct intel_gpu *gpu,
- struct intel_wsi_x11 *x11,
- int fd);
-XGL_RESULT intel_gpu_open(struct intel_gpu *gpu);
-void intel_gpu_close(struct intel_gpu *gpu);
+int intel_gpu_get_primary_fd(struct intel_gpu *gpu);
+
+XGL_RESULT intel_gpu_init_winsys(struct intel_gpu *gpu);
+void intel_gpu_cleanup_winsys(struct intel_gpu *gpu);
enum intel_ext_type intel_gpu_lookup_extension(const struct intel_gpu *gpu,
const char *ext);