drm/vmwgfx: Avoid validating views on view destruction
authorThomas Hellstrom <thellstrom@vmware.com>
Mon, 10 Oct 2016 18:06:45 +0000 (11:06 -0700)
committerSinclair Yeh <syeh@vmware.com>
Mon, 10 Oct 2016 18:15:05 +0000 (11:15 -0700)
commita19440304db2d97aed5cee9bfa5017c98d2348bf
treecf6c0727b420debe8be56edc17d50e6a8487e471
parent51ab70bed997f64f091a639dbe22b629725a7faf
drm/vmwgfx: Avoid validating views on view destruction

When a view destruction command was present in the command stream, the
view was validated to avoid a device error. That caused excessive and
unnecessary validations of views, surfaces and mobs on view destruction.

Replace this with a new relocation type that patches the view
destruction command to a NOP if the view is not present in the device
after the execbuf validation sequence.

Also add checks for the member size of the vmw_res_relocation struct.

Fixes sporadic command submission errors on google-earth exit.

Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c