*/
#include "freedreno_context.h"
+#include "freedreno_blitter.h"
#include "freedreno_draw.h"
#include "freedreno_fence.h"
#include "freedreno_program.h"
struct fd_context *ctx = fd_context(pctx);
struct pipe_fence_handle *fence = NULL;
+ DBG("%p: flush: flags=%x\n", ctx->batch, flags);
+
/* Take a ref to the batch's fence (batch can be unref'd when flushed: */
fd_fence_ref(pctx->screen, &fence, ctx->batch->fence);
if (!ctx->screen->reorder) {
fd_batch_flush(ctx->batch, true, false);
+ } else if (flags & PIPE_FLUSH_DEFERRED) {
+ fd_bc_flush_deferred(&ctx->screen->batch_cache, ctx);
} else {
fd_bc_flush(&ctx->screen->batch_cache, ctx);
}
fd_context_flush(pctx, NULL, 0);
}
+static void
+fd_memory_barrier(struct pipe_context *pctx, unsigned flags)
+{
+ fd_context_flush(pctx, NULL, 0);
+ /* TODO do we need to check for persistently mapped buffers and fd_bo_cpu_prep()?? */
+}
+
/**
* emit marker string as payload of a no-op packet, which can be
* decoded by cffdump.
fd_pipe_del(ctx->pipe);
if (fd_mesa_debug & (FD_DBG_BSTAT | FD_DBG_MSGS)) {
- printf("batch_total=%u, batch_sysmem=%u, batch_gmem=%u, batch_restore=%u\n",
+ printf("batch_total=%u, batch_sysmem=%u, batch_gmem=%u, batch_nondraw=%u, batch_restore=%u\n",
(uint32_t)ctx->stats.batch_total, (uint32_t)ctx->stats.batch_sysmem,
- (uint32_t)ctx->stats.batch_gmem, (uint32_t)ctx->stats.batch_restore);
+ (uint32_t)ctx->stats.batch_gmem, (uint32_t)ctx->stats.batch_nondraw,
+ (uint32_t)ctx->stats.batch_restore);
}
FREE(ctx);
{
struct fd_screen *screen = fd_screen(pscreen);
struct pipe_context *pctx;
+ unsigned prio = 1;
int i;
+ /* lower numerical value == higher priority: */
+ if (fd_mesa_debug & FD_DBG_HIPRIO)
+ prio = 0;
+ else if (flags & PIPE_CONTEXT_HIGH_PRIORITY)
+ prio = 0;
+ else if (flags & PIPE_CONTEXT_LOW_PRIORITY)
+ prio = 2;
+
ctx->screen = screen;
- ctx->pipe = fd_pipe_new(screen->dev, FD_PIPE_3D);
+ ctx->pipe = fd_pipe_new2(screen->dev, FD_PIPE_3D, prio);
ctx->primtypes = primtypes;
ctx->primtype_mask = 0;
pctx->create_fence_fd = fd_create_fence_fd;
pctx->fence_server_sync = fd_fence_server_sync;
pctx->texture_barrier = fd_texture_barrier;
+ pctx->memory_barrier = fd_memory_barrier;
pctx->stream_uploader = u_upload_create_default(pctx);
if (!pctx->stream_uploader)
slab_create_child(&ctx->transfer_pool, &screen->transfer_pool);
+ if (!ctx->blit)
+ ctx->blit = fd_blitter_blit;
+
fd_draw_init(pctx);
fd_resource_context_init(pctx);
fd_query_context_init(pctx);