[Mesa-dev] [PATCH v3 21/25] panfrost: Add new helpers to describe job depencencies on BOs

Alyssa Rosenzweig alyssa at rosenzweig.io
Thu Sep 5 23:26:45 UTC 2019


> --- a/src/gallium/drivers/panfrost/pan_fragment.c
> +++ b/src/gallium/drivers/panfrost/pan_fragment.c
> @@ -44,7 +44,7 @@ panfrost_initialize_surface(
>          rsrc->slices[level].initialized = true;
>  
>          assert(rsrc->bo);
> -        panfrost_batch_add_bo(batch, rsrc->bo);
> +        panfrost_batch_add_bo(batch, rsrc->bo, PAN_SHARED_BO_RW);
>  }

This should be write-only. The corresponding read would be iff we're
wallpapering, so add an add_bo with RO in the wallpaper drawing routine.

I don't know if it really matters (since we can only have one write at a
time) but let's be precise.

-------------------------------

On that note, sometimes we stuff multiple related-but-independent
buffers within a single BO, particularly multiple miplevels/cubemap
faces/etc in one BO.  Hypothetically, it is legal to render to multiple
faces independently at once. In practice, I don't know if this case is
it is, we can of course split up the resource into per-face BOs.

>          _mesa_hash_table_remove_key(ctx->batches, &batch->key);
> +        util_unreference_framebuffer_state(&batch->key);

(Remind me where was the corresponding reference..?)

> +void panfrost_batch_add_fbo_bos(struct panfrost_batch *batch)
> +{
> +        for (unsigned i = 0; i < batch->key.nr_cbufs; ++i) {
> +                struct panfrost_resource *rsrc = pan_resource(batch->key.cbufs[i]->texture);
> +                panfrost_batch_add_bo(batch, rsrc->bo, PAN_SHARED_BO_RW);
> +	}
> +
> +        if (batch->key.zsbuf) {
> +                struct panfrost_resource *rsrc = pan_resource(batch->key.zsbuf->texture);
> +                panfrost_batch_add_bo(batch, rsrc->bo, PAN_SHARED_BO_RW);
> +        }
> +}

As per above, these should be write-only. Also, is this duplicate from
the panfrost_batch_add_bo in panfrost_initialize_surface? It feels like
it. Which one is deadcode..?


More information about the mesa-dev mailing list