diff --git a/src/virglrenderer.c b/src/virglrenderer.c index 7efa1c8..fc81e9b 100644 --- a/src/virglrenderer.c +++ b/src/virglrenderer.c @@ -370,8 +370,6 @@ static struct virgl_renderer_callbacks *rcbs; static void *dev_cookie; -static struct vrend_if_cbs virgl_cbs; - static void virgl_write_fence(uint32_t fence_id) { rcbs->write_fence(dev_cookie, fence_id); @@ -409,7 +407,7 @@ static int make_current(virgl_renderer_gl_context ctx) return rcbs->make_current(dev_cookie, 0, ctx); } -static struct vrend_if_cbs virgl_cbs = { +static const struct vrend_if_cbs vrend_cbs = { virgl_write_fence, create_gl_context, destroy_gl_context, @@ -472,7 +470,7 @@ int virgl_renderer_init(void *cookie, int flags, struct virgl_renderer_callbacks if (flags & VIRGL_RENDERER_USE_EXTERNAL_BLOB) renderer_flags |= VREND_USE_EXTERNAL_BLOB; - return vrend_renderer_init(&virgl_cbs, renderer_flags); + return vrend_renderer_init(&vrend_cbs, renderer_flags); } int virgl_renderer_get_fd_for_texture(uint32_t tex_id, int *fd) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index a282c28..dd8b37e 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -63,7 +63,7 @@ static const uint32_t fake_occlusion_query_samples_passed_default = 1024; -struct vrend_if_cbs *vrend_clicbs; +const struct vrend_if_cbs *vrend_clicbs; struct vrend_fence { uint32_t fence_id; @@ -5931,7 +5931,7 @@ static bool use_integer() { return false; } -int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags) +int vrend_renderer_init(const struct vrend_if_cbs *cbs, uint32_t flags) { bool gles; int gl_ver; diff --git a/src/vrend_renderer.h b/src/vrend_renderer.h index 1e36eaf..bfa5c72 100644 --- a/src/vrend_renderer.h +++ b/src/vrend_renderer.h @@ -122,7 +122,7 @@ struct vrend_if_cbs { #define VREND_USE_THREAD_SYNC 1 #define VREND_USE_EXTERNAL_BLOB 2 -int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags); +int vrend_renderer_init(const struct vrend_if_cbs *cbs, uint32_t flags); void vrend_insert_format(struct vrend_format_table *entry, uint32_t bindings, uint32_t flags); bool vrend_check_framebuffer_mixed_color_attachements(void); @@ -476,7 +476,7 @@ struct gl_version { static const struct gl_version gl_versions[] = { {4,6}, {4,5}, {4,4}, {4,3}, {4,2}, {4,1}, {4,0}, {3,3}, {3,2}, {3,1}, {3,0} }; -extern struct vrend_if_cbs *vrend_clicbs; +extern const struct vrend_if_cbs *vrend_clicbs; int vrend_renderer_export_query(struct pipe_resource *pres, struct virgl_renderer_export_query *export_query);