diff --git a/src/gallium/auxiliary/vl/vl_winsys.h b/src/gallium/auxiliary/vl/vl_winsys.h index 9c6ee1a607d..dac2f262f49 100644 --- a/src/gallium/auxiliary/vl/vl_winsys.h +++ b/src/gallium/auxiliary/vl/vl_winsys.h @@ -38,6 +38,7 @@ extern "C" { #ifdef HAVE_X11_PLATFORM #include +#include #endif #ifdef _WIN32 #include @@ -82,6 +83,8 @@ struct vl_screen }; #ifdef HAVE_X11_PLATFORM +xcb_screen_t * +vl_dri_get_screen_for_root(xcb_connection_t *conn, xcb_window_t root); uint32_t vl_dri2_format_for_depth(struct vl_screen *vscreen, int depth); diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c index bbcf698badc..8e6ab3e8eb2 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_dri.c +++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c @@ -376,6 +376,20 @@ vl_dri2_format_for_depth(struct vl_screen *vscreen, int depth) } } +xcb_screen_t * +vl_dri_get_screen_for_root(xcb_connection_t *conn, xcb_window_t root) +{ + xcb_screen_iterator_t screen_iter = + xcb_setup_roots_iterator(xcb_get_setup(conn)); + + for (; screen_iter.rem; xcb_screen_next (&screen_iter)) { + if (screen_iter.data->root == root) + return screen_iter.data; + } + + return NULL; +} + #ifdef HAVE_X11_DRI2 struct vl_screen * vl_dri2_screen_create(Display *display, int screen) diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri3.c b/src/gallium/auxiliary/vl/vl_winsys_dri3.c index 97febbccbfe..d5945c1530a 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_dri3.c +++ b/src/gallium/auxiliary/vl/vl_winsys_dri3.c @@ -552,20 +552,6 @@ free_buffer: return NULL; } -static xcb_screen_t * -dri3_get_screen_for_root(xcb_connection_t *conn, xcb_window_t root) -{ - xcb_screen_iterator_t screen_iter = - xcb_setup_roots_iterator(xcb_get_setup(conn)); - - for (; screen_iter.rem; xcb_screen_next (&screen_iter)) { - if (screen_iter.data->root == root) - return screen_iter.data; - } - - return NULL; -} - static void vl_dri3_flush_frontbuffer(struct pipe_screen *screen, struct pipe_context *pipe, @@ -828,7 +814,7 @@ vl_dri3_screen_create(Display *display, int screen) if (!geom_reply) goto close_fd; - scrn->base.xcb_screen = dri3_get_screen_for_root(scrn->conn, geom_reply->root); + scrn->base.xcb_screen = vl_dri_get_screen_for_root(scrn->conn, geom_reply->root); if (!scrn->base.xcb_screen) { free(geom_reply); goto close_fd;