+/**
+ * Make sure all pending swapbuffers have been submitted to hardware
+ *
+ * \param driDrawable[in] Pointer to the dri drawable whose swaps we are
+ * flushing.
+ * \param loaderPrivate[in] Pointer to the corresponding struct
+ * loader_dri_drawable.
+ */
+static void
+dri3_flush_swap_buffers(__DRIdrawable *driDrawable, void *loaderPrivate)
+{
+ struct loader_dri3_drawable *draw = loaderPrivate;
+ struct dri3_drawable *pdraw = loader_drawable_to_dri3_drawable(draw);
+ struct dri3_screen *psc;
+
+ if (!pdraw)
+ return;
+
+ if (!pdraw->base.psc)
+ return;
+
+ psc = (struct dri3_screen *) pdraw->base.psc;
+
+ (void) __glXInitialize(psc->base.dpy);
+ loader_dri3_swapbuffer_barrier(draw);
+}
+
+static void
+dri_set_background_context(void *loaderPrivate)
+{
+ struct dri3_context *pcp = (struct dri3_context *)loaderPrivate;
+ __glXSetCurrentContext(&pcp->base);
+}
+
+static GLboolean
+dri_is_thread_safe(void *loaderPrivate)
+{
+ /* Unlike DRI2, DRI3 doesn't call GetBuffers/GetBuffersWithFormat
+ * during draw so we're safe here.
+ */
+ return true;
+}
+