diff options
author | Eric Anholt <eric@anholt.net> | 2016-07-26 13:47:14 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2016-08-19 19:17:34 -0700 |
commit | 9326e6f25574bbb8bd48206d245654780e3fd665 (patch) | |
tree | 4578a372c70758751f214b566ec65757b4eee529 /drivers/gpu/drm/vc4/vc4_drv.h | |
parent | def96527707e1978a0c88e75d13b082f51460d5c (diff) | |
download | linux-stable-9326e6f25574bbb8bd48206d245654780e3fd665.tar.gz linux-stable-9326e6f25574bbb8bd48206d245654780e3fd665.tar.bz2 linux-stable-9326e6f25574bbb8bd48206d245654780e3fd665.zip |
drm/vc4: Fix overflow mem unreferencing when the binner runs dry.
Overflow memory handling is tricky: While it's still referenced by the
BPO registers, we want to keep it from being freed. When we are
putting a new set of overflow memory in the registers, we need to
assign the old one to the last rendering job using it.
We were looking at "what's currently running in the binner", but since
the bin/render submission split, we may end up with the binner
completing and having no new job while the renderer is still
processing. So, if we don't find a bin job at all, look at the
highest-seqno (last) render job to attach our overflow to.
Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: ca26d28bbaa3 ("drm/vc4: improve throughput by pipelining binning and rendering jobs")
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_drv.h')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_drv.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index 489e3de0c050..428e24919ef1 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -321,6 +321,15 @@ vc4_first_render_job(struct vc4_dev *vc4) struct vc4_exec_info, head); } +static inline struct vc4_exec_info * +vc4_last_render_job(struct vc4_dev *vc4) +{ + if (list_empty(&vc4->render_job_list)) + return NULL; + return list_last_entry(&vc4->render_job_list, + struct vc4_exec_info, head); +} + /** * struct vc4_texture_sample_info - saves the offsets into the UBO for texture * setup parameters. |