[Mesa-dev] [PATCH 06/22] i965: Enable BatchbufferLogger in i965 driver

Chris Wilson chris at chris-wilson.co.uk
Wed Sep 27 11:53:57 UTC 2017


Quoting kevin.rogovin at intel.com (2017-09-25 11:34:06)
> +static
> +uint32_t
> +intel_batchbuffer_state(const struct i965_logged_batchbuffer *st)
> +{
> +   struct intel_batchbuffer *batch
> +      = (struct intel_batchbuffer*) st->driver_data;
> +
> +   assert(batch->bo->gem_handle == st->gem_bo);

Hmm, this needs updating for the batch/state split; and of particular
note that the batch->bo is no longer constant. It shouldn't matter
overall as the contents/offsets are preserved.

I would need to go back and see why you need to know the handle before
the submit, but the obvious solution to me would be to record the
submission.

> +   return batch->map_next - batch->map;
> +}
> +
> +static
> +void
> +intel_active_batchbuffer(struct i965_logged_batchbuffer *st)
> +{
> +   GET_CURRENT_CONTEXT(ctx);
> +   struct brw_context *brw = brw_context(ctx);
> +
> +   if(brw != NULL && brw->have_active_batchbuffer) {
> +      st->driver_data = &brw->batch;
> +      st->gem_bo = brw->batch.bo->gem_handle;
> +      st->fd = brw_bufmgr_fd(brw->bufmgr);
> +   } else {
> +      st->driver_data = NULL;
> +      st->gem_bo = -1;

Fwiw, invalid handle is 0.
-Chris


More information about the mesa-dev mailing list