}
static _EGLSurface *
-dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
- _EGLConfig *conf, EGLNativeWindowType window,
- const EGLint *attrib_list)
+dri2_drm_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
+ _EGLConfig *conf, EGLNativeWindowType window,
+ const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
}
static _EGLSurface *
-dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, EGLNativeWindowType window,
- const EGLint *attrib_list)
+dri2_drm_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
+ _EGLConfig *conf, EGLNativeWindowType window,
+ const EGLint *attrib_list)
{
- return dri2_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
- window, attrib_list);
+ return dri2_drm_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
+ window, attrib_list);
}
static EGLBoolean
-dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
+dri2_drm_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
}
static __DRIbuffer *
-dri2_get_buffers_with_format(__DRIdrawable *driDrawable,
+dri2_drm_get_buffers_with_format(__DRIdrawable *driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
}
static __DRIbuffer *
-dri2_get_buffers(__DRIdrawable * driDrawable,
- int *width, int *height,
- unsigned int *attachments, int count,
- int *out_count, void *loaderPrivate)
+dri2_drm_get_buffers(__DRIdrawable * driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate)
{
unsigned int *attachments_with_format;
__DRIbuffer *buffer;
}
buffer =
- dri2_get_buffers_with_format(driDrawable,
- width, height,
- attachments_with_format, count,
- out_count, loaderPrivate);
+ dri2_drm_get_buffers_with_format(driDrawable,
+ width, height,
+ attachments_with_format, count,
+ out_count, loaderPrivate);
free(attachments_with_format);
}
static int
-dri_image_get_buffers(__DRIdrawable *driDrawable,
- unsigned int format,
- uint32_t *stamp,
- void *loaderPrivate,
- uint32_t buffer_mask,
- struct __DRIimageList *buffers)
+dri2_drm_image_get_buffers(__DRIdrawable *driDrawable,
+ unsigned int format,
+ uint32_t *stamp,
+ void *loaderPrivate,
+ uint32_t buffer_mask,
+ struct __DRIimageList *buffers)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct gbm_dri_bo *bo;
}
static void
-dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
+dri2_drm_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
(void) driDrawable;
(void) loaderPrivate;
}
static EGLBoolean
-dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
+dri2_drm_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
}
static EGLint
-dri2_query_buffer_age(_EGLDriver *drv,
- _EGLDisplay *disp, _EGLSurface *surface)
+dri2_drm_query_buffer_age(_EGLDriver *drv,
+ _EGLDisplay *disp, _EGLSurface *surface)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
}
static _EGLImage *
-dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
- EGLClientBuffer buffer, const EGLint *attr_list)
+dri2_drm_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
+ EGLClientBuffer buffer, const EGLint *attr_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct gbm_dri_bo *dri_bo = gbm_dri_bo((struct gbm_bo *) buffer);
switch (target) {
case EGL_NATIVE_PIXMAP_KHR:
- return dri2_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
+ return dri2_drm_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
default:
return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);
}
dri2_dpy->gbm_dri->lookup_image = dri2_lookup_egl_image;
dri2_dpy->gbm_dri->lookup_user_data = disp;
- dri2_dpy->gbm_dri->get_buffers = dri2_get_buffers;
- dri2_dpy->gbm_dri->flush_front_buffer = dri2_flush_front_buffer;
- dri2_dpy->gbm_dri->get_buffers_with_format = dri2_get_buffers_with_format;
- dri2_dpy->gbm_dri->image_get_buffers = dri_image_get_buffers;
+ dri2_dpy->gbm_dri->get_buffers = dri2_drm_get_buffers;
+ dri2_dpy->gbm_dri->flush_front_buffer = dri2_drm_flush_front_buffer;
+ dri2_dpy->gbm_dri->get_buffers_with_format = dri2_drm_get_buffers_with_format;
+ dri2_dpy->gbm_dri->image_get_buffers = dri2_drm_image_get_buffers;
dri2_dpy->gbm_dri->base.base.surface_lock_front_buffer = lock_front_buffer;
dri2_dpy->gbm_dri->base.base.surface_release_buffer = release_buffer;
i + 1, EGL_WINDOW_BIT, attr_list, NULL);
}
- drv->API.CreateWindowSurface = dri2_create_window_surface;
- drv->API.DestroySurface = dri2_destroy_surface;
- drv->API.SwapBuffers = dri2_swap_buffers;
+ drv->API.CreateWindowSurface = dri2_drm_create_window_surface;
+ drv->API.DestroySurface = dri2_drm_destroy_surface;
+ drv->API.SwapBuffers = dri2_drm_swap_buffers;
drv->API.CreateImageKHR = dri2_drm_create_image_khr;
- drv->API.QueryBufferAge = dri2_query_buffer_age;
+ drv->API.QueryBufferAge = dri2_drm_query_buffer_age;
disp->Extensions.EXT_buffer_age = EGL_TRUE;
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
-dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
- _EGLConfig *conf, EGLNativeWindowType window,
- const EGLint *attrib_list)
+dri2_wl_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
+ _EGLConfig *conf, EGLNativeWindowType window,
+ const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
-dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, EGLNativeWindowType window,
- const EGLint *attrib_list)
+dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
+ _EGLConfig *conf, EGLNativeWindowType window,
+ const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_EGLSurface *surf;
- surf = dri2_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
- window, attrib_list);
+ surf = dri2_wl_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
+ window, attrib_list);
if (surf != NULL)
drv->API.SwapInterval(drv, disp, surf, dri2_dpy->default_swap_interval);
* Called via eglDestroySurface(), drv->API.DestroySurface().
*/
static EGLBoolean
-dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
+dri2_wl_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
}
static void
-dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
+dri2_wl_release_buffers(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
(dri2_surf->base.Width != dri2_surf->wl_win->width ||
dri2_surf->base.Height != dri2_surf->wl_win->height)) {
- dri2_release_buffers(dri2_surf);
+ dri2_wl_release_buffers(dri2_surf);
dri2_surf->base.Width = dri2_surf->wl_win->width;
dri2_surf->base.Height = dri2_surf->wl_win->height;
}
static __DRIbuffer *
-dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
- int *width, int *height,
- unsigned int *attachments, int count,
- int *out_count, void *loaderPrivate)
+dri2_wl_get_buffers_with_format(__DRIdrawable * driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
int i, j;
}
static __DRIbuffer *
-dri2_get_buffers(__DRIdrawable * driDrawable,
- int *width, int *height,
- unsigned int *attachments, int count,
- int *out_count, void *loaderPrivate)
+dri2_wl_get_buffers(__DRIdrawable * driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate)
{
unsigned int *attachments_with_format;
__DRIbuffer *buffer;
}
buffer =
- dri2_get_buffers_with_format(driDrawable,
- width, height,
- attachments_with_format, count,
- out_count, loaderPrivate);
+ dri2_wl_get_buffers_with_format(driDrawable,
+ width, height,
+ attachments_with_format, count,
+ out_count, loaderPrivate);
free(attachments_with_format);
}
static void
-dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
+dri2_wl_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
(void) driDrawable;
(void) loaderPrivate;
.base = { __DRI_IMAGE_LOADER, 1 },
.getBuffers = image_get_buffers,
- .flushFrontBuffer = dri2_flush_front_buffer,
+ .flushFrontBuffer = dri2_wl_flush_front_buffer,
};
static void
* Called via eglSwapBuffers(), drv->API.SwapBuffers().
*/
static EGLBoolean
-dri2_swap_buffers_with_damage(_EGLDriver *drv,
- _EGLDisplay *disp,
- _EGLSurface *draw,
- const EGLint *rects,
- EGLint n_rects)
+dri2_wl_swap_buffers_with_damage(_EGLDriver *drv,
+ _EGLDisplay *disp,
+ _EGLSurface *draw,
+ const EGLint *rects,
+ EGLint n_rects)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
}
static EGLint
-dri2_query_buffer_age(_EGLDriver *drv,
- _EGLDisplay *disp, _EGLSurface *surface)
+dri2_wl_query_buffer_age(_EGLDriver *drv,
+ _EGLDisplay *disp, _EGLSurface *surface)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
}
static EGLBoolean
-dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
+dri2_wl_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
- return dri2_swap_buffers_with_damage (drv, disp, draw, NULL, 0);
+ return dri2_wl_swap_buffers_with_damage (drv, disp, draw, NULL, 0);
}
static struct wl_buffer *
-dri2_create_wayland_buffer_from_image_wl(_EGLDriver *drv,
- _EGLDisplay *disp,
- _EGLImage *img)
+dri2_wl_create_wayland_buffer_from_image_wl(_EGLDriver *drv,
+ _EGLDisplay *disp,
+ _EGLImage *img)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_image *dri2_img = dri2_egl_image(img);
}
static int
-dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
+dri2_wl_authenticate(_EGLDisplay *disp, uint32_t id)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
int ret = 0;
* Called via eglTerminate(), drv->API.Terminate().
*/
static EGLBoolean
-dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
+dri2_wl_terminate(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
};
static EGLBoolean
-dri2_swap_interval(_EGLDriver *drv,
+dri2_wl_swap_interval(_EGLDriver *drv,
_EGLDisplay *disp,
_EGLSurface *surf,
EGLint interval)
}
static void
-dri2_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
+dri2_wl_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
{
GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
}
static struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {
- .authenticate = dri2_wayland_authenticate,
+ .authenticate = dri2_wl_authenticate,
};
EGLBoolean
loader_set_logger(_eglLog);
- drv->API.CreateWindowSurface = dri2_create_window_surface;
- drv->API.DestroySurface = dri2_destroy_surface;
- drv->API.SwapBuffers = dri2_swap_buffers;
- drv->API.SwapBuffersWithDamageEXT = dri2_swap_buffers_with_damage;
- drv->API.SwapInterval = dri2_swap_interval;
- drv->API.Terminate = dri2_terminate;
- drv->API.QueryBufferAge = dri2_query_buffer_age;
+ drv->API.CreateWindowSurface = dri2_wl_create_window_surface;
+ drv->API.DestroySurface = dri2_wl_destroy_surface;
+ drv->API.SwapBuffers = dri2_wl_swap_buffers;
+ drv->API.SwapBuffersWithDamageEXT = dri2_wl_swap_buffers_with_damage;
+ drv->API.SwapInterval = dri2_wl_swap_interval;
+ drv->API.Terminate = dri2_wl_terminate;
+ drv->API.QueryBufferAge = dri2_wl_query_buffer_age;
drv->API.CreateWaylandBufferFromImageWL =
- dri2_create_wayland_buffer_from_image_wl;
+ dri2_wl_create_wayland_buffer_from_image_wl;
dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
dri2_dpy->dri2_loader_extension.base.version = 3;
- dri2_dpy->dri2_loader_extension.getBuffers = dri2_get_buffers;
- dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
+ dri2_dpy->dri2_loader_extension.getBuffers = dri2_wl_get_buffers;
+ dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_wl_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
- dri2_get_buffers_with_format;
+ dri2_wl_get_buffers_with_format;
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
dri2_dpy->extensions[1] = &image_loader_extension.base;
if (!dri2_create_screen(disp))
goto cleanup_driver;
- dri2_setup_swap_interval(dri2_dpy);
+ dri2_wl_setup_swap_interval(dri2_dpy);
/* The server shouldn't advertise WL_DRM_CAPABILITY_PRIME if the driver
* doesn't have createImageFromFds, since we're using the same driver on
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
-dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
- _EGLConfig *conf, EGLNativeWindowType native_window,
- const EGLint *attrib_list)
+dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
+ _EGLConfig *conf, EGLNativeWindowType native_window,
+ const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
-dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, EGLNativeWindowType window,
- const EGLint *attrib_list)
+dri2_x11_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
+ _EGLConfig *conf, EGLNativeWindowType window,
+ const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_EGLSurface *surf;
- surf = dri2_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
- window, attrib_list);
+ surf = dri2_x11_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
+ window, attrib_list);
if (surf != NULL) {
/* When we first create the DRI2 drawable, its swap interval on the
* server side is 1.
}
static _EGLSurface *
-dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, EGLNativePixmapType pixmap,
- const EGLint *attrib_list)
+dri2_x11_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
+ _EGLConfig *conf, EGLNativePixmapType pixmap,
+ const EGLint *attrib_list)
{
- return dri2_create_surface(drv, disp, EGL_PIXMAP_BIT, conf,
- pixmap, attrib_list);
+ return dri2_x11_create_surface(drv, disp, EGL_PIXMAP_BIT, conf,
+ pixmap, attrib_list);
}
static _EGLSurface *
-dri2_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
- _EGLConfig *conf, const EGLint *attrib_list)
+dri2_x11_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
+ _EGLConfig *conf, const EGLint *attrib_list)
{
- return dri2_create_surface(drv, disp, EGL_PBUFFER_BIT, conf,
- XCB_WINDOW_NONE, attrib_list);
+ return dri2_x11_create_surface(drv, disp, EGL_PBUFFER_BIT, conf,
+ XCB_WINDOW_NONE, attrib_list);
}
static EGLBoolean
-dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
+dri2_x11_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
* \c DRI2GetBuffers or \c DRI2GetBuffersWithFormat.
*/
static void
-dri2_process_buffers(struct dri2_egl_surface *dri2_surf,
- xcb_dri2_dri2_buffer_t *buffers, unsigned count)
+dri2_x11_process_buffers(struct dri2_egl_surface *dri2_surf,
+ xcb_dri2_dri2_buffer_t *buffers, unsigned count)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
}
static __DRIbuffer *
-dri2_get_buffers(__DRIdrawable * driDrawable,
- int *width, int *height,
- unsigned int *attachments, int count,
- int *out_count, void *loaderPrivate)
+dri2_x11_get_buffers(__DRIdrawable * driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy =
*out_count = reply->count;
dri2_surf->base.Width = *width = reply->width;
dri2_surf->base.Height = *height = reply->height;
- dri2_process_buffers(dri2_surf, buffers, *out_count);
+ dri2_x11_process_buffers(dri2_surf, buffers, *out_count);
free(reply);
}
static __DRIbuffer *
-dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
- int *width, int *height,
- unsigned int *attachments, int count,
- int *out_count, void *loaderPrivate)
+dri2_x11_get_buffers_with_format(__DRIdrawable * driDrawable,
+ int *width, int *height,
+ unsigned int *attachments, int count,
+ int *out_count, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy =
dri2_surf->base.Width = *width = reply->width;
dri2_surf->base.Height = *height = reply->height;
*out_count = reply->count;
- dri2_process_buffers(dri2_surf, buffers, *out_count);
+ dri2_x11_process_buffers(dri2_surf, buffers, *out_count);
free(reply);
}
static void
-dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
+dri2_x11_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
(void) driDrawable;
}
static char *
-dri2_strndup(const char *s, int length)
+dri2_x11_strndup(const char *s, int length)
{
char *d;
}
static EGLBoolean
-dri2_connect(struct dri2_egl_display *dri2_dpy)
+dri2_x11_connect(struct dri2_egl_display *dri2_dpy)
{
xcb_xfixes_query_version_reply_t *xfixes_query;
xcb_xfixes_query_version_cookie_t xfixes_query_cookie;
driver_name = xcb_dri2_connect_driver_name (connect);
dri2_dpy->driver_name =
- dri2_strndup(driver_name,
- xcb_dri2_connect_driver_name_length (connect));
+ dri2_x11_strndup(driver_name,
+ xcb_dri2_connect_driver_name_length(connect));
device_name = xcb_dri2_connect_device_name (connect);
dri2_dpy->device_name =
- dri2_strndup(device_name,
- xcb_dri2_connect_device_name_length (connect));
+ dri2_x11_strndup(device_name,
+ xcb_dri2_connect_device_name_length(connect));
if (dri2_dpy->device_name == NULL || dri2_dpy->driver_name == NULL) {
free(dri2_dpy->device_name);
}
static EGLBoolean
-dri2_authenticate(_EGLDisplay *disp)
+dri2_x11_local_authenticate(_EGLDisplay *disp)
{
#ifdef HAVE_LIBDRM
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
}
static EGLBoolean
-dri2_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
- _EGLDisplay *disp)
+dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
+ _EGLDisplay *disp)
{
xcb_screen_iterator_t s;
xcb_depth_iterator_t d;
}
static int64_t
-dri2_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
- int64_t msc, int64_t divisor, int64_t remainder)
+dri2_x11_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
+ int64_t msc, int64_t divisor, int64_t remainder)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
}
static EGLBoolean
-dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
+dri2_x11_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
if (dri2_dpy->dri2) {
- return dri2_swap_buffers_msc(drv, disp, draw, 0, 0, 0) != -1;
+ return dri2_x11_swap_buffers_msc(drv, disp, draw, 0, 0, 0) != -1;
} else {
assert(dri2_dpy->swrast);
}
static EGLBoolean
-dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
- EGLint numRects, const EGLint *rects)
+dri2_x11_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp,
+ _EGLSurface *draw,
+ EGLint numRects, const EGLint *rects)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
}
static EGLBoolean
-dri2_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
+dri2_x11_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
EGLint x, EGLint y, EGLint width, EGLint height)
{
const EGLint rect[4] = { x, y, width, height };
if (x < 0 || y < 0 || width < 0 || height < 0)
_eglError(EGL_BAD_PARAMETER, "eglPostSubBufferNV");
- return dri2_swap_buffers_region(drv, disp, draw, 1, rect);
+ return dri2_x11_swap_buffers_region(drv, disp, draw, 1, rect);
}
static EGLBoolean
-dri2_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, EGLint interval)
+dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
+ EGLint interval)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
}
static EGLBoolean
-dri2_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
- EGLNativePixmapType native_target)
+dri2_x11_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
+ EGLNativePixmapType native_target)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
{
struct dri2_egl_display *dri2_dpy;
- drv->API.CreateWindowSurface = dri2_create_window_surface;
- drv->API.CreatePixmapSurface = dri2_create_pixmap_surface;
- drv->API.CreatePbufferSurface = dri2_create_pbuffer_surface;
- drv->API.DestroySurface = dri2_destroy_surface;
- drv->API.SwapBuffers = dri2_swap_buffers;
- drv->API.CopyBuffers = dri2_copy_buffers;
+ drv->API.CreateWindowSurface = dri2_x11_create_window_surface;
+ drv->API.CreatePixmapSurface = dri2_x11_create_pixmap_surface;
+ drv->API.CreatePbufferSurface = dri2_x11_create_pbuffer_surface;
+ drv->API.DestroySurface = dri2_x11_destroy_surface;
+ drv->API.SwapBuffers = dri2_x11_swap_buffers;
+ drv->API.CopyBuffers = dri2_x11_copy_buffers;
drv->API.SwapBuffersRegionNOK = NULL;
drv->API.CreateImageKHR = NULL;
goto cleanup_driver;
if (dri2_dpy->conn) {
- if (!dri2_add_configs_for_visuals(dri2_dpy, disp))
+ if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp))
goto cleanup_configs;
}
}
static void
-dri2_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
+dri2_x11_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
{
GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
int arbitrary_max_interval = 1000;
{
struct dri2_egl_display *dri2_dpy;
- drv->API.CreateWindowSurface = dri2_create_window_surface;
- drv->API.CreatePixmapSurface = dri2_create_pixmap_surface;
- drv->API.CreatePbufferSurface = dri2_create_pbuffer_surface;
- drv->API.DestroySurface = dri2_destroy_surface;
- drv->API.SwapBuffers = dri2_swap_buffers;
- drv->API.CopyBuffers = dri2_copy_buffers;
+ drv->API.CreateWindowSurface = dri2_x11_create_window_surface;
+ drv->API.CreatePixmapSurface = dri2_x11_create_pixmap_surface;
+ drv->API.CreatePbufferSurface = dri2_x11_create_pbuffer_surface;
+ drv->API.DestroySurface = dri2_x11_destroy_surface;
+ drv->API.SwapBuffers = dri2_x11_swap_buffers;
+ drv->API.CopyBuffers = dri2_x11_copy_buffers;
drv->API.CreateImageKHR = dri2_x11_create_image_khr;
- drv->API.SwapBuffersRegionNOK = dri2_swap_buffers_region;
- drv->API.PostSubBufferNV = dri2_post_sub_buffer;
- drv->API.SwapInterval = dri2_swap_interval;
+ drv->API.SwapBuffersRegionNOK = dri2_x11_swap_buffers_region;
+ drv->API.PostSubBufferNV = dri2_x11_post_sub_buffer;
+ drv->API.SwapInterval = dri2_x11_swap_interval;
dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
}
if (dri2_dpy->conn) {
- if (!dri2_connect(dri2_dpy))
+ if (!dri2_x11_connect(dri2_dpy))
goto cleanup_conn;
}
}
if (dri2_dpy->conn) {
- if (!dri2_authenticate(disp))
+ if (!dri2_x11_local_authenticate(disp))
goto cleanup_fd;
}
if (dri2_dpy->dri2_minor >= 1) {
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
dri2_dpy->dri2_loader_extension.base.version = 3;
- dri2_dpy->dri2_loader_extension.getBuffers = dri2_get_buffers;
- dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
+ dri2_dpy->dri2_loader_extension.getBuffers = dri2_x11_get_buffers;
+ dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_x11_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
- dri2_get_buffers_with_format;
+ dri2_x11_get_buffers_with_format;
} else {
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
dri2_dpy->dri2_loader_extension.base.version = 2;
- dri2_dpy->dri2_loader_extension.getBuffers = dri2_get_buffers;
- dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
+ dri2_dpy->dri2_loader_extension.getBuffers = dri2_x11_get_buffers;
+ dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_x11_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffersWithFormat = NULL;
}
if (!dri2_create_screen(disp))
goto cleanup_fd;
- dri2_setup_swap_interval(dri2_dpy);
+ dri2_x11_setup_swap_interval(dri2_dpy);
+
+ if (dri2_dpy->conn) {
+ if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp))
+ goto cleanup_configs;
+ }
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
disp->Extensions.NOK_swap_region = EGL_TRUE;
#endif
if (dri2_dpy->conn) {
- if (!dri2_add_configs_for_visuals(dri2_dpy, disp))
+ if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp))
goto cleanup_configs;
}