diff options
Diffstat (limited to 'src/gallium/winsys/radeon/drm')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 22 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_winsys.h | 16 |
2 files changed, 12 insertions, 26 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c index 4ce1717ecc9..91db6b7f365 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c @@ -137,9 +137,12 @@ static void radeon_destroy_cs_context(struct radeon_cs_context *csc) } -static struct radeon_winsys_cs *radeon_drm_cs_create(struct radeon_winsys *rws, - enum ring_type ring_type, - struct radeon_winsys_cs_handle *trace_buf) +static struct radeon_winsys_cs * +radeon_drm_cs_create(struct radeon_winsys *rws, + enum ring_type ring_type, + void (*flush)(void *ctx, unsigned flags), + void *flush_ctx, + struct radeon_winsys_cs_handle *trace_buf) { struct radeon_drm_winsys *ws = radeon_drm_winsys(rws); struct radeon_drm_cs *cs; @@ -151,6 +154,8 @@ static struct radeon_winsys_cs *radeon_drm_cs_create(struct radeon_winsys *rws, pipe_semaphore_init(&cs->flush_completed, 1); cs->ws = ws; + cs->flush_cs = flush; + cs->flush_data = flush_ctx; cs->trace_buf = (struct radeon_bo*)trace_buf; if (!radeon_init_cs_context(&cs->csc1, cs->ws)) { @@ -551,16 +556,6 @@ static void radeon_drm_cs_destroy(struct radeon_winsys_cs *rcs) FREE(cs); } -static void radeon_drm_cs_set_flush(struct radeon_winsys_cs *rcs, - void (*flush)(void *ctx, unsigned flags), - void *user) -{ - struct radeon_drm_cs *cs = radeon_drm_cs(rcs); - - cs->flush_cs = flush; - cs->flush_data = user; -} - static boolean radeon_bo_is_referenced(struct radeon_winsys_cs *rcs, struct radeon_winsys_cs_handle *_buf, enum radeon_bo_usage usage) @@ -646,7 +641,6 @@ void radeon_drm_cs_init_functions(struct radeon_drm_winsys *ws) ws->base.cs_validate = radeon_drm_cs_validate; ws->base.cs_memory_below_limit = radeon_drm_cs_memory_below_limit; ws->base.cs_flush = radeon_drm_cs_flush; - ws->base.cs_set_flush_callback = radeon_drm_cs_set_flush; ws->base.cs_is_buffer_referenced = radeon_bo_is_referenced; ws->base.cs_sync_flush = radeon_drm_cs_sync_flush; ws->base.cs_create_fence = radeon_cs_create_fence; diff --git a/src/gallium/winsys/radeon/drm/radeon_winsys.h b/src/gallium/winsys/radeon/drm/radeon_winsys.h index 320989c0788..469c79beccc 100644 --- a/src/gallium/winsys/radeon/drm/radeon_winsys.h +++ b/src/gallium/winsys/radeon/drm/radeon_winsys.h @@ -418,10 +418,14 @@ struct radeon_winsys { * * \param ws The winsys this function is called from. * \param ring_type The ring type (GFX, DMA, UVD) + * \param flush Flush callback function associated with the command stream. + * \param user User pointer that will be passed to the flush callback. * \param trace_buf Trace buffer when tracing is enabled */ struct radeon_winsys_cs *(*cs_create)(struct radeon_winsys *ws, enum ring_type ring_type, + void (*flush)(void *ctx, unsigned flags), + void *flush_ctx, struct radeon_winsys_cs_handle *trace_buf); /** @@ -489,18 +493,6 @@ struct radeon_winsys { void (*cs_flush)(struct radeon_winsys_cs *cs, unsigned flags, uint32_t cs_trace_id); /** - * Set a flush callback which is called from winsys when flush is - * required. - * - * \param cs A command stream to set the callback for. - * \param flush A flush callback function associated with the command stream. - * \param user A user pointer that will be passed to the flush callback. - */ - void (*cs_set_flush_callback)(struct radeon_winsys_cs *cs, - void (*flush)(void *ctx, unsigned flags), - void *ctx); - - /** * Return TRUE if a buffer is referenced by a command stream. * * \param cs A command stream. |