freedreno/drm: pipe should hold reference to device
A more direct solution would be for bo's to have a reference to the device. But bo's are ref/unrefd more frequently. This avoids async submits unrefing a bo after the device handle- table is freed. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
This commit is contained in:
@@ -53,7 +53,7 @@ fd_pipe_new2(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pipe->dev = dev;
|
||||
pipe->dev = fd_device_ref(dev);
|
||||
pipe->id = id;
|
||||
p_atomic_set(&pipe->refcnt, 1);
|
||||
|
||||
@@ -114,6 +114,7 @@ fd_pipe_del_locked(struct fd_pipe *pipe)
|
||||
if (!p_atomic_dec_zero(&pipe->refcnt))
|
||||
return;
|
||||
fd_bo_del_locked(pipe->control_mem);
|
||||
fd_device_del_locked(pipe->dev);
|
||||
pipe->funcs->destroy(pipe);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user