virgl: move resource/context table cleanup out of vrend

Those tables should not be tied to vrend.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Chia-I Wu 4 years ago
parent e8ff76ef47
commit fadf5528d9
  1. 12
      src/virglrenderer.c
  2. 5
      src/vrend_decode.c
  3. 8
      src/vrend_renderer.c
  4. 1
      src/vrend_renderer.h

@ -439,8 +439,12 @@ void virgl_renderer_poll(void)
void virgl_renderer_cleanup(UNUSED void *cookie)
{
if (state.vrend_initialized)
if (state.vrend_initialized) {
vrend_renderer_prepare_reset();
virgl_context_table_reset();
virgl_resource_table_cleanup();
vrend_renderer_fini();
}
virgl_context_table_cleanup();
vrend_winsys_cleanup();
@ -503,8 +507,12 @@ int virgl_renderer_get_fd_for_texture2(uint32_t tex_id, int *fd, int *stride, in
void virgl_renderer_reset(void)
{
if (state.vrend_initialized)
if (state.vrend_initialized) {
vrend_renderer_prepare_reset();
virgl_context_table_reset();
virgl_resource_table_reset();
vrend_renderer_reset();
}
}
int virgl_renderer_get_poll_fd(void)

@ -1722,8 +1722,3 @@ static void vrend_decode_ctx_init_base(struct vrend_decode_ctx *dctx,
ctx->get_blob_done = NULL;
ctx->submit_cmd = vrend_decode_ctx_submit_cmd;
}
void vrend_decode_reset(void)
{
virgl_context_table_reset();
}

@ -6054,10 +6054,6 @@ vrend_renderer_fini(void)
{
vrend_state.finishing = true;
vrend_renderer_prepare_reset();
vrend_decode_reset();
virgl_resource_table_cleanup();
if (vrend_state.eventfd != -1) {
close(vrend_state.eventfd);
vrend_state.eventfd = -1;
@ -10465,10 +10461,6 @@ void vrend_renderer_prepare_reset(void)
void vrend_renderer_reset(void)
{
vrend_renderer_prepare_reset();
vrend_decode_reset();
virgl_resource_table_reset();
vrend_reset_fences();
vrend_blitter_fini();

@ -461,7 +461,6 @@ void vrend_blitter_fini(void);
void vrend_renderer_prepare_reset(void);
void vrend_renderer_reset(void);
int vrend_renderer_get_poll_fd(void);
void vrend_decode_reset(void);
unsigned vrend_context_has_debug_flag(const struct vrend_context *ctx,
enum virgl_debug_flags flag);

Loading…
Cancel
Save