sPriv->driverPrivate = (void *)screen;
-#if GALLIUM_STATIC_TARGETS
- pscreen = dd_create_screen(screen->fd);
-
- 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)) {
- pscreen = pipe_loader_create_screen(screen->dev, PIPE_SEARCH_DIR);
+ if (pipe_loader_drm_probe_fd(&screen->dev, dup(screen->fd))) {
+ pscreen = pipe_loader_create_screen(screen->dev);
throttle_ret = pipe_loader_configuration(screen->dev, DRM_CONF_THROTTLE);
dmabuf_ret = pipe_loader_configuration(screen->dev, DRM_CONF_SHARE_FD);
}
-#endif // GALLIUM_STATIC_TARGETS
if (throttle_ret && throttle_ret->val.val_int != -1) {
screen->throttling_enabled = TRUE;
/* dri_init_screen_helper checks pscreen for us */
-#if GALLIUM_STATIC_TARGETS
- configs = dri_init_screen_helper(screen, pscreen, dd_driver_name());
-#else
configs = dri_init_screen_helper(screen, pscreen, screen->dev->driver_name);
-#endif // GALLIUM_STATIC_TARGETS
if (!configs)
goto fail;
return configs;
fail:
dri_destroy_screen_helper(screen);
-#if !GALLIUM_STATIC_TARGETS
if (screen->dev)
pipe_loader_release(&screen->dev, 1);
-#endif // !GALLIUM_STATIC_TARGETS
FREE(screen);
return NULL;
}
static const __DRIconfig **
dri_kms_init_screen(__DRIscreen * sPriv)
{
-#if GALLIUM_STATIC_TARGETS
#if defined(GALLIUM_SOFTPIPE)
const __DRIconfig **configs;
struct dri_screen *screen;
sPriv->driverPrivate = (void *)screen;
- pscreen = kms_swrast_create_screen(screen->fd);
+ if (pipe_loader_sw_probe_kms(&screen->dev, dup(screen->fd)))
+ pscreen = pipe_loader_create_screen(screen->dev);
if (drmGetCap(sPriv->fd, DRM_CAP_PRIME, &cap) == 0 &&
(cap & DRM_PRIME_CAP_IMPORT)) {
return configs;
fail:
dri_destroy_screen_helper(screen);
+ if (screen->dev)
+ pipe_loader_release(&screen->dev, 1);
FREE(screen);
#endif // GALLIUM_SOFTPIPE
-#endif // GALLIUM_STATIC_TARGETS
return NULL;
}