WAYLAND_PROTOCOLS_REQUIRED=1.8
XCB_REQUIRED=1.9.3
XCBDRI2_REQUIRED=1.8
-XCBDRI3_REQUIRED=1.13
+XCBDRI3_MODIFIERS_REQUIRED=1.13
XCBGLX_REQUIRED=1.8.1
-XCBPRESENT_REQUIRED=1.13
+XCBPRESENT_MODIFIERS_REQUIRED=1.13
XDAMAGE_REQUIRED=1.1
XSHMFENCE_REQUIRED=1.1
XVMC_REQUIRED=1.0.6
if test x"$enable_dri3" = xyes; then
DEFINES="$DEFINES -DHAVE_DRI3"
- dri3_modules="x11-xcb xcb >= $XCB_REQUIRED xcb-dri3 >= $XCBDRI3_REQUIRED xcb-xfixes xcb-present >= $XCBPRESENT_REQUIRED xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
+ dri3_modules="x11-xcb xcb >= $XCB_REQUIRED xcb-dri3 xcb-xfixes xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
PKG_CHECK_MODULES([XCB_DRI3], [$dri3_modules])
+ dri3_modifier_modules="xcb-dri3 >= $XCBDRI3_MODIFIERS_REQUIRED xcb-present >= $XCBPRESENT_MODIFIERS_REQUIRES"
+ PKG_CHECK_MODULES([XCB_DRI3_MODIFIERS], [$dri3_modifier_modules], [have_dri3_modifiers=yes], [have_dri3_modifiers=no])
+
+ if test "x$have_dri3_modifiers" == xyes; then
+ DEFINES="$DEFINES -DHAVE_DRI3_MODIFIERS"
+ fi
fi
AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$platforms" | grep -q 'x11')
dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
if with_dri3
- pre_args += '-DHAVE_DRI3'
+ pre_args += '-DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS'
dep_xcb_dri3 = dependency('xcb-dri3', version : '>= 1.13')
dep_xcb_present = dependency('xcb-present', version: '>= 1.13')
dep_xcb_sync = dependency('xcb-sync')
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
}
static _EGLImage *
/* If the server tells us that our allocation is suboptimal, we
* reallocate once.
*/
+#ifdef HAVE_DRI3_MODIFIERS
if (ce->mode == XCB_PRESENT_COMPLETE_MODE_SUBOPTIMAL_COPY &&
draw->last_present_mode != ce->mode) {
for (int b = 0; b < ARRAY_SIZE(draw->buffers); b++) {
draw->buffers[b]->reallocate = true;
}
}
-
+#endif
draw->last_present_mode = ce->mode;
if (draw->vtable->show_fps)
*/
if (!loader_dri3_have_image_blit(draw) && draw->cur_blit_source != -1)
options |= XCB_PRESENT_OPTION_COPY;
-
+#ifdef HAVE_DRI3_MODIFIERS
if (draw->multiplanes_available)
options |= XCB_PRESENT_OPTION_SUBOPTIMAL;
-
+#endif
back->busy = 1;
back->last_swap = draw->send_sbc;
xcb_present_pixmap(draw->conn,
return 0;
}
+#ifdef HAVE_DRI3_MODIFIERS
static bool
has_supported_modifier(struct loader_dri3_drawable *draw, unsigned int format,
uint64_t *modifiers, uint32_t count)
free(supported_modifiers);
return found;
}
+#endif
/** loader_dri3_alloc_render_buffer
*
goto no_image;
if (!draw->is_different_gpu) {
+#ifdef HAVE_DRI3_MODIFIERS
if (draw->multiplanes_available &&
draw->ext->image->base.version >= 15 &&
draw->ext->image->queryDmaBufModifiers &&
buffer);
free(modifiers);
}
-
+#endif
if (!buffer->image)
buffer->image = draw->ext->image->createImage(draw->dri_screen,
width, height,
pixmap = xcb_generate_id(draw->conn);
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);
+#endif
} else {
xcb_dri3_pixmap_from_buffer(draw->conn,
pixmap,
return ret;
}
+#ifdef HAVE_DRI3_MODIFIERS
__DRIimage *
loader_dri3_create_image_from_buffers(xcb_connection_t *c,
xcb_dri3_buffers_from_pixmap_reply_t *bp_reply,
return ret;
}
+#endif
/** dri3_get_pixmap_buffer
*
(sync_fence = xcb_generate_id(draw->conn)),
false,
fence_fd);
-
+#ifdef HAVE_DRI3_MODIFIERS
if (draw->multiplanes_available &&
draw->ext->image->base.version >= 15 &&
draw->ext->image->createImageFromDmaBufs2) {
width = bps_reply->width;
height = bps_reply->height;
free(bps_reply);
- } else {
+ } else
+#endif
+ {
xcb_dri3_buffer_from_pixmap_cookie_t bp_cookie;
xcb_dri3_buffer_from_pixmap_reply_t *bp_reply;
const __DRIimageExtension *image,
void *loaderPrivate);
+#ifdef HAVE_DRI3_MODIFIERS
__DRIimage *
loader_dri3_create_image_from_buffers(xcb_connection_t *c,
xcb_dri3_buffers_from_pixmap_reply_t *bp_reply,
__DRIscreen *dri_screen,
const __DRIimageExtension *image,
void *loaderPrivate);
-
+#endif
int
loader_dri3_get_buffers(__DRIdrawable *driDrawable,
unsigned int format,
/* The winsys is now trying to flip directly and cannot due to our
* configuration. Request the user reallocate.
*/
+#ifdef HAVE_DRI3_MODIFIERS
if (complete->mode == XCB_PRESENT_COMPLETE_MODE_SUBOPTIMAL_COPY &&
chain->last_present_mode != XCB_PRESENT_COMPLETE_MODE_SUBOPTIMAL_COPY)
result = VK_SUBOPTIMAL_KHR;
+#endif
/* When we go from flipping to copying, the odds are very likely that
* we could reallocate in a more optimal way if we didn't have to care
if (chain->base.present_mode == VK_PRESENT_MODE_IMMEDIATE_KHR)
options |= XCB_PRESENT_OPTION_ASYNC;
+#ifdef HAVE_DRI3_MODIFIERS
if (chain->has_dri3_modifiers)
options |= XCB_PRESENT_OPTION_SUBOPTIMAL;
+#endif
xshmfence_reset(image->shm_fence);
image->pixmap = xcb_generate_id(chain->conn);
+#ifdef HAVE_DRI3_MODIFIERS
if (image->base.drm_modifier != DRM_FORMAT_MOD_INVALID) {
/* If the image has a modifier, we must have DRI3 v1.2. */
assert(chain->has_dri3_modifiers);
chain->depth, bpp,
image->base.drm_modifier,
image->base.fds);
- } else {
+ } else
+#endif
+ {
/* Without passing modifiers, we can't have multi-plane RGB images. */
assert(image->base.num_planes == 1);
if (!wsi_conn->has_dri3_modifiers)
goto out;
+#ifdef HAVE_DRI3_MODIFIERS
xcb_generic_error_t *error = NULL;
xcb_dri3_get_supported_modifiers_cookie_t mod_cookie =
xcb_dri3_get_supported_modifiers(conn, window, depth, bpp);
free(mod_reply);
return;
-
+#endif
out:
*num_tranches_in = 0;
}