1. 10 Aug, 2019 1 commit
    • Matt Turner's avatar
      dix: Assert noPanoramiXExtension is false in PanoramiX code · 61aa40ae
      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: #590Signed-off-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
      61aa40ae
  2. 09 Aug, 2019 3 commits
  3. 07 Aug, 2019 1 commit
    • Dave Airlie's avatar
      xf86: autobind GPUs to the screen · 078277e4
      Dave Airlie authored
      This is a modified version of a patch we've been carry-ing in Fedora and
      RHEL for years now. This patch automatically adds secondary GPUs to the
      master as output sink / offload source making e.g. the use of
      slave-outputs just work, with requiring the user to manually run
      "xrandr --setprovideroutputsource" before he can hookup an external
      monitor to his hybrid graphics laptop.
      
      There is one problem with this patch, which is why it was not upstreamed
      before. What to do when a secondary GPU gets detected really is a policy
      decission (e.g. one may want to autobind PCI GPUs but not USB ones) and
      as such should be under control of the Desktop Environment.
      
      Unconditionally adding autobinding support to the xserver will result
      in races between the DE dealing with the hotplug of a secondary GPU
      and the server itself dealing with it.
      
      However we've waited for years for any Desktop Environments to actually
      start doing some sort of autoconfiguration of secondary GPUs and there
      is still not a single DE dealing with this, so I believe that it is
      time to upstream this now.
      
      To avoid potential future problems if any DEs get support for doing
      secondary GPU configuration themselves, the new autobind functionality
      is made optional. Since no DEs currently support doing this themselves it
      is enabled by default. When DEs grow support for doing this themselves
      they can disable the servers autobinding through the servers cmdline or a
      xorg.conf snippet.
      Signed-off-by: 's avatarDave Airlie <airlied@gmail.com>
      [hdegoede@redhat.com: Make configurable, fix with nvidia, submit upstream]
      Signed-off-by: 's avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      Reviewed-by: 's avatarEmil Velikov <emil.velikov@collabora.com>
      ---
      Changes in v2:
      -Make the default enabled instead of installing a xorg.conf
       snippet which enables it unconditionally
      
      Changes in v3:
      -Handle GPUScreen autoconfig in randr/rrprovider.c, looking at
       rrScrPriv->provider, rather then in hw/xfree86/modes/xf86Crtc.c
       looking at xf86CrtcConfig->provider. This fixes the autoconfig not
       working with the nvidia binary driver
      078277e4
  4. 06 Aug, 2019 5 commits
  5. 05 Aug, 2019 1 commit
    • Ross Burton's avatar
      sdksyms.sh: don't embed the build path · 6f41bf31
      Ross Burton authored
      This script generates a header that has a comment containing the build path for
      no real reason.  As this source can end up deployed on targets in debug packages
      this means there is both potentially sensitive information leakage about the
      build environment, and a source of change for reproducible builds.
      6f41bf31
  6. 04 Aug, 2019 1 commit
  7. 31 Jul, 2019 2 commits
    • Olivier Fourdan's avatar
      xwayland: Fix build warning without glamor · f107bde1
      Olivier Fourdan authored
      Building Xwayland without glamor support would raise a warning at build
      time:
      
        xwayland.c: In function ‘xwl_screen_init’:
        xwayland.c:980:10: warning: unused variable ‘use_eglstreams’
          980 |     Bool use_eglstreams = FALSE;
              |          ^~~~~~~~~~~~~~
      
      When building without glamor support, we cannot have EGL Streams support
      either, the two being related. So we do not need to declare the variable
      `use_eglstreams` if glamor is not enabled.
      Signed-off-by: 's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
      f107bde1
    • Olivier Fourdan's avatar
      xwayland: Fix build without glamor · 8587bbd8
      Olivier Fourdan authored
      When building Xwayland without glamor support enabled using automake,
      the build would fail at link time trying to find `glamor_block_handler`:
      
        /usr/bin/ld: xwayland-glx.o: in function `egl_drawable_wait_x':
        hw/xwayland/xwayland-glx.c:102: undefined reference to
        `glamor_block_handler'
      
      Make sure we don't try to build `xwayland-glx.c` without glamor in the
      Xwayland Makefile.
      
      Note: Meson build is fine because it's already build only with glamor
      enabled.
      
      Fixes: commit 84692415 - "xwayland: Add EGL-backed GLX provider"
      Signed-off-by: 's avatarOlivier Fourdan <ofourdan@redhat.com>
      8587bbd8
  8. 23 Jul, 2019 4 commits
  9. 22 Jul, 2019 1 commit
  10. 21 Jul, 2019 6 commits
  11. 17 Jul, 2019 3 commits
  12. 16 Jul, 2019 1 commit
  13. 15 Jul, 2019 1 commit
  14. 12 Jul, 2019 1 commit
  15. 10 Jul, 2019 2 commits
  16. 03 Jul, 2019 1 commit
  17. 01 Jul, 2019 2 commits
    • Samuel Thibault's avatar
      Fix crash on XkbSetMap · fabc4219
      Samuel Thibault authored
      Since group_info and width are used for the key actions allocations,
      when modifying them we need to take care of reallocation key actions if
      needed.
      fabc4219
    • Samuel Thibault's avatar
      Fix crash on XkbSetMap · 8469bfea
      Samuel Thibault authored
      Some devices may not have keyboard information.
      
      Fixes #574
      8469bfea
  18. 28 Jun, 2019 4 commits
    • Jon Turney's avatar
      hw/xwin: Improve data returned for RANDR queries · ff6b771e
      Jon Turney authored
      Set a linear gamma ramp.  This avoids the xrandr command always warning
      'Failed to get size of gamma for output default'
      (perhaps we should be using GDI GetDeviceGammaRamp(), if possible?)
      
      Make CRTC report non-zero physical dimensions initially
      ff6b771e
    • Jon Turney's avatar
      hw/xwin: Always keep RANDR fake mode information up to date · 2549ab20
      Jon Turney authored
      The rrGetInfo hook is not called for all RANDR requests (e.g.
      RRGetOutputInfo), so we must always keep the fake mode information up to
      date, rather than doing it lazily in the rrGetInfo hook)
      
      Because we are so bad, most GTK+3 versions treat the output name 'default'
      specially, and don't try to use RANDR with it.  But versions 3.21.6 to
      3.22.24, don't do this, and get badly confused by a CRTC with size 0x0.
      
      See:
      https://bugzilla.gnome.org/show_bug.cgi?id=771033
      https://bugzilla.gnome.org/show_bug.cgi?id=780101
      
      Future work: Rather than reporting a single fake CRTC with a mode matching
      the entire virtual display, the fake CRTCs we report should match our
      'pseudo-xinerama' monitors
      2549ab20
    • Jon Turney's avatar
      hw/xwin: Make QueryMonitor() slightly less insane · b078e034
      Jon Turney authored
      Make QueryMonitor() slightly less insane, making it return TRUE if the
      specified monitor exists, rather than always returning TRUE (which we
      are uselessly checking, and then also checking if the specified monitor
      exists)
      
      (Note that EnumDisplayMonitors() doesn't seem to have meaningful way to
      return errors, see 5940580f)
      
      Also: Spamming the long UseMsg() after "Invalid monitor number" isn't very
      helpful.
      
      Also: If we are exiting in ddxProcessArgument() due to an error in
      options, use a non-zero exit status.
      b078e034
    • Jon Turney's avatar