nv30: avoid setting user_priv without setting cur_ctx
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 27 Dec 2018 03:58:54 +0000 (22:58 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 31 Dec 2018 00:44:43 +0000 (19:44 -0500)
commitef3eac954574d630593012369ba309210158b760
treeff9dbf9cec5775021e51cbb71fef3b905db8db7a
parentad1e59cf8d05f07db9f8d4183b3179cef230edfa
nv30: avoid setting user_priv without setting cur_ctx

The whole user_priv thing is a mess, but as long as it's there, it
basically has to map 1:1 to the cur_ctx. Unfortunately we were setting
user_priv to some context, then that context could get deleted without
any draws/validations in it, leading user_priv to become NULL, with
cur_ctx still pointing at some old context. Then we wouldn't run the
switch logic, which in turn led to a NULL bufctx being dereferenced.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102349
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nv30/nv30_context.c