summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
authorBoris Brezillon <[email protected]>2019-07-01 17:22:26 +0200
committerBoris Brezillon <[email protected]>2019-07-02 14:57:35 +0200
commit873b7b93e81accf9c241ac5a12b84cc29b94601e (patch)
treea0d7714d3c0ecfac9d3897ec620dc2d2923d1e23 /src/gallium/drivers/panfrost
parent6cc213b3c123a636baf07511c8e17ca32fb5da5a (diff)
panfrost: Add the sampled texture BO to the job
Otherwise we get random use-after-{free,unmap} errors. Signed-off-by: Boris Brezillon <[email protected]> --- Changes in v2: - Move the panfrost_job_add_bo() call out of the loop
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 88e70c97881..c78042d412d 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -801,6 +801,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 */