Re: [Mesa-dev] [PATCH v2 18/37] panfrost: Add flags to reflect the BO imported/exported state

2019-09-16 Thread Alyssa Rosenzweig
R-b, but could we move this patch before the one adding the WAIT_BO? And I guess some succeeding patches we'll want to move before as well, and then the final one using it get squashed? Let's see. On Mon, Sep 16, 2019 at 11:36:56AM +0200, Boris Brezillon wrote: > Will be useful to make the ioctl(W

Re: [Mesa-dev] [PATCH v2 19/37] panfrost: Add the panfrost_batch_create_bo() helper

2019-09-16 Thread Alyssa Rosenzweig
R-b, wonderful On Mon, Sep 16, 2019 at 11:36:57AM +0200, Boris Brezillon wrote: > This helper automates the panfrost_bo_create()+panfrost_batch_add_bo()+ > panfrost_bo_unreference() sequence that's done for all per-batch BOs. > > Signed-off-by: Boris Brezillon > --- > src/gallium/drivers/panfro

Re: [Mesa-dev] [PATCH v2 20/37] panfrost: Add FBO BOs to batch->bos earlier

2019-09-16 Thread Alyssa Rosenzweig
R-b On Mon, Sep 16, 2019 at 11:36:58AM +0200, Boris Brezillon wrote: > If we want the batch dependency tracking to work correctly we must > make sure all BOs are added to the batch->bos set early enough. Adding > FBO BOs when generating the fragment job is clearly to late. Add a > panfrost_batch_a

Re: [Mesa-dev] [PATCH v2 21/37] panfrost: Allocate tiler and scratchpad BOs per-batch

2019-09-16 Thread Alyssa Rosenzweig
> Note to Alyssa: I tried removing the dummy_tiler BO replacing it by a > dummy value (tried both 0xdeafbeef and 0x0) and unfortunately it > crashed, so I decided to keep this dummy allocation for now. Very well. That'd be a neat but very low prio RE task, so *shrug* > -static void > -panfrost_se

Re: [Mesa-dev] [PATCH v2 22/37] panfrost: Extend the panfrost_batch_add_bo() API to pass access flags

2019-09-16 Thread Alyssa Rosenzweig
PAN_BO_GPU_ACCESS_* is rather wordy. We're a GPU driver, of course it's GPU access :) Could we just do PAN_BO_ACCESS_* instead? > static mali_ptr > panfrost_upload_tex( > struct panfrost_context *ctx, > +enum pipe_shader_type st, > struct panfrost_sampler_view *view) >

Re: [Mesa-dev] [PATCH v2 23/37] panfrost: Make panfrost_batch->bos a hash table

2019-09-16 Thread Alyssa Rosenzweig
What if flags = 0? On Mon, Sep 16, 2019 at 11:37:01AM +0200, Boris Brezillon wrote: > So we can store the flags as data and keep the BO as a key. This way > we keep track of the type of access done on BOs. > > Signed-off-by: Boris Brezillon > --- > src/gallium/drivers/panfrost/pan_job.c | 33 ++

Re: [Mesa-dev] [PATCH v2 24/37] panfrost: Cache GPU accesses to BOs

2019-09-16 Thread Alyssa Rosenzweig
> +/* If ->gpu_access is 0, the BO is idle, and if the WRITE > flag > + * is cleared, that means we only have readers. > + */ > +if (!bo->gpu_access) > +return true; > +else if (!(access_type &

Re: [Mesa-dev] [PATCH v2 22/37] panfrost: Extend the panfrost_batch_add_bo() API to pass access flags

2019-09-16 Thread Alyssa Rosenzweig
> > PAN_BO_GPU_ACCESS_* is rather wordy. We're a GPU driver, of course it's > > GPU access :) > > Well, the driver can also do CPU accesses to the same BOs :P. Yes, but we won't be marking them off this way ever, no? > > > +panfrost_batch_add_bo(batch, rsrc->bo, > > > +

Re: [Mesa-dev] [PATCH v2 23/37] panfrost: Make panfrost_batch->bos a hash table

2019-09-16 Thread Alyssa Rosenzweig
Well, the hash tables strongly assume you're not using NULLs for things. See _mesa_hash_table_set_deleted_key for how to change that behaviour. On Mon, Sep 16, 2019 at 04:17:37PM +0200, Boris Brezillon wrote: > On Mon, 16 Sep 2019 10:00:13 -0400 > Alyssa Rosenzweig wrote: > >

Re: [Mesa-dev] [PATCH v2 24/37] panfrost: Cache GPU accesses to BOs

2019-09-16 Thread Alyssa Rosenzweig
> > > +/* If ->gpu_access is 0, the BO is idle, and if the > > > WRITE flag > > > + * is cleared, that means we only have readers. > > > + */ > > > +if (!bo->gpu_access) > > > +return true; > > > +

Re: [Mesa-dev] [PATCH v2 25/37] panfrost: Add a batch fence

2019-09-16 Thread Alyssa Rosenzweig
> +/* Start in a signaled state so that even non-submitted batches > + * (those that have no draw/clear) can be waited upon. > + */ When would this happen? Presumably if a batch does nothing whatsoever, it doesn't make sense to wait on it. > #include "pan_resource.h" > >

Re: [Mesa-dev] [PATCH v2 25/37] panfrost: Add a batch fence

2019-09-16 Thread Alyssa Rosenzweig
Also, some typos: > + * since other batches might want to wait on an fence of already a fence. > +/* panfrost_batch_fence is the out fence of batch that users or other batches a batch > +/* Cached value of the signaled state to avoid calling WAIC_SYNCOBJs WAIT_SYNCOBJs ___

Re: [Mesa-dev] [PATCH v2 26/37] panfrost: Use the per-batch fences to wait on the last submitted batch

2019-09-16 Thread Alyssa Rosenzweig
R-b On Mon, Sep 16, 2019 at 11:37:04AM +0200, Boris Brezillon wrote: > We just replace the per-context out_sync object by a pointer to the > the fence of the last last submitted batch. Pipelining of batches will > come later. > > Signed-off-by: Boris Brezillon > --- > src/gallium/drivers/panfro

Re: [Mesa-dev] [PATCH v2 27/37] panfrost: Add a panfrost_freeze_batch() helper

2019-09-16 Thread Alyssa Rosenzweig
> +/* Remove the entry in the FBO -> batch hash table if the batch > + * matches. This way, next draws/clears targeting this FBO will > trigger > + * the creation of a new batch. > + */ > +entry = _mesa_hash_table_search(ctx->batches, &batch->key); > + i

Re: [Mesa-dev] [PATCH v2 28/37] panfrost: Start tracking inter-batch dependencies

2019-09-16 Thread Alyssa Rosenzweig
> + * A BO is either being written or read at any time, that's what the type > field > + * encodes. Might this be inferred from (writer != NULL) and (readers->length > 0)? > +util_dynarray_foreach(&batch->dependencies, > + struct panfrost_batch_fence *, dep)

Re: [Mesa-dev] [PATCH v2 29/37] panfrost: Prepare panfrost_fence for batch pipelining

2019-09-16 Thread Alyssa Rosenzweig
> +/* Export fences from all pending pending batches. */ Pending pending batches, from the Department of Redundancy Department. Aside from that, R-b :) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailma

Re: [Mesa-dev] [PATCH v2 30/37] panfrost: Add a panfrost_flush_all_batches() helper

2019-09-16 Thread Alyssa Rosenzweig
> diff --git a/src/gallium/drivers/panfrost/pan_compute.c > b/src/gallium/drivers/panfrost/pan_compute.c > index 4639c1b03c38..036dffbb17be 100644 > --- a/src/gallium/drivers/panfrost/pan_compute.c > +++ b/src/gallium/drivers/panfrost/pan_compute.c > @@ -133,7 +133,7 @@ panfrost_launch_grid(struct

Re: [Mesa-dev] [PATCH v2 00/37] panfrost: Support batch pipelining

2019-09-16 Thread Alyssa Rosenzweig
> As a drive-by comment, in case you didn't know, the "standard" > solution for avoiding flushing when BO's are written by the CPU (e.g. > uniform buffer updates) as documented in ARM's performance guide is to > add a copy-on-write mechanism, so that you have "shadow" BO's when the > original BO is

Re: [Mesa-dev] [PATCH v2 23/37] panfrost: Make panfrost_batch->bos a hash table

2019-09-17 Thread Alyssa Rosenzweig
Ah, perhaps, yes. My bad. On Tue, Sep 17, 2019 at 12:18:17AM +0200, Boris Brezillon wrote: > On Mon, 16 Sep 2019 15:26:12 -0400 > Alyssa Rosenzweig wrote: > > > Well, the hash tables strongly assume you're not using NULLs for things. > > > > See _mesa_hash_

Re: [Mesa-dev] [PATCH v2 25/37] panfrost: Add a batch fence

2019-09-17 Thread Alyssa Rosenzweig
> > > +/* Start in a signaled state so that even non-submitted batches > > > + * (those that have no draw/clear) can be waited upon. > > > + */ > > > > When would this happen? Presumably if a batch does nothing whatsoever, > > it doesn't make sense to wait on it. > > Was

Re: [Mesa-dev] [PATCH v2 31/37] panfrost: Add a panfrost_flush_batches_accessing_bo() helper

2019-09-17 Thread Alyssa Rosenzweig
R-b On Mon, Sep 16, 2019 at 11:37:09AM +0200, Boris Brezillon wrote: > This will allow us to only flush batches touching a specific resource, > which is particularly useful when the CPU needs to access a BO. > > Signed-off-by: Boris Brezillon > --- > src/gallium/drivers/panfrost/pan_job.c | 31

Re: [Mesa-dev] [PATCH v2 28/37] panfrost: Start tracking inter-batch dependencies

2019-09-17 Thread Alyssa Rosenzweig
> > I'm wondering if batch->dependencies should be expressed as a set, > > rather than a dynarray, such that testing whether a batch has a > > given dependency is ideally O(1), not O(N). > > > > In practice I don't know if the asymptotic complexity matters, esp. for > > small numbers of batches, a

Re: [Mesa-dev] [PATCH v2 32/37] panfrost: Kill the explicit serialization in panfrost_batch_submit()

2019-09-17 Thread Alyssa Rosenzweig
R-b with enthusiasm :) On Mon, Sep 16, 2019 at 11:37:10AM +0200, Boris Brezillon wrote: > Now that we have all the pieces in place to support pipelining batches > we can get rid of the drmSyncobjWait() at the end of > panfrost_batch_submit(). > > Signed-off-by: Boris Brezillon > --- > src/galli

Re: [Mesa-dev] [PATCH v2 33/37] panfrost: Get rid of the flush in panfrost_set_framebuffer_state()

2019-09-17 Thread Alyssa Rosenzweig
R-b :D On Mon, Sep 16, 2019 at 11:37:11AM +0200, Boris Brezillon wrote: > Now that we have track inter-batch dependencies, the flush done in > panfrost_set_framebuffer_state() is no longer needed. Let's get rid of > it. > > Signed-off-by: Boris Brezillon > --- > src/gallium/drivers/panfrost/pan

Re: [Mesa-dev] [PATCH v2 34/37] panfrost: Do fine-grained flushing when preparing BO for CPU accesses

2019-09-17 Thread Alyssa Rosenzweig
R-b On Mon, Sep 16, 2019 at 11:37:12AM +0200, Boris Brezillon wrote: > We don't have to flush all batches when we're only interested in > reading/writing a specific BO. Thanks to the > panfrost_flush_batches_accessing_bo() and panfrost_bo_wait() helpers > we can now flush only the batches touching

Re: [Mesa-dev] [PATCH v2 35/37] panfrost: Rename ctx->batches into ctx->fbo_to_batch

2019-09-17 Thread Alyssa Rosenzweig
R-b On Mon, Sep 16, 2019 at 11:37:13AM +0200, Boris Brezillon wrote: > We are about to add a batch queue to keep track of submission order. > Let's rename the existing batches hash table (which is used to get the > batch attached to an FBO) into fbo_to_batch to avoid confusion. > > Signed-off-by:

Re: [Mesa-dev] [PATCH v2 36/37] panfrost: Take draw call order into account

2019-09-17 Thread Alyssa Rosenzweig
Hmm, could you explain a bit why this is necessary? I would think if there's no dependency, there's no dependency, and if this fixes bugs, that's a dependency tracking issue that we're just papering over. (Also, I guess r-b on previous patch retracted temporarily since it was a setup for this.)

Re: [Mesa-dev] [PATCH v2 37/37] panfrost/ci: New tests are passing

2019-09-17 Thread Alyssa Rosenzweig
R-b, nice :) On Mon, Sep 16, 2019 at 11:37:15AM +0200, Boris Brezillon wrote: > All dEQP-GLES2.functional.fbo.render.texsubimage.* tests are now > passing. > > Signed-off-by: Boris Brezillon > --- > src/gallium/drivers/panfrost/ci/expected-failures.txt | 4 > 1 file changed, 4 deletions(-)

Re: [Mesa-dev] [PATCH v2 00/37] panfrost: Support batch pipelining

2019-09-17 Thread Alyssa Rosenzweig
00, Boris Brezillon wrote: > On Mon, 16 Sep 2019 16:29:05 -0400 > Alyssa Rosenzweig wrote: > > > > As a drive-by comment, in case you didn't know, the "standard" > > > solution for avoiding flushing when BO's are written by the CPU (e.g. > > > u

Re: [Mesa-dev] [PATCH 1/2] panfrost: Fix indexed draws

2019-09-18 Thread Alyssa Rosenzweig
R-b On Wed, Sep 18, 2019 at 03:54:37PM +0200, Boris Brezillon wrote: > ->padded_count should be large enough to cover all vertices pointed by > the index array. Use the local vertex_count variable that contains the > updated vertex_count value for the indexed draw case. > > Signed-off-by: Boris B

Re: [Mesa-dev] [PATCH 1/3] panfrost: Make sure a clear does not re-use a pre-existing batch

2019-09-20 Thread Alyssa Rosenzweig
To be clear, if we have a batch and do the following operations: clear red draw 1 clear green draw 2 flush All we should see is #2 on a green background, which this patch handles by the second clear invalidating all the clears/draws that came before it (pro

Re: [Mesa-dev] [PATCH 2/3] panfrost: Draw the wallpaper when only depth/stencil bufs are cleared

2019-09-20 Thread Alyssa Rosenzweig
R-b, nice fix :) On Fri, Sep 20, 2019 at 04:53:38PM +0200, Boris Brezillon wrote: > When only the depth/stencil bufs are cleared, we should make sure the > color content is reloaded into the tile buffers if we want to preserve > their content. > > Signed-off-by: Boris Brezillon > --- > There mig

Re: [Mesa-dev] [PATCH 3/3] panfrost: More tests are passing

2019-09-20 Thread Alyssa Rosenzweig
R-b with pleasure! Glad to see those tests fixed, those have stumped me for a *long* time :D Congratulations! Thank you! On Fri, Sep 20, 2019 at 04:53:39PM +0200, Boris Brezillon wrote: > Remove the tests that are now passing. > > Signed-off-by: Boris Brezillon > --- > .../drivers/panfrost/ci/

Re: [Mesa-dev] [PATCH v3 01/17] panfrost: Extend the panfrost_batch_add_bo() API to pass access flags

2019-09-20 Thread Alyssa Rosenzweig
> @@ -1121,7 +1134,11 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, > bool with_vertex_data) > > struct panfrost_shader_state *ss = > &all->variants[all->active_variant]; > > -panfrost_batch_add_bo(batch, ss->bo); > +panfrost_batch_ad

Re: [Mesa-dev] [PATCH v3 02/17] panfrost: Make panfrost_batch->bos a hash table

2019-09-20 Thread Alyssa Rosenzweig
R-b On Wed, Sep 18, 2019 at 03:24:24PM +0200, Boris Brezillon wrote: > So we can store the flags as data and keep the BO as a key. This way > we keep track of the type of access done on BOs. > > Signed-off-by: Boris Brezillon > --- > Changes in v3: > * None > --- > src/gallium/drivers/panfrost/p

Re: [Mesa-dev] [PATCH v3 03/17] panfrost: Add a batch fence

2019-09-20 Thread Alyssa Rosenzweig
R-b On Wed, Sep 18, 2019 at 03:24:25PM +0200, Boris Brezillon wrote: > So we can implement fine-grained dependency tracking between batches. > > Signed-off-by: Boris Brezillon > --- > Changes in v3: > * Fix typos > * Do not initialize the syncobj in a signaled state, and set > fence->signaled

Re: [Mesa-dev] [PATCH v3 04/17] panfrost: Use the per-batch fences to wait on the last submitted batch

2019-09-20 Thread Alyssa Rosenzweig
R-b On Wed, Sep 18, 2019 at 03:24:26PM +0200, Boris Brezillon wrote: > We just replace the per-context out_sync object by a pointer to the > the fence of the last last submitted batch. Pipelining of batches will > come later. > > Signed-off-by: Boris Brezillon > --- > Alyssa, I dropped your R-b s

Re: [Mesa-dev] [PATCH v3 05/17] panfrost: Add a panfrost_freeze_batch() helper

2019-09-20 Thread Alyssa Rosenzweig
ogic. > > Signed-off-by: Boris Brezillon > Reviewed-by: Alyssa Rosenzweig > --- > Changes in v3: > * Collect R-b > --- > src/gallium/drivers/panfrost/pan_job.c | 62 ++ > 1 file changed, 44 insertions(+), 18 deletions(-) > > diff --git

Re: [Mesa-dev] [PATCH v3 06/17] panfrost: Start tracking inter-batch dependencies

2019-09-20 Thread Alyssa Rosenzweig
R-b. nice work! On Wed, Sep 18, 2019 at 03:24:28PM +0200, Boris Brezillon wrote: > The idea is to track which BO are being accessed and the type of access > to determine when a dependency exists. Thanks to that we can build a > dependency graph that will allow us to flush batches in the correct >

Re: [Mesa-dev] [PATCH v3 07/17] panfrost: Prepare panfrost_fence for batch pipelining

2019-09-20 Thread Alyssa Rosenzweig
be pipelined, and the last submitted one is not necessarily > the one that will finish last. > > We need to make sure the fence logic waits on all flushed batches, not > only the last one. > > Signed-off-by: Boris Brezillon > Reviewed-by: Alyssa Rosenzweig > --- > Chan

Re: [Mesa-dev] [PATCH v3 09/17] panfrost: Add a panfrost_flush_batches_accessing_bo() helper

2019-09-20 Thread Alyssa Rosenzweig
" On Wed, Sep 18, 2019 at 03:24:31PM +0200, Boris Brezillon wrote: > This will allow us to only flush batches touching a specific resource, > which is particularly useful when the CPU needs to access a BO. > > Signed-off-by: Boris Brezillon > Reviewed-by: Alyssa Rosenzweig &

Re: [Mesa-dev] [PATCH v3 08/17] panfrost: Add a panfrost_flush_all_batches() helper

2019-09-20 Thread Alyssa Rosenzweig
_batches() ones. > > Signed-off-by: Boris Brezillon > Reviewed-by: Alyssa Rosenzweig > --- > Changes in v3: > * Add missing blank line > * Collect R-b > --- > src/gallium/drivers/panfrost/pan_compute.c | 2 +- > src/gallium/drivers/panfrost/pan_context.c | 23 +++-

Re: [Mesa-dev] [PATCH v3 13/17] panfrost: Make sure the BO is 'ready' when picked from the cache

2019-09-20 Thread Alyssa Rosenzweig
c > index 9daddf9d0cc2..37602688d630 100644 > --- a/src/gallium/drivers/panfrost/pan_bo.c > +++ b/src/gallium/drivers/panfrost/pan_bo.c > @@ -23,6 +23,7 @@ > * Authors (Collabora): > * Alyssa Rosenzweig > */ > +#include > #include > #include &

Re: [Mesa-dev] [PATCH v3 14/17] panfrost: Do fine-grained flushing when preparing BO for CPU accesses

2019-09-20 Thread Alyssa Rosenzweig
Looks good, still r-b. But while we're here, let's get this right: > @@ -578,10 +578,8 @@ panfrost_transfer_map(struct pipe_context *pctx, > is_bound |= fb->cbufs[c]->texture == resource; > } > > -if (is_bound && (usage & PIPE_TRANSFER_READ)) { > -

Re: [Mesa-dev] [PATCH v3 15/17] panfrost: Rename ctx->batches into ctx->fbo_to_batch

2019-09-20 Thread Alyssa Rosenzweig
R-b On Wed, Sep 18, 2019 at 03:24:37PM +0200, Boris Brezillon wrote: > We are about to add a batch queue to keep track of submission order. > Let's rename the existing batches hash table (which is used to get the > batch attached to an FBO) into fbo_to_batch to avoid confusion. > > Signed-off-by:

Re: [Mesa-dev] [PATCH v3 15/17] panfrost: Rename ctx->batches into ctx->fbo_to_batch

2019-09-20 Thread Alyssa Rosenzweig
Erm, un r-b, sorry, didn't realize this was the optional. Let's hold off on this patch and the succeeding one for now. On Wed, Sep 18, 2019 at 03:24:37PM +0200, Boris Brezillon wrote: > We are about to add a batch queue to keep track of submission order. > Let's rename the existing batches hash ta

Re: [Mesa-dev] [PATCH v3 00/17] panfrost: Support batch pipelining

2019-09-20 Thread Alyssa Rosenzweig
Series looks quite good, overall. Just a few minor issues, but probably not even enough to justify a respin. Congratulations! :p On Wed, Sep 18, 2019 at 03:24:22PM +0200, Boris Brezillon wrote: > Hello, > > This is the third attempt at supporting batch pipelining. This time I > implemented it usi

Re: [Mesa-dev] [PATCH v3 01/17] panfrost: Extend the panfrost_batch_add_bo() API to pass access flags

2019-09-22 Thread Alyssa Rosenzweig
> > Although actually I am not at all sure what this batch_add_bo is doing > > at all? > > > > I think this batch_add_bo should probably dropped altogether? This loop > > is dealing with constant buffers; the shaders themselves were added > > I'll double check. I couldn't find where BOs containin

Re: [Mesa-dev] [PATCH 1/3] panfrost: Make sure a clear does not re-use a pre-existing batch

2019-09-22 Thread Alyssa Rosenzweig
> > To be clear, if we have a batch and do the following operations: > > > > clear red > > draw 1 > > clear green > > draw 2 > > flush > > > > All we should see is #2 on a green background, which this patch handles > > by the second clear invalidating all the clears/draws that

Re: [Mesa-dev] [PATCH v3 01/17] panfrost: Extend the panfrost_batch_add_bo() API to pass access flags

2019-09-22 Thread Alyssa Rosenzweig
> +your collabora address Thank you > > > > I think this batch_add_bo should probably dropped altogether? This loop > > > > is dealing with constant buffers; the shaders themselves were added > > > > > > I'll double check. I couldn't find where BOs containing shader programs > > > were added l

Re: [Mesa-dev] [PATCH 1/3] panfrost: Make sure a clear does not re-use a pre-existing batch

2019-09-23 Thread Alyssa Rosenzweig
> One more thing: optimization of the above scenario is probably > something we'll want to have at some point, but I think the current > patch is worth applying in the meantime. All this patch does is > enforcing ordering of clears/draws to make sure the end result matches > users expectation. Hum

[Mesa-dev] [PATCH 01/30] pan/midgard: Add missing parans in SWIZZLE definition

2019-09-28 Thread Alyssa Rosenzweig
TODO: Move me to front of series. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/midgard/helpers.h b/src/panfrost/midgard/helpers.h index ac58fd50327..343fad0fea8 100644 --- a/src/panfrost

[Mesa-dev] [PATCH 10/30] pan/midgard: Add mir_schedule_texture/ldst/alu helpers

2019-09-28 Thread Alyssa Rosenzweig
We don't actually do any scheduling here yet, but add per-tag helpers to consume an instruction, print it, pop it off the worklist. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 190 1 file changed, 190 insertions(+) diff --git

[Mesa-dev] [PATCH 06/30] pan/midgard: Initialize worklist

2019-09-28 Thread Alyssa Rosenzweig
This flows naturally from the dependency graph Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 17 + 1 file changed, 17 insertions(+) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 70fa030390c

[Mesa-dev] [PATCH 09/30] pan/midgard: Add mir_choose_bundle helper

2019-09-28 Thread Alyssa Rosenzweig
It's not always obvious what the optimal bundle type should be. Let's break out the logic to decide. Currently set for purely in-order operation. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 25 + 1 file changed, 25 insertion

[Mesa-dev] [PATCH 07/30] pan/midgard: Add mir_choose_instruction stub

2019-09-28 Thread Alyssa Rosenzweig
-powerful out-of-order model. So rather than discriminating by a register pressure estimate, we simply choose the latest possible instruction in the worklist. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 55 + 1 file changed, 55 insertions

[Mesa-dev] [PATCH 03/30] pan/midgard: Squeeze indices before scheduling

2019-09-28 Thread Alyssa Rosenzweig
This allows node_count to be correct while scheduling. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index b8d9b5ec9be

[Mesa-dev] [PATCH 08/30] pan/midgard: Add mir_update_worklist helper

2019-09-28 Thread Alyssa Rosenzweig
After we've chosen an instruction, popped it off, and processed it, it's time to update the worklist, removing that instruction from the dependency graph to allow its dependents to be put onto the worklist. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_sched

[Mesa-dev] [PATCH 13/30] pan/midgard: Add predicate->exclude

2019-09-28 Thread Alyssa Rosenzweig
o add an actual dependency practically speaking, since the new synthetic imov doesn't have a node associated. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/panfro

[Mesa-dev] [PATCH 14/30] pan/midgard: Implement predicate->unit

2019-09-28 Thread Alyssa Rosenzweig
This allows ALUs to select for each unit of the bundle separately. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index

[Mesa-dev] [PATCH 11/30] pan/midgard: Remove csel constant unit force

2019-09-28 Thread Alyssa Rosenzweig
Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_compile.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 585591d9356..95ec48e9563 100644 --- a/src/panfrost/midgard/midgard_compile.c

[Mesa-dev] [PATCH 12/30] pan/midgard: Add constant intersection filters

2019-09-28 Thread Alyssa Rosenzweig
ly do better, of course. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 55 + 1 file changed, 55 insertions(+) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 72c6ec42980..86a77149c78 1

[Mesa-dev] [PATCH 19/30] pan/midgard: Add distance metric to choose_instruction

2019-09-28 Thread Alyssa Rosenzweig
We require chosen instructions to be "close", to avoid ballooning register pressure. This is a kludge that will go away once we have proper liveness tracking in the scheduler, but for now it prevents a lot of needless spilling. Signed-off-by: Alyssa Rosenzweig --- src/panfro

[Mesa-dev] [PATCH 18/30] pan/midgard: Add mir_choose_alu helper

2019-09-28 Thread Alyssa Rosenzweig
Based on a given unit. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 24 1 file changed, 24 insertions(+) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index e2641ea0180..dea8b023e9d

[Mesa-dev] [PATCH 15/30] pan/midgard: Add helpers for scheduling conditionals

2019-09-28 Thread Alyssa Rosenzweig
conditionals correct is surprisingly complex. Essentially, we see if we could stuff the conditional within the same bundle as the csel/branch without breaking anything; if we can, we do that. If we can't, we add a dummy move to make room. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/mi

[Mesa-dev] [PATCH 05/30] pan/midgard: Calculate dependency graph

2019-09-28 Thread Alyssa Rosenzweig
Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/compiler.h | 10 ++ src/panfrost/midgard/midgard_schedule.c | 121 2 files changed, 131 insertions(+) diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index 8612bab7686

[Mesa-dev] [PATCH 22/30] pan/midgard: Extend choose_instruction for scalar units

2019-09-28 Thread Alyssa Rosenzweig
Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 4 1 file changed, 4 insertions(+) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index e71f65f6004..094451ceb9d 100644 --- a/src/panfrost/midgard

[Mesa-dev] [PATCH 16/30] pan/midgard: Extend csel_swizzle to branches

2019-09-28 Thread Alyssa Rosenzweig
Conditions for branches don't have a swizzle explicitly in the emitted binary, but they do implicitly get swizzled in whatever instruction wrote r31, so we need to handle that. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/compiler.h| 4 ++-- src/panfrost/mi

[Mesa-dev] [PATCH 20/30] pan/midgard: Use new scheduler

2019-09-28 Thread Alyssa Rosenzweig
We still emit in-order but we switch to using the bundles created from the new scheduler, which will allow greater flexibility and room for out-of-order optimization. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/compiler.h | 6 - src/panfrost/midgard/midgard_compile.c

[Mesa-dev] [PATCH 26/30] pan/midgard: Allow writeout to see into the future

2019-09-28 Thread Alyssa Rosenzweig
If an instruction could be scheduled to vmul to satisfy the writeout conditions, let's do that and save an instruction+cycle per fragment shader. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 41 - 1 file changed, 40 insertions(

[Mesa-dev] [PATCH 17/30] pan/midgard: Implement load/store pairing

2019-09-28 Thread Alyssa Rosenzweig
We can bundle two load/store together. This eliminates the need for explicit load/store pairing in a prepass, as well. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 67 + 1 file changed, 12 insertions(+), 55 deletions(-) diff --git a/src

[Mesa-dev] [PATCH 02/30] pan/midgard: Fix component count handling for ldst

2019-09-28 Thread Alyssa Rosenzweig
It's not based on the writemask and it can't be inferred; it's just intrinsic to the op itself. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/helpers.h | 15 +++-- src/panfrost/midgard/mir.c | 59 ++ 2 files changed, 37 in

[Mesa-dev] [PATCH 21/30] pan/midgard: Don't double check SCALAR units

2019-09-28 Thread Alyssa Rosenzweig
Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 4 1 file changed, 4 deletions(-) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index f883830cf86..e71f65f6004 100644 --- a/src/panfrost/midgard

[Mesa-dev] [PATCH 04/30] pan/midgard: Add flatten_mir helper

2019-09-28 Thread Alyssa Rosenzweig
We would like to flatten a linked list of midgard_instructions into an array of midgard_instruction pointers on the heap. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/src/panfrost/midgard

[Mesa-dev] [PATCH 00/30] pan/midgard: Implement out-of-order scheduler

2019-09-28 Thread Alyssa Rosenzweig
confidence interval for threads %-change: 100.00% 100.00% total spills in shared programs: 3 -> 3 (0.00%) spills in affected programs: 0 -> 0 helped: 0 HURT: 0 total fills in shared programs: 5 -> 6 (20.00%) fills in affected programs: 5 -> 6 (20.00%) helped: 0 HURT: 1 Alyssa Rosenzwei

[Mesa-dev] [PATCH 24/30] pan/midgard: Only one conditional per bundle allowed

2019-09-28 Thread Alyssa Rosenzweig
There's no r32 to save ya after you use up r31 :) Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 16 1 file changed, 16 insertions(+) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c

[Mesa-dev] [PATCH 23/30] pan/midgard: Schedule to smul/sadd

2019-09-28 Thread Alyssa Rosenzweig
Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 094451ceb9d..5f271608a30 100644 --- a/src/panfrost/midgard

[Mesa-dev] [PATCH 28/30] pan/midgard: Add mir_flip helper

2019-09-28 Thread Alyssa Rosenzweig
Useful for various operations on both commutative and anticommutative ops. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/compiler.h | 1 + src/panfrost/midgard/midgard_opt_invert.c | 13 +++-- src/panfrost/midgard/mir.c| 17 + 3

[Mesa-dev] [PATCH 25/30] pan/midgard: Allow 6 instructions per bundle

2019-09-28 Thread Alyssa Rosenzweig
We never had a scheduler good enough to hit this case before! :) Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/compiler.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index cf943ea6995

[Mesa-dev] [PATCH 29/30] pan/midgard: Add csel invert optimization

2019-09-28 Thread Alyssa Rosenzweig
Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/compiler.h | 1 + src/panfrost/midgard/midgard_compile.c| 1 + src/panfrost/midgard/midgard_opt_invert.c | 25 +++ 3 files changed, 27 insertions(+) diff --git a/src/panfrost/midgard/compiler.h b/src

[Mesa-dev] [PATCH 27/30] pan/midgard: Tightly pack 32-bit constants

2019-09-28 Thread Alyssa Rosenzweig
If we can reuse constant slots from other instructions, we would like to do so to include more instructions per bundle. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 129 +--- 1 file changed, 113 insertions(+), 16 deletions(-) diff --git a

[Mesa-dev] [PATCH 30/30] pan/midgard: Allow scheduling conditions with constants

2019-09-28 Thread Alyssa Rosenzweig
Now that we have constant adjustment logic abstracted, we can do this safely. Along with the csel inversion patch, this allows many more common csel ops to inline their condition in the bundle. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/midgard_schedule.c | 14 ++ 1

[Mesa-dev] Rust drivers in Mesa

2020-10-01 Thread Alyssa Rosenzweig
Hi all, Recently I've been thinking about the potential for the Rust programming language in Mesa. Rust bills itself a safe system programming language with comparable performance to C [0], which is a naturally fit for graphics driver development. Mesa today is written primarily in C, a notorious

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-04 Thread Alyssa Rosenzweig
Cc'd. On Sun, Oct 04, 2020 at 03:17:28PM +0300, Michael Shigorin wrote: > Hello, > regarding this proposal: > http://lists.freedesktop.org/archives/mesa-dev/2020-October/224639.html > > Alyssa, Rust is not "naturally fit for graphics driver > development" since it's not as universally avail

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Alyssa Rosenzweig
> drive-by comment: for something like a gl driver that a lot of other > things depend on, making it harder for us to depend on other external > things is actually a good thing I agree with this as well. The Rust standard library is richer than C's, if we can get by fine with C + util/, that shoul

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Alyssa Rosenzweig
> Yep. Before we can land a single bit of code, we need to do a bunch of > annoying things like build-system integration, FFI bridging, agreeing > on conventions and style, etc etc. Trying to do that whilst also > replacing the GLSL compiler or vtn is way too much; it's 100% doomed > to failure, ev

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Alyssa Rosenzweig
> I have found that other tools like RAII/drop, the closely related smart > pointer types, and safe containers (vectors, strings etc.) even without > the borrow checker niceties, to be relatively more useful in preventing > memory errors. However, these are features that modern C++ also offers, > a

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Alyssa Rosenzweig
> > I think it's just going to get more messy and complicated for people who > > don't want to learn or use another language. Mesa already requires people > > to know C, Python, and now newly Gitlab CI scripts just to get stuff done > > and merged. Another language would only exacerbate the issu

Re: [Mesa-dev] Rust drivers in Mesa

2020-10-14 Thread Alyssa Rosenzweig
> Since the majority opinion seemed to be "if someone wanted to use it > in a leaf node without making everyone use it, that's fine", I've > started trying to put together the CI bits necessary to enable it. > Currently fighting with meson cross files a bit, but the linting works > and the amd64 bu

[Mesa-dev] Developer access

2021-01-21 Thread Alyssa Rosenzweig
Hi all, Icecream95[1], a long-time Mesa/Panfrost contributor, has requested developer access to mesa on the GitLab issue tracker [2]. Quoting here for convenience of those who monitor the mailing list but not the tracker: > @alyssa keeps complaining about getting poked to assign stuff to Marge >

Re: [Mesa-dev] Perfetto CPU/GPU tracing

2021-02-12 Thread Alyssa Rosenzweig
My 2c for Mali/Panfrost -- For us, capturing GPU perf counters is orthogonal to rendering. It's expected (e.g. with Arm's tools) to do this from a separate process. Neither Mesa nor the DDK should require custom instrumentation for the low-level data. Fahien's gfx-pps handles this correctly for Pa

Re: [Mesa-dev] Perfetto CPU/GPU tracing

2021-02-12 Thread Alyssa Rosenzweig
bine them with kernel ftrace > events are a big plus. Admittedly, there is no HW counters and my > needs are simpler (inserting function begin/end and wait begin/end and > combining them with virtio-gpu and dma-fence ftrace events). > > On Fri, Feb 12, 2021 at 2:13 PM Alyssa Rosenzw

Re: [Mesa-dev] [PATCH v2 6/8] gallium: add lima driver

2019-03-22 Thread Alyssa Rosenzweig
> + > +static bool gpir_lower_viewport_transform(gpir_compiler *comp) > +{ > + gpir_node *rcpw = NULL; > + > + /* rcpw = 1 / w */ > + list_for_each_entry(gpir_block, block, &comp->block_list, list) { > + list_for_each_entry(gpir_node, node, &block->node_list, list) { > + if (node

Re: [Mesa-dev] [PATCH v2 6/8] gallium: add lima driver

2019-03-22 Thread Alyssa Rosenzweig
> + f->temp_write.dest = 0x03; // 11 - temporary Maybe make a #define, enum [poofs, again] ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] panfrost: Cache index buffer bounds

2019-03-24 Thread Alyssa Rosenzweig
This code is probably a wholesale duplication of the corresponding code in mesa/src/vbo/vbo_minmax_indices.c; we should investigate reusing that. Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/pan_context.c | 108 ++-- src/gallium/drivers/panfrost

[Mesa-dev] [PATCH] panfrost: Preliminary work for mipmaps

2019-03-24 Thread Alyssa Rosenzweig
handled, while drawing some attention to the blit code. Mipmaps are still disabled at this point, as autogeneration is not yet implemented; enabling as-is would cause regressions. Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/pan_context.c | 49 ++--- src/gallium/drivers

[Mesa-dev] [PATCH 01/12] panfrost: Fix vertex/index buffer corruption

2019-03-24 Thread Alyssa Rosenzweig
Fixes a bunch of crashes in dEQP-GLES2.functional.buffer.* Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/pan_context.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers

[Mesa-dev] [PATCH 02/12] panfrost/midgard: Fix b2f32 swizzle for vectors

2019-03-24 Thread Alyssa Rosenzweig
Fixes issues in most of dEQP-GLES2.functional.shaders.* Signed-off-by: Alyssa Rosenzweig --- .../drivers/panfrost/midgard/midgard_compile.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src

[Mesa-dev] [PATCH 05/12] panfrost/midgard: Add fcsel_i opcode

2019-03-24 Thread Alyssa Rosenzweig
Whereas a normal fcsel acts on a boolean input in r31.w, the fcsel_i variant acts on an integer input in r31.w, which can be preloaded with an instruction like imov (with the appropriate negate flag on the source). Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/midgard

[Mesa-dev] [PATCH 06/12] panfrost/midgard: Schedule ball/bany to vectors

2019-03-24 Thread Alyssa Rosenzweig
Though they output scalars, they need a vector unit to make sense. Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/midgard/helpers.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/panfrost/midgard/helpers.h b/src/gallium

<    1   2   3   4   5   6   7   8   9   10   >