egl/dri2: Avoid unused static functions.
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 0e1a1b5..d77f0ed 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -925,6 +925,7 @@
    return &dri2_img->base;
 }
 
+#ifdef HAVE_WAYLAND_PLATFORM
 static _EGLImage *
 dri2_reference_drm_image(_EGLDisplay *disp, _EGLContext *ctx,
 			 __DRIimage *dri_image, EGLint width, EGLint height)
@@ -951,7 +952,6 @@
 					    attr_list);
 }
 
-#ifdef HAVE_WAYLAND_PLATFORM
 static _EGLImage *
 dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
 				    EGLClientBuffer _buffer,