Commit 279a3010 authored by Dave Airlie's avatar Dave Airlie

drm/vmwgfx: move null mem checks outside move notifies

Both fns checked mem == NULL, just move the check outside.
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201006000644.1005758-3-airlied@gmail.com
parent 881c4117
......@@ -1192,9 +1192,6 @@ void vmw_bo_move_notify(struct ttm_buffer_object *bo,
{
struct vmw_buffer_object *vbo;
if (mem == NULL)
return;
/* Make sure @bo is embedded in a struct vmw_buffer_object? */
if (bo->destroy != vmw_bo_bo_free &&
bo->destroy != vmw_user_bo_destroy)
......
......@@ -867,7 +867,7 @@ void vmw_query_move_notify(struct ttm_buffer_object *bo,
mutex_lock(&dev_priv->binding_mutex);
dx_query_mob = container_of(bo, struct vmw_buffer_object, base);
if (mem == NULL || !dx_query_mob || !dx_query_mob->dx_query_ctx) {
if (!dx_query_mob || !dx_query_mob->dx_query_ctx) {
mutex_unlock(&dev_priv->binding_mutex);
return;
}
......
......@@ -707,6 +707,8 @@ static void vmw_move_notify(struct ttm_buffer_object *bo,
bool evict,
struct ttm_resource *mem)
{
if (!mem)
return;
vmw_bo_move_notify(bo, mem);
vmw_query_move_notify(bo, mem);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment