virgl: make virgl_renderer_context_destroy generic

Calling virgl_context_remove directly is enough.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Chia-I Wu 5 years ago
parent 44c5cfcbb2
commit 13468e4443
  1. 2
      src/virglrenderer.c
  2. 10
      src/vrend_decode.c
  3. 1
      src/vrend_renderer.h

@ -94,7 +94,7 @@ int virgl_renderer_context_create(uint32_t handle, uint32_t nlen, const char *na
void virgl_renderer_context_destroy(uint32_t handle) void virgl_renderer_context_destroy(uint32_t handle)
{ {
vrend_renderer_context_destroy(handle); virgl_context_remove(handle);
} }
int virgl_renderer_submit_cmd(void *buffer, int virgl_renderer_submit_cmd(void *buffer,

@ -1437,16 +1437,6 @@ int vrend_renderer_context_create(uint32_t handle, uint32_t nlen, const char *de
return 0; return 0;
} }
void vrend_renderer_context_destroy(uint32_t handle)
{
/* never destroy context 0 here, it will be destroyed in vrend_decode_reset()*/
if (handle == 0) {
return;
}
virgl_context_remove(handle);
}
struct vrend_context *vrend_lookup_renderer_ctx(uint32_t ctx_id) struct vrend_context *vrend_lookup_renderer_ctx(uint32_t ctx_id)
{ {
struct vrend_decode_ctx *dctx = vrend_decode_ctx_lookup(ctx_id); struct vrend_decode_ctx *dctx = vrend_decode_ctx_lookup(ctx_id);

@ -166,7 +166,6 @@ struct vrend_context *vrend_create_context(int id, uint32_t nlen, const char *de
bool vrend_destroy_context(struct vrend_context *ctx); bool vrend_destroy_context(struct vrend_context *ctx);
int vrend_renderer_context_create(uint32_t handle, uint32_t nlen, const char *name); int vrend_renderer_context_create(uint32_t handle, uint32_t nlen, const char *name);
void vrend_renderer_context_create_internal(uint32_t handle, uint32_t nlen, const char *name); void vrend_renderer_context_create_internal(uint32_t handle, uint32_t nlen, const char *name);
void vrend_renderer_context_destroy(uint32_t handle);
struct vrend_renderer_resource_create_args { struct vrend_renderer_resource_create_args {
uint32_t handle; uint32_t handle;

Loading…
Cancel
Save