dri_init_options_get_screen_flags will return the flags for create_screen().
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
if (screen->fd < 0 || (fd = fcntl(screen->fd, F_DUPFD_CLOEXEC, 3)) < 0)
goto free_screen;
- if (pipe_loader_drm_probe_fd(&screen->dev, fd))
- pscreen = pipe_loader_create_screen(screen->dev, 0);
+
+ if (pipe_loader_drm_probe_fd(&screen->dev, fd)) {
+ unsigned flags =
+ dri_init_options_get_screen_flags(screen, screen->dev->driver_name);
+
+ pscreen = pipe_loader_create_screen(screen->dev, flags);
+ }
if (!pscreen)
goto release_pipe;
else
sPriv->extensions = dri_screen_extensions;
- configs = dri_init_screen_helper(screen, pscreen, screen->dev->driver_name);
+ configs = dri_init_screen_helper(screen, pscreen);
if (!configs)
goto destroy_screen;
if (screen->fd < 0 || (fd = fcntl(screen->fd, F_DUPFD_CLOEXEC, 3)) < 0)
goto free_screen;
+ unsigned flags = dri_init_options_get_screen_flags(screen, "swrast");
+
if (pipe_loader_sw_probe_kms(&screen->dev, fd))
- pscreen = pipe_loader_create_screen(screen->dev, 0);
+ pscreen = pipe_loader_create_screen(screen->dev, flags);
if (!pscreen)
goto release_pipe;
sPriv->extensions = dri_screen_extensions;
- configs = dri_init_screen_helper(screen, pscreen, "swrast");
+ configs = dri_init_screen_helper(screen, pscreen);
if (!configs)
goto destroy_screen;
backgroundCallable->setBackgroundContext(ctx->cPriv->loaderPrivate);
}
+unsigned
+dri_init_options_get_screen_flags(struct dri_screen *screen,
+ const char* driver_name)
+{
+ unsigned flags = 0;
+
+ driParseOptionInfo(&screen->optionCacheDefaults, gallium_config_options.xml);
+ driParseConfigFiles(&screen->optionCache,
+ &screen->optionCacheDefaults,
+ screen->sPriv->myNum,
+ driver_name);
+ dri_fill_st_options(screen);
+
+ return flags;
+}
+
const __DRIconfig **
dri_init_screen_helper(struct dri_screen *screen,
- struct pipe_screen *pscreen,
- const char* driver_name)
+ struct pipe_screen *pscreen)
{
screen->base.screen = pscreen;
screen->base.get_egl_image = dri_get_egl_image;
else
screen->target = PIPE_TEXTURE_RECT;
- driParseOptionInfo(&screen->optionCacheDefaults, gallium_config_options.xml);
-
- driParseConfigFiles(&screen->optionCache,
- &screen->optionCacheDefaults,
- screen->sPriv->myNum,
- driver_name);
-
- dri_fill_st_options(screen);
-
/* Handle force_s3tc_enable. */
if (!util_format_s3tc_enabled && screen->options.force_s3tc_enable) {
/* Ensure libtxc_dxtn has been loaded if available.
dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
const struct gl_config *mode);
+unsigned
+dri_init_options_get_screen_flags(struct dri_screen *screen,
+ const char* driver_name);
+
const __DRIconfig **
dri_init_screen_helper(struct dri_screen *screen,
- struct pipe_screen *pscreen,
- const char* driver_name);
+ struct pipe_screen *pscreen);
void
dri_destroy_screen_helper(struct dri_screen * screen);
sPriv->driverPrivate = (void *)screen;
sPriv->extensions = drisw_screen_extensions;
+ unsigned flags = dri_init_options_get_screen_flags(screen, "swrast");
+
if (pipe_loader_sw_probe_dri(&screen->dev, &drisw_lf))
- pscreen = pipe_loader_create_screen(screen->dev, 0);
+ pscreen = pipe_loader_create_screen(screen->dev, flags);
if (!pscreen)
goto fail;
- configs = dri_init_screen_helper(screen, pscreen, "swrast");
+ configs = dri_init_screen_helper(screen, pscreen);
if (!configs)
goto fail;