Bug 107176

Summary: Mesa Vulkan build fails on Ubuntu 16.04 for dependencies not caught by Mesa configure
Product: Mesa Reporter: Eero Tamminen <eero.t.tamminen>
Component: Drivers/Vulkan/CommonAssignee: Keith Packard <keithp>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: airlied, chadversary, daniel, danylo.piliaiev, jason, pmenzel+bugs.freedesktop.org, sergii.romantsov
Version: git   
Hardware: Other   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=107170
Whiteboard:
i915 platform: i915 features:
Attachments: attachment-21205-0.html

Description Eero Tamminen 2018-07-10 07:51:22 UTC
After cloning Mesa git yesterday to a clean directory, this doesn't produce any errors:
$ ./autogen.sh --prefix=/usr/local/ --enable-texture-float --enable-dri3 --with-dri-driverdir=/usr/local/lib/dri --enable-shared-glapi --disable-llvm-shared-libs --disable-llvm --without-gallium-drivers --with-vulkan-drivers=intel --with-platforms=x11,drm,wayland --enable-gles2 --enable-gbm --disable-debug --with-dri-drivers="i965 swrast"

But with this:
$ make

I get:
----------------------------------------------------
  CC       wsi/wsi_common_display.lo
../../../src/vulkan/wsi/wsi_common_display.c:991:4: error: unknown field ‘sequence_handler’ specified in initializer
    .sequence_handler = wsi_display_sequence_handler,
    ^
../../../src/vulkan/wsi/wsi_common_display.c:991:24: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
    .sequence_handler = wsi_display_sequence_handler,
                        ^
../../../src/vulkan/wsi/wsi_common_display.c:991:24: note: (near initialization for ‘event_context.page_flip_handler’)
../../../src/vulkan/wsi/wsi_common_display.c: In function ‘wsi_register_vblank_event’:
../../../src/vulkan/wsi/wsi_common_display.c:1373:17: error: implicit declaration of function ‘drmCrtcQueueSequence’ [-Werror=implicit-function-declaration]
       int ret = drmCrtcQueueSequence(wsi->fd, connector->crtc_id,
                 ^
../../../src/vulkan/wsi/wsi_common_display.c: In function ‘wsi_acquire_xlib_display’:
../../../src/vulkan/wsi/wsi_common_display.c:2164:4: error: unknown type name ‘xcb_randr_lease_t’
    xcb_randr_lease_t lease = xcb_generate_id(connection);
    ^
../../../src/vulkan/wsi/wsi_common_display.c:2165:4: error: unknown type name ‘xcb_randr_create_lease_cookie_t’
    xcb_randr_create_lease_cookie_t cl_c =
    ^
../../../src/vulkan/wsi/wsi_common_display.c:2166:7: error: implicit declaration of function ‘xcb_randr_create_lease’ [-Werror=implicit-function-declaration]
       xcb_randr_create_lease(connection, root, lease, 1, 1,
       ^
../../../src/vulkan/wsi/wsi_common_display.c:2168:4: error: unknown type name ‘xcb_randr_create_lease_reply_t’
    xcb_randr_create_lease_reply_t *cl_r =
    ^
../../../src/vulkan/wsi/wsi_common_display.c:2169:7: error: implicit declaration of function ‘xcb_randr_create_lease_reply’ [-Werror=implicit-function-declaration]
       xcb_randr_create_lease_reply(connection, cl_c, NULL);
       ^
../../../src/vulkan/wsi/wsi_common_display.c:2169:7: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
../../../src/vulkan/wsi/wsi_common_display.c:2174:12: error: request for member ‘nfd’ in something not a structure or union
    if (cl_r->nfd > 0) {
            ^
../../../src/vulkan/wsi/wsi_common_display.c:2175:20: error: implicit declaration of function ‘xcb_randr_create_lease_reply_fds’ [-Werror=implicit-function-declaration]
       int *rcl_f = xcb_randr_create_lease_reply_fds(connection, cl_r);
                    ^
../../../src/vulkan/wsi/wsi_common_display.c:2175:20: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
../../../src/vulkan/wsi/wsi_common_display.c: In function ‘wsi_get_swapchain_counter’:
../../../src/vulkan/wsi/wsi_common_display.c:2313:14: error: implicit declaration of function ‘drmCrtcGetSequence’ [-Werror=implicit-function-declaration]
    int ret = drmCrtcGetSequence(wsi->fd, connector->crtc_id, value, NULL);
              ^
cc1: some warnings being treated as errors
----------------------------------------------------

"drmCrtcGetSequence" can be found from xf86drm.h header in latest libdrm, not from the one in Ubuntu 16.04.

xcb_randr_* can be found from randr.h header in latest libxcb, not from the one in Ubuntu 16.04 (bew libxcb needs just newer xcb-proto).

-> dependency checks need to be updated.
Comment 1 Danylo 2018-07-11 11:28:28 UTC
Made a patch to fix compilation: https://patchwork.freedesktop.org/patch/237719/
Comment 2 Adam Bolte 2018-08-26 02:47:07 UTC
Works for me on Debain Stretch. Thanks.
Comment 3 Paul Menzel 2018-09-27 16:04:14 UTC
I hit the same issue with Mesa 18.2.1. Will the patch be committed?
Comment 4 Sergii Romantsov 2018-09-28 08:28:43 UTC
Created attachment 141771 [details]
attachment-21205-0.html

Hello, Paul.
Seems as alternative solution into master was pushed commit:
dd333c66bdcb11c0d7c522642761490aced2b7ab (vulkan: Disable randr lease for
libxcb < 1.13)

Could you tried it?

On Thu, Sep 27, 2018 at 7:04 PM <bugzilla-daemon@freedesktop.org> wrote:

> *Comment # 3 <https://bugs.freedesktop.org/show_bug.cgi?id=107176#c3> on
> bug 107176 <https://bugs.freedesktop.org/show_bug.cgi?id=107176> from Paul
> Menzel <pmenzel+bugs.freedesktop@molgen.mpg.de> *
>
> I hit the same issue with Mesa 18.2.1. Will the patch be committed?
>
> ------------------------------
> You are receiving this mail because:
>
>    - You are on the CC list for the bug.
>
>
Comment 5 Daniel Stone 2018-11-16 10:25:15 UTC
Fixed per above comment.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.