summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-06-28 14:47:32 +0200
committerNicolai Hähnle <[email protected]>2017-08-02 09:50:57 +0200
commitbc7f41e11d325280db12e7b9444501357bc13922 (patch)
tree418517dd1010fd545e4059610b2a63541f823dd5
parent781375ac6f4025d8af729fc3886ea9995f184667 (diff)
gallium: add pipe_screen_config to screen_create functions
This allows a more generic mechanism for passing user configurations into drivers by accessing the dri options directly. Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader.c5
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader.h5
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c5
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h2
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c2
-rw-r--r--src/gallium/auxiliary/target-helpers/drm_helper.h56
-rw-r--r--src/gallium/auxiliary/target-helpers/drm_helper_public.h27
-rw-r--r--src/gallium/auxiliary/vl/vl_winsys_dri.c2
-rw-r--r--src/gallium/auxiliary/vl/vl_winsys_dri3.c2
-rw-r--r--src/gallium/auxiliary/vl/vl_winsys_drm.c2
-rw-r--r--src/gallium/drivers/r300/r300_public.h4
-rw-r--r--src/gallium/drivers/r300/r300_screen.c3
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c5
-rw-r--r--src/gallium/drivers/r600/r600_public.h4
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c4
-rw-r--r--src/gallium/drivers/radeonsi/si_public.h2
-rw-r--r--src/gallium/include/pipe/p_screen.h8
-rw-r--r--src/gallium/include/state_tracker/drm_driver.h4
-rw-r--r--src/gallium/state_trackers/clover/core/device.cpp2
-rw-r--r--src/gallium/state_trackers/dri/dri2.c12
-rw-r--r--src/gallium/state_trackers/dri/drisw.c6
-rw-r--r--src/gallium/state_trackers/xa/xa_tracker.c2
-rw-r--r--src/gallium/targets/d3dadapter9/drm.c4
-rw-r--r--src/gallium/targets/pipe-loader/pipe_i915.c2
-rw-r--r--src/gallium/targets/pipe-loader/pipe_msm.c2
-rw-r--r--src/gallium/targets/pipe-loader/pipe_nouveau.c2
-rw-r--r--src/gallium/targets/pipe-loader/pipe_r300.c2
-rw-r--r--src/gallium/targets/pipe-loader/pipe_r600.c2
-rw-r--r--src/gallium/targets/pipe-loader/pipe_radeonsi.c2
-rw-r--r--src/gallium/targets/pipe-loader/pipe_vmwgfx.c2
-rw-r--r--src/gallium/tests/trivial/compute.c2
-rw-r--r--src/gallium/tests/trivial/quad-tex.c2
-rw-r--r--src/gallium/tests/trivial/tri.c2
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_public.h5
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c4
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_public.h5
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_winsys.c4
37 files changed, 118 insertions, 88 deletions
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
index 0857a2cbb7e..cd93648fdc3 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
@@ -74,9 +74,10 @@ pipe_loader_configuration(struct pipe_loader_device *dev,
}
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 *
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
index 73b75586cfa..969feace7f1 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
@@ -82,9 +82,12 @@ pipe_loader_probe(struct pipe_loader_device **devs, int ndev);
* 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.
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index ef446b6e4f9..385d8145223 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -281,11 +281,12 @@ pipe_loader_drm_configuration(struct pipe_loader_device *dev,
}
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 = {
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h b/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
index 58ab992a906..7708455d949 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
@@ -32,7 +32,7 @@
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);
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
index 46c6604f74e..3c8e0c2d523 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
@@ -295,7 +295,7 @@ pipe_loader_sw_configuration(struct pipe_loader_device *dev,
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;
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h
index 0027ede23a1..2a2f57d20db 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper.h
@@ -10,7 +10,7 @@
#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;
@@ -26,7 +26,7 @@ pipe_i915_create_screen(int fd, unsigned flags)
#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;
@@ -38,7 +38,7 @@ pipe_i915_create_screen(int fd, unsigned flags)
#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;
@@ -49,7 +49,7 @@ pipe_nouveau_create_screen(int fd, unsigned flags)
#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;
@@ -61,7 +61,7 @@ pipe_nouveau_create_screen(int fd, unsigned flags)
#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;
@@ -72,7 +72,7 @@ pipe_pl111_create_screen(int fd, unsigned flags)
#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;
@@ -86,18 +86,18 @@ pipe_pl111_create_screen(int fd, unsigned flags)
#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;
@@ -111,18 +111,18 @@ pipe_r300_create_screen(int fd, unsigned flags)
#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;
@@ -137,15 +137,15 @@ pipe_r600_create_screen(int fd, unsigned flags)
#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;
}
@@ -153,7 +153,7 @@ pipe_radeonsi_create_screen(int fd, unsigned flags)
#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;
@@ -166,7 +166,7 @@ pipe_radeonsi_create_screen(int fd, unsigned flags)
#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;
@@ -182,7 +182,7 @@ pipe_vmwgfx_create_screen(int fd, unsigned flags)
#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;
@@ -194,7 +194,7 @@ pipe_vmwgfx_create_screen(int fd, unsigned flags)
#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;
@@ -205,7 +205,7 @@ pipe_freedreno_create_screen(int fd, unsigned flags)
#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;
@@ -218,7 +218,7 @@ pipe_freedreno_create_screen(int fd, unsigned flags)
#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;
@@ -229,7 +229,7 @@ pipe_virgl_create_screen(int fd, unsigned flags)
#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;
@@ -241,7 +241,7 @@ pipe_virgl_create_screen(int fd, unsigned flags)
#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;
@@ -252,7 +252,7 @@ pipe_vc4_create_screen(int fd, unsigned flags)
#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;
@@ -264,7 +264,7 @@ pipe_vc4_create_screen(int fd, unsigned flags)
#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;
@@ -275,7 +275,7 @@ pipe_etna_create_screen(int fd, unsigned flags)
#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;
@@ -287,7 +287,7 @@ pipe_etna_create_screen(int fd, unsigned flags)
#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;
@@ -298,7 +298,7 @@ pipe_imx_drm_create_screen(int fd, unsigned flags)
#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;
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper_public.h b/src/gallium/auxiliary/target-helpers/drm_helper_public.h
index d4adc880df0..5746e08554b 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper_public.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper_public.h
@@ -3,44 +3,45 @@
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 */
diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c
index 043483b7fea..7a0fc3c3bf2 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_dri.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c
@@ -406,7 +406,7 @@ vl_dri2_screen_create(Display *display, int screen)
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;
diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri3.c b/src/gallium/auxiliary/vl/vl_winsys_dri3.c
index 68bac44d95b..fbb729ae176 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_dri3.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_dri3.c
@@ -817,7 +817,7 @@ vl_dri3_screen_create(Display *display, int screen)
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;
diff --git a/src/gallium/auxiliary/vl/vl_winsys_drm.c b/src/gallium/auxiliary/vl/vl_winsys_drm.c
index ebde5b8cb63..07ce380ef55 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_drm.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_drm.c
@@ -52,7 +52,7 @@ vl_drm_screen_create(int fd)
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;
diff --git a/src/gallium/drivers/r300/r300_public.h b/src/gallium/drivers/r300/r300_public.h
index d2300103aaa..bf54cc4dfc0 100644
--- a/src/gallium/drivers/r300/r300_public.h
+++ b/src/gallium/drivers/r300/r300_public.h
@@ -7,8 +7,10 @@ extern "C" {
#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"
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index c78c484b82c..7d82608e70e 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -726,7 +726,8 @@ static boolean r300_fence_finish(struct pipe_screen *screen,
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);
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 0f30d0985c1..e7e29998513 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -634,7 +634,8 @@ static struct pipe_resource *r600_resource_create(struct pipe_screen *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);
@@ -649,7 +650,7 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws, unsigned flags)
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;
}
diff --git a/src/gallium/drivers/r600/r600_public.h b/src/gallium/drivers/r600/r600_public.h
index 2018440070d..937b8f7cc44 100644
--- a/src/gallium/drivers/r600/r600_public.h
+++ b/src/gallium/drivers/r600/r600_public.h
@@ -24,7 +24,9 @@
#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
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 67bc7bf4aec..d276b885c11 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -966,7 +966,7 @@ static void si_test_vmfault(struct si_screen *sscreen)
}
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;
@@ -985,7 +985,7 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
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);
diff --git a/src/gallium/drivers/radeonsi/si_public.h b/src/gallium/drivers/radeonsi/si_public.h
index 13b1731bc3c..d5027175e23 100644
--- a/src/gallium/drivers/radeonsi/si_public.h
+++ b/src/gallium/drivers/radeonsi/si_public.h
@@ -26,6 +26,6 @@
struct radeon_winsys;
struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
- unsigned flags);
+ const struct pipe_screen_config *config);
#endif
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index 65e954aa87e..a804aa93a8b 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -360,6 +360,14 @@ struct pipe_screen {
};
+/**
+ * Global configuration options for screen creation.
+ */
+struct pipe_screen_config {
+ unsigned flags;
+};
+
+
#ifdef __cplusplus
}
#endif
diff --git a/src/gallium/include/state_tracker/drm_driver.h b/src/gallium/include/state_tracker/drm_driver.h
index 1ac0528448b..f188b5a7d4c 100644
--- a/src/gallium/include/state_tracker/drm_driver.h
+++ b/src/gallium/include/state_tracker/drm_driver.h
@@ -5,6 +5,7 @@
#include "pipe/p_compiler.h"
struct pipe_screen;
+struct pipe_screen_config;
struct pipe_context;
struct pipe_resource;
@@ -104,7 +105,8 @@ struct drm_driver_descriptor
* 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.
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index 2ad9e49cf8d..bd07670f384 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -42,7 +42,7 @@ namespace {
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);
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index e4e2a534fd1..ab85cc2452e 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -2056,10 +2056,12 @@ dri2_init_screen(__DRIscreen * sPriv)
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)
@@ -2150,10 +2152,12 @@ dri_kms_init_screen(__DRIscreen * sPriv)
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;
diff --git a/src/gallium/state_trackers/dri/drisw.c b/src/gallium/state_trackers/dri/drisw.c
index ac4095618c0..10d1c8d1e4d 100644
--- a/src/gallium/state_trackers/dri/drisw.c
+++ b/src/gallium/state_trackers/dri/drisw.c
@@ -400,10 +400,12 @@ drisw_init_screen(__DRIscreen * sPriv)
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;
diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c
index e5addcf8fef..d4114ab5591 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.c
+++ b/src/gallium/state_trackers/xa/xa_tracker.c
@@ -162,7 +162,7 @@ xa_tracker_create(int drm_fd)
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;
diff --git a/src/gallium/targets/d3dadapter9/drm.c b/src/gallium/targets/d3dadapter9/drm.c
index c0ed97a6fb5..e6e71448a28 100644
--- a/src/gallium/targets/d3dadapter9/drm.c
+++ b/src/gallium/targets/d3dadapter9/drm.c
@@ -229,7 +229,7 @@ drm_create_adapter( int fd,
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);
@@ -312,7 +312,7 @@ drm_create_adapter( int fd,
/* 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 "
diff --git a/src/gallium/targets/pipe-loader/pipe_i915.c b/src/gallium/targets/pipe-loader/pipe_i915.c
index 43061b06d66..8524a1dc58f 100644
--- a/src/gallium/targets/pipe-loader/pipe_i915.c
+++ b/src/gallium/targets/pipe-loader/pipe_i915.c
@@ -5,7 +5,7 @@
#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;
diff --git a/src/gallium/targets/pipe-loader/pipe_msm.c b/src/gallium/targets/pipe-loader/pipe_msm.c
index 180e0f93511..886fbdfc7e3 100644
--- a/src/gallium/targets/pipe-loader/pipe_msm.c
+++ b/src/gallium/targets/pipe-loader/pipe_msm.c
@@ -4,7 +4,7 @@
#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;
diff --git a/src/gallium/targets/pipe-loader/pipe_nouveau.c b/src/gallium/targets/pipe-loader/pipe_nouveau.c
index de61f44ce2c..d95aeda529b 100644
--- a/src/gallium/targets/pipe-loader/pipe_nouveau.c
+++ b/src/gallium/targets/pipe-loader/pipe_nouveau.c
@@ -4,7 +4,7 @@
#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;
diff --git a/src/gallium/targets/pipe-loader/pipe_r300.c b/src/gallium/targets/pipe-loader/pipe_r300.c
index da72859f019..0dcc0191dfb 100644
--- a/src/gallium/targets/pipe-loader/pipe_r300.c
+++ b/src/gallium/targets/pipe-loader/pipe_r300.c
@@ -5,7 +5,7 @@
#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;
diff --git a/src/gallium/targets/pipe-loader/pipe_r600.c b/src/gallium/targets/pipe-loader/pipe_r600.c
index dfe130a2fc2..0eedde76bef 100644
--- a/src/gallium/targets/pipe-loader/pipe_r600.c
+++ b/src/gallium/targets/pipe-loader/pipe_r600.c
@@ -5,7 +5,7 @@
#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;
diff --git a/src/gallium/targets/pipe-loader/pipe_radeonsi.c b/src/gallium/targets/pipe-loader/pipe_radeonsi.c
index 1bbd97ff802..598baf58da3 100644
--- a/src/gallium/targets/pipe-loader/pipe_radeonsi.c
+++ b/src/gallium/targets/pipe-loader/pipe_radeonsi.c
@@ -6,7 +6,7 @@
#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;
diff --git a/src/gallium/targets/pipe-loader/pipe_vmwgfx.c b/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
index 63208318880..68bf92ce82e 100644
--- a/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
+++ b/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
@@ -5,7 +5,7 @@
#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;
diff --git a/src/gallium/tests/trivial/compute.c b/src/gallium/tests/trivial/compute.c
index a2e882cc81d..49fefd84b4b 100644
--- a/src/gallium/tests/trivial/compute.c
+++ b/src/gallium/tests/trivial/compute.c
@@ -76,7 +76,7 @@ static void init_ctx(struct context *ctx)
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);
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c
index 113cb9230bb..f6232d5dc3a 100644
--- a/src/gallium/tests/trivial/quad-tex.c
+++ b/src/gallium/tests/trivial/quad-tex.c
@@ -96,7 +96,7 @@ static void init_prog(struct program *p)
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 */
diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c
index df02e96d85f..b45a408d425 100644
--- a/src/gallium/tests/trivial/tri.c
+++ b/src/gallium/tests/trivial/tri.c
@@ -91,7 +91,7 @@ static void init_prog(struct program *p)
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 */
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_public.h b/src/gallium/winsys/amdgpu/drm/amdgpu_public.h
index 3cb5a1bf429..8702e4f6e8a 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_public.h
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_public.h
@@ -31,12 +31,13 @@
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
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index 837c1e2aae0..26c7dacb9df 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -231,7 +231,7 @@ static const char* amdgpu_get_chip_name(struct radeon_winsys *ws)
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;
@@ -328,7 +328,7 @@ amdgpu_winsys_create(int fd, unsigned flags,
*
* 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);
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_public.h b/src/gallium/winsys/radeon/drm/radeon_drm_public.h
index 2192aa68ef6..6a772f3a621 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_public.h
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_public.h
@@ -5,12 +5,13 @@
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
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
index ad1db3c388c..542e5494beb 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -736,7 +736,7 @@ static int handle_compare(void *key1, void *key2)
}
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;
@@ -832,7 +832,7 @@ radeon_drm_winsys_create(int fd, unsigned flags,
*
* 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);