From c554757bc2448cf9b3398af8303be769793b1941 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 1 May 2021 10:57:40 -0700 Subject: [PATCH] freedreno/drm: Initialize control->fence Don't rely on getting a zero'd out buffer, we could hit the bo-cache. Fixes: 7dabd624649 ("freedreno/drm: Userspace fences") Signed-off-by: Rob Clark Part-of: --- src/freedreno/drm/freedreno_pipe.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/freedreno/drm/freedreno_pipe.c b/src/freedreno/drm/freedreno_pipe.c index cc51a55d4df..35ddec8e20a 100644 --- a/src/freedreno/drm/freedreno_pipe.c +++ b/src/freedreno/drm/freedreno_pipe.c @@ -64,6 +64,11 @@ fd_pipe_new2(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio) 0, "pipe-control"); pipe->control = fd_bo_map(pipe->control_mem); + /* We could be getting a bo from the bo-cache, make sure the fence value + * is not garbage: + */ + pipe->control->fence = 0; + /* We don't want the control_mem bo to hold a reference to the ourself, * so disable userspace fencing. This also means that we won't be able * to determine if the buffer is idle which is needed by bo-cache. But