[Mesa-dev] [PATCH 1/5] gallium: allow passing 'unsigned flags' to create_screen()
Marek Olšák
maraeo at gmail.com
Tue Jun 20 22:54:37 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
for drirc options
---
src/gallium/auxiliary/pipe-loader/pipe_loader.c | 4 +-
src/gallium/auxiliary/pipe-loader/pipe_loader.h | 2 +-
.../auxiliary/pipe-loader/pipe_loader_drm.c | 4 +-
.../auxiliary/pipe-loader/pipe_loader_priv.h | 3 +-
src/gallium/auxiliary/target-helpers/drm_helper.h | 48 +++++++++++-----------
.../auxiliary/target-helpers/drm_helper_public.h | 26 ++++++------
src/gallium/auxiliary/vl/vl_winsys_dri.c | 2 +-
src/gallium/auxiliary/vl/vl_winsys_dri3.c | 2 +-
src/gallium/auxiliary/vl/vl_winsys_drm.c | 2 +-
src/gallium/include/state_tracker/drm_driver.h | 2 +-
src/gallium/state_trackers/clover/core/device.cpp | 2 +-
src/gallium/state_trackers/dri/dri2.c | 4 +-
src/gallium/state_trackers/dri/drisw.c | 2 +-
src/gallium/state_trackers/xa/xa_tracker.c | 2 +-
src/gallium/targets/d3dadapter9/drm.c | 4 +-
src/gallium/targets/pipe-loader/pipe_i915.c | 2 +-
src/gallium/targets/pipe-loader/pipe_msm.c | 2 +-
src/gallium/targets/pipe-loader/pipe_nouveau.c | 2 +-
src/gallium/targets/pipe-loader/pipe_r300.c | 2 +-
src/gallium/targets/pipe-loader/pipe_r600.c | 2 +-
src/gallium/targets/pipe-loader/pipe_radeonsi.c | 2 +-
src/gallium/targets/pipe-loader/pipe_vmwgfx.c | 2 +-
src/gallium/tests/trivial/compute.c | 2 +-
src/gallium/tests/trivial/quad-tex.c | 2 +-
src/gallium/tests/trivial/tri.c | 2 +-
25 files changed, 65 insertions(+), 64 deletions(-)
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
index 1ddfeba..0857a2c 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
@@ -67,23 +67,23 @@ pipe_loader_release(struct pipe_loader_device **devs, int ndev)
}
const struct drm_conf_ret *
pipe_loader_configuration(struct pipe_loader_device *dev,
enum drm_conf conf)
{
return dev->ops->configuration(dev, conf);
}
struct pipe_screen *
-pipe_loader_create_screen(struct pipe_loader_device *dev)
+pipe_loader_create_screen(struct pipe_loader_device *dev, unsigned flags)
{
- return dev->ops->create_screen(dev);
+ return dev->ops->create_screen(dev, flags);
}
struct util_dl_library *
pipe_loader_find_module(struct pipe_loader_device *dev,
const char *library_paths)
{
struct util_dl_library *lib;
const char *next;
char path[PATH_MAX];
int len, ret;
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
index 690d088..73b7558 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
@@ -77,21 +77,21 @@ struct pipe_loader_device {
*/
int
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.
*/
struct pipe_screen *
-pipe_loader_create_screen(struct pipe_loader_device *dev);
+pipe_loader_create_screen(struct pipe_loader_device *dev, unsigned flags);
/**
* Query the configuration parameters for the specified device.
*
* \param dev Device that will be queried.
* \param conf The drm_conf id of the option to be queried.
*/
const struct drm_conf_ret *
pipe_loader_configuration(struct pipe_loader_device *dev,
enum drm_conf conf);
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 0ba360e..ef446b6 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -274,22 +274,22 @@ pipe_loader_drm_configuration(struct pipe_loader_device *dev,
{
struct pipe_loader_drm_device *ddev = pipe_loader_drm_device(dev);
if (!ddev->dd->configuration)
return NULL;
return ddev->dd->configuration(conf);
}
static struct pipe_screen *
-pipe_loader_drm_create_screen(struct pipe_loader_device *dev)
+pipe_loader_drm_create_screen(struct pipe_loader_device *dev, unsigned flags)
{
struct pipe_loader_drm_device *ddev = pipe_loader_drm_device(dev);
- return ddev->dd->create_screen(ddev->fd);
+ return ddev->dd->create_screen(ddev->fd, flags);
}
static const struct pipe_loader_ops pipe_loader_drm_ops = {
.create_screen = pipe_loader_drm_create_screen,
.configuration = pipe_loader_drm_configuration,
.release = pipe_loader_drm_release
};
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h b/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
index da2ca8c..58ab992 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_priv.h
@@ -24,21 +24,22 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef PIPE_LOADER_PRIV_H
#define PIPE_LOADER_PRIV_H
#include "pipe_loader.h"
struct pipe_loader_ops {
- struct pipe_screen *(*create_screen)(struct pipe_loader_device *dev);
+ struct pipe_screen *(*create_screen)(struct pipe_loader_device *dev,
+ unsigned flags);
const struct drm_conf_ret *(*configuration)(struct pipe_loader_device *dev,
enum drm_conf conf);
void (*release)(struct pipe_loader_device **dev);
};
/**
* Open the pipe driver module that handles a specified device.
*/
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h
index 1b071a6..65231cf 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper.h
@@ -3,308 +3,308 @@
#include <stdio.h>
#include "target-helpers/inline_debug_helper.h"
#include "target-helpers/drm_helper_public.h"
#ifdef GALLIUM_I915
#include "i915/drm/i915_drm_public.h"
#include "i915/i915_public.h"
struct pipe_screen *
-pipe_i915_create_screen(int fd)
+pipe_i915_create_screen(int fd, unsigned flags)
{
struct i915_winsys *iws;
struct pipe_screen *screen;
iws = i915_drm_winsys_create(fd);
if (!iws)
return NULL;
screen = i915_screen_create(iws);
return screen ? debug_screen_wrap(screen) : NULL;
}
#else
struct pipe_screen *
-pipe_i915_create_screen(int fd)
+pipe_i915_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "i915g: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_NOUVEAU
#include "nouveau/drm/nouveau_drm_public.h"
struct pipe_screen *
-pipe_nouveau_create_screen(int fd)
+pipe_nouveau_create_screen(int fd, unsigned flags)
{
struct pipe_screen *screen;
screen = nouveau_drm_screen_create(fd);
return screen ? debug_screen_wrap(screen) : NULL;
}
#else
struct pipe_screen *
-pipe_nouveau_create_screen(int fd)
+pipe_nouveau_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "nouveau: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_PL111
#include "pl111/drm/pl111_drm_public.h"
struct pipe_screen *
-pipe_pl111_create_screen(int fd)
+pipe_pl111_create_screen(int fd, unsigned flags)
{
struct pipe_screen *screen;
screen = pl111_drm_screen_create(fd);
return screen ? debug_screen_wrap(screen) : NULL;
}
#else
struct pipe_screen *
-pipe_pl111_create_screen(int fd)
+pipe_pl111_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "pl111: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_R300
#include "radeon/radeon_winsys.h"
#include "radeon/drm/radeon_drm_public.h"
#include "r300/r300_public.h"
struct pipe_screen *
-pipe_r300_create_screen(int fd)
+pipe_r300_create_screen(int fd, unsigned flags)
{
struct radeon_winsys *rw;
rw = radeon_drm_winsys_create(fd, r300_screen_create);
return rw ? debug_screen_wrap(rw->screen) : NULL;
}
#else
struct pipe_screen *
-pipe_r300_create_screen(int fd)
+pipe_r300_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "r300: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_R600
#include "radeon/radeon_winsys.h"
#include "radeon/drm/radeon_drm_public.h"
#include "r600/r600_public.h"
struct pipe_screen *
-pipe_r600_create_screen(int fd)
+pipe_r600_create_screen(int fd, unsigned flags)
{
struct radeon_winsys *rw;
rw = radeon_drm_winsys_create(fd, r600_screen_create);
return rw ? debug_screen_wrap(rw->screen) : NULL;
}
#else
struct pipe_screen *
-pipe_r600_create_screen(int fd)
+pipe_r600_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "r600: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_RADEONSI
#include "radeon/radeon_winsys.h"
#include "radeon/drm/radeon_drm_public.h"
#include "amdgpu/drm/amdgpu_public.h"
#include "radeonsi/si_public.h"
struct pipe_screen *
-pipe_radeonsi_create_screen(int fd)
+pipe_radeonsi_create_screen(int fd, unsigned flags)
{
struct radeon_winsys *rw;
/* First, try amdgpu. */
rw = amdgpu_winsys_create(fd, radeonsi_screen_create);
if (!rw)
rw = radeon_drm_winsys_create(fd, radeonsi_screen_create);
return rw ? debug_screen_wrap(rw->screen) : NULL;
}
#else
struct pipe_screen *
-pipe_radeonsi_create_screen(int fd)
+pipe_radeonsi_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "radeonsi: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_VMWGFX
#include "svga/drm/svga_drm_public.h"
#include "svga/svga_public.h"
struct pipe_screen *
-pipe_vmwgfx_create_screen(int fd)
+pipe_vmwgfx_create_screen(int fd, unsigned flags)
{
struct svga_winsys_screen *sws;
struct pipe_screen *screen;
sws = svga_drm_winsys_screen_create(fd);
if (!sws)
return NULL;
screen = svga_screen_create(sws);
return screen ? debug_screen_wrap(screen) : NULL;
}
#else
struct pipe_screen *
-pipe_vmwgfx_create_screen(int fd)
+pipe_vmwgfx_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "svga: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_FREEDRENO
#include "freedreno/drm/freedreno_drm_public.h"
struct pipe_screen *
-pipe_freedreno_create_screen(int fd)
+pipe_freedreno_create_screen(int fd, unsigned flags)
{
struct pipe_screen *screen;
screen = fd_drm_screen_create(fd);
return screen ? debug_screen_wrap(screen) : NULL;
}
#else
struct pipe_screen *
-pipe_freedreno_create_screen(int fd)
+pipe_freedreno_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "freedreno: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_VIRGL
#include "virgl/drm/virgl_drm_public.h"
#include "virgl/virgl_public.h"
struct pipe_screen *
-pipe_virgl_create_screen(int fd)
+pipe_virgl_create_screen(int fd, unsigned flags)
{
struct pipe_screen *screen;
screen = virgl_drm_screen_create(fd);
return screen ? debug_screen_wrap(screen) : NULL;
}
#else
struct pipe_screen *
-pipe_virgl_create_screen(int fd)
+pipe_virgl_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "virgl: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_VC4
#include "vc4/drm/vc4_drm_public.h"
struct pipe_screen *
-pipe_vc4_create_screen(int fd)
+pipe_vc4_create_screen(int fd, unsigned flags)
{
struct pipe_screen *screen;
screen = vc4_drm_screen_create(fd);
return screen ? debug_screen_wrap(screen) : NULL;
}
#else
struct pipe_screen *
-pipe_vc4_create_screen(int fd)
+pipe_vc4_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "vc4: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_ETNAVIV
#include "etnaviv/drm/etnaviv_drm_public.h"
struct pipe_screen *
-pipe_etna_create_screen(int fd)
+pipe_etna_create_screen(int fd, unsigned flags)
{
struct pipe_screen *screen;
screen = etna_drm_screen_create(fd);
return screen ? debug_screen_wrap(screen) : NULL;
}
#else
struct pipe_screen *
-pipe_etna_create_screen(int fd)
+pipe_etna_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "etnaviv: driver missing\n");
return NULL;
}
#endif
#ifdef GALLIUM_IMX
#include "imx/drm/imx_drm_public.h"
struct pipe_screen *
-pipe_imx_drm_create_screen(int fd)
+pipe_imx_drm_create_screen(int fd, unsigned flags)
{
struct pipe_screen *screen;
screen = imx_drm_screen_create(fd);
return screen ? debug_screen_wrap(screen) : NULL;
}
#else
struct pipe_screen *
-pipe_imx_drm_create_screen(int fd)
+pipe_imx_drm_create_screen(int fd, unsigned flags)
{
fprintf(stderr, "imx-drm: driver missing\n");
return NULL;
}
#endif
#endif /* DRM_HELPER_H */
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper_public.h b/src/gallium/auxiliary/target-helpers/drm_helper_public.h
index 5abb5fc..d4adc88 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper_public.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper_public.h
@@ -1,46 +1,46 @@
#ifndef _DRM_HELPER_PUBLIC_H
#define _DRM_HELPER_PUBLIC_H
struct pipe_screen;
struct pipe_screen *
-pipe_i915_create_screen(int fd);
+pipe_i915_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_ilo_create_screen(int fd);
+pipe_ilo_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_nouveau_create_screen(int fd);
+pipe_nouveau_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_r300_create_screen(int fd);
+pipe_r300_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_r600_create_screen(int fd);
+pipe_r600_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_radeonsi_create_screen(int fd);
+pipe_radeonsi_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_vmwgfx_create_screen(int fd);
+pipe_vmwgfx_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_freedreno_create_screen(int fd);
+pipe_freedreno_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_virgl_create_screen(int fd);
+pipe_virgl_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_vc4_create_screen(int fd);
+pipe_vc4_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_pl111_create_screen(int fd);
+pipe_pl111_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_etna_create_screen(int fd);
+pipe_etna_create_screen(int fd, unsigned flags);
struct pipe_screen *
-pipe_imx_drm_create_screen(int fd);
+pipe_imx_drm_create_screen(int fd, unsigned flags);
#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 b4fb47e..043483b 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_dri.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c
@@ -399,21 +399,21 @@ vl_dri2_screen_create(Display *display, int screen)
authenticate_cookie = xcb_dri2_authenticate_unchecked(scrn->conn,
xcb_screen->root,
magic);
authenticate = xcb_dri2_authenticate_reply(scrn->conn, authenticate_cookie, NULL);
if (authenticate == NULL || !authenticate->authenticated)
goto free_authenticate;
if (pipe_loader_drm_probe_fd(&scrn->base.dev, fd))
- scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev);
+ scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev, 0);
if (!scrn->base.pscreen)
goto release_pipe;
scrn->base.destroy = vl_dri2_screen_destroy;
scrn->base.texture_from_drawable = vl_dri2_screen_texture_from_drawable;
scrn->base.get_dirty_area = vl_dri2_screen_get_dirty_area;
scrn->base.get_timestamp = vl_dri2_screen_get_timestamp;
scrn->base.set_next_timestamp = vl_dri2_screen_set_next_timestamp;
scrn->base.get_private = vl_dri2_screen_get_private;
diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri3.c b/src/gallium/auxiliary/vl/vl_winsys_dri3.c
index c7c615b..47e5238 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_dri3.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_dri3.c
@@ -810,21 +810,21 @@ vl_dri3_screen_create(Display *display, int screen)
if (!geom_reply)
goto close_fd;
/* TODO support depth other than 24 */
if (geom_reply->depth != 24) {
free(geom_reply);
goto close_fd;
}
free(geom_reply);
if (pipe_loader_drm_probe_fd(&scrn->base.dev, fd))
- scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev);
+ scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev, 0);
if (!scrn->base.pscreen)
goto release_pipe;
scrn->pipe = scrn->base.pscreen->context_create(scrn->base.pscreen,
NULL, 0);
if (!scrn->pipe)
goto no_context;
scrn->base.destroy = vl_dri3_screen_destroy;
diff --git a/src/gallium/auxiliary/vl/vl_winsys_drm.c b/src/gallium/auxiliary/vl/vl_winsys_drm.c
index df8809c..ebde5b8 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_drm.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_drm.c
@@ -45,21 +45,21 @@ vl_drm_screen_create(int fd)
int new_fd;
vscreen = CALLOC_STRUCT(vl_screen);
if (!vscreen)
return NULL;
if (fd < 0 || (new_fd = fcntl(fd, F_DUPFD_CLOEXEC, 3)) < 0)
goto free_screen;
if (pipe_loader_drm_probe_fd(&vscreen->dev, new_fd))
- vscreen->pscreen = pipe_loader_create_screen(vscreen->dev);
+ vscreen->pscreen = pipe_loader_create_screen(vscreen->dev, 0);
if (!vscreen->pscreen)
goto release_pipe;
vscreen->destroy = vl_drm_screen_destroy;
vscreen->texture_from_drawable = NULL;
vscreen->get_dirty_area = NULL;
vscreen->get_timestamp = NULL;
vscreen->set_next_timestamp = NULL;
vscreen->get_private = NULL;
diff --git a/src/gallium/include/state_tracker/drm_driver.h b/src/gallium/include/state_tracker/drm_driver.h
index 88dda0a..4383276 100644
--- a/src/gallium/include/state_tracker/drm_driver.h
+++ b/src/gallium/include/state_tracker/drm_driver.h
@@ -95,21 +95,21 @@ struct drm_driver_descriptor
* Identifying prefix/suffix of the binary, used by the pipe-loader.
*/
const char *driver_name;
/**
* Create a pipe srcreen.
*
* 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);
+ struct pipe_screen* (*create_screen)(int drm_fd, unsigned flags);
/**
* Return a configuration value.
*
* If this function is NULL, or if it returns NULL
* the state tracker- or state
* tracker manager should provide a reasonable default value.
*/
const struct drm_conf_ret *(*configuration) (enum drm_conf conf);
};
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index 8dfba1a..2ad9e49 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -35,21 +35,21 @@ namespace {
int sz = pipe->get_compute_param(pipe, ir_format, cap, NULL);
std::vector<T> v(sz / sizeof(T));
pipe->get_compute_param(pipe, ir_format, cap, &v.front());
return v;
}
}
device::device(clover::platform &platform, pipe_loader_device *ldev) :
platform(platform), ldev(ldev) {
- pipe = pipe_loader_create_screen(ldev);
+ pipe = pipe_loader_create_screen(ldev, 0);
if (!pipe || !pipe->get_param(pipe, PIPE_CAP_COMPUTE)) {
if (pipe)
pipe->destroy(pipe);
throw error(CL_INVALID_DEVICE);
}
}
device::~device() {
if (pipe)
pipe->destroy(pipe);
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index c5e69d6..2d0e78c 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -2019,21 +2019,21 @@ dri2_init_screen(__DRIscreen * sPriv)
screen->sPriv = sPriv;
screen->fd = sPriv->fd;
(void) mtx_init(&screen->opencl_func_mutex, mtx_plain);
sPriv->driverPrivate = (void *)screen;
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);
+ pscreen = pipe_loader_create_screen(screen->dev, 0);
if (!pscreen)
goto release_pipe;
throttle_ret = pipe_loader_configuration(screen->dev, DRM_CONF_THROTTLE);
dmabuf_ret = pipe_loader_configuration(screen->dev, DRM_CONF_SHARE_FD);
if (throttle_ret && throttle_ret->val.val_int != -1) {
screen->throttling_enabled = TRUE;
screen->default_throttle_frames = throttle_ret->val.val_int;
@@ -2110,21 +2110,21 @@ dri_kms_init_screen(__DRIscreen * sPriv)
screen->sPriv = sPriv;
screen->fd = sPriv->fd;
sPriv->driverPrivate = (void *)screen;
if (screen->fd < 0 || (fd = fcntl(screen->fd, F_DUPFD_CLOEXEC, 3)) < 0)
goto free_screen;
if (pipe_loader_sw_probe_kms(&screen->dev, fd))
- pscreen = pipe_loader_create_screen(screen->dev);
+ pscreen = pipe_loader_create_screen(screen->dev, 0);
if (!pscreen)
goto release_pipe;
if (pscreen->resource_create_with_modifiers)
dri2ImageExtension.createImageWithModifiers =
dri2_create_image_with_modifiers;
if (drmGetCap(sPriv->fd, DRM_CAP_PRIME, &cap) == 0 &&
(cap & DRM_PRIME_CAP_IMPORT)) {
diff --git a/src/gallium/state_trackers/dri/drisw.c b/src/gallium/state_trackers/dri/drisw.c
index 8fbfa9e..877aa71 100644
--- a/src/gallium/state_trackers/dri/drisw.c
+++ b/src/gallium/state_trackers/dri/drisw.c
@@ -393,21 +393,21 @@ drisw_init_screen(__DRIscreen * sPriv)
screen->sPriv = sPriv;
screen->fd = -1;
swrast_no_present = debug_get_option_swrast_no_present();
sPriv->driverPrivate = (void *)screen;
sPriv->extensions = drisw_screen_extensions;
if (pipe_loader_sw_probe_dri(&screen->dev, &drisw_lf))
- pscreen = pipe_loader_create_screen(screen->dev);
+ pscreen = pipe_loader_create_screen(screen->dev, 0);
if (!pscreen)
goto fail;
configs = dri_init_screen_helper(screen, pscreen, "swrast");
if (!configs)
goto fail;
return configs;
fail:
diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c
index 03a3abf..e5addcf 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.c
+++ b/src/gallium/state_trackers/xa/xa_tracker.c
@@ -155,21 +155,21 @@ xa_tracker_create(int drm_fd)
unsigned int num_formats;
int fd;
if (!xa)
return NULL;
if (drm_fd < 0 || (fd = fcntl(drm_fd, F_DUPFD_CLOEXEC, 3)) < 0)
goto out_no_fd;
if (pipe_loader_drm_probe_fd(&xa->dev, fd))
- xa->screen = pipe_loader_create_screen(xa->dev);
+ xa->screen = pipe_loader_create_screen(xa->dev, 0);
if (!xa->screen)
goto out_no_screen;
xa->default_ctx = xa_context_create(xa);
if (!xa->default_ctx)
goto out_no_pipe;
num_formats = 0;
for (stype = 0; stype < XA_LAST_SURFACE_TYPE; ++stype)
diff --git a/src/gallium/targets/d3dadapter9/drm.c b/src/gallium/targets/d3dadapter9/drm.c
index 6163734..13c8648 100644
--- a/src/gallium/targets/d3dadapter9/drm.c
+++ b/src/gallium/targets/d3dadapter9/drm.c
@@ -222,21 +222,21 @@ drm_create_adapter( int fd,
ctx->fd = fd;
ctx->base.linear_framebuffer = !!different_device;
if (!pipe_loader_drm_probe_fd(&ctx->dev, fd)) {
ERR("Failed to probe drm fd %d.\n", fd);
FREE(ctx);
close(fd);
return D3DERR_DRIVERINTERNALERROR;
}
- ctx->base.hal = pipe_loader_create_screen(ctx->dev);
+ ctx->base.hal = pipe_loader_create_screen(ctx->dev, 0);
if (!ctx->base.hal) {
ERR("Unable to load requested driver.\n");
drm_destroy(&ctx->base);
return D3DERR_DRIVERINTERNALERROR;
}
dmabuf_ret = pipe_loader_configuration(ctx->dev, DRM_CONF_SHARE_FD);
throttle_ret = pipe_loader_configuration(ctx->dev, DRM_CONF_THROTTLE);
if (!dmabuf_ret || !dmabuf_ret->val.val_bool) {
ERR("The driver is not capable of dma-buf sharing."
@@ -305,21 +305,21 @@ drm_create_adapter( int fd,
if (driCheckOption(&userInitOptions, "csmt_force", DRI_INT))
ctx->base.csmt_force = driQueryOptioni(&userInitOptions, "csmt_force");
else
ctx->base.csmt_force = -1;
driDestroyOptionCache(&userInitOptions);
driDestroyOptionInfo(&defaultInitOptions);
/* 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);
+ ctx->base.ref = pipe_loader_create_screen(ctx->swdev, 0);
if (!ctx->base.ref) {
ERR("Couldn't wrap drm screen to swrast screen. Software devices "
"will be unavailable.\n");
}
/* read out PCI info */
read_descriptor(&ctx->base, fd, override_vendorid);
/* create and return new ID3DAdapter9 */
diff --git a/src/gallium/targets/pipe-loader/pipe_i915.c b/src/gallium/targets/pipe-loader/pipe_i915.c
index 2183dc3..43061b0 100644
--- a/src/gallium/targets/pipe-loader/pipe_i915.c
+++ b/src/gallium/targets/pipe-loader/pipe_i915.c
@@ -1,18 +1,18 @@
#include "target-helpers/inline_debug_helper.h"
#include "state_tracker/drm_driver.h"
#include "i915/drm/i915_drm_public.h"
#include "i915/i915_public.h"
static struct pipe_screen *
-create_screen(int fd)
+create_screen(int fd, unsigned flags)
{
struct i915_winsys *iws;
struct pipe_screen *screen;
iws = i915_drm_winsys_create(fd);
if (!iws)
return NULL;
screen = i915_screen_create(iws);
if (!screen)
diff --git a/src/gallium/targets/pipe-loader/pipe_msm.c b/src/gallium/targets/pipe-loader/pipe_msm.c
index 858b248..180e0f9 100644
--- a/src/gallium/targets/pipe-loader/pipe_msm.c
+++ b/src/gallium/targets/pipe-loader/pipe_msm.c
@@ -1,17 +1,17 @@
#include "target-helpers/inline_debug_helper.h"
#include "state_tracker/drm_driver.h"
#include "freedreno/drm/freedreno_drm_public.h"
static struct pipe_screen *
-create_screen(int fd)
+create_screen(int fd, unsigned flags)
{
struct pipe_screen *screen;
screen = fd_drm_screen_create(fd);
if (!screen)
return NULL;
screen = debug_screen_wrap(screen);
return screen;
diff --git a/src/gallium/targets/pipe-loader/pipe_nouveau.c b/src/gallium/targets/pipe-loader/pipe_nouveau.c
index d9c0c5d..de61f44 100644
--- a/src/gallium/targets/pipe-loader/pipe_nouveau.c
+++ b/src/gallium/targets/pipe-loader/pipe_nouveau.c
@@ -1,17 +1,17 @@
#include "target-helpers/inline_debug_helper.h"
#include "state_tracker/drm_driver.h"
#include "nouveau/drm/nouveau_drm_public.h"
static struct pipe_screen *
-create_screen(int fd)
+create_screen(int fd, unsigned flags)
{
struct pipe_screen *screen;
screen = nouveau_drm_screen_create(fd);
if (!screen)
return NULL;
screen = debug_screen_wrap(screen);
return screen;
diff --git a/src/gallium/targets/pipe-loader/pipe_r300.c b/src/gallium/targets/pipe-loader/pipe_r300.c
index dd5c0bd..ffd6ba8 100644
--- a/src/gallium/targets/pipe-loader/pipe_r300.c
+++ b/src/gallium/targets/pipe-loader/pipe_r300.c
@@ -1,18 +1,18 @@
#include "target-helpers/inline_debug_helper.h"
#include "state_tracker/drm_driver.h"
#include "radeon/drm/radeon_drm_public.h"
#include "radeon/radeon_winsys.h"
#include "r300/r300_public.h"
static struct pipe_screen *
-create_screen(int fd)
+create_screen(int fd, unsigned flags)
{
struct radeon_winsys *sws;
sws = radeon_drm_winsys_create(fd, r300_screen_create);
return sws ? debug_screen_wrap(sws->screen) : NULL;
}
static const struct drm_conf_ret throttle_ret = {
.type = DRM_CONF_INT,
.val.val_int = 2,
diff --git a/src/gallium/targets/pipe-loader/pipe_r600.c b/src/gallium/targets/pipe-loader/pipe_r600.c
index 70760d0..6f21c50 100644
--- a/src/gallium/targets/pipe-loader/pipe_r600.c
+++ b/src/gallium/targets/pipe-loader/pipe_r600.c
@@ -1,18 +1,18 @@
#include "state_tracker/drm_driver.h"
#include "target-helpers/inline_debug_helper.h"
#include "radeon/drm/radeon_drm_public.h"
#include "radeon/radeon_winsys.h"
#include "r600/r600_public.h"
static struct pipe_screen *
-create_screen(int fd)
+create_screen(int fd, unsigned flags)
{
struct radeon_winsys *rw;
rw = radeon_drm_winsys_create(fd, r600_screen_create);
return rw ? debug_screen_wrap(rw->screen) : NULL;
}
static const struct drm_conf_ret throttle_ret = {
.type = DRM_CONF_INT,
.val.val_int = 2,
diff --git a/src/gallium/targets/pipe-loader/pipe_radeonsi.c b/src/gallium/targets/pipe-loader/pipe_radeonsi.c
index 01b1d8a..b6a78e4 100644
--- a/src/gallium/targets/pipe-loader/pipe_radeonsi.c
+++ b/src/gallium/targets/pipe-loader/pipe_radeonsi.c
@@ -1,19 +1,19 @@
#include "state_tracker/drm_driver.h"
#include "target-helpers/inline_debug_helper.h"
#include "radeon/drm/radeon_drm_public.h"
#include "radeon/radeon_winsys.h"
#include "amdgpu/drm/amdgpu_public.h"
#include "radeonsi/si_public.h"
static struct pipe_screen *
-create_screen(int fd)
+create_screen(int fd, unsigned flags)
{
struct radeon_winsys *rw;
/* First, try amdgpu. */
rw = amdgpu_winsys_create(fd, radeonsi_screen_create);
if (!rw)
rw = radeon_drm_winsys_create(fd, radeonsi_screen_create);
return rw ? debug_screen_wrap(rw->screen) : NULL;
diff --git a/src/gallium/targets/pipe-loader/pipe_vmwgfx.c b/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
index 7aa4421..6320831 100644
--- a/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
+++ b/src/gallium/targets/pipe-loader/pipe_vmwgfx.c
@@ -1,18 +1,18 @@
#include "target-helpers/inline_debug_helper.h"
#include "state_tracker/drm_driver.h"
#include "svga/drm/svga_drm_public.h"
#include "svga/svga_public.h"
static struct pipe_screen *
-create_screen(int fd)
+create_screen(int fd, unsigned flags)
{
struct svga_winsys_screen *sws;
struct pipe_screen *screen;
sws = svga_drm_winsys_screen_create(fd);
if (!sws)
return NULL;
screen = svga_screen_create(sws);
if (!screen)
diff --git a/src/gallium/tests/trivial/compute.c b/src/gallium/tests/trivial/compute.c
index 443451e..a2e882c 100644
--- a/src/gallium/tests/trivial/compute.c
+++ b/src/gallium/tests/trivial/compute.c
@@ -69,21 +69,21 @@ struct context {
printf(" }\n"); \
} while (0)
static void init_ctx(struct context *ctx)
{
int ret;
ret = pipe_loader_probe(&ctx->dev, 1);
assert(ret);
- ctx->screen = pipe_loader_create_screen(ctx->dev);
+ ctx->screen = pipe_loader_create_screen(ctx->dev, 0);
assert(ctx->screen);
ctx->pipe = ctx->screen->context_create(ctx->screen, NULL, 0);
assert(ctx->pipe);
DUMP_COMPUTE_PARAM(p, PIPE_COMPUTE_CAP_GRID_DIMENSION);
DUMP_COMPUTE_PARAM(p, PIPE_COMPUTE_CAP_MAX_GRID_SIZE);
DUMP_COMPUTE_PARAM(p, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE);
}
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c
index 2ee544a..113cb92 100644
--- a/src/gallium/tests/trivial/quad-tex.c
+++ b/src/gallium/tests/trivial/quad-tex.c
@@ -89,21 +89,21 @@ struct program
static void init_prog(struct program *p)
{
struct pipe_surface surf_tmpl;
int ret;
/* find a hardware device */
ret = pipe_loader_probe(&p->dev, 1);
assert(ret);
/* init a pipe screen */
- p->screen = pipe_loader_create_screen(p->dev);
+ p->screen = pipe_loader_create_screen(p->dev, 0);
assert(p->screen);
/* create the pipe driver context and cso context */
p->pipe = p->screen->context_create(p->screen, NULL, 0);
p->cso = cso_create_context(p->pipe, 0);
/* set clear color */
p->clear_color.f[0] = 0.3;
p->clear_color.f[1] = 0.1;
p->clear_color.f[2] = 0.3;
diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c
index a203169..df02e96 100644
--- a/src/gallium/tests/trivial/tri.c
+++ b/src/gallium/tests/trivial/tri.c
@@ -84,21 +84,21 @@ struct program
static void init_prog(struct program *p)
{
struct pipe_surface surf_tmpl;
int ret;
/* find a hardware device */
ret = pipe_loader_probe(&p->dev, 1);
assert(ret);
/* init a pipe screen */
- p->screen = pipe_loader_create_screen(p->dev);
+ p->screen = pipe_loader_create_screen(p->dev, 0);
assert(p->screen);
/* create the pipe driver context and cso context */
p->pipe = p->screen->context_create(p->screen, NULL, 0);
p->cso = cso_create_context(p->pipe, 0);
/* set clear color */
p->clear_color.f[0] = 0.3;
p->clear_color.f[1] = 0.1;
p->clear_color.f[2] = 0.3;
--
2.7.4
More information about the mesa-dev
mailing list