}
struct pipe_screen *
-pipe_loader_create_screen(struct pipe_loader_device *dev, unsigned flags)
+pipe_loader_create_screen(struct pipe_loader_device *dev,
+ struct pipe_screen_config *config)
{
- return dev->ops->create_screen(dev, flags);
+ return dev->ops->create_screen(dev, config);
}
struct util_dl_library *
* Create a pipe_screen for the specified device.
*
* \param dev Device the screen will be created for.
+ * \param config Configuration options. The lifetime of this structure and its
+ * elements may be limited to the duration of this call.
*/
struct pipe_screen *
-pipe_loader_create_screen(struct pipe_loader_device *dev, unsigned flags);
+pipe_loader_create_screen(struct pipe_loader_device *dev,
+ struct pipe_screen_config *config);
/**
* Query the configuration parameters for the specified device.
}
static struct pipe_screen *
-pipe_loader_drm_create_screen(struct pipe_loader_device *dev, unsigned flags)
+pipe_loader_drm_create_screen(struct pipe_loader_device *dev,
+ const struct pipe_screen_config *config)
{
struct pipe_loader_drm_device *ddev = pipe_loader_drm_device(dev);
- return ddev->dd->create_screen(ddev->fd, flags);
+ return ddev->dd->create_screen(ddev->fd, config);
}
static const struct pipe_loader_ops pipe_loader_drm_ops = {
struct pipe_loader_ops {
struct pipe_screen *(*create_screen)(struct pipe_loader_device *dev,
- unsigned flags);
+ const struct pipe_screen_config *config);
const struct drm_conf_ret *(*configuration)(struct pipe_loader_device *dev,
enum drm_conf conf);
static struct pipe_screen *
pipe_loader_sw_create_screen(struct pipe_loader_device *dev,
- unsigned flags)
+ const struct pipe_screen_config *config)
{
struct pipe_loader_sw_device *sdev = pipe_loader_sw_device(dev);
struct pipe_screen *screen;
#include "i915/i915_public.h"
struct pipe_screen *
-pipe_i915_create_screen(int fd, unsigned flags)
+pipe_i915_create_screen(int fd, const struct pipe_screen_config *config)
{
struct i915_winsys *iws;
struct pipe_screen *screen;
#else
struct pipe_screen *
-pipe_i915_create_screen(int fd, unsigned flags)
+pipe_i915_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "i915g: driver missing\n");
return NULL;
#include "nouveau/drm/nouveau_drm_public.h"
struct pipe_screen *
-pipe_nouveau_create_screen(int fd, unsigned flags)
+pipe_nouveau_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
#else
struct pipe_screen *
-pipe_nouveau_create_screen(int fd, unsigned flags)
+pipe_nouveau_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "nouveau: driver missing\n");
return NULL;
#include "pl111/drm/pl111_drm_public.h"
struct pipe_screen *
-pipe_pl111_create_screen(int fd, unsigned flags)
+pipe_pl111_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
#else
struct pipe_screen *
-pipe_pl111_create_screen(int fd, unsigned flags)
+pipe_pl111_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "pl111: driver missing\n");
return NULL;
#include "r300/r300_public.h"
struct pipe_screen *
-pipe_r300_create_screen(int fd, unsigned flags)
+pipe_r300_create_screen(int fd, const struct pipe_screen_config *config)
{
struct radeon_winsys *rw;
- rw = radeon_drm_winsys_create(fd, flags, r300_screen_create);
+ rw = radeon_drm_winsys_create(fd, config, r300_screen_create);
return rw ? debug_screen_wrap(rw->screen) : NULL;
}
#else
struct pipe_screen *
-pipe_r300_create_screen(int fd, unsigned flags)
+pipe_r300_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "r300: driver missing\n");
return NULL;
#include "r600/r600_public.h"
struct pipe_screen *
-pipe_r600_create_screen(int fd, unsigned flags)
+pipe_r600_create_screen(int fd, const struct pipe_screen_config *config)
{
struct radeon_winsys *rw;
- rw = radeon_drm_winsys_create(fd, flags, r600_screen_create);
+ rw = radeon_drm_winsys_create(fd, config, r600_screen_create);
return rw ? debug_screen_wrap(rw->screen) : NULL;
}
#else
struct pipe_screen *
-pipe_r600_create_screen(int fd, unsigned flags)
+pipe_r600_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "r600: driver missing\n");
return NULL;
#include "radeonsi/si_public.h"
struct pipe_screen *
-pipe_radeonsi_create_screen(int fd, unsigned flags)
+pipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config)
{
struct radeon_winsys *rw;
/* First, try amdgpu. */
- rw = amdgpu_winsys_create(fd, flags, radeonsi_screen_create);
+ rw = amdgpu_winsys_create(fd, config, radeonsi_screen_create);
if (!rw)
- rw = radeon_drm_winsys_create(fd, flags, radeonsi_screen_create);
+ rw = radeon_drm_winsys_create(fd, config, radeonsi_screen_create);
return rw ? debug_screen_wrap(rw->screen) : NULL;
}
#else
struct pipe_screen *
-pipe_radeonsi_create_screen(int fd, unsigned flags)
+pipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "radeonsi: driver missing\n");
return NULL;
#include "svga/svga_public.h"
struct pipe_screen *
-pipe_vmwgfx_create_screen(int fd, unsigned flags)
+pipe_vmwgfx_create_screen(int fd, const struct pipe_screen_config *config)
{
struct svga_winsys_screen *sws;
struct pipe_screen *screen;
#else
struct pipe_screen *
-pipe_vmwgfx_create_screen(int fd, unsigned flags)
+pipe_vmwgfx_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "svga: driver missing\n");
return NULL;
#include "freedreno/drm/freedreno_drm_public.h"
struct pipe_screen *
-pipe_freedreno_create_screen(int fd, unsigned flags)
+pipe_freedreno_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
#else
struct pipe_screen *
-pipe_freedreno_create_screen(int fd, unsigned flags)
+pipe_freedreno_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "freedreno: driver missing\n");
return NULL;
#include "virgl/virgl_public.h"
struct pipe_screen *
-pipe_virgl_create_screen(int fd, unsigned flags)
+pipe_virgl_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
#else
struct pipe_screen *
-pipe_virgl_create_screen(int fd, unsigned flags)
+pipe_virgl_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "virgl: driver missing\n");
return NULL;
#include "vc4/drm/vc4_drm_public.h"
struct pipe_screen *
-pipe_vc4_create_screen(int fd, unsigned flags)
+pipe_vc4_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
#else
struct pipe_screen *
-pipe_vc4_create_screen(int fd, unsigned flags)
+pipe_vc4_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "vc4: driver missing\n");
return NULL;
#include "etnaviv/drm/etnaviv_drm_public.h"
struct pipe_screen *
-pipe_etna_create_screen(int fd, unsigned flags)
+pipe_etna_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
#else
struct pipe_screen *
-pipe_etna_create_screen(int fd, unsigned flags)
+pipe_etna_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "etnaviv: driver missing\n");
return NULL;
#include "imx/drm/imx_drm_public.h"
struct pipe_screen *
-pipe_imx_drm_create_screen(int fd, unsigned flags)
+pipe_imx_drm_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
#else
struct pipe_screen *
-pipe_imx_drm_create_screen(int fd, unsigned flags)
+pipe_imx_drm_create_screen(int fd, const struct pipe_screen_config *config)
{
fprintf(stderr, "imx-drm: driver missing\n");
return NULL;
struct pipe_screen;
+struct pipe_screen_config;
struct pipe_screen *
-pipe_i915_create_screen(int fd, unsigned flags);
+pipe_i915_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_ilo_create_screen(int fd, unsigned flags);
+pipe_ilo_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_nouveau_create_screen(int fd, unsigned flags);
+pipe_nouveau_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_r300_create_screen(int fd, unsigned flags);
+pipe_r300_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_r600_create_screen(int fd, unsigned flags);
+pipe_r600_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_radeonsi_create_screen(int fd, unsigned flags);
+pipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_vmwgfx_create_screen(int fd, unsigned flags);
+pipe_vmwgfx_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_freedreno_create_screen(int fd, unsigned flags);
+pipe_freedreno_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_virgl_create_screen(int fd, unsigned flags);
+pipe_virgl_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_vc4_create_screen(int fd, unsigned flags);
+pipe_vc4_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_pl111_create_screen(int fd, unsigned flags);
+pipe_pl111_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_etna_create_screen(int fd, unsigned flags);
+pipe_etna_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
-pipe_imx_drm_create_screen(int fd, unsigned flags);
+pipe_imx_drm_create_screen(int fd, const struct pipe_screen_config *config);
#endif /* _DRM_HELPER_PUBLIC_H */
goto free_authenticate;
if (pipe_loader_drm_probe_fd(&scrn->base.dev, fd))
- scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev, 0);
+ scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev, NULL);
if (!scrn->base.pscreen)
goto release_pipe;
free(geom_reply);
if (pipe_loader_drm_probe_fd(&scrn->base.dev, fd))
- scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev, 0);
+ scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev, NULL);
if (!scrn->base.pscreen)
goto release_pipe;
goto free_screen;
if (pipe_loader_drm_probe_fd(&vscreen->dev, new_fd))
- vscreen->pscreen = pipe_loader_create_screen(vscreen->dev, 0);
+ vscreen->pscreen = pipe_loader_create_screen(vscreen->dev, NULL);
if (!vscreen->pscreen)
goto release_pipe;
#endif
struct radeon_winsys;
+struct pipe_screen_config;
-struct pipe_screen* r300_screen_create(struct radeon_winsys *rws, unsigned flags);
+struct pipe_screen* r300_screen_create(struct radeon_winsys *rws,
+ const struct pipe_screen_config *config);
#ifdef __cplusplus
} // extern "C"
return rws->fence_wait(rws, fence, timeout);
}
-struct pipe_screen* r300_screen_create(struct radeon_winsys *rws, unsigned flags)
+struct pipe_screen* r300_screen_create(struct radeon_winsys *rws,
+ const struct pipe_screen_config *config)
{
struct r300_screen *r300screen = CALLOC_STRUCT(r300_screen);
return r600_resource_create_common(screen, templ);
}
-struct pipe_screen *r600_screen_create(struct radeon_winsys *ws, unsigned flags)
+struct pipe_screen *r600_screen_create(struct radeon_winsys *ws,
+ const struct pipe_screen_config *config)
{
struct r600_screen *rscreen = CALLOC_STRUCT(r600_screen);
rscreen->b.b.get_shader_param = r600_get_shader_param;
rscreen->b.b.resource_create = r600_resource_create;
- if (!r600_common_screen_init(&rscreen->b, ws, flags)) {
+ if (!r600_common_screen_init(&rscreen->b, ws, config->flags)) {
FREE(rscreen);
return NULL;
}
#define R600_PUBLIC_H
struct radeon_winsys;
+struct pipe_screen_config;
-struct pipe_screen *r600_screen_create(struct radeon_winsys *ws, unsigned flags);
+struct pipe_screen *r600_screen_create(struct radeon_winsys *ws,
+ const struct pipe_screen_config *config);
#endif
}
struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
- unsigned flags)
+ const struct pipe_screen_config *config)
{
struct si_screen *sscreen = CALLOC_STRUCT(si_screen);
unsigned num_threads, num_compiler_threads, num_compiler_threads_lowprio, i;
si_init_screen_state_functions(sscreen);
- if (!r600_common_screen_init(&sscreen->b, ws, flags) ||
+ if (!r600_common_screen_init(&sscreen->b, ws, config->flags) ||
!si_init_gs_info(sscreen) ||
!si_init_shader_cache(sscreen)) {
FREE(sscreen);
struct radeon_winsys;
struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
- unsigned flags);
+ const struct pipe_screen_config *config);
#endif
};
+/**
+ * Global configuration options for screen creation.
+ */
+struct pipe_screen_config {
+ unsigned flags;
+};
+
+
#ifdef __cplusplus
}
#endif
#include "pipe/p_compiler.h"
struct pipe_screen;
+struct pipe_screen_config;
struct pipe_context;
struct pipe_resource;
* This function does any wrapping of the screen.
* For example wrapping trace or rbug debugging drivers around it.
*/
- struct pipe_screen* (*create_screen)(int drm_fd, unsigned flags);
+ struct pipe_screen* (*create_screen)(int drm_fd,
+ const struct pipe_screen_config *config);
/**
* Return a configuration value.
device::device(clover::platform &platform, pipe_loader_device *ldev) :
platform(platform), ldev(ldev) {
- pipe = pipe_loader_create_screen(ldev, 0);
+ pipe = pipe_loader_create_screen(ldev, NULL);
if (!pipe || !pipe->get_param(pipe, PIPE_CAP_COMPUTE)) {
if (pipe)
pipe->destroy(pipe);
if (pipe_loader_drm_probe_fd(&screen->dev, fd)) {
- unsigned flags =
+ struct pipe_screen_config config = {};
+
+ config.flags =
dri_init_options_get_screen_flags(screen, screen->dev->driver_name);
- pscreen = pipe_loader_create_screen(screen->dev, flags);
+ pscreen = pipe_loader_create_screen(screen->dev, &config);
}
if (!pscreen)
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");
+ struct pipe_screen_config config = {};
+
+ config.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, flags);
+ pscreen = pipe_loader_create_screen(screen->dev, &config);
if (!pscreen)
goto release_pipe;
sPriv->driverPrivate = (void *)screen;
sPriv->extensions = drisw_screen_extensions;
- unsigned flags = dri_init_options_get_screen_flags(screen, "swrast");
+ struct pipe_screen_config config;
+
+ config.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, flags);
+ pscreen = pipe_loader_create_screen(screen->dev, &config);
if (!pscreen)
goto fail;
goto out_no_fd;
if (pipe_loader_drm_probe_fd(&xa->dev, fd))
- xa->screen = pipe_loader_create_screen(xa->dev, 0);
+ xa->screen = pipe_loader_create_screen(xa->dev, NULL);
if (!xa->screen)
goto out_no_screen;
return D3DERR_DRIVERINTERNALERROR;
}
- ctx->base.hal = pipe_loader_create_screen(ctx->dev, 0);
+ ctx->base.hal = pipe_loader_create_screen(ctx->dev, NULL);
if (!ctx->base.hal) {
ERR("Unable to load requested driver.\n");
drm_destroy(&ctx->base);
/* wrap it to create a software screen that can share resources */
if (pipe_loader_sw_probe_wrapped(&ctx->swdev, ctx->base.hal))
- ctx->base.ref = pipe_loader_create_screen(ctx->swdev, 0);
+ ctx->base.ref = pipe_loader_create_screen(ctx->swdev, NULL);
if (!ctx->base.ref) {
ERR("Couldn't wrap drm screen to swrast screen. Software devices "
#include "i915/i915_public.h"
static struct pipe_screen *
-create_screen(int fd, unsigned flags)
+create_screen(int fd, const struct pipe_screen_config *config)
{
struct i915_winsys *iws;
struct pipe_screen *screen;
#include "freedreno/drm/freedreno_drm_public.h"
static struct pipe_screen *
-create_screen(int fd, unsigned flags)
+create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
#include "nouveau/drm/nouveau_drm_public.h"
static struct pipe_screen *
-create_screen(int fd, unsigned flags)
+create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
#include "r300/r300_public.h"
static struct pipe_screen *
-create_screen(int fd, unsigned flags)
+create_screen(int fd, const struct pipe_screen_config *config)
{
struct radeon_winsys *sws;
#include "r600/r600_public.h"
static struct pipe_screen *
-create_screen(int fd, unsigned flags)
+create_screen(int fd, const struct pipe_screen_config *config)
{
struct radeon_winsys *rw;
#include "radeonsi/si_public.h"
static struct pipe_screen *
-create_screen(int fd, unsigned flags)
+create_screen(int fd, const struct pipe_screen_config *config)
{
struct radeon_winsys *rw;
#include "svga/svga_public.h"
static struct pipe_screen *
-create_screen(int fd, unsigned flags)
+create_screen(int fd, const struct pipe_screen_config *config)
{
struct svga_winsys_screen *sws;
struct pipe_screen *screen;
ret = pipe_loader_probe(&ctx->dev, 1);
assert(ret);
- ctx->screen = pipe_loader_create_screen(ctx->dev, 0);
+ ctx->screen = pipe_loader_create_screen(ctx->dev, NULL);
assert(ctx->screen);
ctx->pipe = ctx->screen->context_create(ctx->screen, NULL, 0);
assert(ret);
/* init a pipe screen */
- p->screen = pipe_loader_create_screen(p->dev, 0);
+ p->screen = pipe_loader_create_screen(p->dev, NULL);
assert(p->screen);
/* create the pipe driver context and cso context */
assert(ret);
/* init a pipe screen */
- p->screen = pipe_loader_create_screen(p->dev, 0);
+ p->screen = pipe_loader_create_screen(p->dev, NULL);
assert(p->screen);
/* create the pipe driver context and cso context */
struct radeon_winsys;
struct pipe_screen;
+struct pipe_screen_config;
typedef struct pipe_screen *(*radeon_screen_create_t)(struct radeon_winsys *,
- unsigned);
+ const struct pipe_screen_config *config);
struct radeon_winsys *
-amdgpu_winsys_create(int fd, unsigned flags,
+amdgpu_winsys_create(int fd, const struct pipe_screen_config *config,
radeon_screen_create_t screen_create);
#endif
PUBLIC struct radeon_winsys *
-amdgpu_winsys_create(int fd, unsigned flags,
+amdgpu_winsys_create(int fd, const struct pipe_screen_config *config,
radeon_screen_create_t screen_create)
{
struct amdgpu_winsys *ws;
*
* Alternatively, we could create the screen based on "ws->gen"
* and link all drivers into one binary blob. */
- ws->base.screen = screen_create(&ws->base, flags);
+ ws->base.screen = screen_create(&ws->base, config);
if (!ws->base.screen) {
amdgpu_winsys_destroy(&ws->base);
mtx_unlock(&dev_tab_mutex);
struct radeon_winsys;
struct pipe_screen;
+struct pipe_screen_config;
typedef struct pipe_screen *(*radeon_screen_create_t)(struct radeon_winsys *,
- unsigned);
+ const struct pipe_screen_config *);
struct radeon_winsys *
-radeon_drm_winsys_create(int fd, unsigned flags,
+radeon_drm_winsys_create(int fd, const struct pipe_screen_config *config,
radeon_screen_create_t screen_create);
#endif
}
PUBLIC struct radeon_winsys *
-radeon_drm_winsys_create(int fd, unsigned flags,
+radeon_drm_winsys_create(int fd, const struct pipe_screen_config *config,
radeon_screen_create_t screen_create)
{
struct radeon_drm_winsys *ws;
*
* Alternatively, we could create the screen based on "ws->gen"
* and link all drivers into one binary blob. */
- ws->base.screen = screen_create(&ws->base, flags);
+ ws->base.screen = screen_create(&ws->base, config);
if (!ws->base.screen) {
radeon_winsys_destroy(&ws->base);
mtx_unlock(&fd_tab_mutex);