From 0959d7312d37dd9841cbf7a53cb40b3cfa6e5fc9 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 29 Jun 2015 12:44:44 +0100 Subject: pipe-loader: remove pipe_loader_drm_probe_fd() x_auth argument No longer used by anyone, as of last commit. Cc: Tom Stellard Signed-off-by: Emil Velikov Reviewed-by: Francisco Jerez --- src/gallium/auxiliary/pipe-loader/pipe_loader.h | 6 +- .../auxiliary/pipe-loader/pipe_loader_drm.c | 83 +--------------------- src/gallium/auxiliary/vl/vl_winsys_dri.c | 2 +- src/gallium/state_trackers/dri/dri2.c | 2 +- src/gallium/state_trackers/xa/xa_tracker.c | 2 +- src/gallium/targets/d3dadapter9/drm.c | 2 +- 6 files changed, 7 insertions(+), 90 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h index 9f43f17a6e2..95cbc262e57 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h @@ -195,13 +195,9 @@ pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev); * This function is platform-specific. * * \sa pipe_loader_probe - * - * \param auth_x If true, the pipe-loader will attempt to - * authenticate with the X server. */ bool -pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd, - boolean auth_x); +pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd); #endif diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c index 1ff5f3e8df8..05f7c57c904 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c @@ -35,12 +35,6 @@ #include #include -#ifdef HAVE_PIPE_LOADER_XCB - -#include - -#endif - #include "loader.h" #include "state_tracker/drm_driver.h" #include "pipe_loader_priv.h" @@ -64,78 +58,8 @@ struct pipe_loader_drm_device { static struct pipe_loader_ops pipe_loader_drm_ops; -#ifdef HAVE_PIPE_LOADER_XCB - -static xcb_screen_t * -get_xcb_screen(xcb_screen_iterator_t iter, int screen) -{ - for (; iter.rem; --screen, xcb_screen_next(&iter)) - if (screen == 0) - return iter.data; - - return NULL; -} - -#endif - -static void -pipe_loader_drm_x_auth(int fd) -{ -#ifdef HAVE_PIPE_LOADER_XCB - /* Try authenticate with the X server to give us access to devices that X - * is running on. */ - xcb_connection_t *xcb_conn; - const xcb_setup_t *xcb_setup; - xcb_screen_iterator_t s; - xcb_dri2_connect_cookie_t connect_cookie; - xcb_dri2_connect_reply_t *connect; - drm_magic_t magic; - xcb_dri2_authenticate_cookie_t authenticate_cookie; - xcb_dri2_authenticate_reply_t *authenticate; - int screen; - - xcb_conn = xcb_connect(NULL, &screen); - - if(!xcb_conn) - return; - - xcb_setup = xcb_get_setup(xcb_conn); - - if (!xcb_setup) - goto disconnect; - - s = xcb_setup_roots_iterator(xcb_setup); - connect_cookie = xcb_dri2_connect_unchecked(xcb_conn, - get_xcb_screen(s, screen)->root, - XCB_DRI2_DRIVER_TYPE_DRI); - connect = xcb_dri2_connect_reply(xcb_conn, connect_cookie, NULL); - - if (!connect || connect->driver_name_length - + connect->device_name_length == 0) { - - goto disconnect; - } - - if (drmGetMagic(fd, &magic)) - goto disconnect; - - authenticate_cookie = xcb_dri2_authenticate_unchecked(xcb_conn, - s.data->root, - magic); - authenticate = xcb_dri2_authenticate_reply(xcb_conn, - authenticate_cookie, - NULL); - FREE(authenticate); - -disconnect: - xcb_disconnect(xcb_conn); - -#endif -} - bool -pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd, - boolean auth_x) +pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd) { struct pipe_loader_drm_device *ddev = CALLOC_STRUCT(pipe_loader_drm_device); int vendor_id, chip_id; @@ -153,9 +77,6 @@ pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd, ddev->base.ops = &pipe_loader_drm_ops; ddev->fd = fd; - if (auth_x) - pipe_loader_drm_x_auth(fd); - ddev->base.driver_name = loader_get_driver_for_fd(fd, _LOADER_GALLIUM); if (!ddev->base.driver_name) goto fail; @@ -190,7 +111,7 @@ pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev) if (fd < 0) continue; - if (!pipe_loader_drm_probe_fd(&dev, fd, false)) { + if (!pipe_loader_drm_probe_fd(&dev, fd)) { close(fd); continue; } diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c index 7e61b88e6b5..8e39569f515 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_dri.c +++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c @@ -379,7 +379,7 @@ vl_screen_create(Display *display, int screen) #if GALLIUM_STATIC_TARGETS scrn->base.pscreen = dd_create_screen(fd); #else - if (pipe_loader_drm_probe_fd(&scrn->base.dev, fd, false)) + if (pipe_loader_drm_probe_fd(&scrn->base.dev, fd)) scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev, PIPE_SEARCH_DIR); #endif // GALLIUM_STATIC_TARGETS diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c index 1eda036750e..91b443147d6 100644 --- a/src/gallium/state_trackers/dri/dri2.c +++ b/src/gallium/state_trackers/dri/dri2.c @@ -1460,7 +1460,7 @@ dri2_init_screen(__DRIscreen * sPriv) throttle_ret = dd_configuration(DRM_CONF_THROTTLE); dmabuf_ret = dd_configuration(DRM_CONF_SHARE_FD); #else - if (pipe_loader_drm_probe_fd(&screen->dev, screen->fd, false)) { + if (pipe_loader_drm_probe_fd(&screen->dev, screen->fd)) { pscreen = pipe_loader_create_screen(screen->dev, PIPE_SEARCH_DIR); throttle_ret = pipe_loader_configuration(screen->dev, DRM_CONF_THROTTLE); diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c index 59e8108b1b5..21ca57ca633 100644 --- a/src/gallium/state_trackers/xa/xa_tracker.c +++ b/src/gallium/state_trackers/xa/xa_tracker.c @@ -153,7 +153,7 @@ xa_tracker_create(int drm_fd) loader_fd = dup(drm_fd); if (loader_fd == -1) return NULL; - if (pipe_loader_drm_probe_fd(&xa->dev, loader_fd, false)) + if (pipe_loader_drm_probe_fd(&xa->dev, loader_fd)) xa->screen = pipe_loader_create_screen(xa->dev, PIPE_SEARCH_DIR); #endif if (!xa->screen) diff --git a/src/gallium/targets/d3dadapter9/drm.c b/src/gallium/targets/d3dadapter9/drm.c index 6342ab801a9..cc660606c1f 100644 --- a/src/gallium/targets/d3dadapter9/drm.c +++ b/src/gallium/targets/d3dadapter9/drm.c @@ -243,7 +243,7 @@ drm_create_adapter( int fd, ctx->base.hal = dd_create_screen(fd); #else /* use pipe-loader to dlopen appropriate drm driver */ - if (!pipe_loader_drm_probe_fd(&ctx->dev, fd, FALSE)) { + if (!pipe_loader_drm_probe_fd(&ctx->dev, fd)) { ERR("Failed to probe drm fd %d.\n", fd); FREE(ctx); close(fd); -- cgit v1.2.3