From a98a04ec80deb6a6b452165cf54a79c6ea824ab2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 21 Jun 2017 00:38:06 +0200 Subject: [PATCH] gallium/radeon: pass create_screen flags to r600_common_screen_init MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/auxiliary/target-helpers/drm_helper.h | 8 ++++---- src/gallium/drivers/r300/r300_public.h | 2 +- src/gallium/drivers/r300/r300_screen.c | 2 +- src/gallium/drivers/r600/r600_pipe.c | 4 ++-- src/gallium/drivers/r600/r600_public.h | 2 +- src/gallium/drivers/radeon/r600_pipe_common.c | 2 +- src/gallium/drivers/radeon/r600_pipe_common.h | 2 +- src/gallium/drivers/radeonsi/si_pipe.c | 5 +++-- src/gallium/drivers/radeonsi/si_public.h | 3 ++- 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 | 4 ++-- src/gallium/winsys/amdgpu/drm/amdgpu_public.h | 6 ++++-- src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 5 +++-- src/gallium/winsys/radeon/drm/radeon_drm_public.h | 6 ++++-- src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 5 +++-- 16 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h index 65231cf3eba..0027ede23a1 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper.h @@ -90,7 +90,7 @@ pipe_r300_create_screen(int fd, unsigned flags) { struct radeon_winsys *rw; - rw = radeon_drm_winsys_create(fd, r300_screen_create); + rw = radeon_drm_winsys_create(fd, flags, r300_screen_create); return rw ? debug_screen_wrap(rw->screen) : NULL; } @@ -115,7 +115,7 @@ pipe_r600_create_screen(int fd, unsigned flags) { struct radeon_winsys *rw; - rw = radeon_drm_winsys_create(fd, r600_screen_create); + rw = radeon_drm_winsys_create(fd, flags, r600_screen_create); return rw ? debug_screen_wrap(rw->screen) : NULL; } @@ -142,10 +142,10 @@ pipe_radeonsi_create_screen(int fd, unsigned flags) struct radeon_winsys *rw; /* First, try amdgpu. */ - rw = amdgpu_winsys_create(fd, radeonsi_screen_create); + rw = amdgpu_winsys_create(fd, flags, radeonsi_screen_create); if (!rw) - rw = radeon_drm_winsys_create(fd, radeonsi_screen_create); + rw = radeon_drm_winsys_create(fd, flags, radeonsi_screen_create); return rw ? debug_screen_wrap(rw->screen) : NULL; } diff --git a/src/gallium/drivers/r300/r300_public.h b/src/gallium/drivers/r300/r300_public.h index 57a69cb7c9f..d2300103aaa 100644 --- a/src/gallium/drivers/r300/r300_public.h +++ b/src/gallium/drivers/r300/r300_public.h @@ -8,7 +8,7 @@ extern "C" { struct radeon_winsys; -struct pipe_screen* r300_screen_create(struct radeon_winsys *rws); +struct pipe_screen* r300_screen_create(struct radeon_winsys *rws, unsigned flags); #ifdef __cplusplus } // extern "C" diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 937f9aed883..5cdb24871c3 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -724,7 +724,7 @@ 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) +struct pipe_screen* r300_screen_create(struct radeon_winsys *rws, unsigned flags) { 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 a225f417f27..f0ea4095762 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -632,7 +632,7 @@ 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) +struct pipe_screen *r600_screen_create(struct radeon_winsys *ws, unsigned flags) { struct r600_screen *rscreen = CALLOC_STRUCT(r600_screen); @@ -647,7 +647,7 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws) 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)) { + if (!r600_common_screen_init(&rscreen->b, ws, flags)) { FREE(rscreen); return NULL; } diff --git a/src/gallium/drivers/r600/r600_public.h b/src/gallium/drivers/r600/r600_public.h index e4fe23a87b7..2018440070d 100644 --- a/src/gallium/drivers/r600/r600_public.h +++ b/src/gallium/drivers/r600/r600_public.h @@ -25,6 +25,6 @@ struct radeon_winsys; -struct pipe_screen *r600_screen_create(struct radeon_winsys *ws); +struct pipe_screen *r600_screen_create(struct radeon_winsys *ws, unsigned flags); #endif diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 1cec6d5ea68..04f7fc19e9d 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -1322,7 +1322,7 @@ struct pipe_resource *r600_resource_create_common(struct pipe_screen *screen, } bool r600_common_screen_init(struct r600_common_screen *rscreen, - struct radeon_winsys *ws) + struct radeon_winsys *ws, unsigned flags) { char family_name[32] = {}, llvm_string[32] = {}, kernel_version[128] = {}; struct utsname uname_data; diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 310fb576847..e67982a4094 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -745,7 +745,7 @@ void r600_draw_rectangle(struct blitter_context *blitter, enum blitter_attrib_type type, const union pipe_color_union *attrib); bool r600_common_screen_init(struct r600_common_screen *rscreen, - struct radeon_winsys *ws); + struct radeon_winsys *ws, unsigned flags); void r600_destroy_common_screen(struct r600_common_screen *rscreen); void r600_preflush_suspend_features(struct r600_common_context *ctx); void r600_postflush_resume_features(struct r600_common_context *ctx); diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 74ac0ec0389..ff787adcf34 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -916,7 +916,8 @@ static void si_test_vmfault(struct si_screen *sscreen) exit(0); } -struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws) +struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws, + unsigned flags) { struct si_screen *sscreen = CALLOC_STRUCT(si_screen); unsigned num_threads, num_compiler_threads, num_compiler_threads_lowprio, i; @@ -934,7 +935,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) || + if (!r600_common_screen_init(&sscreen->b, ws, 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 7cf36c8407a..13b1731bc3c 100644 --- a/src/gallium/drivers/radeonsi/si_public.h +++ b/src/gallium/drivers/radeonsi/si_public.h @@ -25,6 +25,7 @@ struct radeon_winsys; -struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws); +struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws, + unsigned flags); #endif diff --git a/src/gallium/targets/pipe-loader/pipe_r300.c b/src/gallium/targets/pipe-loader/pipe_r300.c index ffd6ba84bf0..da72859f019 100644 --- a/src/gallium/targets/pipe-loader/pipe_r300.c +++ b/src/gallium/targets/pipe-loader/pipe_r300.c @@ -9,7 +9,7 @@ create_screen(int fd, unsigned flags) { struct radeon_winsys *sws; - sws = radeon_drm_winsys_create(fd, r300_screen_create); + sws = radeon_drm_winsys_create(fd, flags, r300_screen_create); return sws ? debug_screen_wrap(sws->screen) : NULL; } diff --git a/src/gallium/targets/pipe-loader/pipe_r600.c b/src/gallium/targets/pipe-loader/pipe_r600.c index 6f21c50a8bb..dfe130a2fc2 100644 --- a/src/gallium/targets/pipe-loader/pipe_r600.c +++ b/src/gallium/targets/pipe-loader/pipe_r600.c @@ -9,7 +9,7 @@ create_screen(int fd, unsigned flags) { struct radeon_winsys *rw; - rw = radeon_drm_winsys_create(fd, r600_screen_create); + rw = radeon_drm_winsys_create(fd, flags, r600_screen_create); return rw ? debug_screen_wrap(rw->screen) : NULL; } diff --git a/src/gallium/targets/pipe-loader/pipe_radeonsi.c b/src/gallium/targets/pipe-loader/pipe_radeonsi.c index b6a78e42cbe..1bbd97ff802 100644 --- a/src/gallium/targets/pipe-loader/pipe_radeonsi.c +++ b/src/gallium/targets/pipe-loader/pipe_radeonsi.c @@ -11,10 +11,10 @@ create_screen(int fd, unsigned flags) struct radeon_winsys *rw; /* First, try amdgpu. */ - rw = amdgpu_winsys_create(fd, radeonsi_screen_create); + rw = amdgpu_winsys_create(fd, flags, radeonsi_screen_create); if (!rw) - rw = radeon_drm_winsys_create(fd, radeonsi_screen_create); + rw = radeon_drm_winsys_create(fd, flags, radeonsi_screen_create); return rw ? debug_screen_wrap(rw->screen) : NULL; } diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_public.h b/src/gallium/winsys/amdgpu/drm/amdgpu_public.h index ad133b20bf6..3cb5a1bf429 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_public.h +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_public.h @@ -32,9 +32,11 @@ struct radeon_winsys; struct pipe_screen; -typedef struct pipe_screen *(*radeon_screen_create_t)(struct radeon_winsys *); +typedef struct pipe_screen *(*radeon_screen_create_t)(struct radeon_winsys *, + unsigned); struct radeon_winsys * -amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create); +amdgpu_winsys_create(int fd, unsigned flags, + 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 2cbc39c0c70..c4d52166fb7 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c @@ -229,7 +229,8 @@ static const char* amdgpu_get_chip_name(struct radeon_winsys *ws) PUBLIC struct radeon_winsys * -amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create) +amdgpu_winsys_create(int fd, unsigned flags, + radeon_screen_create_t screen_create) { struct amdgpu_winsys *ws; drmVersionPtr version = drmGetVersion(fd); @@ -324,7 +325,7 @@ amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create) * * 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); + ws->base.screen = screen_create(&ws->base, flags); 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 dfcaaa4b6ef..2192aa68ef6 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_public.h +++ b/src/gallium/winsys/radeon/drm/radeon_drm_public.h @@ -6,9 +6,11 @@ struct radeon_winsys; struct pipe_screen; -typedef struct pipe_screen *(*radeon_screen_create_t)(struct radeon_winsys *); +typedef struct pipe_screen *(*radeon_screen_create_t)(struct radeon_winsys *, + unsigned); struct radeon_winsys * -radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create); +radeon_drm_winsys_create(int fd, unsigned flags, + 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 e0d4cc8d773..2a6ce2ca216 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c @@ -735,7 +735,8 @@ static int handle_compare(void *key1, void *key2) } PUBLIC struct radeon_winsys * -radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create) +radeon_drm_winsys_create(int fd, unsigned flags, + radeon_screen_create_t screen_create) { struct radeon_drm_winsys *ws; @@ -830,7 +831,7 @@ radeon_drm_winsys_create(int fd, radeon_screen_create_t screen_create) * * 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); + ws->base.screen = screen_create(&ws->base, flags); if (!ws->base.screen) { radeon_winsys_destroy(&ws->base); mtx_unlock(&fd_tab_mutex); -- 2.30.2