vrend: drop pointless argument to make_current

This is always passed as zero, so let's make the code a bit easier to
grok by removing this unused argument. We still need to pass zero to the
externally passed callback, though.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Erik Faye-Lund 6 years ago committed by Dave Airlie
parent 4757372d5a
commit 056328c868
  1. 4
      src/virglrenderer.c
  2. 4
      src/vrend_blitter.c
  3. 18
      src/vrend_renderer.c
  4. 2
      src/vrend_renderer.h

@ -247,7 +247,7 @@ static void destroy_gl_context(virgl_renderer_gl_context ctx)
return rcbs->destroy_gl_context(dev_cookie, ctx);
}
static int make_current(int scanout_idx, virgl_renderer_gl_context ctx)
static int make_current(virgl_renderer_gl_context ctx)
{
#ifdef HAVE_EPOXY_EGL_H
if (use_context == CONTEXT_EGL)
@ -257,7 +257,7 @@ static int make_current(int scanout_idx, virgl_renderer_gl_context ctx)
if (use_context == CONTEXT_GLX)
return virgl_glx_make_context_current(glx_info, ctx);
#endif
return rcbs->make_current(dev_cookie, scanout_idx, ctx);
return rcbs->make_current(dev_cookie, 0, ctx);
}
static struct vrend_if_cbs virgl_cbs = {

@ -442,7 +442,7 @@ static void vrend_renderer_init_blit_ctx(struct vrend_blitter_ctx *blit_ctx)
struct virgl_gl_ctx_param ctx_params;
int i;
if (blit_ctx->initialised) {
vrend_clicbs->make_current(0, blit_ctx->gl_context);
vrend_clicbs->make_current(blit_ctx->gl_context);
return;
}
@ -458,7 +458,7 @@ static void vrend_renderer_init_blit_ctx(struct vrend_blitter_ctx *blit_ctx)
break;
}
vrend_clicbs->make_current(0, blit_ctx->gl_context);
vrend_clicbs->make_current(blit_ctx->gl_context);
glGenVertexArrays(1, &blit_ctx->vaoid);
glGenFramebuffers(1, &blit_ctx->fb_id);

@ -5146,7 +5146,7 @@ static int thread_sync(UNUSED void *arg)
pipe_mutex_lock(vrend_state.fence_mutex);
vrend_clicbs->make_current(0, gl_context);
vrend_clicbs->make_current(gl_context);
while (!vrend_state.stop_sync_thread) {
if (LIST_IS_EMPTY(&vrend_state.fence_wait_list) &&
@ -5165,7 +5165,7 @@ static int thread_sync(UNUSED void *arg)
}
}
vrend_clicbs->make_current(0, 0);
vrend_clicbs->make_current(0);
vrend_clicbs->destroy_gl_context(vrend_state.sync_context);
pipe_mutex_unlock(vrend_state.fence_mutex);
return 0;
@ -5253,7 +5253,7 @@ int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags)
break;
}
vrend_clicbs->make_current(0, gl_context);
vrend_clicbs->make_current(gl_context);
gl_ver = epoxy_gl_version();
/* enable error output as early as possible */
@ -7329,7 +7329,7 @@ static void vrend_renderer_blit_int(struct vrend_context *ctx,
VREND_DEBUG(dbg_blit, ctx, "BLIT_INT: use GL fallback\n");
vrend_renderer_blit_gl(ctx, src_res, dst_res, info,
has_feature(feat_texture_srgb_decode));
vrend_clicbs->make_current(0, ctx->sub->gl_context);
vrend_clicbs->make_current(ctx->sub->gl_context);
return;
}
@ -7707,7 +7707,7 @@ static void vrend_finish_context_switch(struct vrend_context *ctx)
vrend_state.current_hw_ctx = ctx;
vrend_clicbs->make_current(0, ctx->sub->gl_context);
vrend_clicbs->make_current(ctx->sub->gl_context);
}
void
@ -8584,7 +8584,7 @@ void vrend_renderer_force_ctx_0(void)
vrend_state.current_ctx = NULL;
vrend_state.current_hw_ctx = NULL;
vrend_hw_switch_context(ctx0, true);
vrend_clicbs->make_current(0, ctx0->sub->gl_context);
vrend_clicbs->make_current(ctx0->sub->gl_context);
}
void vrend_renderer_get_rect(int res_handle, struct iovec *iov, unsigned int num_iovs,
@ -8730,7 +8730,7 @@ void vrend_renderer_create_sub_ctx(struct vrend_context *ctx, int sub_ctx_id)
ctx_params.major_ver = vrend_state.gl_major_ver;
ctx_params.minor_ver = vrend_state.gl_minor_ver;
sub->gl_context = vrend_clicbs->create_gl_context(0, &ctx_params);
vrend_clicbs->make_current(0, sub->gl_context);
vrend_clicbs->make_current(sub->gl_context);
/* enable if vrend_renderer_init function has done it as well */
if (has_feature(feat_debug_cb)) {
@ -8795,7 +8795,7 @@ void vrend_renderer_destroy_sub_ctx(struct vrend_context *ctx, int sub_ctx_id)
if (tofree) {
if (ctx->sub == tofree) {
ctx->sub = ctx->sub0;
vrend_clicbs->make_current(0, ctx->sub->gl_context);
vrend_clicbs->make_current(ctx->sub->gl_context);
}
vrend_destroy_sub_context(tofree);
}
@ -8812,7 +8812,7 @@ void vrend_renderer_set_sub_ctx(struct vrend_context *ctx, int sub_ctx_id)
LIST_FOR_EACH_ENTRY(sub, &ctx->sub_ctxs, head) {
if (sub->sub_ctx_id == sub_ctx_id) {
ctx->sub = sub;
vrend_clicbs->make_current(0, sub->gl_context);
vrend_clicbs->make_current(sub->gl_context);
break;
}
}

@ -101,7 +101,7 @@ struct vrend_if_cbs {
virgl_gl_context (*create_gl_context)(int scanout, struct virgl_gl_ctx_param *params);
void (*destroy_gl_context)(virgl_gl_context ctx);
int (*make_current)(int scanout, virgl_gl_context ctx);
int (*make_current)(virgl_gl_context ctx);
};
#define VREND_USE_THREAD_SYNC 1

Loading…
Cancel
Save