st/dri: clean up dri_unbind_context
authorMarek Olšák <marek.olsak@amd.com>
Sat, 18 Nov 2017 23:19:19 +0000 (00:19 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 25 Nov 2017 16:16:56 +0000 (17:16 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/state_trackers/dri/dri_context.c

index 18bbfa0..f5400ab 100644 (file)
@@ -228,12 +228,13 @@ dri_unbind_context(__DRIcontext * cPriv)
    /* dri_util.c ensures cPriv is not null */
    struct dri_screen *screen = dri_screen(cPriv->driScreenPriv);
    struct dri_context *ctx = dri_context(cPriv);
+   struct st_context_iface *st = ctx->st;
    struct st_api *stapi = screen->st_api;
 
    if (--ctx->bind_count == 0) {
-      if (ctx->st == ctx->stapi->get_current(ctx->stapi)) {
-         if (ctx->st->thread_finish)
-            ctx->st->thread_finish(ctx->st);
+      if (st == stapi->get_current(stapi)) {
+         if (st->thread_finish)
+            st->thread_finish(st);
 
          /* For conformance, unbind is supposed to flush the context.
           * However, if we do it here we might end up flushing a partially