mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 09:00:10 +01:00
freedreno/drm: Avoid CPU_PREP ioctl if bo is idle
With userspace fences, if we know definitely that the buffer is idle (which implies that it is not shared with other processes, etc), then skip the ioctl. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
This commit is contained in:
parent
9bcc983256
commit
88a10c6216
1 changed files with 7 additions and 7 deletions
|
|
@ -503,7 +503,6 @@ fd_bo_upload(struct fd_bo *bo, void *src, unsigned len)
|
|||
int
|
||||
fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op)
|
||||
{
|
||||
if (op & (FD_BO_PREP_NOSYNC | FD_BO_PREP_FLUSH)) {
|
||||
simple_mtx_lock(&table_lock);
|
||||
enum fd_bo_state state = fd_bo_state(bo);
|
||||
simple_mtx_unlock(&table_lock);
|
||||
|
|
@ -511,6 +510,7 @@ fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op)
|
|||
if (state == FD_BO_STATE_IDLE)
|
||||
return 0;
|
||||
|
||||
if (op & (FD_BO_PREP_NOSYNC | FD_BO_PREP_FLUSH)) {
|
||||
if (op & FD_BO_PREP_FLUSH)
|
||||
bo_flush(bo);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue