[v3,19/25] panfrost: Pass a batch to panfrost_set_value_job()

Submitted by Boris Brezillon on Sept. 5, 2019, 7:41 p.m.

Details

Message ID 20190905194150.17608-20-boris.brezillon@collabora.com
State Accepted
Commit e5c7701a0a9be29efd8a8947ae55392455a3b6e7
Headers show
Series "panfrost: Rework the batch pipelining logic" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Boris Brezillon Sept. 5, 2019, 7:41 p.m.
So we can emit SET_VALUE jobs for a batch that's not currently bound
to the context.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 src/gallium/drivers/panfrost/pan_scoreboard.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/pan_scoreboard.c b/src/gallium/drivers/panfrost/pan_scoreboard.c
index f0771a2c5b56..f340bb62662e 100644
--- a/src/gallium/drivers/panfrost/pan_scoreboard.c
+++ b/src/gallium/drivers/panfrost/pan_scoreboard.c
@@ -270,7 +270,7 @@  panfrost_scoreboard_queue_fused_job_prepend(
 /* Generates a set value job, used below as part of TILER job scheduling. */
 
 static struct panfrost_transfer
-panfrost_set_value_job(struct panfrost_context *ctx, mali_ptr polygon_list)
+panfrost_set_value_job(struct panfrost_batch *batch, mali_ptr polygon_list)
 {
         struct mali_job_descriptor_header job = {
                 .job_type = JOB_TYPE_SET_VALUE,
@@ -282,7 +282,6 @@  panfrost_set_value_job(struct panfrost_context *ctx, mali_ptr polygon_list)
                 .unknown = 0x3,
         };
 
-        struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
         struct panfrost_transfer transfer = panfrost_allocate_transient(batch, sizeof(job) + sizeof(payload));
         memcpy(transfer.cpu, &job, sizeof(job));
         memcpy(transfer.cpu + sizeof(job), &payload, sizeof(payload));
@@ -303,11 +302,10 @@  panfrost_scoreboard_set_value(struct panfrost_batch *batch)
         /* Okay, we do. Let's generate it. We'll need the job's polygon list
          * regardless of size. */
 
-        struct panfrost_context *ctx = batch->ctx;
         mali_ptr polygon_list = panfrost_batch_get_polygon_list(batch, 0);
 
         struct panfrost_transfer job =
-                panfrost_set_value_job(ctx, polygon_list);
+                panfrost_set_value_job(batch, polygon_list);
 
         /* Queue it */
         panfrost_scoreboard_queue_compute_job(batch, job);

Comments

R-b

On Thu, Sep 05, 2019 at 09:41:44PM +0200, Boris Brezillon wrote:
> So we can emit SET_VALUE jobs for a batch that's not currently bound
> to the context.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  src/gallium/drivers/panfrost/pan_scoreboard.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/gallium/drivers/panfrost/pan_scoreboard.c b/src/gallium/drivers/panfrost/pan_scoreboard.c
> index f0771a2c5b56..f340bb62662e 100644
> --- a/src/gallium/drivers/panfrost/pan_scoreboard.c
> +++ b/src/gallium/drivers/panfrost/pan_scoreboard.c
> @@ -270,7 +270,7 @@ panfrost_scoreboard_queue_fused_job_prepend(
>  /* Generates a set value job, used below as part of TILER job scheduling. */
>  
>  static struct panfrost_transfer
> -panfrost_set_value_job(struct panfrost_context *ctx, mali_ptr polygon_list)
> +panfrost_set_value_job(struct panfrost_batch *batch, mali_ptr polygon_list)
>  {
>          struct mali_job_descriptor_header job = {
>                  .job_type = JOB_TYPE_SET_VALUE,
> @@ -282,7 +282,6 @@ panfrost_set_value_job(struct panfrost_context *ctx, mali_ptr polygon_list)
>                  .unknown = 0x3,
>          };
>  
> -        struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
>          struct panfrost_transfer transfer = panfrost_allocate_transient(batch, sizeof(job) + sizeof(payload));
>          memcpy(transfer.cpu, &job, sizeof(job));
>          memcpy(transfer.cpu + sizeof(job), &payload, sizeof(payload));
> @@ -303,11 +302,10 @@ panfrost_scoreboard_set_value(struct panfrost_batch *batch)
>          /* Okay, we do. Let's generate it. We'll need the job's polygon list
>           * regardless of size. */
>  
> -        struct panfrost_context *ctx = batch->ctx;
>          mali_ptr polygon_list = panfrost_batch_get_polygon_list(batch, 0);
>  
>          struct panfrost_transfer job =
> -                panfrost_set_value_job(ctx, polygon_list);
> +                panfrost_set_value_job(batch, polygon_list);
>  
>          /* Queue it */
>          panfrost_scoreboard_queue_compute_job(batch, job);
> -- 
> 2.21.0