pipe-loader: remove pipe_loader_drm_probe_fd() x_auth argument

No longer used by anyone, as of last commit.

Cc: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
Emil Velikov
2015-06-29 12:44:44 +01:00
parent a27ec5dc46
commit 0959d7312d
6 changed files with 7 additions and 90 deletions

View File

@@ -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

View File

@@ -35,12 +35,6 @@
#include <xf86drm.h>
#include <unistd.h>
#ifdef HAVE_PIPE_LOADER_XCB
#include <xcb/dri2.h>
#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;
}

View File

@@ -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

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);