intel: fix waiting of present fences

For presentation fences, we should wait until the server has submitted the
presentation command to the kernel _and_ the GPU has executed the command.
We failed to wait for the latter until this fix.
diff --git a/icd/intel/fence.c b/icd/intel/fence.c
index 75c2843..debcd7e 100644
--- a/icd/intel/fence.c
+++ b/icd/intel/fence.c
@@ -81,36 +81,41 @@
 void intel_fence_set_x11(struct intel_fence *fence,
                          struct intel_wsi_x11 *x11,
                          struct intel_wsi_x11_window *win,
-                         uint32_t serial)
+                         uint32_t serial,
+                         struct intel_bo *seqno_bo)
 {
-    if (fence->seqno_bo) {
-        intel_bo_unreference(fence->seqno_bo);
-        fence->seqno_bo = NULL;
-    }
-
 #ifdef ENABLE_WSI_X11
     fence->x11 = x11;
     fence->x11_win = win;
     fence->x11_serial = serial;
 #endif
+
+    if (fence->seqno_bo)
+        intel_bo_unreference(fence->seqno_bo);
+
+    fence->seqno_bo = seqno_bo;
+    intel_bo_reference(fence->seqno_bo);
 }
 
 XGL_RESULT intel_fence_wait(struct intel_fence *fence, int64_t timeout_ns)
 {
+#ifdef ENABLE_WSI_X11
+    if (fence->x11) {
+        const bool wait = (timeout_ns != 0);
+        XGL_RESULT ret;
+
+        ret = intel_wsi_x11_wait(fence->x11, fence->x11_win,
+                fence->x11_serial, wait);
+        if (ret != XGL_SUCCESS)
+            return ret;
+    }
+#endif
+
     if (fence->seqno_bo) {
         return (intel_bo_wait(fence->seqno_bo, timeout_ns)) ?
             XGL_NOT_READY : XGL_SUCCESS;
     }
 
-#ifdef ENABLE_WSI_X11
-    if (fence->x11) {
-        const bool wait = (timeout_ns != 0);
-
-        return intel_wsi_x11_wait(fence->x11, fence->x11_win,
-                fence->x11_serial, wait);
-    }
-#endif
-
     return XGL_ERROR_UNAVAILABLE;
 }