renderer: reset decode contexts in two stages

reset the non-0 contexts first, then kill resource
table, then nuke the 0 context.
macos/master
Dave Airlie 10 years ago
parent 38685b314b
commit 96e1b0b693
  1. 9
      src/vrend_decode.c
  2. 8
      src/vrend_renderer.c
  3. 2
      src/vrend_renderer.h

@ -1160,11 +1160,13 @@ void vrend_decode_block(uint32_t ctx_id, uint32_t *block, int ndw)
}
void vrend_decode_reset(void)
void vrend_decode_reset(bool ctx_0_only)
{
int i;
vrend_hw_switch_context(dec_ctx[0]->grctx, TRUE);
if (ctx_0_only == false) {
for (i = 1; i < VREND_MAX_CTX; i++) {
if (!dec_ctx[i])
continue;
@ -1174,8 +1176,11 @@ void vrend_decode_reset(void)
vrend_destroy_context(dec_ctx[i]->grctx);
free(dec_ctx[i]);
dec_ctx[i] = NULL;
}
} else {
vrend_destroy_context(dec_ctx[0]->grctx);
free(dec_ctx[0]);
dec_ctx[0] = NULL;
}
}

@ -3179,9 +3179,9 @@ vrend_renderer_fini(void)
if (!inited)
return;
vrend_renderer_force_ctx_0();
vrend_decode_reset(false);
vrend_object_fini_resource_table();
vrend_decode_reset();
vrend_decode_reset(true);
inited = 0;
}
@ -5508,9 +5508,9 @@ static void vrend_reset_fences(void)
void vrend_renderer_reset(void)
{
vrend_reset_fences();
vrend_decode_reset();
vrend_decode_reset(false);
vrend_object_fini_resource_table();
vrend_decode_reset(true);
vrend_object_init_resource_table();
vrend_state.viewport_dirty = vrend_state.scissor_dirty = TRUE;
vrend_state.program_id = (GLuint)-1;

@ -383,7 +383,7 @@ void vrend_renderer_blit_gl(struct vrend_context *ctx,
const struct pipe_blit_info *info);
void vrend_renderer_reset(void);
void vrend_decode_reset(void);
void vrend_decode_reset(bool ctx_0_only);
#define VREND_GL_VER_MAJOR 3
#define VREND_GL_VER_MINOR 1

Loading…
Cancel
Save