|
|
@ -388,14 +388,9 @@ static virgl_renderer_gl_context create_gl_context(int scanout_idx, struct virgl |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct virgl_renderer_gl_ctx_param vparam; |
|
|
|
struct virgl_renderer_gl_ctx_param vparam; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_EPOXY_EGL_H |
|
|
|
if (use_context != CONTEXT_NONE) |
|
|
|
if (use_context == CONTEXT_EGL) |
|
|
|
return vrend_winsys_create_context(param); |
|
|
|
return virgl_egl_create_context(egl, param); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef HAVE_EPOXY_GLX_H |
|
|
|
|
|
|
|
if (use_context == CONTEXT_GLX) |
|
|
|
|
|
|
|
return virgl_glx_create_context(glx_info, param); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
vparam.version = 1; |
|
|
|
vparam.version = 1; |
|
|
|
vparam.shared = param->shared; |
|
|
|
vparam.shared = param->shared; |
|
|
|
vparam.major_ver = param->major_ver; |
|
|
|
vparam.major_ver = param->major_ver; |
|
|
@ -405,31 +400,19 @@ static virgl_renderer_gl_context create_gl_context(int scanout_idx, struct virgl |
|
|
|
|
|
|
|
|
|
|
|
static void destroy_gl_context(virgl_renderer_gl_context ctx) |
|
|
|
static void destroy_gl_context(virgl_renderer_gl_context ctx) |
|
|
|
{ |
|
|
|
{ |
|
|
|
#ifdef HAVE_EPOXY_EGL_H |
|
|
|
if (use_context != CONTEXT_NONE) { |
|
|
|
if (use_context == CONTEXT_EGL) { |
|
|
|
vrend_winsys_destroy_context(ctx); |
|
|
|
virgl_egl_destroy_context(egl, ctx); |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef HAVE_EPOXY_GLX_H |
|
|
|
|
|
|
|
if (use_context == CONTEXT_GLX) { |
|
|
|
|
|
|
|
virgl_glx_destroy_context(glx_info, ctx); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
rcbs->destroy_gl_context(dev_cookie, ctx); |
|
|
|
rcbs->destroy_gl_context(dev_cookie, ctx); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int make_current(virgl_renderer_gl_context ctx) |
|
|
|
static int make_current(virgl_renderer_gl_context ctx) |
|
|
|
{ |
|
|
|
{ |
|
|
|
#ifdef HAVE_EPOXY_EGL_H |
|
|
|
if (use_context != CONTEXT_NONE) |
|
|
|
if (use_context == CONTEXT_EGL) |
|
|
|
return vrend_winsys_make_context_current(ctx); |
|
|
|
return virgl_egl_make_context_current(egl, ctx); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef HAVE_EPOXY_GLX_H |
|
|
|
|
|
|
|
if (use_context == CONTEXT_GLX) |
|
|
|
|
|
|
|
return virgl_glx_make_context_current(glx_info, ctx); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
return rcbs->make_current(dev_cookie, 0, ctx); |
|
|
|
return rcbs->make_current(dev_cookie, 0, ctx); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|