DRI3 fails to initialize on i915 due to incompatible flush extension
Submitted by regwz
Assigned to Ian Romanick
Description
When DRI3 is enabled, any application that uses DRI on X server 1.16 produces libGL errors (see below).
-
Steps to Reproduce: $ glxgears
-
Actual Results: libGL error: Version 4 or later of flush extension not found libGL error: failed to load driver: i915
(the application falls back on DRI2, I assume, but otherwise works as expected)
-
Expected Results: application produces no errors and still works as expected but with DRI3
-
System / Package info: Arch Linux i686
mesa 10.2.4-1 + upstream patch: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b656e3c603da46fe0acd9905dc039c93d76f0b06 intel-dri 10.2.4-1 xorg-server 1.16.0-2 xf86-video-intel 2.99.912-3
mesa build options: https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/mesa&id=8c1d8a818e98c9c1717dbe2bb0cbc4a075bba864
./configure --prefix=/usr
--sysconfdir=/etc
--with-dri-driverdir=/usr/lib/xorg/modules/dri
--with-gallium-drivers=r300,r600,radeonsi,nouveau,svga,swrast
--with-dri-drivers=i915,i965,r200,radeon,nouveau,swrast
--with-egl-platforms=x11,drm,wayland
--enable-llvm-shared-libs
--enable-egl
--disable-gallium-egl
--enable-gbm
--enable-gallium-gbm
--enable-gallium-llvm
--enable-shared-glapi
--enable-glx-tls
--enable-dri
--enable-glx
--enable-osmesa
--enable-gles1
--enable-gles2
--enable-texture-float
--enable-xa
--enable-vdpau
--enable-dri3
--enable-omx
--enable-opencl --enable-opencl-icd
--with-clang-libdir=/usr/lib
Other people encountered the same problem: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754297#25 https://bugzilla.redhat.com/show_bug.cgi?id=1115323#c18
- Analysis: It looks like the i965 driver has DRI2flush extension version 4, but the i915 driver has only version 3 available.
static const struct __DRI2flushExtensionRec intelFlushExtension = { .base = { __DRI2_FLUSH, 4 },
.flush = intel_dri2_flush,
.invalidate = dri2InvalidateDrawable,
.flush_with_flags = intel_dri2_flush_with_flags,
};
static const struct __DRI2flushExtensionRec intelFlushExtension = { .base = { __DRI2_FLUSH, 3 },
.flush = intelDRI2Flush,
.invalidate = dri2InvalidateDrawable,
};
This check then fails: http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/dri3_glx.c?h=10.2&id=816d37e5c59b50167e0b13c5e290a08f04ee166c#n1729
if (!psc->f || psc->f->base.version < 4) { ErrorMessageF("Version 4 or later of flush extension not found\n"); goto handle_error; }
Version: 10.2