1. 14 Jan, 2020 1 commit
  2. 13 Jan, 2020 9 commits
  3. 09 Jan, 2020 1 commit
  4. 18 Dec, 2019 4 commits
  5. 05 Dec, 2019 1 commit
    • Kenneth Graunke's avatar
      modesetting: Use EGL_MESA_query_driver to select DRI driver if possible · 255d8c3c
      Kenneth Graunke authored
      We now ask Glamor to use EGL_MESA_query_driver to obtain the DRI driver
      name; if successful, we use that as the DRI driver name.  Following the
      existing dri2.c logic, we also use the same name for the VDPAU driver,
      except for i965 (and now iris), where we switch to the "va_gl" fallback.
      This allows us to bypass the PCI ID lists in xserver and centralize the
      driver selection mechanism inside Mesa.  The hope is that we no longer
      have to update these lists for any future hardware.
      (backported from commit 8d4be7f6
      Acked-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
  6. 27 Nov, 2019 1 commit
  7. 25 Nov, 2019 4 commits
  8. 22 Nov, 2019 2 commits
  9. 21 Nov, 2019 1 commit
  10. 20 Nov, 2019 1 commit
    • Aaron Plattner's avatar
      os: Don't crash in AttendClient if the client is gone · 2edadf26
      Aaron Plattner authored
      If a client is in the process of being closed down, then its client->osPrivate
      pointer will be set to NULL by CloseDownConnection. This can cause a crash if
      freeing the client's resources results in a call to AttendClient. For example,
      if the client has a pending sync fence:
       Thread 1 "X" received signal SIGSEGV, Segmentation fault.
       AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942
       (gdb) bt
       #0  AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942
       #1  0x00005571c3dbb865 in SyncAwaitTriggerFired (pTrigger=<optimized out>) at ../Xext/sync.c:694
       #2  0x00005571c3dd5749 in miSyncDestroyFence (pFence=0x5571c5063980) at ../miext/sync/misync.c:120
       #3  0x00005571c3dbbc69 in FreeFence (obj=<optimized out>, id=<optimized out>) at ../Xext/sync.c:1909
       #4  0x00005571c3d7a01d in doFreeResource (res=0x5571c506e3d0, skip=skip@entry=0) at ../dix/resource.c:880
       #5  0x00005571c3d7b1dc in FreeClientResources (client=0x5571c4aed9a0) at ../dix/resource.c:1146
       #6  FreeClientResources (client=0x5571c4aed9a0) at ../dix/resource.c:1109
       #7  0x00005571c3d5525f in CloseDownClient (client=0x5571c4aed9a0) at ../dix/dispatch.c:3473
       #8  0x00005571c3d55eeb in Dispatch () at ../dix/dispatch.c:492
       #9  0x00005571c3d59e96 in dix_main (argc=3, argv=0x7ffe7854bc28, envp=<optimized out>) at ../dix/main.c:276
       #10 0x00007fea4837cb6b in __libc_start_main (main=0x5571c3d1d060 <main>, argc=3, argv=0x7ffe7854bc28, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe7854bc18) at ../csu/libc-start.c:308
       #11 0x00005571c3d1d09a in _start () at ../Xext/sync.c:2378
       (gdb) print client->osPrivate
       $1 = (void *) 0x0
      Since the client is about to be freed, its ignore count doesn't matter and
      AttendClient can simply be a no-op. Check for client->clientGone in AttendClient
      and remove similar checks from two callers that had them.
      Signed-off-by: Aaron Plattner's avatarAaron Plattner <aplattner@nvidia.com>
      (cherry picked from commit 4308f5d3)
  11. 18 Nov, 2019 3 commits
    • Adam Jackson's avatar
      dix: Call SourceValidate before GetImage · 68cfee97
      Adam Jackson authored
      This ensures that any prep work for the drawable we're about to read
      from is already done before we call down to GetImage. This should be no
      functional change as most of the callers with a non-trivial
      SourceValidate are already wrapping GetImage and doing the equivalent
      thing, but we'll be simplifying that shortly.
      More importantly this ensures that if any of that prep work would
      generate events - like automatic compositing flushing rendering to a
      parent pixmap which then triggers damage - then it happens entirely
      before we start writing the GetImage reply header.
      Note that we do not do the same for GetSpans, but that's okay. The only
      way to get to GetSpans is through miCopyArea or miCopyPlane - where the
      callers must already call SourceValidate - or miGetImage - which this
      commit now protects with SourceValidate.
      Fixes: xorg/xserver#902
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      (cherry picked from commit 516e75db)
    • Adam Jackson's avatar
      mi: Add a default no-op miSourceValidate · 2320fd4b
      Adam Jackson authored
      Slightly simplifies the callers since they don't need to check for
      non-NULL anymore.
      I do extremely hate the workarounds here to suppress misprite taking the
      cursor down though. Surely there's a better way.
      [1.20: Do not in fact simplify the callers as above, since it would
      change the ABI. - ajax]
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      (cherry picked from commit ff310903)
    • Olivier Fourdan's avatar
      compiler.h: Do not include sys/io.h on ARM with glibc · 07efd81b
      Olivier Fourdan authored and Matt Turner's avatar Matt Turner committed
      <sys/io.h> on ARM hasn't worked for a long, long time, so it was removed
      it from glibc upstream.
      Remove the include to avoid a compilation failure on ARM with glibc.
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Closes: xorg/xserver#840
      (cherry picked from commit fe4cd0e7)
  12. 13 Nov, 2019 1 commit
    • Aaron Plattner's avatar
      xfree86: Call ScreenInit for protocol screens before GPU screens · 03b91e17
      Aaron Plattner authored
      During startup, the xfree86 DDX's InitOutput() calls PreInit for
      protocol screens first, and then GPU screens. On teardown, dix_main()
      calls CloseScreen in the reverse order: GPU screens first starting with
      the last one and then working backwards, and then protocol screens also
      in reverse order.
      InitOutput() calls ScreenInit in the wrong order: for GPU screens first and then
      for protocol screens. This causes a problem for drivers that have global state
      that is tied to the first screen that calls ScreenInit.
      Fix this by simply re-ordering the for loops to call PreInit for
      protocol screens first and then for GPU screens second.
      (cherry picked from commit e5e9a8ca)
  13. 11 Nov, 2019 4 commits
    • Alex Goins's avatar
      modesetting: Implement ms_covering_randr_crtc() for ms_present_get_crtc() · 325f694e
      Alex Goins authored and Aaron Plattner's avatar Aaron Plattner committed
      ms_present_get_crtc() returns an RRCrtcPtr, but derives it from a xf86CrtcPtr
      found via ms_dri2_crtc_covering_drawable()=>ms_covering_crtc(). As a result, it
      depends on all associated DIX ScreenRecs having an xf86CrtcConfigPtr DDX
      Some DIX ScreenRecs don't have an xf86CrtcConfigPtr DDX private, but do have an
      rrScrPrivPtr DDX private. Given that we can derive all of the information we
      need from RandR, we can support these screens by avoiding the use of xf86Crtc.
      This change implements an RandR-based path for ms_present_get_crtc(), allowing
      drawables to successfully fall back to syncing to the primary output, even if
      the slave doesn't have an xf86CrtcConfigPtr DDX private.
      Without this change, if a slave doesn't have an xf86CrtcConfigPtr DDX private,
      drawables will fall back to 1 FPS if they overlap an output on that slave.
      Signed-off-by: Alex Goins's avatarAlex Goins <agoins@nvidia.com>
      (cherry picked from commit 562c7888)
    • Alex Goins's avatar
      modesetting: Fix ms_covering_crtc() segfault with non-xf86Crtc slave · aa43dce1
      Alex Goins authored and Aaron Plattner's avatar Aaron Plattner committed
      DIX ScreenRecs don't necessarily have an xf86CrtcConfigPtr DDX private.
      ms_covering_crtc() assumes that they do, which can result in a segfault.
      Update ms_covering_crtc() to check the XF86_CRTC_CONFIG_PTR() returned pointer
      before dereferencing it. This will still mean that ms_covering_crtc() can't fall
      back to the primary output when a drawable overlaps a slave output (going to the
      1 FPS default instead), but it won't segfault.
      Signed-off-by: Alex Goins's avatarAlex Goins <agoins@nvidia.com>
      (cherry picked from commit 797e7a0c)
    • Alex Goins's avatar
      modesetting: Fix ms_covering_crtc() segfault with non-modesetting slave primary · 341a4787
      Alex Goins authored and Aaron Plattner's avatar Aaron Plattner committed
      ms_covering_crtc() uses RRFirstOutput() to determine a primary output to fall
      back to if a drawable is overlapping a slave output.
      If the primary output is a slave output, RRFirstOutput() will return a slave
      output even if passed a master ScreenPtr. ms_covering_crtc() dereferences the
      output's devPrivate, which is invalid for non-modesetting outputs, and can
      Changing RRFirstOutput() could have unintended side effects for other callers,
      so this change replaces the call to RRFirstOutput() with ms_first_output().
      ms_first_output() ignores the primary output if it doesn't match the given
      ScreenPtr, choosing the first connected output instead.
      Signed-off-by: Alex Goins's avatarAlex Goins <agoins@nvidia.com>
      (cherry picked from commit 3ef9029a)
    • Alex Goins's avatar
      randr: Fix RRCrtcDetachScanoutPixmap() segfault during server teardown · 2dd9dfc8
      Alex Goins authored and Aaron Plattner's avatar Aaron Plattner committed
      During server teardown, mrootdraw is NULL, which can cause segfaults if
      master->Stop{,Flipping}PixmapTracking() don't do NULL checking. In this case we
      shouldn't need to do master->Stop{,Flipping}PixmapTracking() anyway, so just
      skip it.
      Signed-off-by: Alex Goins's avatarAlex Goins <agoins@nvidia.com>
      (cherry picked from commit c82f8143)
  14. 05 Nov, 2019 4 commits
    • Hans de Goede's avatar
      glamor/xwayland: Define EGL_NO_X11 · 642c1f83
      Hans de Goede authored and Aaron Plattner's avatar Aaron Plattner committed
      Define EGL_NO_X11 everywhere were we also define MESA_EGL_NO_X11_HEADERS,
      EGL_NO_X11 is the MESA_EGL_NO_X11_HEADERS equivalent for the egl headers
      shipped with libglvnd.
      This fixes the xserver not building with the libglvnd-1.2.0 headers:
      In file included from /usr/include/EGL/eglplatform.h:128,
                       from /usr/include/epoxy/egl_generated.h:11,
                       from /usr/include/epoxy/egl.h:46,
                       from glamor_priv.h:43,
                       from glamor_composite_glyphs.c:25:
      /usr/include/X11/Xlib.h:222:2: error: conflicting types for 'GC'
        222 | *GC;
            |  ^~
      In file included from glamor.h:34,
                       from glamor_priv.h:32,
                       from glamor_composite_glyphs.c:25:
      ../include/gcstruct.h:282:3: note: previous declaration of 'GC' was here
        282 | } GC;
            |   ^~
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      (cherry picked from commit 741bd734)
    • Adam Jackson's avatar
      meson: Apparently 1.2 is < 1.2.0 · 2f55e8dc
      Adam Jackson authored and Aaron Plattner's avatar Aaron Plattner committed
      (cherry picked from commit 3340ddf3)
    • Adam Jackson's avatar
      meson: Fix another reference to "gl" 9.2.0 · e16eb696
      Adam Jackson authored and Aaron Plattner's avatar Aaron Plattner committed
      Previous commit e6ef2b12 missed a spot.
      (cherry picked from commit c7486613)
    • Marvin Schmidt's avatar
      build: glx: Lower gl version to work with libglvnd · a57729d3
      Marvin Schmidt authored and Aaron Plattner's avatar Aaron Plattner committed
      When using mesa with libglvnd support, mesa will no longer install the
      gl, glx, egl pkg-config files but instead let libglvnd provide them.
      libglvnd maintainers decided to change the versioning as it was
      mesa-specific previously. Now the libraries have versions of the API
      they expose[1].
      This causes problems when building the X server:
        checking for glproto >= 1.4.17 gl >= 9.2.0... no
        configure: error: Package requirements (glproto >= 1.4.17 gl >= 9.2.0) were not met:
        Requested 'gl >= 9.2.0' but version of gl is 1.2
      Lower the version requirement to 1.2 to allow building against libglvnd
      provided libraries
      [1] https://github.com/NVIDIA/libglvnd/commit/0dfaea2bcb7cdcc785f95e244223bd004a2d7fba
      (cherry picked from commit e6ef2b12)
  15. 30 Oct, 2019 1 commit
  16. 29 Oct, 2019 2 commits
    • Alexander Tsoy's avatar
      configure: Set libdrm flags correctly if only XORG is enabled · df1f8f69
      Alexander Tsoy authored and Matt Turner's avatar Matt Turner committed
      This fixes modesetting driver build failure which can be triggered with
      the following configure options:
      $ ./configure --disable-dri --disable-dri2 --disable-dri3
      --disable-config-udev --enable-xorg
      Bugzilla: https://bugs.gentoo.org/689768
      Signed-off-by: Alexander Tsoy's avatarAlexander Tsoy <alexander@tsoy.me>
      Reviewed-by: Emil Velikov's avatarEmil Velikov <emil.velikov@collabora.com>
      (cherry picked from commit 334f1107)
    • Matt Turner's avatar
      dix: Assert noPanoramiXExtension is false in PanoramiX code · fada61e8
      Matt Turner authored
      When compiling with link time optimization, GCC thinks it's discovered
      undefined behavior:
      events.c: In function 'XineramaConfineCursorToWindow':
      events.c:609:13: warning: iteration 2147483647 invokes undefined behavior [-Waggressive-loop-optimizations]
      events.c:609:11: note: within this loop
      events.c:605:49: warning: array subscript -1 is below array bounds of 'struct _Window *[16]' [-Warray-bounds]
      events.c:606:31: warning: array subscript -1 is below array bounds of 'struct _Screen *[16]' [-Warray-bounds]
      events.c:610:39: warning: array subscript -2 is below array bounds of 'struct _Screen *[16]' [-Warray-bounds]
      events.c:617:38: warning: array subscript -2 is below array bounds of 'struct _Window *[16]' [-Warray-bounds]
      events.c:619:35: warning: array subscript -2 is below array bounds of 'struct _Screen *[16]' [-Warray-bounds]
      This results from
          i = PanoramiXNumScreens - 1;
          RegionCopy(&pSprite->Reg1, &pSprite->windows[i]->borderSize);
          off_x = screenInfo.screens[i]->x;
          off_y = screenInfo.screens[i]->y;
      where GCC believes that PanoramiXNumScreens might be 0. Unfortunately
      GCC is just smart enough to be an annoyance because this case is not
      actually possible: XineramaConfineCursorToWindow() is only called when
      noPanoramiXExtension is false, and if noPanoramiXExtension is false then
      PanoramiXNumScreens must be >1 (see PanoramiXExtensionInit()).
      So, add an assert(!noPanoramiXExtension), which to my surprise provides
      GCC with information even in release builds and lets GCC understand that
      the code is not doing anything that is undefined behavior.
      I chose this solution instead of the proposed assert(i >= 0) because the
      same pattern occurs in CheckVirtualMotion() but is inside an
      'if (!noPanoramiXExtension)' and does not generate any warnings.
      Fixes: xorg/xserver#590
      Signed-off-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
      (cherry picked from commit 61aa40ae)