mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-09 09:48:05 +02:00
Fix buffer object map wait error.
Add some branch prediction hints.
This commit is contained in:
parent
c5955c6523
commit
1ad1bd5bd9
1 changed files with 5 additions and 2 deletions
|
|
@ -1225,11 +1225,13 @@ static int drm_buffer_object_map(struct drm_file *file_priv, uint32_t handle,
|
|||
bo->priv_flags &= ~_DRM_BO_FLAG_UNLOCKED;
|
||||
|
||||
ret = drm_bo_wait(bo, 0, 1, no_wait, 1);
|
||||
if (unlikely(ret))
|
||||
goto out;
|
||||
|
||||
if (bo->mem.flags & DRM_BO_FLAG_CACHED_MAPPED)
|
||||
drm_bo_evict_cached(bo);
|
||||
|
||||
} while (bo->priv_flags & _DRM_BO_FLAG_UNLOCKED);
|
||||
} while (unlikely(bo->priv_flags & _DRM_BO_FLAG_UNLOCKED));
|
||||
|
||||
atomic_inc(&bo->mapped);
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
|
|
@ -1242,6 +1244,7 @@ static int drm_buffer_object_map(struct drm_file *file_priv, uint32_t handle,
|
|||
} else
|
||||
drm_bo_fill_rep_arg(bo, rep);
|
||||
|
||||
out:
|
||||
mutex_unlock(&bo->mutex);
|
||||
drm_bo_usage_deref_unlocked(&bo);
|
||||
|
||||
|
|
@ -1610,7 +1613,7 @@ int drm_bo_do_validate(struct drm_buffer_object *bo,
|
|||
if (ret)
|
||||
goto out;
|
||||
|
||||
} while(bo->priv_flags & _DRM_BO_FLAG_UNLOCKED);
|
||||
} while(unlikely(bo->priv_flags & _DRM_BO_FLAG_UNLOCKED));
|
||||
|
||||
ret = drm_buffer_object_validate(bo,
|
||||
fence_class,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue