virgl: constify virgl_cbs

Also rename it to vrend_cbs.

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 8dd1242c3f
commit c38c248a1a
  1. 6
      src/virglrenderer.c
  2. 4
      src/vrend_renderer.c
  3. 4
      src/vrend_renderer.h

@ -370,8 +370,6 @@ static struct virgl_renderer_callbacks *rcbs;
static void *dev_cookie; static void *dev_cookie;
static struct vrend_if_cbs virgl_cbs;
static void virgl_write_fence(uint32_t fence_id) static void virgl_write_fence(uint32_t fence_id)
{ {
rcbs->write_fence(dev_cookie, 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); 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, virgl_write_fence,
create_gl_context, create_gl_context,
destroy_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) if (flags & VIRGL_RENDERER_USE_EXTERNAL_BLOB)
renderer_flags |= VREND_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) int virgl_renderer_get_fd_for_texture(uint32_t tex_id, int *fd)

@ -63,7 +63,7 @@
static const uint32_t fake_occlusion_query_samples_passed_default = 1024; 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 { struct vrend_fence {
uint32_t fence_id; uint32_t fence_id;
@ -5931,7 +5931,7 @@ static bool use_integer() {
return false; 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; bool gles;
int gl_ver; int gl_ver;

@ -122,7 +122,7 @@ struct vrend_if_cbs {
#define VREND_USE_THREAD_SYNC 1 #define VREND_USE_THREAD_SYNC 1
#define VREND_USE_EXTERNAL_BLOB 2 #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); void vrend_insert_format(struct vrend_format_table *entry, uint32_t bindings, uint32_t flags);
bool vrend_check_framebuffer_mixed_color_attachements(void); 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}, 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} }; {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, int vrend_renderer_export_query(struct pipe_resource *pres,
struct virgl_renderer_export_query *export_query); struct virgl_renderer_export_query *export_query);

Loading…
Cancel
Save