summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/target-helpers
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 /src/gallium/auxiliary/target-helpers
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]>
Diffstat (limited to 'src/gallium/auxiliary/target-helpers')
-rw-r--r--src/gallium/auxiliary/target-helpers/drm_helper.h56
-rw-r--r--src/gallium/auxiliary/target-helpers/drm_helper_public.h27
2 files changed, 42 insertions, 41 deletions
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 */