To enable per-context priorities, we need to have per-context pipe's.
Unfortunately we still need to keep the global screen pipe, mostly just
for screen->get_timestamp().
Signed-off-by: Rob Clark <robdclark@gmail.com>
// draw
if (!batch->lrz_clear) {
- batch->lrz_clear = fd_ringbuffer_new(batch->ctx->screen->pipe, 0x1000);
+ batch->lrz_clear = fd_ringbuffer_new(batch->ctx->pipe, 0x1000);
fd_ringbuffer_set_parent(batch->lrz_clear, batch->gmem);
}
size = 0x100000;
}
- batch->draw = fd_ringbuffer_new(ctx->screen->pipe, size);
- batch->binning = fd_ringbuffer_new(ctx->screen->pipe, size);
- batch->gmem = fd_ringbuffer_new(ctx->screen->pipe, size);
+ batch->draw = fd_ringbuffer_new(ctx->pipe, size);
+ batch->binning = fd_ringbuffer_new(ctx->pipe, size);
+ batch->gmem = fd_ringbuffer_new(ctx->pipe, size);
fd_ringbuffer_set_parent(batch->gmem, NULL);
fd_ringbuffer_set_parent(batch->draw, batch->gmem);
}
fd_device_del(ctx->dev);
+ 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",
int i;
ctx->screen = screen;
+ ctx->pipe = fd_pipe_new(screen->dev, FD_PIPE_3D);
ctx->primtypes = primtypes;
ctx->primtype_mask = 0;
struct fd_device *dev;
struct fd_screen *screen;
+ struct fd_pipe *pipe;
struct util_queue flush_queue;
return ret == 0;
}
- if (fd_pipe_wait_timeout(fence->screen->pipe, fence->timestamp, timeout))
+ if (fd_pipe_wait_timeout(fence->ctx->pipe, fence->timestamp, timeout))
return false;
return true;
/* don't assume the buffer is zero-initialized: */
rsc = fd_resource(aq->prsc);
- fd_bo_cpu_prep(rsc->bo, ctx->screen->pipe, DRM_FREEDRENO_PREP_WRITE);
+ fd_bo_cpu_prep(rsc->bo, ctx->pipe, DRM_FREEDRENO_PREP_WRITE);
map = fd_bo_map(rsc->bo);
memset(map, 0, aq->provider->size);
return false;
}
- ret = fd_bo_cpu_prep(rsc->bo, ctx->screen->pipe,
+ ret = fd_bo_cpu_prep(rsc->bo, ctx->pipe,
DRM_FREEDRENO_PREP_READ | DRM_FREEDRENO_PREP_NOSYNC);
if (ret)
return false;
fd_batch_flush(rsc->write_batch, true);
/* get the result: */
- fd_bo_cpu_prep(rsc->bo, ctx->screen->pipe, DRM_FREEDRENO_PREP_READ);
+ fd_bo_cpu_prep(rsc->bo, ctx->pipe, DRM_FREEDRENO_PREP_READ);
void *ptr = fd_bo_map(rsc->bo);
p->result(ctx, ptr, result);
if (!rsc->bo)
return false;
- ret = fd_bo_cpu_prep(rsc->bo, ctx->screen->pipe,
+ ret = fd_bo_cpu_prep(rsc->bo, ctx->pipe,
DRM_FREEDRENO_PREP_READ | DRM_FREEDRENO_PREP_NOSYNC);
if (ret)
return false;
if (!rsc->bo)
continue;
- fd_bo_cpu_prep(rsc->bo, ctx->screen->pipe, DRM_FREEDRENO_PREP_READ);
+ fd_bo_cpu_prep(rsc->bo, ctx->pipe, DRM_FREEDRENO_PREP_READ);
void *ptr = fd_bo_map(rsc->bo);
*/
bool needs_flush = pending(rsc, !!(usage & PIPE_TRANSFER_WRITE));
bool busy = needs_flush || (0 != fd_bo_cpu_prep(rsc->bo,
- ctx->screen->pipe, op | DRM_FREEDRENO_PREP_NOSYNC));
+ ctx->pipe, op | DRM_FREEDRENO_PREP_NOSYNC));
/* if we need to flush/stall, see if we can make a shadow buffer
* to avoid this:
* completed.
*/
if (busy) {
- ret = fd_bo_cpu_prep(rsc->bo, ctx->screen->pipe, op);
+ ret = fd_bo_cpu_prep(rsc->bo, ctx->pipe, op);
if (ret)
goto fail;
}
void *compiler; /* currently unused for a2xx */
struct fd_device *dev;
+
+ /* NOTE: we still need a pipe associated with the screen in a few
+ * places, like screen->get_timestamp(). For anything context
+ * related, use ctx->pipe instead.
+ */
struct fd_pipe *pipe;
int64_t cpu_gpu_time_delta;