diff options
author | Marek Olšák <[email protected]> | 2016-06-11 15:40:28 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-06-24 12:24:40 +0200 |
commit | 404d0d50d8aaf60597668e65a2d7c96cdea53aea (patch) | |
tree | 4bc6013efc181d8678a00ac5f434bc4433772172 /src/gallium/winsys/amdgpu | |
parent | 4358f6dd130680d60d48d6646959c11c8d7ca13d (diff) |
gallium/u_queue: add an option to have multiple worker threads
independent jobs don't have to be stuck on only one thread
v2: use CALLOC & FREE
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/winsys/amdgpu')
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 4 | ||||
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_cs.h | 2 | ||||
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index 4a7302ab2cb..5636f834de1 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -872,7 +872,7 @@ static void amdgpu_add_fence_dependencies(struct amdgpu_cs *acs) } } -void amdgpu_cs_submit_ib(void *job) +void amdgpu_cs_submit_ib(void *job, int thread_index) { struct amdgpu_cs *acs = (struct amdgpu_cs*)job; struct amdgpu_winsys *ws = acs->ctx->ws; @@ -1054,7 +1054,7 @@ static void amdgpu_cs_flush(struct radeon_winsys_cs *rcs, util_queue_is_initialized(&ws->cs_queue)) { util_queue_add_job(&ws->cs_queue, cs, &cs->flush_completed); } else { - amdgpu_cs_submit_ib(cs); + amdgpu_cs_submit_ib(cs, 0); } } else { amdgpu_cs_context_cleanup(cs->csc); diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h index 354e403fa36..a7f3414269f 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h @@ -218,6 +218,6 @@ bool amdgpu_fence_wait(struct pipe_fence_handle *fence, uint64_t timeout, bool absolute); void amdgpu_cs_sync_flush(struct radeon_winsys_cs *rcs); void amdgpu_cs_init_functions(struct amdgpu_winsys *ws); -void amdgpu_cs_submit_ib(void *job); +void amdgpu_cs_submit_ib(void *job, int thread_index); #endif diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c index ddcdc865f1b..22a81220ace 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c @@ -493,7 +493,7 @@ amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create) pipe_mutex_init(ws->bo_fence_lock); if (sysconf(_SC_NPROCESSORS_ONLN) > 1 && debug_get_option_thread()) - util_queue_init(&ws->cs_queue, 8, amdgpu_cs_submit_ib); + util_queue_init(&ws->cs_queue, 8, 1, amdgpu_cs_submit_ib); /* Create the screen at the end. The winsys must be initialized * completely. |