if (!dri2_bind_extensions(dri2_dpy, mandatory_core_extensions, extensions, false))
return EGL_FALSE;
-#ifdef HAVE_DRI3
+#ifdef HAVE_DRI3_MODIFIERS
dri2_dpy->multibuffers_available =
(dri2_dpy->dri3_major_version > 1 || (dri2_dpy->dri3_major_version == 1 &&
dri2_dpy->dri3_minor_version >= 2)) &&
return &dri2_img->base;
}
+#ifdef HAVE_DRI3_MODIFIERS
static _EGLImage *
dri3_create_image_khr_pixmap_from_buffers(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer,
const EGLint *attr_list)
{
-#ifdef HAVE_DRI3_MODIFIERS
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_image *dri2_img;
xcb_dri3_buffers_from_pixmap_cookie_t bp_cookie;
}
return &dri2_img->base;
-#else
- return NULL;
-#endif
}
+#endif
static _EGLImage *
dri3_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list)
{
+#ifdef HAVE_DRI3_MODIFIERS
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+#endif
switch (target) {
case EGL_NATIVE_PIXMAP_KHR:
+#ifdef HAVE_DRI3_MODIFIERS
if (dri2_dpy->multibuffers_available)
return dri3_create_image_khr_pixmap_from_buffers(disp, ctx, buffer,
attr_list);
+#endif
return dri3_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
default:
return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);
{
struct dri3_drawable *pdraw;
struct dri3_screen *psc = (struct dri3_screen *) base;
- const struct dri3_display *const pdp = (struct dri3_display *)
- base->display->dri3Display;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base;
bool has_multibuffer = false;
+#ifdef HAVE_DRI3_MODIFIERS
+ const struct dri3_display *const pdp = (struct dri3_display *)
+ base->display->dri3Display;
+#endif
pdraw = calloc(1, sizeof(*pdraw));
if (!pdraw)
pdraw->base.drawable = drawable;
pdraw->base.psc = &psc->base;
+#ifdef HAVE_DRI3_MODIFIERS
if ((psc->image && psc->image->base.version >= 15) &&
(pdp->dri3Major > 1 || (pdp->dri3Major == 1 && pdp->dri3Minor >= 2)) &&
(pdp->presentMajor > 1 ||
(pdp->presentMajor == 1 && pdp->presentMinor >= 2)))
has_multibuffer = true;
+#endif
(void) __glXInitialize(psc->base.dpy);
buffer->modifier = DRM_FORMAT_MOD_INVALID;
pixmap = xcb_generate_id(draw->conn);
+#ifdef HAVE_DRI3_MODIFIERS
if (draw->multiplanes_available &&
buffer->modifier != DRM_FORMAT_MOD_INVALID) {
-#ifdef HAVE_DRI3_MODIFIERS
xcb_dri3_pixmap_from_buffers(draw->conn,
pixmap,
draw->drawable,
depth, buffer->cpp * 8,
buffer->modifier,
buffer_fds);
+ } else
#endif
- } else {
+ {
xcb_dri3_pixmap_from_buffer(draw->conn,
pixmap,
draw->drawable,
}
wsi_conn->has_dri3 = dri3_reply->present != 0;
+#ifdef HAVE_DRI3_MODIFIERS
if (wsi_conn->has_dri3) {
xcb_dri3_query_version_cookie_t ver_cookie;
xcb_dri3_query_version_reply_t *ver_reply;
(ver_reply->major_version > 1 || ver_reply->minor_version >= 2);
free(ver_reply);
}
+#endif
wsi_conn->has_present = pres_reply->present != 0;
+#ifdef HAVE_DRI3_MODIFIERS
if (wsi_conn->has_present) {
xcb_present_query_version_cookie_t ver_cookie;
xcb_present_query_version_reply_t *ver_reply;
(ver_reply->major_version > 1 || ver_reply->minor_version >= 2);
free(ver_reply);
}
+#endif
wsi_conn->has_dri3_modifiers = has_dri3_v1_2 && has_present_v1_2;
wsi_conn->is_proprietary_x11 = false;