[Mesa-dev] [PATCH v2 1/2] panfrost: Jobs must be per context, not per screen

2019-08-30 Thread Rohan Garg
Jobs _must_ only be shared across the same context, having the last_job tracked in a screen causes use-after-free issues and memory corruptions. Signed-off-by: Rohan Garg --- src/gallium/drivers/panfrost/pan_context.c | 10 +- src/gallium/drivers/panfrost/pan_context.h | 6 ++ src

[Mesa-dev] [PATCH v2 2/2] panfrost: protect access to shared bo cache and transient pool

2019-08-30 Thread Rohan Garg
Both the BO cache and the transient pool are shared across context's. Protect access to these with mutexes. Signed-off-by: Rohan Garg --- src/gallium/drivers/panfrost/pan_allocate.c | 2 ++ src/gallium/drivers/panfrost/pan_bo_cache.c | 16 +++- src/gallium/drivers/pan

Re: [Mesa-dev] [PATCH] panfrost: Remove unused variable from panfrost_drm_submit_vs_fs_job

2019-08-29 Thread Rohan Garg
On jueves, 29 de agosto de 2019 15:07:08 (CEST) Boris Brezillon wrote: > On Thu, 29 Aug 2019 14:53:10 +0200 > > Rohan Garg wrote: > > is_scanout is not used anywhere and can be inferred within > > panfrost_drm_submit_vs_fs_job if required. > > Signed-off-by tag is mi

[Mesa-dev] [PATCH] panfrost: Remove unused variable from panfrost_drm_submit_vs_fs_job

2019-08-29 Thread Rohan Garg
is_scanout is not used anywhere and can be inferred within panfrost_drm_submit_vs_fs_job if required. --- src/gallium/drivers/panfrost/pan_drm.c| 2 +- src/gallium/drivers/panfrost/pan_job.c| 3 +-- src/gallium/drivers/panfrost/pan_screen.h | 3 +-- 3 files changed, 3 insertions(+), 5 dele

[Mesa-dev] [PATCH] panfrost: Jobs must be per context, not per screen

2019-08-29 Thread Rohan Garg
Jobs _must_ only be shared across the same context, having the last_job tracked in a screen causes use-after-free issues and memory corruptions. Signed-off-by: Rohan Garg --- src/gallium/drivers/panfrost/pan_allocate.c | 2 ++ src/gallium/drivers/panfrost/pan_bo_cache.c | 16

[Mesa-dev] [PATCH v2] panfrost: Take into account a index_bias for glDrawElementsBaseVertex calls

2019-08-05 Thread Rohan Garg
glDrawElementsBaseVertex call and then supply a additional offset_bias_correction to the hardware. Changes for v2: * Renamed the draw_start and negative_start variables to something more appropriate. Signed-off-by: Rohan Garg --- src/gallium/drivers/panfrost/pan_context.c | 17 - src

[Mesa-dev] [PATCH] panfrost: Take into account a index_bias for glDrawElementsBaseVertex calls

2019-07-18 Thread Rohan Garg
Make sure we adjust draw_start and vertex_count in order to take into account a index_bias as required by a glDrawElementsBaseVertex call Signed-off-by: Rohan Garg --- src/gallium/drivers/panfrost/pan_context.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src

[Mesa-dev] [PATCH] panfrost: Maintain a whitelist of supported GPU's

2019-06-24 Thread Rohan Garg
Maintain a list of panfrost supported GPU's and exit early when running on a unsupported GPU. Signed-off-by: Rohan Garg --- src/gallium/drivers/panfrost/pan_screen.c | 15 +++ src/gallium/drivers/panfrost/pan_screen.h | 6 ++ 2 files changed, 21 insertions(+) diff --git

Re: [Mesa-dev] [PATCH 1/3] panfrost: Print a backtrace if there is one

2019-06-24 Thread Rohan Garg
> I think assertions should be limited to the most basic of sanity checks, > and the other asserts replaced by proper error handling. So, should I leave it as is and let us hit assertions that we fix? Cheers Rohan Garg signature.asc Description: This is a digitally signed messag

Re: [Mesa-dev] [PATCH] panfrost: Implement command stream scoreboarding

2019-06-21 Thread Rohan Garg
; + > +/* We compute no_incoming by traversing the batch. */ > + > +for (unsigned i = 0; i < node_count; ++i) { > +struct mali_job_descriptor_header *node = > DESCRIPTOR_FOR_NODE(i); + > +unsigned dep_1 = node->job_dependency_index_1; > +unsigned dep_2 = node->job_dependency_index_2; > + > +if (!(dep_1 || dep_2)) > +BITSET_SET(no_incoming, i); > +} > + > +/* No next_job fields are set at the beginning, so L is implciitly > the + * empty set. As next_job fields are filled, L is implicitly > set. Tail + * is the tail of L, however. */ > + > +struct mali_job_descriptor_header *tail = NULL; > + > +/* We iterate, popping off elements of S. A simple foreach won't > do, + * since we mutate S as we go (even adding elements) */ > + > +unsigned arr_size = BITSET_WORDS(node_count); > + > +for (unsigned node_n_1 = __bitset_ffs(no_incoming, arr_size); > +(node_n_1 != 0); > +node_n_1 = __bitset_ffs(no_incoming, arr_size)) { > + > +unsigned node_n = node_n_1 - 1; > + > +/* We've got a node n, pop it off */ > +BITSET_CLEAR(no_incoming, node_n); > + > +/* Add it to the list */ > +struct mali_job_descriptor_header *n = > +DESCRIPTOR_FOR_NODE(node_n); > + > +mali_ptr addr = GPU_ADDRESS_FOR_NODE(node_n); > + > +if (tail) { > +/* Link us to the last node */ > +panfrost_set_job_next(tail, addr); > +} else { > +/* We are the first/last node */ > +batch->first_job.cpu = (uint8_t *) n; > +batch->first_job.gpu = addr; > +} > + > +tail = n; > + > +/* Scan dependencies */ > +for (unsigned node_m = 0; node_m < node_count; ++node_m) { > +struct mali_job_descriptor_header *m = > +DESCRIPTOR_FOR_NODE(node_m); > + > +/* Get the deps, accounting for removal */ > +unsigned dep_1 = m->job_dependency_index_1; > +unsigned dep_2 = m->job_dependency_index_2; > + > +if (BITSET_TEST(edge_removal_1, node_m)) > +dep_1 = 0; > + > +if (BITSET_TEST(edge_removal_2, node_m)) > +dep_2 = 0; > + > +/* Pretend to remove edges */ > +if (dep_1 == node_n_1) { > +BITSET_SET(edge_removal_1, node_m); > +dep_1 = 0; > +} else if (dep_2 == node_n_1) { > +BITSET_SET(edge_removal_2, node_m); > +dep_2 = 0; > +} else { > +/* This node has no relevant dependencies > */ +continue; > +} > + > +/* Are there edges left? If not, add us to S */ > +bool has_edges = dep_1 || dep_2; > + > +if (!has_edges) > +BITSET_SET(no_incoming, node_m); > +} > +} > + > +} Awesome stuff \o/ R-b :) Cheers Rohan Garg signature.asc Description: This is a digitally signed message part. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 1/1] panfrost: Use mir_foreach_instr_in_block_safe

2019-06-21 Thread Rohan Garg
Use the _safe version as asserted by gallium Signed-off-by: Rohan Garg --- src/gallium/drivers/panfrost/midgard/midgard_schedule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/midgard/midgard_schedule.c b/src/gallium/drivers/panfrost/midgard

Re: [Mesa-dev] [PATCH 2/3] panfrost: Make the gitlab-ci.yml file more robust

2019-06-21 Thread Rohan Garg
On Friday, 21 June 2019 07:40:02 CEST Tomeu Vizoso wrote: > On 6/20/19 6:33 PM, Rohan Garg wrote: > >> Not sure I understand how this works. Isn't this going to cause > >> unnecessary container builds? > >> > >> And, why cannot developers just add whate

Re: [Mesa-dev] [PATCH 1/3] panfrost: Print a backtrace if there is one

2019-06-21 Thread Rohan Garg
Hey > Good stuff, but isn't this change making us hit assertions? Hm, I thought it only enabled debugging symbols. Do you have a recommendation on how to enable debug symbols but not enabling assertions? Cheers Rohan Garg ___ mesa-dev mail

Re: [Mesa-dev] [PATCH 2/3] panfrost: Make the gitlab-ci.yml file more robust

2019-06-20 Thread Rohan Garg
s for someone working in a branch to ( if the need be ) customize their containers for their branch. To that extent, I've simply enabled the CI to auto generate a DEBIAN_TAG which depends on the branch name so that a developer doesn't have to change the DEBIAN_TAG themselves. Ch

Re: [Mesa-dev] [PATCH] panfrost: Set job requirements during draw

2019-06-20 Thread Rohan Garg
On Thursday, 20 June 2019 16:06:57 CEST you wrote: > Right now we are doing it at a moment when we don't have all the > information we need. > > Signed-off-by: Tomeu Vizoso > Suggested-by: Alyssa Rosenzweig > Cc: Rohan Garg > Fixes: bfca21b622df ("panfrost:

[Mesa-dev] [PATCH 3/3] panfrost: The working dir is deleted right before

2019-06-20 Thread Rohan Garg
Change to /artifacts in order to potentially fix debootstrap failiures. --- src/gallium/drivers/panfrost/ci/debian-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/panfrost/ci/debian-install.sh b/src/gallium/drivers/panfrost/ci/debian-install.sh index 8a8b4ec9a47

[Mesa-dev] [PATCH 2/3] panfrost: Make the gitlab-ci.yml file more robust

2019-06-20 Thread Rohan Garg
This enables developers to add packages to the container when working on their own branches by creating a container tag which features the branch name. Dropped the IMAGE_LOCAL variable since I did not see it being used anywhere. --- src/gallium/drivers/panfrost/ci/gitlab-ci.yml | 6 +++--- 1 file

[Mesa-dev] [PATCH 1/3] panfrost: Print a backtrace if there is one

2019-06-20 Thread Rohan Garg
--- src/gallium/drivers/panfrost/ci/create-rootfs.sh | 2 +- src/gallium/drivers/panfrost/ci/deqp-runner.sh | 6 ++ src/gallium/drivers/panfrost/ci/gitlab-ci.yml| 4 ++-- src/gallium/drivers/panfrost/ci/lava-deqp.yml.jinja2 | 3 +++ 4 files changed, 12 insertions(+), 3 deleti

[Mesa-dev] [PATCH 0/3] panfrost: CI improvements

2019-06-20 Thread Rohan Garg
I've made a few improvements to make the CI a bit more robust. Rohan Garg (3): panfrost: Print a backtrace if there is one panfrost: Make the gitlab-ci.yml file more robust panfrost: The working dir is deleted right before src/gallium/drivers/panfrost/ci/create-rootfs.sh | 2 +-

[Mesa-dev] [PATCH libdrm 7/9] panfrost/midgard: Move draw_count into panfrost_job

2019-06-12 Thread Rohan Garg
Refactor code to use draw_counts from a panfrost_job --- src/gallium/drivers/panfrost/pan_context.c | 31 -- src/gallium/drivers/panfrost/pan_context.h | 2 -- src/gallium/drivers/panfrost/pan_job.c | 4 +-- src/gallium/drivers/panfrost/pan_job.h | 2 ++ 4 files chan

[Mesa-dev] [PATCH libdrm 5/9] panfrost/midgard: Remove unnecessary variables

2019-06-12 Thread Rohan Garg
These are not required anymore since mali jobs are now linked lists i.e. u_vertex_jobs and u_tiler_jobs --- src/gallium/drivers/panfrost/pan_context.c | 5 - src/gallium/drivers/panfrost/pan_context.h | 2 -- src/gallium/drivers/panfrost/pan_wallpaper.c | 1 - 3 files changed, 8 deletions(

[Mesa-dev] [PATCH libdrm 6/9] panfrost/midgard: Remove duplicated header

2019-06-12 Thread Rohan Garg
--- src/gallium/drivers/panfrost/pan_context.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 66762a010f8..eaceaa8725e 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/driver

[Mesa-dev] [PATCH libdrm 4/9] panfrost/midgard: Move clearing logic into pan_job

2019-06-12 Thread Rohan Garg
--- src/gallium/drivers/panfrost/pan_context.c | 49 +- src/gallium/drivers/panfrost/pan_job.c | 59 ++ src/gallium/drivers/panfrost/pan_job.h | 8 +++ 3 files changed, 68 insertions(+), 48 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_con

[Mesa-dev] [PATCH libdrm 9/9] Fixes 88ae2f5870c: "panfrost/midgard: Remove unnecessary variables"

2019-06-12 Thread Rohan Garg
Make sure we link the last vertex job to the first tiler job. --- src/gallium/drivers/panfrost/pan_context.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 00acb464bc6..caa914e33cb 100644 ---

[Mesa-dev] [PATCH libdrm 8/9] panfrost/midgard: Move requirement setting into panfrost_job

2019-06-12 Thread Rohan Garg
Move panfrost_job_set_requirements into panfrost_get_job_for_fbo, requirements should be set when acquiring a job from a context. --- src/gallium/drivers/panfrost/pan_context.c | 2 -- src/gallium/drivers/panfrost/pan_job.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/s

[Mesa-dev] [PATCH libdrm 1/9] panfrost/midgard: Initial implementation of panfrost_job_submit

2019-06-12 Thread Rohan Garg
Start fleshing out panfrost_job --- src/gallium/drivers/panfrost/pan_context.c | 3 +-- src/gallium/drivers/panfrost/pan_job.c | 20 src/gallium/drivers/panfrost/pan_job.h | 2 ++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/pan

[Mesa-dev] [PATCH libdrm 0/9] panfrost/midgard: Refactor pan_context

2019-06-12 Thread Rohan Garg
Refactor pan_context to separate out responsibilities between pan_context and pan_job. Rohan Garg (9): panfrost/midgard: Initial implementation of panfrost_job_submit panfrost/midgard: Reset job counters once the job is submitted panfrost/midgard: Figure out job requirements in pan_job.c

[Mesa-dev] [PATCH libdrm 2/9] panfrost/midgard: Reset job counters once the job is submitted

2019-06-12 Thread Rohan Garg
Move the reset out of frame invalidation into job submission --- src/gallium/drivers/panfrost/pan_context.c | 5 - src/gallium/drivers/panfrost/pan_job.c | 4 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drive

[Mesa-dev] [PATCH libdrm 3/9] panfrost/midgard: Figure out job requirements in pan_job.c

2019-06-12 Thread Rohan Garg
Requirements for a job should be figured out in pan_job.c --- src/gallium/drivers/panfrost/pan_context.c | 8 +--- src/gallium/drivers/panfrost/pan_job.c | 11 +++ src/gallium/drivers/panfrost/pan_job.h | 4 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a