[Mesa-dev] [PATCH 1/9] panfrost: Get rid of ctx->job

Alyssa Rosenzweig alyssa.rosenzweig at collabora.com
Fri Aug 2 14:59:02 UTC 2019


Theoretically we were supposed to set ctx->job to the current job, I
guess cacheing the result of panfrost_get_job_for_fbo()

See v3d's implementation which this is a carbon clone of.

On Fri, Aug 02, 2019 at 12:12:49PM +0200, Boris Brezillon wrote:
> This field is never set to anything but NULL, which means the test
> done in panfrost_free_job() and panfrost_get_job_for_fbo() will always
> evaluate to false. Let's get rid of this field.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
> ---
>  src/gallium/drivers/panfrost/pan_context.h | 3 +--
>  src/gallium/drivers/panfrost/pan_job.c     | 8 --------
>  2 files changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
> index d930f12a537b..a90dbb04e833 100644
> --- a/src/gallium/drivers/panfrost/pan_context.h
> +++ b/src/gallium/drivers/panfrost/pan_context.h
> @@ -95,8 +95,7 @@ struct panfrost_context {
>          /* Compiler context */
>          struct midgard_screen compiler;
>  
> -        /* Bound job and map of panfrost_job_key to jobs */
> -        struct panfrost_job *job;
> +        /* Map of panfrost_job_key to jobs */
>          struct hash_table *jobs;
>  
>          /* panfrost_resource -> panfrost_job */
> diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
> index 6339b39d29a0..960c8556e2f0 100644
> --- a/src/gallium/drivers/panfrost/pan_job.c
> +++ b/src/gallium/drivers/panfrost/pan_job.c
> @@ -72,9 +72,6 @@ panfrost_free_job(struct panfrost_context *ctx, struct panfrost_job *job)
>  
>          _mesa_hash_table_remove_key(ctx->jobs, &job->key);
>  
> -        if (ctx->job == job)
> -                ctx->job = NULL;
> -
>          ralloc_free(job);
>  }
>  
> @@ -122,11 +119,6 @@ panfrost_get_job_for_fbo(struct panfrost_context *ctx)
>          if (ctx->wallpaper_batch)
>                  return ctx->wallpaper_batch;
>  
> -        /* If we already began rendering, use that */
> -
> -        if (ctx->job)
> -                return ctx->job;
> -
>          /* If not, look up the job */
>  
>          struct pipe_surface **cbufs = ctx->pipe_framebuffer.cbufs;
> -- 
> 2.21.0
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190802/07dce54a/attachment.sig>


More information about the mesa-dev mailing list