Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-17 Thread Alyssa Rosenzweig
> I think the only (valid) reason not to use pipe_reference would be if > it was some code that might someday be useful for a vulkan driver. Good to know :) > (That said, maybe we should move more and more of gallium's helpful > util stuff out of gallium so they can be re-used across the mesa >

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-17 Thread Rob Clark
On Tue, Apr 16, 2019 at 8:07 AM Alyssa Rosenzweig wrote: > > > > diff --git a/src/gallium/drivers/panfrost/pan_job.c > > > b/src/gallium/drivers/panfrost/pan_job.c > > > index 66a8b0d4b07..6c68575158f 100644 > > > --- a/src/gallium/drivers/panfrost/pan_job.c > > > +++

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-17 Thread Rob Clark
On Tue, Apr 16, 2019 at 12:31 AM Boris Brezillon wrote: > > On Tue, 16 Apr 2019 01:49:21 + > Alyssa Rosenzweig wrote: > > > @@ -1793,22 +1799,9 @@ panfrost_set_vertex_buffers( > > const struct pipe_vertex_buffer *buffers) > > { > > struct panfrost_context *ctx =

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-16 Thread Alyssa Rosenzweig
Gotcha, thank you! I'll fix this over. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-16 Thread Eric Anholt
Alyssa Rosenzweig writes: >> > diff --git a/src/gallium/drivers/panfrost/pan_job.c >> > b/src/gallium/drivers/panfrost/pan_job.c >> > index 66a8b0d4b07..6c68575158f 100644 >> > --- a/src/gallium/drivers/panfrost/pan_job.c >> > +++ b/src/gallium/drivers/panfrost/pan_job.c >> > @@ -27,6 +27,13 @@

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-16 Thread Alyssa Rosenzweig
> It's outside of the diff context, but we shouldn't use i as the index > for attrs[] as the first active vertex buffers might be != 0 and vb_mask > might be sparse (my patch had the same issue). Ack, good catch, thank you. Will address in next version. +1

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-16 Thread Alyssa Rosenzweig
> Had a look at the cso code (more precisely > cso_{save,restore}_vertex_buffer0() and their users) and I'm not sure > util_set_vertex_buffers_mask() does what's expected by the CSO layer > (don't know who's right about the ->set_vertex_buffers() semantic > though). I'm not sure. Other drivers

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-16 Thread Alyssa Rosenzweig
> loop in panfrost_emit_vertex_data() to do the right thing. But I think > we can get rid of ->vertex_buffer_count entirely and just do a > > for (int i = 0; i < ARRAY_SIZE(ctx->vertex_buffers); ++i) > > > } Sure, that's probably cleaner now that we're testing the mask. Will do for v2.

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-16 Thread Alyssa Rosenzweig
> > diff --git a/src/gallium/drivers/panfrost/pan_job.c > > b/src/gallium/drivers/panfrost/pan_job.c > > index 66a8b0d4b07..6c68575158f 100644 > > --- a/src/gallium/drivers/panfrost/pan_job.c > > +++ b/src/gallium/drivers/panfrost/pan_job.c > > @@ -27,6 +27,13 @@ > > #include "util/hash_table.h"

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-16 Thread Erik Faye-Lund
On Tue, 2019-04-16 at 01:49 +, Alyssa Rosenzweig wrote: > This (fairly large) patch continues work surrounding the panfrost_job > abstraction to improve job lifetime management. In particular, we add > infrastructure to track which BOs are used by a particular job > (currently limited to the

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-16 Thread Boris Brezillon
On Tue, 16 Apr 2019 01:49:21 + Alyssa Rosenzweig wrote: > @@ -745,6 +747,8 @@ panfrost_emit_vertex_data(struct panfrost_context *ctx) > unsigned invocation_count = > MALI_NEGATIVE(ctx->payload_tiler.prefix.invocation_count); > > for (int i = 0; i <

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-16 Thread Boris Brezillon
On Tue, 16 Apr 2019 09:31:46 +0200 Boris Brezillon wrote: > On Tue, 16 Apr 2019 01:49:21 + > Alyssa Rosenzweig wrote: > > > @@ -1793,22 +1799,9 @@ panfrost_set_vertex_buffers( > > const struct pipe_vertex_buffer *buffers) > > { > > struct panfrost_context *ctx =

Re: [Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-16 Thread Boris Brezillon
On Tue, 16 Apr 2019 01:49:21 + Alyssa Rosenzweig wrote: > @@ -1793,22 +1799,9 @@ panfrost_set_vertex_buffers( > const struct pipe_vertex_buffer *buffers) > { > struct panfrost_context *ctx = pan_context(pctx); > -assert(num_buffers <= PIPE_MAX_ATTRIBS); > - > -

[Mesa-dev] [PATCH 1/2] panfrost: Track BO lifetime with jobs and reference counts

2019-04-15 Thread Alyssa Rosenzweig
This (fairly large) patch continues work surrounding the panfrost_job abstraction to improve job lifetime management. In particular, we add infrastructure to track which BOs are used by a particular job (currently limited to the vertex buffer BOs), to reference count these BOs, and to