Module: Mesa Branch: master Commit: ae7283dcbc00c6df07118c47f393ed5f52046050 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae7283dcbc00c6df07118c47f393ed5f52046050
Author: Nicolai Hähnle <nicolai.haeh...@amd.com> Date: Thu Aug 3 15:02:09 2017 +0200 pipe-loader: remove config from pipe_loader_create_screen The config passed into the screen should be independent from the state tracker, because at least in the case of radeonsi, the screen structure can be shared between different state trackers. Incidentally, this also fixes crashes that were recently introduced. Fixes: a35a9e7c ("gallium: add driconf options to pipe_screen_config") Tested-by: Dieter Nützel <die...@nuetzel-hh.de> Reviewed-by: Marek Olšák <marek.ol...@amd.com> --- src/gallium/auxiliary/pipe-loader/pipe_loader.c | 9 +++++---- src/gallium/auxiliary/pipe-loader/pipe_loader.h | 5 +---- 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/state_trackers/clover/core/device.cpp | 2 +- src/gallium/state_trackers/dri/dri2.c | 8 ++------ src/gallium/state_trackers/dri/drisw.c | 3 +-- src/gallium/state_trackers/xa/xa_tracker.c | 2 +- src/gallium/targets/d3dadapter9/drm.c | 4 ++-- src/gallium/tests/trivial/compute.c | 2 +- src/gallium/tests/trivial/quad-tex.c | 2 +- src/gallium/tests/trivial/tri.c | 2 +- 13 files changed, 19 insertions(+), 26 deletions(-) diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c b/src/gallium/auxiliary/pipe-loader/pipe_loader.c index 6d9acebdb6..926db49fd2 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c @@ -123,13 +123,14 @@ pipe_loader_get_driinfo_xml(const char *driver_name) } struct pipe_screen * -pipe_loader_create_screen(struct pipe_loader_device *dev, - struct pipe_screen_config *config) +pipe_loader_create_screen(struct pipe_loader_device *dev) { + struct pipe_screen_config config; + pipe_loader_load_options(dev); - config->options = &dev->option_cache; + config.options = &dev->option_cache; - return dev->ops->create_screen(dev, config); + 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 b6e81cf391..b50114310b 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h @@ -86,12 +86,9 @@ 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, - struct pipe_screen_config *config); +pipe_loader_create_screen(struct pipe_loader_device *dev); /** * Query the configuration parameters for the specified device. diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c index 7a0fc3c3bf..b4fb47ea8e 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, NULL); + scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev); 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 fbb729ae17..8251087f3f 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, NULL); + scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev); 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 07ce380ef5..df8809c501 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, NULL); + vscreen->pscreen = pipe_loader_create_screen(vscreen->dev); if (!vscreen->pscreen) goto release_pipe; diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp index bd07670f38..8dfba1ad9f 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, NULL); + pipe = pipe_loader_create_screen(ldev); 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 0f36e1bf89..3555107856 100644 --- a/src/gallium/state_trackers/dri/dri2.c +++ b/src/gallium/state_trackers/dri/dri2.c @@ -2071,11 +2071,9 @@ dri2_init_screen(__DRIscreen * sPriv) if (pipe_loader_drm_probe_fd(&screen->dev, fd)) { - struct pipe_screen_config config = {}; - dri_init_options(screen); - pscreen = pipe_loader_create_screen(screen->dev, &config); + pscreen = pipe_loader_create_screen(screen->dev); } if (!pscreen) @@ -2166,12 +2164,10 @@ dri_kms_init_screen(__DRIscreen * sPriv) if (screen->fd < 0 || (fd = fcntl(screen->fd, F_DUPFD_CLOEXEC, 3)) < 0) goto free_screen; - struct pipe_screen_config config = {}; - dri_init_options(screen); if (pipe_loader_sw_probe_kms(&screen->dev, fd)) - pscreen = pipe_loader_create_screen(screen->dev, &config); + pscreen = pipe_loader_create_screen(screen->dev); if (!pscreen) goto release_pipe; diff --git a/src/gallium/state_trackers/dri/drisw.c b/src/gallium/state_trackers/dri/drisw.c index ad40e2f837..46ec95c690 100644 --- a/src/gallium/state_trackers/dri/drisw.c +++ b/src/gallium/state_trackers/dri/drisw.c @@ -401,10 +401,9 @@ drisw_init_screen(__DRIscreen * sPriv) sPriv->extensions = drisw_screen_extensions; if (pipe_loader_sw_probe_dri(&screen->dev, &drisw_lf)) { - struct pipe_screen_config config; dri_init_options(screen); - pscreen = pipe_loader_create_screen(screen->dev, &config); + pscreen = pipe_loader_create_screen(screen->dev); } if (!pscreen) diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c index d4114ab559..03a3abf683 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, NULL); + xa->screen = pipe_loader_create_screen(xa->dev); if (!xa->screen) goto out_no_screen; diff --git a/src/gallium/targets/d3dadapter9/drm.c b/src/gallium/targets/d3dadapter9/drm.c index e6e71448a2..9c5bd8a15b 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, NULL); + ctx->base.hal = pipe_loader_create_screen(ctx->dev); 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, NULL); + ctx->base.ref = pipe_loader_create_screen(ctx->swdev); if (!ctx->base.ref) { ERR("Couldn't wrap drm screen to swrast screen. Software devices " diff --git a/src/gallium/tests/trivial/compute.c b/src/gallium/tests/trivial/compute.c index 49fefd84b4..443451e13d 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, NULL); + ctx->screen = pipe_loader_create_screen(ctx->dev); 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 f6232d5dc3..2ee544a412 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, NULL); + p->screen = pipe_loader_create_screen(p->dev); 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 b45a408d42..a2031696f0 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, NULL); + p->screen = pipe_loader_create_screen(p->dev); assert(p->screen); /* create the pipe driver context and cso context */ _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit