1. 01 Sep, 2021 2 commits
    • Mario Kleiner's avatar
      Revert "glamor: Enable modifier support for xfree86 too" · 7c63c582
      Mario Kleiner authored and Povilas Kanapickas's avatar Povilas Kanapickas committed
      This reverts commit 9b899941.
      
      Turns out that defaulting glamor_egl->dmabuf_capable = TRUE
      breaks kms page-flipping on various Mesa+Linux/DRM-KMS+hardware
      combos, resulting in broken presentation timing, degraded performance
      and awful tearing. E.g., my testing shows that X-Server master +
      Mesa 21.2 + Linux 5.3 on Intel Kabylake has broken pageflipping.
      Similar behaviour was observed in the past on RaspberryPi 4/400
      with VideoCore-6 by myself and others, and iirc by myself on some
      AMD gpu's, although my memories of the latter are a bit dim.
      
      Cfe. mesa/mesa#3601 and
      possibly !254
      
      
      for related problems.
      
      The reason for pageflip failure on the modesetting-ddx under
      DRI3/Present seems to be the following sequence:
      
      1. Atomic modesetting for the modesetting-ddx is broken and therefore
         both disabled by default in the modesetting-ddx itself and also
         force-disabled by the Linux kernel since quite a while. If the kernel
         detects drmSetClientCap(fd, DRM_CLIENT_CAP_ATOMIC, 1); from the
         X-Server, it will reject the request, as a countermeasure to all the
         past and current brokeness.
      
      2. Without DRM_CLIENT_CAP_ATOMIC we don't get the implied universal
         planes support (DRM_CLIENT_CAP_UNIVERSAL_PLANES).
      
      3. Without DRM_CLIENT_CAP_UNIVERSAL_PLANES, drmModeGetPlaneResources()
         will only return overlay planes, but not primary- or cursor planes.
      
      4. As modesetting-ddx drmmode_crtc_create_planes() function can only
         operate on primary planes, but can't get any from drmModeGetPlaneResources(),
         the drmmode_crtc_create_planes() mostly turns into a no-op, never
         executes populate_format_modifiers() and therefore the Linux kernels
         DRM-KMS driver is not ever queried for the list of scanout/pageflip
         capable DRM format modifiers. Iow. the drmmode_crtc->formats[i].modifiers
         list stays empty with zero drmmode_crtc->formats[i].num_modifiers.
      
      5. The list from step 4 provides the format+modifiers for intersection
         which would get returned by the X-Servers DRI3 backend as response to
         a xcb_dri3_get_supported_modifiers_window_modifiers() request. Given
         an empty list was returned in step 4, this will lead to return of an
         empty modifiers list by xcb_dri3_get_supported_modifiers_window_modifiers().
      
      6. Both Mesa's DRI3/Present OpenGL backbuffer allocation logic and iirc
         Mesa/Vulkan/WSI/X11's swapchain image allocation logic use the list
         from xcb_dri3_get_supported_modifiers_window_modifiers() for format+
         modifier selection for scanout/pageflip capable buffers. Cfe. Mesa's
         dri3_alloc_render_buffer() function.
      
         Due to the empty list, the Mesa code falls back to the format+modifiers
         reported by xcb_dri3_get_supported_modifiers_screen_modifiers()
         instead. This list contains all modifiers reported by GLAMOR as
         result of glamor_get_formats() and glamor_get_modifiers(), which
         in turn are query results from Mesa eglQueryDmaBufFormatsEXT()
         and eglQueryDmaBufModifiersEXT(). Iow. all format+modifiers which
         are supported for rendering are considered for the OpenGL backbuffers
         and Vulkan swapchain buffers.
      
      7. Depending on kms driver + gpu combo and Mesa version, such buffers
         are often not direct-scanout / pageflip capable, and so pageflipping
         can't be used for DRI3/Present of fullscreen windows. Whenever the
         system has to fallback to copies instead of pageflips, the results
         are broken presentation timing, degraded performance and quite
         horrible tearing, as the current DRI3/Present implementation does not
         perform any hardware synchronization of copy presents to the start
         of vblank or similar.
      
      By defaulting glamor_egl->dmabuf_capable = FALSE instead, as the server
      1.20 branch does, we avoid this failure:
      
      1. glamor_get_modifiers() turns into a no-op and returns false, not
         reporting any supported dmabuf modifiers to the servers DRI3 code,
         ie. the servers cache_formats_and_modifiers() function can't retrieve
         and cache any format+modifiers. Therefore the servers DRI3 code now
         also reports an empty format+modifiers list when Mesa does a
         xcb_dri3_get_supported_modifiers_screen_modifiers() query.
      
      2. Mesa's buffer allocation code therefore falls back to using the old
         DRI image extensions createImage() function to allocate buffers
         with use flags __DRI_IMAGE_USE_SCANOUT | __DRI_IMAGE_USE_BACKBUFFER
         and our OpenGL backbuffers / Vulkan swapchain images get allocated
         in a direct-scanout / pageflip capable format. Pageflipping works,
         timing and performance is good, presentation is tear-free.
      
      Please consider merging this for branching the X-Server 1.21 branch.
      Signed-off-by: Mario Kleiner's avatarMario Kleiner <mario.kleiner.de@gmail.com>
      7c63c582
    • Jon Turney's avatar
      Don't underlink inputtest on targets which require complete linkage · c5a9287d
      Jon Turney authored
      Don't underlink inputtest on targets which require complete linkage
      (e.g. when building for PE/COFF)
      c5a9287d
  2. 31 Aug, 2021 1 commit
    • Jon Turney's avatar
      Fix compilation with windows.h from latest w32api · d68b50ec
      Jon Turney authored
      misc.h has complex logic (checking MAXSHORT is undefined etc.)
      controlling if it includes assert.h or not.
      
      Including windows.h from w32api 9.0.0 now trips over that, causing
      assert.h to not be included, causing various errors, e.g.
      
      In file included from ../include/cursor.h:53,
                       from ../include/dix.h:54,
                       from ../os/osdep.h:139,
                       from ../hw/xwin/winauth.c:40:
      ../include/privates.h: In function ‘dixGetPrivateAddr’:
      ../include/privates.h:121:5: error: implicit declaration of function ‘assert’ [-Werror=implicit-function-declaration]
      
      Fix this by IWYU in privates.h
      d68b50ec
  3. 27 Aug, 2021 1 commit
    • Mario Kleiner's avatar
      modesetting: Fix VRR window property handling. · ab86be0e
      Mario Kleiner authored
      
      
      A misplaced error check can cause this failure scenario, and does
      so reliably as tested on Ubuntu 21.04 with KDE Plasma 5 desktop
      within the first few seconds of login session startup, rendering
      VRR under modesetting-ddx unusable:
      
      1. Some X11 client application changes some window property.
      
      2. ms_change_property() is called as part of the property change
         handling call chain (client->requestVector[X_ChangeProperty]).
         It removes itself temporarily from the call chain - or so it
         thinks, hooking up saved_change_property instead.
      
      3. ret = saved_change_property(client) is called and fails
         temporarily for some non-critical reason.
      
      4. The misplaced error check returns early (error abort), without
         first restoring ms_change_property() as initial X_ChangeProperty
         handler in the call chain again.
      
      -> Now ms_change_property() has removed itself permanently from the
         property handler call chain for the remainder of the X session
         and VRR property changes on windows are no longer handled, ie.
         VRR no longer gets enabled/disabled in response to window VRR
         property changes.
      
      Place the error check at the proper place, just as it is correctly
      done by amdgpu-ddx, and in modesetting-ddx ms_delete_property()
      function.
      
      Verified to fix VRR handling with an AMD gpu under KDE desktop
      session.
      
      Please consider merging before branching the server 1.21 branch.
      Signed-off-by: Mario Kleiner's avatarMario Kleiner <mario.kleiner.de@gmail.com>
      ab86be0e
  4. 20 Aug, 2021 2 commits
  5. 17 Aug, 2021 4 commits
    • Adam Jackson's avatar
      dmx: Fix some redeclaration warnings from gcc 11 · 1f720dc9
      Adam Jackson authored
      Of the form:
      
          ../hw/dmx/config/xdmxconfig.c:68:26: warning: redundant redeclaration of ‘dmxConfigEntry’ [-Wredundant-decls]
             68 | extern DMXConfigEntryPtr dmxConfigEntry;
                |                          ^~~~~~~~~~~~~~
      1f720dc9
    • Adam Jackson's avatar
      xkb: Silence a warning from gcc 11 · b49f0f9b
      Adam Jackson authored
      I get this:
      
          In function ‘TryCopyStr’,
              inlined from ‘CopyISOLockArgs’ at ../xkb/xkbtext.c:875:9:
          ../xkb/xkbtext.c:720:13: warning: ‘tbuf’ may be used uninitialized [-Wmaybe-uninitialized]
            720 |             strcat(to, from);
                |             ^~~~~~~~~~~~~~~~
          ../xkb/xkbtext.c: In function ‘CopyISOLockArgs’:
          <built-in>: note: by argument 1 of type ‘const char *’ to ‘__builtin_strlen’ declared here
          ../xkb/xkbtext.c:871:10: note: ‘tbuf’ declared here
            871 |     char tbuf[64];
                |          ^~~~
      
      Just initialize tbuf so it definitely works.
      b49f0f9b
    • Adam Jackson's avatar
      xinput: Silence a warning from gcc 11 · c1138d8e
      Adam Jackson authored
      [45/388] Compiling C object Xi/liblibxserver_xi.a.p/xichangehierarchy.c.o
      ../Xi/xichangehierarchy.c:61:32: warning: argument 1 of type ‘int[256]’ with mismatched bound [-Warray-parameter=]
         61 | XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
            |                            ~~~~^~~~~~~~~~~~~~~~~
      In file included from ../Xi/xichangehierarchy.c:54:
      ../Xi/xichangehierarchy.h:42:37: note: previously declared as ‘int[]’
         42 | void XISendDeviceHierarchyEvent(int flags[]);
            |                                 ~~~~^~~~~~~
      c1138d8e
    • Adam Jackson's avatar
      selinux: Stop using security_context_t · f3a98334
      Adam Jackson authored
      This is apparently deprecated now and is and was always just char *.
      f3a98334
  6. 12 Aug, 2021 1 commit
  7. 08 Aug, 2021 1 commit
  8. 07 Aug, 2021 1 commit
  9. 06 Aug, 2021 7 commits
  10. 31 Jul, 2021 1 commit
  11. 30 Jul, 2021 4 commits
  12. 29 Jul, 2021 1 commit
    • Boris-Barboris's avatar
      Don't hardcode fps for fake screen · 16571b89
      Boris-Barboris authored and Povilas Kanapickas's avatar Povilas Kanapickas committed
      
      
      Currently, when main hardware screen is powered-off,
      X server initializes fake screen's timer with
      1 second update interval.
      
      Streaming software like Nomachine or Vnc, as well as
      desktop input automation suffers from it, since it
      will forever be stuck on 1 fps until the display is
      turned back on.
      
      This commit adds command line option -fakescreenfps <int>
      that allows the user to change the default fake screen
      timer.
      Signed-off-by: Boris-Barboris's avatarBaranin Alexander <ismailsiege@gmail.com>
      16571b89
  13. 22 Jul, 2021 1 commit
  14. 20 Jul, 2021 1 commit
  15. 09 Jul, 2021 12 commits