gallium: Reset {d,r}Priv in dri_unbind_context
authorLepton Wu <lepton@chromium.org>
Sat, 24 Jul 2021 04:27:00 +0000 (21:27 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 27 Jul 2021 18:40:11 +0000 (18:40 +0000)
commit7ff30a0499bd872d77b0f377414bbc03463b9f87
tree5de4f74341c87e511d77db96ff0f491760a0ba00
parent49908c602ffd2d84063effa7ddd0ee842be41a89
gallium: Reset {d,r}Priv in dri_unbind_context

The code in dri_make_current just checks the value of the pointers
to decide to update texture_stamp or not. This is buggy since a new
allocated drawable could share the same address with the previous
released drawable. Fix the stale pointer issue by always resetting
these pointers to NULL in dri_unbind_context.

v2:
   Move the reset codes to the end of the function.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12050>
src/gallium/frontends/dri/dri_context.c