Re: [Mesa-dev] [PATCH v2] panfrost: Add the sampled texture BO to the job

2019-07-01 Thread Alyssa Rosenzweig
R-b, thank you! :)

On Mon, Jul 01, 2019 at 07:04:44PM +0200, Boris Brezillon wrote:
> Otherwise we get random use-after-{free,unmap} errors.
> 
> Signed-off-by: Boris Brezillon 
> ---
> Changes in v2:
> - Move the panfrost_job_add_bo() call out of the loop
> ---
>  src/gallium/drivers/panfrost/pan_context.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/gallium/drivers/panfrost/pan_context.c 
> b/src/gallium/drivers/panfrost/pan_context.c
> index bf98d3853f16..c103a764edd9 100644
> --- a/src/gallium/drivers/panfrost/pan_context.c
> +++ b/src/gallium/drivers/panfrost/pan_context.c
> @@ -840,6 +840,10 @@ panfrost_upload_tex(
>  bool is_zs = rsrc->base.bind & PIPE_BIND_DEPTH_STENCIL;
>  unsigned afbc_bit = (is_afbc && !is_zs) ? 1 : 0;
>  
> + /* Add the BO to the job so it's retained until the job is done. */
> +struct panfrost_job *job = panfrost_get_job_for_fbo(ctx);
> +panfrost_job_add_bo(job, rsrc->bo);
> +
>  /* Inject the addresses in, interleaving mip levels, cube faces, and
>   * strides in that order */
>  
> -- 
> 2.21.0
> 


signature.asc
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH v2] panfrost: Add the sampled texture BO to the job

2019-07-01 Thread Boris Brezillon
Otherwise we get random use-after-{free,unmap} errors.

Signed-off-by: Boris Brezillon 
---
Changes in v2:
- Move the panfrost_job_add_bo() call out of the loop
---
 src/gallium/drivers/panfrost/pan_context.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/panfrost/pan_context.c 
b/src/gallium/drivers/panfrost/pan_context.c
index bf98d3853f16..c103a764edd9 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -840,6 +840,10 @@ panfrost_upload_tex(
 bool is_zs = rsrc->base.bind & PIPE_BIND_DEPTH_STENCIL;
 unsigned afbc_bit = (is_afbc && !is_zs) ? 1 : 0;
 
+   /* Add the BO to the job so it's retained until the job is done. */
+struct panfrost_job *job = panfrost_get_job_for_fbo(ctx);
+panfrost_job_add_bo(job, rsrc->bo);
+
 /* Inject the addresses in, interleaving mip levels, cube faces, and
  * strides in that order */
 
-- 
2.21.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev