Skip to content
Commits on Source (26)
  • Adam Jackson's avatar
    sdksyms: Skip empty symbols · 0031bbad
    Adam Jackson authored
    
    
    Apparently on NetBSD we can hit failures like this:
    
    sdksyms.c:1773:15: error: expected expression before ',' token
         (void *) &,                                                  /* ../../dri3/dri3.h:110 */
    
    I've been unable to reproduce that locally (even in a NetBSD vm), but
    an obvious workaround might be to just notice empty symbol names and
    ignore them rather than emit invalid C code.
    
    Tested-by: default avatarThomas Klausner <wiz@netbsd.org>
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    0031bbad
  • Emil Velikov's avatar
    configure.ac: make use of wayland-scanner.pc · d7269b49
    Emil Velikov authored
    
    
    Replace the current (incorrect) assumption that wayland-scanner is
    located in the wayland-client prefix. Make use of the wayland_scanner
    variable in wayland-scanner.pc
    
    It was introduced back in 2013 and we already require newer wayland bits
    
    Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
    Signed-off-by: default avatarEmil Velikov <emil.velikov@collabora.com>
    d7269b49
  • Adam Jackson's avatar
    xwayland: Don't crash on WarpPointer(dest_w = None) · bf147f67
    Adam Jackson authored
    
    
    Turns out that's legal, and xts exercises it, and we crash:
    
        Thread 1 "Xwayland" received signal SIGSEGV, Segmentation fault.
        dixGetPrivate (key=0x813660 <xwl_window_private_key>, privates=0x20) at ../../include/privates.h:122
        122	    return (char *) (*privates) + key->offset;
        (gdb) bt
        #0  dixGetPrivate (key=0x813660 <xwl_window_private_key>, privates=0x20) at ../../include/privates.h:122
        #1  dixLookupPrivate (key=0x813660 <xwl_window_private_key>, privates=0x20) at ../../include/privates.h:166
        #2  xwl_window_of_top (window=0x0) at xwayland.c:128
        #3  xwl_cursor_warped_to (device=<optimized out>, screen=0x268b6e0, client=<optimized out>, window=0x0, sprite=0x300bb30,
            x=2400, y=1350) at xwayland.c:292
        #4  0x00000000005622ec in ProcWarpPointer (client=0x32755d0) at events.c:3618
    
    In this case, x/y are the screen-space coordinates where the pointer
    ends up, and we need to look up the (X) window there.
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    Reviewed-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    bf147f67
  • Olivier Fourdan's avatar
    xwayland: Fix build without glamor · c3ae963a
    Olivier Fourdan authored
    
    
    Present support in Xwayland relies on glamor, make sure Xwayland can
    be built without glamor by moving references to Present code inside
    the conditional GLAMOR_HAS_GBM.
    
    Reported-by: default avatarMatt Turner <mattst88@gmail.com>
    Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: default avatarMatt Turner <mattst88@gmail.com>
    Reviewed-by: default avatarRoman Gilg <subdiff@gmail.com>
    c3ae963a
  • Matt Turner's avatar
    modesetting: Move GBM code inside #ifdef GLAMOR_HAS_GBM · a98a95b7
    Matt Turner authored
    Fixes a compilation error without Glamor.
    
    Bugzilla: https://bugs.gentoo.org/653288
    
    
    Signed-off-by: default avatarMatt Turner <mattst88@gmail.com>
    Reviewed-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
    a98a95b7
  • Mario Kleiner's avatar
    dri3: Fix dri3_buffers_from_pixmap request. · 4e92c51c
    Mario Kleiner authored
    
    
    Sending pixmap depth and bpp was omitted, so the Mesa
    X11 + EGL + DRI3 side of things always failed to
    dri3_create_image_khr_pixmap_from_buffers(), which led
    to failure of X11 + EGL compositing under DRI3 under,
    e.g., KDE Plasma 5.
    
    Fixes: 6e7c40f6 ("dri3: Add multi-planar/modifier buffer requests")
    Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
    Cc: Daniel Stone <daniels@collabora.com>
    Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
    Reviewed-by: default avatarLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
    Tested-by: default avatarMike Lothian <mike@fireburn.co.uk>
    4e92c51c
  • Adam Jackson's avatar
    modesetting: Fix inverted check in dri2 WaitMSC · 78b6f940
    Adam Jackson authored
    
    
    ms_queue_vblank() returns false on failure.
    
    Reported-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    Reviewed-by: default avatarFrank Binns <frank.binns@imgtec.com>
    Tested-by: default avatarMike Lothian <mike@fireburn.co.uk>
    78b6f940
  • Chris Wilson's avatar
    os/WaitFor: Check timers on every iteration · ac7a4bf4
    Chris Wilson authored
    
    
    Currently we only check timer expiry if there are no client fd (or
    other input) waiting to be serviced. This makes it very easy to starve
    the timers with long request queues, and so miss critical timestamps.
    
    The timer subsystem is just another input waiting to be serviced, so
    evaluate it on every loop like all the others, at the cost of calling
    GetTimeInMillis() slightly more frequently. (A more invasive and likely
    OS specific alternative would be to move the timer wheel to the local
    equivalent of timerfd, and treat it as an input fd to the event loop
    exactly equivalent to all the others, and so also serviced on every
    pass. The trade-off being that the kernel timer wheel is likely more
    efficiently integrated with epoll, but individual updates to each timer
    would then require syscalls.)
    
    Reviewed-by: default avatarPeter Harris <pharris@opentext.com>
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    ac7a4bf4
  • David Woodhouse's avatar
    glamor: fix glamor_xv_query_image_attributes() for odd-width images · 12a6b189
    David Woodhouse authored
    Images which are one pixel wider than a multiple of 8 are being handled
    incorrectly. Other drivers round up the width to a multiple of two
    before they start calculating. Do the same.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795235
    
    
    
    Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
    Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
    12a6b189
  • Olivier Fourdan's avatar
    xwayland: avoid using freed xwl_window on unrealize · 8b8f9007
    Olivier Fourdan authored
    
    
    xwl_unrealize_window() would use freed xwl_window which can lead to
    various memory corruption and crashes, as reported by valgrind:
    
     Invalid read of size 8
        at 0x42C802: xwl_present_cleanup (xwayland-present.c:84)
        by 0x42BA67: xwl_unrealize_window (xwayland.c:601)
        by 0x541EE9: compUnrealizeWindow (compwindow.c:285)
        by 0x57E1FA: UnrealizeTree (window.c:2816)
        by 0x581189: UnmapWindow (window.c:2874)
        by 0x54EB26: ProcUnmapWindow (dispatch.c:879)
        by 0x554B7D: Dispatch (dispatch.c:479)
        by 0x558BE5: dix_main (main.c:276)
        by 0x7C4B1BA: (below main) (libc-start.c:308)
      Address 0xf520f60 is 96 bytes inside a block of size 184 free'd
        at 0x4C2EDAC: free (vg_replace_malloc.c:530)
        by 0x42B9FB: xwl_unrealize_window (xwayland.c:624)
        by 0x541EE9: compUnrealizeWindow (compwindow.c:285)
        by 0x57E1FA: UnrealizeTree (window.c:2816)
        by 0x581189: UnmapWindow (window.c:2874)
        by 0x54EB26: ProcUnmapWindow (dispatch.c:879)
        by 0x554B7D: Dispatch (dispatch.c:479)
        by 0x558BE5: dix_main (main.c:276)
        by 0x7C4B1BA: (below main) (libc-start.c:308)
      Block was alloc'd at
        at 0x4C2FB06: calloc (vg_replace_malloc.c:711)
        by 0x42B307: xwl_realize_window (xwayland.c:488)
        by 0x541E59: compRealizeWindow (compwindow.c:268)
        by 0x57DA40: RealizeTree (window.c:2617)
        by 0x580B28: MapWindow (window.c:2694)
        by 0x54EA2A: ProcMapWindow (dispatch.c:845)
        by 0x554B7D: Dispatch (dispatch.c:479)
        by 0x558BE5: dix_main (main.c:276)
        by 0x7C4B1BA: (below main) (libc-start.c:308)
    
    This is because UnrealizeTree() traverses the tree from top to bottom,
    which invalidates the assumption that if the Window doesn't feature an
    xwl_window on its own, it's the xwl_window of its first ancestor with
    one.
    
    This reverts commit 82df2ce3
    
    Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
    Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
    8b8f9007
  • Olivier Fourdan's avatar
    xwayland: Clean up all frame callbacks · 3b4671f9
    Olivier Fourdan authored
    
    
    Regardless of the order we un-realize windows.
    
    Suggested-by: default avatarRoman Gilg <subdiff@gmail.com>
    Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: default avatarRoman Gilg <subdiff@gmail.com>
    3b4671f9
  • Lyude Paul's avatar
    meson: Ensure we always build Xext/hashtable.c for glx · 4e28a6a2
    Lyude Paul authored
    
    
    Seems that while glxvnd relies on some of the hashtable functions in
    Xext, we only build hashtable support for Xext if we're also building
    the res extension. This leads to some errors if you try to build glx
    without res enabled:
    
    glx/liblibglxvnd.a(vndcmds.c.o): In function `LookupVendorPrivDispatch':
    /home/lyudess/Projects/xserver/glx/vndcmds.c:65: undefined reference to `ht_find'
    /home/lyudess/Projects/xserver/glx/vndcmds.c:67: undefined reference to `ht_add'
    glx/liblibglxvnd.a(vndcmds.c.o): In function `GlxDispatchInit':
    /home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_generic_compare'
    /home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_generic_hash'
    /home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_create'
    glx/liblibglxvnd.a(vndcmds.c.o): In function `GlxDispatchReset':
    /home/lyudess/Projects/xserver/glx/vndcmds.c:468: undefined reference to `ht_destroy'
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    
    So, make sure that hashtable.c gets both for both glx and res
    
    Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
    Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
    4e28a6a2
  • Lyude Paul's avatar
    meson: Fix indenting in glx/meson.build · fe4d1876
    Lyude Paul authored
    
    
    No functional changes, just fixing a tabs vs. space error I noticed
    
    Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
    Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
    fe4d1876
  • Mario Kleiner's avatar
    modesetting: Only use modifiers on kms drivers which do support them. · e29d7832
    Mario Kleiner authored
    
    
    Use the DRM_CAP_ADDFB2_MODIFIERS query to make sure the kms
    driver supports modifiers in the addfb2 ioctl, and fall back
    to addfb ioctl without modifiers if modifiers are unsupported.
    
    E.g., as of Linux 4.17, nouveau-kms so far does not suppport
    modifiers and gets angry if drmModeAddFB2WithModifiers() is
    called (-> failure to set a video mode -> blank screen), but
    Mesa's nvc0+ gallium driver causes gbm_bo_get_modifier() to
    return a valid modifier by translating the default tiling of
    bo's created via gbm_bo_create() into a modifier other than
    DRM_FORMAT_MOD_INVALID (see Mesa's nvc0_miptree_get_modifier()).
    
    Testing for != DRM_FORMAT_MOD_INVALID is apparently not
    sufficient for safe use of drmModeAddFB2WithModifiers.
    
    Bonus: Handle potential failure of populate_format_modifiers().
    
    The required DRM_CAP is defined since libdrm v2.4.65, and we
    require v2.4.89+ for the server, so we can use it unconditionally.
    
    Tested on intel-kms, radeon-kms, nouveau-kms. Fixes failure on
    NVidia Pascal.
    
    Fixes: 2f807c23 ("modesetting: Add support for multi-plane pixmaps when page-flipping")
    Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
    Cc: Daniel Stone <daniels@collabora.com>
    Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
    Reviewed-by: default avatarLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
    e29d7832
  • Thomas Klausner's avatar
    sdksyms: Cope with __pid_t and __uint32_t · 82759039
    Thomas Klausner authored
    
    
    Kludge sdksyms.c generator to not fail on GetClientPid.
    It returns pid_t which on NetBSD is #define pid_t __pid_t
    This slightly alters the GCC preprocessor output which this fragile
    code could not deal with when using GCC 5+
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    82759039
  • Adam Jackson's avatar
    animcur: Fix crash when removing a master device · 9d5af632
    Adam Jackson authored
    Reproducer:
    
    $ Xvfb -ac -noreset :1 &
    $ DISPLAY=:1 xinput create-master touch1
    $ DISPLAY=:1 xinput remove-master "touch1 pointer"
    
    Bugzilla: https://bugs.freedesktop.org/105761
    
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    Reviewed-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    9d5af632
  • Adam Jackson's avatar
    dix: Factor out extension availability check · 73a1cb9c
    Adam Jackson authored
    
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    73a1cb9c
  • Adam Jackson's avatar
    dix: Allow an extension to disable itself · fc25bceb
    Adam Jackson authored
    
    
    GLX registers an extension before we know if there are any screens that
    can actually do it. It's inconvenient to shrink the extension list, so
    instead allow the extension to simply zero out its base opcode to
    indicate that it needed to panic and disable itself.
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    fc25bceb
  • Adam Jackson's avatar
    818885e6
  • Adam Jackson's avatar
    glx: Require depth > 12 for GLX visuals · 79a71375
    Adam Jackson authored
    
    
    fb is happy to do TrueColor to 8bpp drawables, but mesa is not. Depth 12
    is the biggest pseudocolor anyone ever really did, and 15 is the least
    truecolor.
    
    Without this Xvfb at depth 8 would "have" GLX, but no vendors
    would actually back any of the screens. libGL will attempt to call
    GLXQueryServerString to figure out the GLX version, and vnd will throw
    an error because there's no vendor to dispatch that to, and then clients
    crash.
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    79a71375
  • Adam Jackson's avatar
    vfb: Fix man page in re depth · d2d664df
    Adam Jackson authored
    
    
    32 is not a valid depth, and the default is now 24 not 8.
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    Reviewed-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
    d2d664df
  • Lyude Paul's avatar
    xwayland: Decouple GBM from glamor · 1545e2db
    Lyude Paul authored
    
    
    This takes all of the gbm related code in wayland-glamor.c and moves it
    into it's own EGL backend for Xwayland, xwayland-glamor-gbm.c.
    Additionally, we add the egl_backend struct into xwl_screen in order to
    provide hooks for alternative EGL backends such as nvidia's EGLStreams.
    
    Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
    Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
    Reviewed-by: default avatarDaniel Stone <daniels@collabora.com>
    Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
    1545e2db
  • Lyude Paul's avatar
    xwayland: Add xwayland-config.h · 994f7810
    Lyude Paul authored
    
    
    Just a small autogenerated header that will soon contain more then just
    one macro.
    
    Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
    Reviewed-by: default avatarDaniel Stone <daniels@collabora.com>
    Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
    994f7810
  • Lyude Paul's avatar
    xwayland: Add glamor egl_backend for EGLStreams · 54ac0971
    Lyude Paul authored
    
    
    This adds initial support for displaying Xwayland applications through
    the use of EGLStreams and nvidia's custom wayland protocol by adding
    another egl_backend driver. This also adds some additional egl_backend
    hooks that are required to make things work properly.
    
    EGLStreams work a lot differently then the traditional way of handling
    buffers with wayland. Unfortunately, there are also a LOT of various
    pitfalls baked into it's design that need to be explained.
    
    This has a very large and unfortunate implication: direct rendering is,
    for the time being at least, impossible to do through EGLStreams. The
    main reason being that the EGLStream spec mandates that we lose the
    entire color buffer contents with each eglSwapBuffers(), which goes
    against X's requirement of not losing data with pixmaps.  no way to use
    an allocated EGLSurface as the storage for glamor rendering like we do
    with GBM, we have to rely on blitting each pixmap to it's respective
    EGLSurface producer each frame. In order to pull this off, we add two
    different additional egl_backend hooks that GBM opts out of
    implementing:
    
    - egl_backend.allow_commits for holding off displaying any EGLStream
      backed pixmaps until the point where it's stream is completely
      initialized and ready for use
    - egl_backend.post_damage for blitting the content of the EGLStream
      surface producer before Xwayland actually damages and commits the
      wl_surface to the screen.
    
    The other big pitfall here is that using nvidia's wayland-eglstreams
    helper library is also not possible for the most part. All of it's API
    for creating and destroying streams rely on being able to perform a
    roundtrip in order to bring each stream to completion since the wayland
    compositor must perform it's job of connecting a consumer to each
    EGLstream. Because Xwayland has to potentially handle both responding to
    the wayland compositor and it's own X clients, the situation of the
    wayland compositor being one of our X clients must be considered. If we
    perform a roundtrip with the Wayland compositor, it's possible that the
    wayland compositor might currently be connected to us as an X client and
    thus hang while both Xwayland and the wayland compositor await responses
    from eachother. To avoid this, we work directly with the wayland
    protocol and use wl_display_sync() events along with release() events to
    set up and destroy EGLStreams asynchronously alongside handling X
    clients.
    
    Additionally, since setting up EGLStreams is not an atomic operation we
    have to take into consideration the fact that an EGLStream can
    potentially be created in response to a window resize, then immediately
    deleted due to another pending window resize in the same X client's
    pending reqests before Xwayland hits the part of it's event loop where
    we read from the wayland compositor. To make this even more painful, we
    also have to take into consideration that since EGLStreams are not
    atomic that it's possible we could delete wayland resources for an
    EGLStream before the compositor even finishes using them and thus run
    into errors. So, we use quite a bit of tracking logic to keep EGLStream
    objects alive until we know the compositor isn't using them (even if
    this means the stream outlives the pixmap it backed).
    
    While the default backend for glamor remains GBM, this patch exists for
    users who have had to deal with the reprecussion of their GPU
    manufacturers ignoring the advice of upstream and the standardization of
    GBM across most major GPU manufacturers. It is not intended to be a
    final solution to the GBM debate, but merely a baindaid so our users
    don't have to suffer from the consequences of companies avoiding working
    upstream. New drivers are strongly encouraged not to use this as a
    backend, and use GBM like everyone else. We even spit this out as an
    error from Xwayland when using the eglstream backend.
    
    Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
    Acked-by: default avatarDaniel Stone <daniels@collabora.com>
    Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
    54ac0971
  • Daniel Stone's avatar
    dri3: Don't call vfuncs on old DRI3 screens · c593d843
    Daniel Stone authored
    
    
    Only call the get_supported_modifiers vfunc if the DRI3 screen struct is
    sufficiently new.
    
    Signed-off-by: default avatarDaniel Stone <daniels@collabora.com>
    Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
    c593d843
  • Adam Jackson's avatar
    xserver 1.20 RC5 · c6ab2102
    Adam Jackson authored
    
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    c6ab2102
......@@ -23,8 +23,12 @@ if build_mitshm
hdrs_xext += ['shmint.h']
endif
if build_hashtable
srcs_xext += 'hashtable.c'
endif
if build_res
srcs_xext += ['hashtable.c', 'xres.c']
srcs_xext += 'xres.c'
endif
if build_screensaver
......
......@@ -26,9 +26,9 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.60)
AC_INIT([xorg-server], 1.19.99.904, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="2018-04-10"
RELEASE_NAME="Stuffed Morel"
AC_INIT([xorg-server], 1.19.99.905, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="2018-04-24"
RELEASE_NAME="Chicken Paprikash"
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
......@@ -67,6 +67,8 @@ dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs.
AC_CONFIG_HEADERS(include/xkb-config.h)
dnl xwin-config.h covers the XWin DDX.
AC_CONFIG_HEADERS(include/xwin-config.h)
dnl xwayland-config.h covers Xwayland.
AC_CONFIG_HEADERS(include/xwayland-config.h)
dnl version-config.h covers the version numbers so they can be bumped without
dnl forcing an entire recompile.x
AC_CONFIG_HEADERS(include/version-config.h)
......@@ -588,6 +590,7 @@ AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server
AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
AC_ARG_ENABLE(xwayland, AS_HELP_STRING([--enable-xwayland], [Build Xwayland server (default: auto)]), [XWAYLAND=$enableval], [XWAYLAND=auto])
AC_ARG_ENABLE(xwayland-eglstream, AS_HELP_STRING([--enable-xwayland-eglstream], [Build Xwayland eglstream support (default: no)]), [XWAYLAND_EGLSTREAM=$enableval], [XWAYLAND_EGLSTREAM=no])
AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no])
AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
AC_ARG_ENABLE(glamor, AS_HELP_STRING([--enable-glamor], [Build glamor dix module (default: auto)]), [GLAMOR=$enableval], [GLAMOR=auto])
......@@ -2378,6 +2381,33 @@ if test "x$XWAYLAND" = xyes; then
AC_MSG_ERROR([Xwayland build explicitly requested, but required modules not found.])
fi
if test "x$GLAMOR" = xyes && test "x$GBM" = xyes; then
AC_DEFINE(XWL_HAS_GLAMOR, 1,
[Build xwayland with glamor support])
fi
PKG_CHECK_MODULES(WAYLAND_EGLSTREAM, [wayland-eglstream-protocols >= 1.0.2], [have_wl_eglstream=yes], [have_wl_eglstream=no])
if test "x$XWAYLAND_EGLSTREAM" = xauto; then
if test "x$have_wl_eglstream" = xyes && test "x$GLAMOR" = xyes; then
XWAYLAND_EGLSTREAM=yes
fi
fi
if test "x$XWAYLAND_EGLSTREAM" = xyes; then
if test "x$GLAMOR" != xyes; then
AC_MSG_ERROR([Xwayland eglstream support explicitly requested, but required modules not found.])
fi
if test "x$have_wl_eglstream" = xno; then
AC_MSG_ERROR([Xwayland eglstream support requires wayland-eglstream-protocols >= 1.0.2])
fi
AC_SUBST(WAYLAND_EGLSTREAM_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-eglstream-protocols`)
AC_DEFINE(XWL_HAS_EGLSTREAM, 1,
[Build xwayland with eglstream support])
fi
XWAYLAND_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB"
XWAYLAND_SYS_LIBS="$XWAYLANDMODULES_LIBS $GLX_SYS_LIBS"
AC_SUBST([XWAYLAND_LIBS])
......@@ -2387,9 +2417,11 @@ if test "x$XWAYLAND" = xyes; then
AC_MSG_ERROR([Xwayland requires CLOCK_MONOTONIC support.])
fi
WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
[${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
if test "x$WAYLAND_SCANNER" = x; then
PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])
AC_SUBST(WAYLAND_SCANNER, `$PKG_CONFIG --variable=wayland_scanner wayland-scanner`)
fi
PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner >= 1.14.91],
AC_SUBST(SCANNER_ARG, 'private-code'),
......@@ -2397,6 +2429,7 @@ if test "x$XWAYLAND" = xyes; then
AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
fi
AM_CONDITIONAL(XWAYLAND_EGLSTREAM, [test "x$XWAYLAND_EGLSTREAM" = "xyes"])
dnl and the rest of these are generic, so they're in config.h
......
......@@ -210,6 +210,16 @@ CloseDownExtensions(void)
lastError = FirstExtensionError;
}
static Bool
ExtensionAvailable(ClientPtr client, ExtensionEntry *ext)
{
if (XaceHook(XACE_EXT_ACCESS, client, ext) != Success)
return FALSE;
if (!ext->base)
return FALSE;
return TRUE;
}
int
ProcQueryExtension(ClientPtr client)
{
......@@ -231,7 +241,7 @@ ProcQueryExtension(ClientPtr client)
reply.present = xFalse;
else {
i = FindExtension((char *) &stuff[1], stuff->nbytes);
if (i < 0 || XaceHook(XACE_EXT_ACCESS, client, extensions[i]))
if (i < 0 || !ExtensionAvailable(client, extensions[i]))
reply.present = xFalse;
else {
reply.present = xTrue;
......@@ -266,7 +276,7 @@ ProcListExtensions(ClientPtr client)
for (i = 0; i < NumExtensions; i++) {
/* call callbacks to find out whether to show extension */
if (XaceHook(XACE_EXT_ACCESS, client, extensions[i]) != Success)
if (!ExtensionAvailable(client, extensions[i]))
continue;
total_length += strlen(extensions[i]->name) + 1;
......@@ -279,7 +289,7 @@ ProcListExtensions(ClientPtr client)
for (i = 0; i < NumExtensions; i++) {
int len;
if (XaceHook(XACE_EXT_ACCESS, client, extensions[i]) != Success)
if (!ExtensionAvailable(client, extensions[i]))
continue;
*bufptr++ = len = strlen(extensions[i]->name);
......
......@@ -481,7 +481,7 @@ proc_dri3_buffers_from_pixmap(ClientPtr client)
int i;
PixmapPtr pixmap;
REQUEST_SIZE_MATCH(xDRI3BufferFromPixmapReq);
REQUEST_SIZE_MATCH(xDRI3BuffersFromPixmapReq);
rc = dixLookupResourceByType((void **) &pixmap, stuff->pixmap, RT_PIXMAP,
client, DixWriteAccess);
if (rc != Success) {
......@@ -497,6 +497,8 @@ proc_dri3_buffers_from_pixmap(ClientPtr client)
rep.length = bytes_to_int32(num_fds * 2 * sizeof(CARD32));
rep.width = pixmap->drawable.width;
rep.height = pixmap->drawable.height;
rep.depth = pixmap->drawable.depth;
rep.bpp = pixmap->drawable.bitsPerPixel;
rep.modifier = modifier;
if (client->swapped) {
......
......@@ -171,7 +171,7 @@ cache_formats_and_modifiers(ScreenPtr screen)
if (!info)
return BadImplementation;
if (!info->get_formats || !info->get_modifiers) {
if (info->version < 2 || !info->get_formats || !info->get_modifiers) {
ds->formats = NULL;
ds->num_formats = 0;
ds->formats_cached = TRUE;
......
......@@ -210,6 +210,7 @@ glamor_xv_query_image_attributes(int id,
switch (id) {
case FOURCC_YV12:
case FOURCC_I420:
*w = ALIGN(*w, 2);
*h = ALIGN(*h, 2);
size = ALIGN(*w, 4);
if (pitches)
......
......@@ -289,8 +289,9 @@ checkScreenVisuals(void)
for (i = 0; i < screenInfo.numScreens; i++) {
ScreenPtr screen = screenInfo.screens[i];
for (j = 0; j < screen->numVisuals; j++) {
if (screen->visuals[j].class == TrueColor ||
screen->visuals[j].class == DirectColor)
if ((screen->visuals[j].class == TrueColor ||
screen->visuals[j].class == DirectColor) &&
screen->visuals[j].nplanes > 12)
return TRUE;
}
}
......
......@@ -472,6 +472,8 @@ void GlxDispatchReset(void)
int GlxDispatchRequest(ClientPtr client)
{
REQUEST(xReq);
if (GlxExtensionEntry->base == 0)
return BadRequest;
if (stuff->data < OPCODE_ARRAY_LEN) {
if (dispatchFuncs[stuff->data] == NULL) {
// Try to find a dispatch stub.
......
......@@ -39,6 +39,7 @@
#include <GL/glxproto.h>
#include "vndservervendor.h"
ExtensionEntry *GlxExtensionEntry;
int GlxErrorBase = 0;
static CallbackListRec vndInitCallbackList;
static CallbackListPtr vndInitCallbackListPtr = &vndInitCallbackList;
......@@ -202,6 +203,7 @@ void
GlxExtensionInit(void)
{
ExtensionEntry *extEntry;
GlxExtensionEntry = NULL;
// Init private keys, per-screen data
if (!dixRegisterPrivateKey(&glvXGLVScreenPrivKey, PRIVATE_SCREEN, 0))
......@@ -228,8 +230,15 @@ GlxExtensionInit(void)
return;
}
GlxExtensionEntry = extEntry;
GlxErrorBase = extEntry->errorBase;
CallCallbacks(&vndInitCallbackListPtr, extEntry);
/* We'd better have found at least one vendor */
for (int i = 0; i < screenInfo.numScreens; i++)
if (GlxGetVendorForScreen(serverClient, screenInfo.screens[i]))
return;
extEntry->base = 0;
}
static int
......
......@@ -62,9 +62,7 @@ typedef struct GlxClientPrivRec {
extern int GlxErrorBase;
extern RESTYPE idResource;
// Defined in glxext.c.
const ExtensionEntry *GlxGetExtensionEntry(void);
extern ExtensionEntry *GlxExtensionEntry;
Bool GlxDispatchInit(void);
void GlxDispatchReset(void);
......
......@@ -55,7 +55,7 @@ manual page, \fIXvfb\fP accepts the following command line switches:
.B "\-screen \fIscreennum\fP \fIWxHxD\fP"
This option creates screen \fIscreennum\fP and sets its width, height,
and depth to W, H, and D respectively. By default, only screen 0 exists
and has the dimensions 1280x1024x8.
and has the dimensions 1280x1024x24.
.TP 4
.B "\-pixdepths \fIlist-of-depths\fP"
This option specifies a list of pixmap depths that the server should
......@@ -100,18 +100,17 @@ snapshot can be done with a file copy command, and the resulting
snapshot will even contain the cursor image.
.SH EXAMPLES
.TP 8
Xvfb :1 -screen 0 1600x1200x32
Xvfb :1 -screen 0 1600x1200x24
The server will listen for connections as server number 1, and screen 0
will be depth 32 1600x1200.
will be depth 24 1600x1200.
.TP 8
Xvfb :1 -screen 1 1600x1200x16
The server will listen for connections as server number 1, will have the
default screen configuration (one screen, 1280x1024x8), and screen 1
will be depth 16 1600x1200.
The server will listen for connections as server number 1, screen 0 will have the
default screen configuration (1280x1024x24), and screen 1 will be depth 16 1600x1200.
.TP 8
Xvfb -pixdepths 3 27 -fbdir /var/tmp
The server will listen for connections as server number 0, will have the
default screen configuration (one screen, 1280x1024x8),
default screen configuration (one screen, 1280x1024x24),
will also support pixmap
depths of 3 and 27,
and will use memory mapped files in /var/tmp for the framebuffer.
......
......@@ -749,7 +749,7 @@ ms_dri2_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc,
target_msc = current_msc;
ret = ms_queue_vblank(crtc, MS_QUEUE_ABSOLUTE, target_msc, &queued_msc, seq);
if (ret) {
if (!ret) {
static int limit = 5;
if (limit) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
......
......@@ -1018,6 +1018,11 @@ PreInit(ScrnInfoPtr pScrn, int flags)
ret |= drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1);
ms->atomic_modeset = (ret == 0);
ms->kms_has_modifiers = FALSE;
ret = drmGetCap(ms->fd, DRM_CAP_ADDFB2_MODIFIERS, &value);
if (ret == 0 && value != 0)
ms->kms_has_modifiers = TRUE;
if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS setup failed\n");
goto fail;
......
......@@ -117,6 +117,8 @@ typedef struct _modesettingRec {
Bool has_queue_sequence;
Bool tried_queue_sequence;
Bool kms_has_modifiers;
} modesettingRec, *modesettingPtr;
#define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate))
......
......@@ -954,7 +954,8 @@ drmmode_bo_import(drmmode_ptr drmmode, drmmode_bo *bo,
uint32_t *fb_id)
{
#ifdef GBM_BO_WITH_MODIFIERS
if (bo->gbm &&
modesettingPtr ms = modesettingPTR(drmmode->scrn);
if (bo->gbm && ms->kms_has_modifiers &&
gbm_bo_get_modifier(bo->gbm) != DRM_FORMAT_MOD_INVALID) {
int num_fds;
......@@ -998,6 +999,11 @@ static Bool
drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo,
unsigned width, unsigned height, unsigned bpp)
{
bo->width = width;
bo->height = height;
#ifdef GLAMOR_HAS_GBM
if (drmmode->glamor) {
uint32_t format;
if (drmmode->scrn->depth == 30)
......@@ -1005,11 +1011,6 @@ drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo,
else
format = GBM_FORMAT_ARGB8888;
bo->width = width;
bo->height = height;
#ifdef GLAMOR_HAS_GBM
if (drmmode->glamor) {
#ifdef GBM_BO_WITH_MODIFIERS
uint32_t num_modifiers;
uint64_t *modifiers = NULL;
......@@ -1974,6 +1975,9 @@ populate_format_modifiers(xf86CrtcPtr crtc, const drmModePlane *kplane,
uint32_t *blob_formats;
struct drm_format_modifier *blob_modifiers;
if (!blob_id)
return FALSE;
blob = drmModeGetPropertyBlob(drmmode->fd, blob_id);
if (!blob)
return FALSE;
......@@ -1988,7 +1992,6 @@ populate_format_modifiers(xf86CrtcPtr crtc, const drmModePlane *kplane,
uint32_t num_modifiers = 0;
uint64_t *modifiers = NULL;
uint64_t *tmp;
for (j = 0; j < fmt_mod_blob->count_modifiers; j++) {
struct drm_format_modifier *mod = &blob_modifiers[j];
......@@ -2147,11 +2150,7 @@ drmmode_crtc_create_planes(xf86CrtcPtr crtc, int num)
drmmode_crtc->num_formats = best_kplane->count_formats;
drmmode_crtc->formats = calloc(sizeof(drmmode_format_rec),
best_kplane->count_formats);
if (blob_id) {
populate_format_modifiers(crtc, best_kplane, blob_id);
}
else
{
if (!populate_format_modifiers(crtc, best_kplane, blob_id)) {
for (i = 0; i < best_kplane->count_formats; i++)
drmmode_crtc->formats[i].format = best_kplane->formats[i];
}
......
......@@ -373,6 +373,17 @@ BEGIN {
n = 1;
}
}
# hack: pid_t becomes __pid_t on NetBSD, same for uint32_t -> __uint32_t.
# GCC 5 inserts additional lines around this.
if (($1 == "__pid_t" || $1 == "__uint32_t") && NF == 1) {
getline;
n++;
# skip line numbers GCC 5 adds (after typedef return type?)
while ($n == "" || $0 ~ /^# [0-9]+ "/) {
getline;
n = 1;
}
}
# type specifier may not be set, as in
# extern _X_EXPORT unsigned name(...)
......@@ -415,6 +426,7 @@ BEGIN {
sub(/[^a-zA-Z0-9_].*/, "", symbol);
#print;
if (symbol != "")
printf(" (void *) &%-50s /* %s:%s */\n", symbol ",", header, line);
}
}
......
......@@ -11,7 +11,6 @@ Xwayland_CFLAGS = \
Xwayland_SOURCES = \
xwayland.c \
xwayland-present.c \
xwayland-input.c \
xwayland-cursor.c \
xwayland-shm.c \
......@@ -35,12 +34,19 @@ Xwayland_built_sources =
if GLAMOR_EGL
Xwayland_SOURCES += \
xwayland-glamor.c
xwayland-glamor.c \
xwayland-glamor-gbm.c \
xwayland-present.c
if XV
Xwayland_SOURCES += \
xwayland-glamor-xv.c
endif
if XWAYLAND_EGLSTREAM
Xwayland_SOURCES += \
xwayland-glamor-eglstream.c
endif
glamor_built_sources = \
drm-client-protocol.h \
drm-protocol.c
......@@ -67,12 +73,19 @@ Xwayland_built_sources += \
linux-dmabuf-unstable-v1-client-protocol.h \
linux-dmabuf-unstable-v1-protocol.c
if XWAYLAND_EGLSTREAM
Xwayland_built_sources += \
wayland-eglstream-client-protocol.h \
wayland-eglstream-protocol.c \
wayland-eglstream-controller-client-protocol.h \
wayland-eglstream-controller-protocol.c
endif
nodist_Xwayland_SOURCES = $(Xwayland_built_sources)
CLEANFILES = $(Xwayland_built_sources)
EXTRA_DIST = drm.xml
$(Xwayland_SOURCES): $(Xwayland_built_sources)
relink:
......@@ -107,6 +120,16 @@ linux-dmabuf-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linu
linux-dmabuf-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
wayland-eglstream-client-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
wayland-eglstream-controller-client-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream-controller.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
wayland-eglstream-protocol.c : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
wayland-eglstream-controller-protocol.c : $(WAYLAND_EGLSTREAM_DATADIR)/wayland-eglstream-controller.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
%-protocol.c : %.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@
......
srcs = [
'xwayland.c',
'xwayland-present.c',
'xwayland-input.c',
'xwayland-cursor.c',
'xwayland-shm.c',
......@@ -52,8 +51,25 @@ srcs += code.process(xdg_output_xml)
srcs += code.process(dmabuf_xml)
xwayland_glamor = []
if gbm_dep.found()
eglstream_srcs = []
if build_glamor
srcs += 'xwayland-glamor.c'
if gbm_dep.found()
srcs += 'xwayland-glamor-gbm.c'
endif
if build_eglstream
eglstream_protodir = eglstream_dep.get_pkgconfig_variable('pkgdatadir')
eglstream_xml = join_paths(eglstream_protodir, 'wayland-eglstream.xml')
eglstream_controller_xml = join_paths(eglstream_protodir, 'wayland-eglstream-controller.xml')
srcs += client_header.process(eglstream_xml)
srcs += client_header.process(eglstream_controller_xml)
srcs += code.process(eglstream_xml)
srcs += code.process(eglstream_controller_xml)
srcs += 'xwayland-glamor-eglstream.c'
endif
srcs += 'xwayland-present.c'
if build_xv
srcs += 'xwayland-glamor-xv.c'
endif
......
This diff is collapsed.