v3d: do not leak BO on query begin
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 7 Apr 2022 16:05:36 +0000 (18:05 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 8 Apr 2022 13:51:25 +0000 (13:51 +0000)
commit36066702ade7d51dffd44e7f5d1da282dcc61f9f
treec0edefe79f48a8702d614e61b73b8435654243f1
parent82ca8a707eba4aa0955fc682efec3dd28ed8fb6b
v3d: do not leak BO on query begin

This happens when we have a sequence of multiple beginQuery / endQuery
with the same target and query identifier.

As a BO is created on beginQuery but not free on endQuery (we need to
wait until either explicitly deleting the query or querying the
results), in the above sequence we are basically leaking the BO.

This ensures that any BO created before is unreference before creating
the new one.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15796>
src/gallium/drivers/v3d/v3d_query_pipe.c