lima: remove its hash table entry when invalidating a resource
authorIcenowy Zheng <icenowy@aosc.io>
Sat, 22 Feb 2020 08:54:56 +0000 (16:54 +0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 24 Feb 2020 20:53:31 +0000 (20:53 +0000)
commit6499738d3dee2c2420f8d2207442f57c432d9510
tree98074a12d7cf3c0fa5dd56fe30b6aacd4abcdef9
parent956e4b2d371736e073542cf8556f0c972c197989
lima: remove its hash table entry when invalidating a resource

When a resouce is already invalidated, its hash table entry becomes
useless. In addition, the lima_job_free() function won't remove the hash
table entry for invalidated resource. So the hash entry should be
removed when invalidating the resource, otherwise bogus hash entry might
be left in the table, and when the resource is reused in another job,
the code will find the freed job when invalidating and thus result in crash.

Fixes: c64994433c0d ("lima: track write submits of context (v3)")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3917>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3917>
src/gallium/drivers/lima/lima_context.c