struct glx_context *gc = __glXGetCurrentContext();
struct dri3_screen *psc = (struct dri3_screen *) gc->psc;
- return (gc != &dummyContext && psc) ? psc->driScreen : NULL;
+ return (gc != &dummyContext && psc) ? psc->driScreenRenderGPU : NULL;
}
static void
pcp->renderType = dca.render_type;
pcp->driContext =
- psc->image_driver->createContextAttribs(psc->driScreen,
- dca.api,
- config ? config->driConfig
- : NULL,
- shared,
- num_ctx_attribs / 2,
- ctx_attribs,
- error,
- pcp);
+ psc->image_driver->createContextAttribs(psc->driScreenRenderGPU,
+ dca.api,
+ config ? config->driConfig
+ : NULL,
+ shared,
+ num_ctx_attribs / 2,
+ ctx_attribs,
+ error,
+ pcp);
if (pcp->driContext == NULL)
goto error_exit;
if (loader_dri3_drawable_init(XGetXCBConnection(base->dpy),
xDrawable,
glx_to_loader_dri3_drawable_type(type),
- psc->driScreen, psc->driScreenDisplayGPU,
+ psc->driScreenRenderGPU, psc->driScreenDisplayGPU,
psc->is_different_gpu, has_multibuffer,
psc->prefer_back_buffer_reuse,
config->driConfig,
}
close(psc->fd_display_gpu);
}
- loader_dri3_close_screen(psc->driScreen);
- psc->core->destroyScreen(psc->driScreen);
+ loader_dri3_close_screen(psc->driScreenRenderGPU);
+ psc->core->destroyScreen(psc->driScreenRenderGPU);
driDestroyConfigs(psc->driver_configs);
- close(psc->fd);
+ close(psc->fd_render_gpu);
free(psc);
}
struct dri3_drawable *priv = (struct dri3_drawable *) pdraw;
struct dri3_screen *psc = (struct dri3_screen *) priv->base.psc;
- if (!dri_valid_swap_interval(psc->driScreen, psc->config, interval))
+ if (!dri_valid_swap_interval(psc->driScreenRenderGPU, psc->config, interval))
return GLX_BAD_VALUE;
loader_dri3_set_swap_interval(&priv->loader_drawable, interval);
unsigned mask;
int i;
- extensions = psc->core->getExtensions(psc->driScreen);
+ extensions = psc->core->getExtensions(psc->driScreenRenderGPU);
__glXEnableDirectExtension(&psc->base, "GLX_EXT_swap_control");
__glXEnableDirectExtension(&psc->base, "GLX_EXT_swap_control_tear");
__glXEnableDirectExtension(&psc->base, "GLX_SGI_make_current_read");
__glXEnableDirectExtension(&psc->base, "GLX_INTEL_swap_event");
- mask = psc->image_driver->getAPIMask(psc->driScreen);
+ mask = psc->image_driver->getAPIMask(psc->driScreenRenderGPU);
__glXEnableDirectExtension(&psc->base, "GLX_ARB_create_context");
__glXEnableDirectExtension(&psc->base, "GLX_ARB_create_context_profile");
{
struct dri3_screen *psc = (struct dri3_screen *)glx_screen;
- return loader_get_driver_for_fd(psc->fd);
+ return loader_get_driver_for_fd(psc->fd_render_gpu);
}
static const struct glx_screen_vtable dri3_screen_vtable = {
if (psc == NULL)
return NULL;
- psc->fd = -1;
+ psc->fd_render_gpu = -1;
psc->fd_display_gpu = -1;
if (!glx_screen_init(&psc->base, screen, priv)) {
return NULL;
}
- psc->fd = loader_dri3_open(c, RootWindow(priv->dpy, screen), None);
- if (psc->fd < 0) {
+ psc->fd_render_gpu = loader_dri3_open(c, RootWindow(priv->dpy, screen), None);
+ if (psc->fd_render_gpu < 0) {
int conn_error = xcb_connection_has_error(c);
glx_screen_cleanup(&psc->base);
return NULL;
}
- psc->fd_display_gpu = fcntl(psc->fd, F_DUPFD_CLOEXEC, 3);
- psc->fd = loader_get_user_preferred_fd(psc->fd, &psc->is_different_gpu);
+ psc->fd_display_gpu = fcntl(psc->fd_render_gpu, F_DUPFD_CLOEXEC, 3);
+ psc->fd_render_gpu = loader_get_user_preferred_fd(psc->fd_render_gpu, &psc->is_different_gpu);
if (!psc->is_different_gpu) {
close(psc->fd_display_gpu);
psc->fd_display_gpu = -1;
}
- driverName = loader_get_driver_for_fd(psc->fd);
+ driverName = loader_get_driver_for_fd(psc->fd_render_gpu);
if (!driverName) {
ErrorMessageF("No driver found\n");
goto handle_error;
}
}
- psc->driScreen =
- psc->image_driver->createNewScreen2(screen, psc->fd,
+ psc->driScreenRenderGPU =
+ psc->image_driver->createNewScreen2(screen, psc->fd_render_gpu,
pdp->loader_extensions,
extensions,
&driver_configs, psc);
- if (psc->driScreen == NULL) {
+ if (psc->driScreenRenderGPU == NULL) {
ErrorMessageF("glx: failed to create dri3 screen\n");
goto handle_error;
}
__glXEnableDirectExtension(&psc->base, "GLX_EXT_buffer_age");
if (psc->config->base.version > 1 &&
- psc->config->configQuerys(psc->driScreen, "glx_extension_override",
+ psc->config->configQuerys(psc->driScreenRenderGPU, "glx_extension_override",
&tmp) == 0)
__glXParseExtensionOverride(&psc->base, tmp);
if (psc->config->base.version > 1 &&
- psc->config->configQuerys(psc->driScreen,
+ psc->config->configQuerys(psc->driScreenRenderGPU,
"indirect_gl_extension_override",
&tmp) == 0)
__IndirectGlParseExtensionOverride(&psc->base, tmp);
if (psc->config->base.version > 1) {
uint8_t force = false;
- if (psc->config->configQueryb(psc->driScreen, "force_direct_glx_context",
+ if (psc->config->configQueryb(psc->driScreenRenderGPU, "force_direct_glx_context",
&force) == 0) {
psc->base.force_direct_context = force;
}
uint8_t invalid_glx_destroy_window = false;
- if (psc->config->configQueryb(psc->driScreen,
+ if (psc->config->configQueryb(psc->driScreenRenderGPU,
"allow_invalid_glx_destroy_window",
&invalid_glx_destroy_window) == 0) {
psc->base.allow_invalid_glx_destroy_window = invalid_glx_destroy_window;
}
uint8_t keep_native_window_glx_drawable = false;
- if (psc->config->configQueryb(psc->driScreen,
+ if (psc->config->configQueryb(psc->driScreenRenderGPU,
"keep_native_window_glx_drawable",
&keep_native_window_glx_drawable) == 0) {
psc->base.keep_native_window_glx_drawable = keep_native_window_glx_drawable;
psc->prefer_back_buffer_reuse = 1;
if (psc->is_different_gpu && psc->rendererQuery) {
unsigned value;
- if (psc->rendererQuery->queryInteger(psc->driScreen,
+ if (psc->rendererQuery->queryInteger(psc->driScreenRenderGPU,
__DRI2_RENDERER_PREFER_BACK_BUFFER_REUSE,
&value) == 0)
psc->prefer_back_buffer_reuse = value;
glx_config_destroy_list(configs);
if (visuals)
glx_config_destroy_list(visuals);
- if (psc->driScreen)
- psc->core->destroyScreen(psc->driScreen);
- psc->driScreen = NULL;
+ if (psc->driScreenRenderGPU)
+ psc->core->destroyScreen(psc->driScreenRenderGPU);
+ psc->driScreenRenderGPU = NULL;
if (psc->driScreenDisplayGPU)
psc->core->destroyScreen(psc->driScreenDisplayGPU);
psc->driScreenDisplayGPU = NULL;
- if (psc->fd >= 0)
- close(psc->fd);
+ if (psc->fd_render_gpu >= 0)
+ close(psc->fd_render_gpu);
if (psc->fd_display_gpu >= 0)
close(psc->fd_display_gpu);
if (psc->driver)
{
mtx_lock(&blit_context.mtx);
- if (blit_context.ctx && blit_context.cur_screen != draw->dri_screen) {
+ if (blit_context.ctx && blit_context.cur_screen != draw->dri_screen_render_gpu) {
blit_context.core->destroyContext(blit_context.ctx);
blit_context.ctx = NULL;
}
if (!blit_context.ctx) {
- blit_context.ctx = draw->ext->core->createNewContext(draw->dri_screen,
+ blit_context.ctx = draw->ext->core->createNewContext(draw->dri_screen_render_gpu,
NULL, NULL, NULL);
- blit_context.cur_screen = draw->dri_screen;
+ blit_context.cur_screen = draw->dri_screen_render_gpu;
blit_context.core = draw->ext->core;
}
loader_dri3_drawable_init(xcb_connection_t *conn,
xcb_drawable_t drawable,
enum loader_dri3_drawable_type type,
- __DRIscreen *dri_screen,
+ __DRIscreen *dri_screen_render_gpu,
__DRIscreen *dri_screen_display_gpu,
bool is_different_gpu,
bool multiplanes_available,
draw->drawable = drawable;
draw->type = type;
draw->region = 0;
- draw->dri_screen = dri_screen;
+ draw->dri_screen_render_gpu = dri_screen_render_gpu;
draw->dri_screen_display_gpu = dri_screen_display_gpu;
draw->is_different_gpu = is_different_gpu;
draw->multiplanes_available = multiplanes_available;
unsigned char adaptive_sync = 0;
unsigned char block_on_depleted_buffers = 0;
- draw->ext->config->configQueryb(draw->dri_screen,
+ draw->ext->config->configQueryb(draw->dri_screen_render_gpu,
"adaptive_sync",
&adaptive_sync);
draw->adaptive_sync = adaptive_sync;
- draw->ext->config->configQueryb(draw->dri_screen,
+ draw->ext->config->configQueryb(draw->dri_screen_render_gpu,
"block_on_depleted_buffers",
&block_on_depleted_buffers);
if (!draw->adaptive_sync)
set_adaptive_sync_property(conn, draw->drawable, false);
- draw->swap_interval = dri_get_initial_swap_interval(draw->dri_screen,
+ draw->swap_interval = dri_get_initial_swap_interval(draw->dri_screen_render_gpu,
draw->ext->config);
dri3_update_max_num_back(draw);
/* Create a new drawable */
draw->dri_drawable =
- draw->ext->image_driver->createNewDrawable(dri_screen,
+ draw->ext->image_driver->createNewDrawable(dri_screen_render_gpu,
dri_config,
draw);
bool found = false;
int i, j;
- if (!draw->ext->image->queryDmaBufModifiers(draw->dri_screen,
+ if (!draw->ext->image->queryDmaBufModifiers(draw->dri_screen_render_gpu,
format, 0, NULL, NULL,
&supported_modifiers_count) ||
supported_modifiers_count == 0)
if (!supported_modifiers)
return false;
- draw->ext->image->queryDmaBufModifiers(draw->dri_screen, format,
+ draw->ext->image->queryDmaBufModifiers(draw->dri_screen_render_gpu, format,
supported_modifiers_count,
supported_modifiers, NULL,
&supported_modifiers_count);
free(mod_reply);
}
#endif
- buffer->image = loader_dri_create_image(draw->dri_screen, draw->ext->image,
+ buffer->image = loader_dri_create_image(draw->dri_screen_render_gpu, draw->ext->image,
width, height, format,
__DRI_IMAGE_USE_SHARE |
__DRI_IMAGE_USE_SCANOUT |
if (!buffer->image)
goto no_image;
} else {
- buffer->image = draw->ext->image->createImage(draw->dri_screen,
+ buffer->image = draw->ext->image->createImage(draw->dri_screen_render_gpu,
width, height,
format,
0,
if (!pixmap_buffer) {
buffer->linear_buffer =
- draw->ext->image->createImage(draw->dri_screen,
+ draw->ext->image->createImage(draw->dri_screen_render_gpu,
width, height,
dri3_linear_format_for_format(draw, format),
__DRI_IMAGE_USE_SHARE |
*/
if (draw->ext->image->base.version >= 20)
buffer->linear_buffer =
- draw->ext->image->createImageFromFds2(draw->dri_screen,
+ draw->ext->image->createImageFromFds2(draw->dri_screen_render_gpu,
width,
height,
loader_image_format_to_fourcc(format),
buffer);
else
buffer->linear_buffer =
- draw->ext->image->createImageFromFds(draw->dri_screen,
+ draw->ext->image->createImageFromFds(draw->dri_screen_render_gpu,
width,
height,
loader_image_format_to_fourcc(format),
*/
cur_screen = draw->vtable->get_dri_screen();
if (!cur_screen) {
- cur_screen = draw->dri_screen;
+ cur_screen = draw->dri_screen_render_gpu;
}
xcb_dri3_fence_from_fd(draw->conn,