1. 19 Jan, 2019 1 commit
  2. 18 Jan, 2019 1 commit
  3. 17 Jan, 2019 1 commit
  4. 10 Sep, 2018 1 commit
    • Lionel Landwerlin's avatar
      xwayland: fix access to invalid pointer · 53ce2ba0
      Lionel Landwerlin authored and Adam Jackson's avatar Adam Jackson committed
      
      
      xwl_output->randr_crtc is used in the update_screen_size() function :
      
      ==5331== Invalid read of size 4
      ==5331==    at 0x15263D: update_screen_size (xwayland-output.c:190)
      ==5331==    by 0x152C48: xwl_output_remove (xwayland-output.c:413)
      ==5331==    by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x14BCCA: xwl_read_events (xwayland.c:814)
      ==5331==    by 0x2AC0D0: ospoll_wait (ospoll.c:651)
      ==5331==    by 0x2A5322: WaitForSomething (WaitFor.c:208)
      ==5331==    by 0x27574B: Dispatch (dispatch.c:421)
      ==5331==    by 0x279945: dix_main (main.c:276)
      ==5331==  Address 0x1aacb5f4 is 36 bytes inside a block of size 154 free'd
      ==5331==    at 0x48369EB: free (vg_replace_malloc.c:530)
      ==5331==    by 0x1F8AE8: RROutputDestroyResource (rroutput.c:421)
      ==5331==    by 0x29A2AC: doFreeResource (resource.c:880)
      ==5331==    by 0x29AE5B: FreeResource (resource.c:910)
      ==5331==    by 0x152BE0: xwl_output_remove (xwayland-output.c:408)
      ==5331==    by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x14BCCA: xwl_read_events (xwayland.c:814)
      ==5331==    by 0x2AC0D0: ospoll_wait (ospoll.c:651)
      ==5331==  Block was alloc'd at
      ==5331==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
      ==5331==    by 0x1F93E0: RROutputCreate (rroutput.c:83)
      ==5331==    by 0x152A75: xwl_output_create (xwayland-output.c:361)
      ==5331==    by 0x14BE59: registry_global (xwayland.c:764)
      ==5331==    by 0x6570FCD: ffi_call_unix64 (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x657093E: ffi_call (in /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4)
      ==5331==    by 0x4DDB183: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD79D8: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x4DD8EA3: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0)
      ==5331==    by 0x14BCCA: xwl_read_events (xwayland.c:814)
      ==5331==    by 0x2AC0D0: ospoll_wait (ospoll.c:651)
      ==5331==    by 0x2A5322: WaitForSomething (WaitFor.c:208)
      Signed-off-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      53ce2ba0
  5. 25 Jul, 2018 1 commit
  6. 21 Jun, 2018 1 commit
  7. 20 Feb, 2018 1 commit
    • Jason Ekstrand's avatar
      xwayland: Fix backwards need_rotate logic (v2) · a0545326
      Jason Ekstrand authored and Adam Jackson's avatar Adam Jackson committed
      
      
      When xdg_output support was added to Xwayland, need_rotate parameter was
      added to output_get_new_size where true gave you the old pre-xdg_output
      behavior and false gave the new behavior.  Unfortunately, the two places
      where this is called, need_rotate was set backwards.  This caused input
      get clampped to the wrong dimensions.  Also, the logic for deciding
      whether or not to flip was wrong because, if need_rotate was false, it
      would always flip which is not what you want.
      
      v2 (Daniel Stone):
       - Fix output_get_new_size so that it doesn't flip the dimensions when
         need_rotate is false.
      Signed-off-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      Reviewed-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      a0545326
  8. 24 Jan, 2018 1 commit
    • Olivier Fourdan's avatar
      xwayland: Add optional xdg-output support · da8de2a7
      Olivier Fourdan authored and Adam Jackson's avatar Adam Jackson committed
      
      
      The xdg-output protocol aims at describing outputs in way which is
      more in line with the concept of an output on desktop oriented systems.
      
      For now it just features the position and logical size which describe
      the output position and size in the global compositor space.
      
      This is however much useful for Xwayland to advertise the output size
      and position to X11 clients which need this to configure their surfaces
      in the global compositor space as the compositor may apply a different
      scale from what is advertised by the output scaling property (to achieve
      fractional scaling, for example).
      
      This was added in wayland-protocols 1.10.
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      da8de2a7
  9. 07 Jun, 2017 1 commit
  10. 18 Apr, 2017 1 commit
  11. 08 Feb, 2017 2 commits
    • Olivier Fourdan's avatar
      xwayland: Apply output rotation for screen size · 058809c4
      Olivier Fourdan authored and Adam Jackson's avatar Adam Jackson committed
      Previously, we would swap the width/height of the Xwayland output based
      on the output rotation, so that the overall screen size would match the
      actual rotation of each output.
      
      Problem is the RandR's ConstrainCursorHarder() handler will also apply
      the output rotation, meaning that when the output is rotated, the
      pointer will be constrained within the wrong dimension.
      
      Moreover, XRandR assumes the original output width/height are unchanged
      when the output is rotated, so by changing the Xwayland output width and
      height based on rotation, Xwayland causes XRandr to report the wrong
      output sizes (an output of size 1024x768 rotated left or right should
      remain 1024x768, not 768x1024).
      
      So to avoid this issue and keep things consistent between Wayland and
      Xwayland outputs, leave the actual width/height unchanged but apply the
      rotation when computing the screen size. This fixes both the output size
      being wrong in "xrandr -q" and the pointer being constrained in the
      wrong dimension with rotated with weston.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663
      
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      058809c4
    • Olivier Fourdan's avatar
      xwayland: CRTC should support all rotations · afeace27
      Olivier Fourdan authored and Adam Jackson's avatar Adam Jackson committed
      If the Wayland compositor sets a rotation on the output, Xwayland
      translates the transformation as an xrandr rotation for the given
      output.
      
      However, if the rotation is not supported by the CRTC, this is not
      a valid setup and xrandr queries will fail.
      
      Pretend we support all rotations and reflections so that the
      configuration remains a valid xrandr setup.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663
      
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      afeace27
  12. 07 Feb, 2017 1 commit
  13. 25 Nov, 2016 1 commit
  14. 15 Aug, 2016 1 commit
    • Olivier Fourdan's avatar
      xwayland: Avoid double free of RRCrtc and RROutput · 4cbf1fb1
      Olivier Fourdan authored and Adam Jackson's avatar Adam Jackson committed
      
      
      At shutdown, the Xserver will free all its resources which includes the
      RRCrtc and RROutput created.
      
      Xwayland would do the same in its xwl_output_destroy() called from
      xwl_close_screen(), leading to a double free of existing RRCrtc
      RROutput:
      
       Invalid read of size 4
          at 0x4CDA10: RRCrtcDestroy (rrcrtc.c:689)
          by 0x426E75: xwl_output_destroy (xwayland-output.c:301)
          by 0x424144: xwl_close_screen (xwayland.c:117)
          by 0x460E17: CursorCloseScreen (cursor.c:187)
          by 0x4EB5A3: AnimCurCloseScreen (animcur.c:106)
          by 0x4EF431: present_close_screen (present_screen.c:64)
          by 0x556D40: dix_main (main.c:354)
          by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so)
        Address 0xbb1fc30 is 0 bytes inside a block of size 728 free'd
          at 0x4C2BDB0: free (in
      /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          by 0x4CCE5F: RRCrtcDestroyResource (rrcrtc.c:719)
          by 0x577541: doFreeResource (resource.c:895)
          by 0x5787B5: FreeClientResources (resource.c:1161)
          by 0x578862: FreeAllResources (resource.c:1176)
          by 0x556C54: dix_main (main.c:323)
          by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so)
        Block was alloc'd at
          at 0x4C2CA6A: calloc (in
      /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
          by 0x4CC6DB: RRCrtcCreate (rrcrtc.c:76)
          by 0x426D1C: xwl_output_create (xwayland-output.c:264)
          by 0x4232EC: registry_global (xwayland.c:431)
          by 0x76CB1C7: ffi_call_unix64 (in /usr/lib/libffi.so.6.0.4)
          by 0x76CAC29: ffi_call (in /usr/lib/libffi.so.6.0.4)
          by 0x556CEFD: wl_closure_invoke (connection.c:935)
          by 0x5569CBF: dispatch_event.isra.4 (wayland-client.c:1310)
          by 0x556AF13: dispatch_queue (wayland-client.c:1456)
          by 0x556AF13: wl_display_dispatch_queue_pending
      (wayland-client.c:1698)
          by 0x556B33A: wl_display_roundtrip_queue (wayland-client.c:1121)
          by 0x42371C: xwl_screen_init (xwayland.c:631)
          by 0x552F60: AddScreen (dispatch.c:3864)
      
      And:
      
       Invalid read of size 4
          at 0x522890: RROutputDestroy (rroutput.c:348)
          by 0x42684E: xwl_output_destroy (xwayland-output.c:302)
          by 0x423CF4: xwl_close_screen (xwayland.c:118)
          by 0x4B6377: CursorCloseScreen (cursor.c:187)
          by 0x539503: AnimCurCloseScreen (animcur.c:106)
          by 0x53D081: present_close_screen (present_screen.c:64)
          by 0x43DBF0: dix_main (main.c:354)
          by 0x7068730: (below main) (libc-start.c:289)
        Address 0xc403190 is 0 bytes inside a block of size 154 free'd
          at 0x4C2CD5A: free (vg_replace_malloc.c:530)
          by 0x521DF3: RROutputDestroyResource (rroutput.c:389)
          by 0x45DA61: doFreeResource (resource.c:895)
          by 0x45ECFD: FreeClientResources (resource.c:1161)
          by 0x45EDC2: FreeAllResources (resource.c:1176)
          by 0x43DB04: dix_main (main.c:323)
          by 0x7068730: (below main) (libc-start.c:289)
        Block was alloc'd at
          at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
          by 0x52206B: RROutputCreate (rroutput.c:84)
          by 0x426763: xwl_output_create (xwayland-output.c:270)
          by 0x422EDC: registry_global (xwayland.c:432)
          by 0x740FC57: ffi_call_unix64 (unix64.S:76)
          by 0x740F6B9: ffi_call (ffi64.c:525)
          by 0x5495A9D: wl_closure_invoke (connection.c:949)
          by 0x549283F: dispatch_event.isra.4 (wayland-client.c:1274)
          by 0x5493A13: dispatch_queue (wayland-client.c:1420)
          by 0x5493A13: wl_display_dispatch_queue_pending
      (wayland-client.c:1662)
          by 0x5493D2E: wl_display_roundtrip_queue (wayland-client.c:1085)
          by 0x4232EC: xwl_screen_init (xwayland.c:632)
          by 0x439F50: AddScreen (dispatch.c:3864)
      
      Split xwl_output_destroy() into xwl_output_destroy() which frees the
      wl_output and the xwl_output structure, and xwl_output_remove() which
      does the RRCrtcDestroy() and RROutputDestroy() and call the latter only
      when an output is effectively removed.
      
      An additional benefit, on top of avoiding a double free, is to avoid
      updating the screen size at shutdown.
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      4cbf1fb1
  15. 15 Jul, 2016 1 commit
  16. 20 Jun, 2016 1 commit
  17. 01 Mar, 2016 1 commit
    • Olivier Fourdan's avatar
      xwayland: fix a crash on output removal · 2116f03b
      Olivier Fourdan authored and Adam Jackson's avatar Adam Jackson committed
      
      
      On output removal, the CRTC that was added in xwl_output_create()
      is not removed in xwl_output_destroy() and would cause a segmentation
      fault later on in ProcRRGetMonitors():
      
        (EE) Segmentation fault at address 0x100000001
        (EE)
        (EE) 10: ? (?+0x29) [0x29]
        (EE) 9: /usr/bin/Xwayland (_start+0x29) [0x423299]
        (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7fdd80e7f580]
        (EE) 7: /usr/bin/Xwayland (dix_main+0x3b3) [0x544ef3]
        (EE) 6: /usr/bin/Xwayland (Dispatch+0x31e) [0x54109e]
        (EE) 5: /usr/bin/Xwayland (ProcRRGetMonitors+0x9b) [0x4ca18b]
        (EE) 4: /usr/bin/Xwayland (RRMonitorMakeList+0x269) [0x4c9ba9]
        (EE) 3: /usr/bin/Xwayland (RRMonitorSetFromServer+0x118) [0x4c9198]
        (EE) 2: /usr/bin/Xwayland (MakeAtom+0x30) [0x530710]
        (EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7fdd80e93b1f]
        (EE) 0: /usr/bin/Xwayland (OsSigHandler+0x29) [0x5792d9]
      
      Remove the output CRTC in xwl_output_destroy() to avoid the crash.
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      2116f03b
  18. 22 Feb, 2016 1 commit
    • Daniel Stone's avatar
      dix: Add hybrid full-size/empty-clip mode to SetRootClip · e957a2e5
      Daniel Stone authored and Adam Jackson's avatar Adam Jackson committed
      216bdbc7 removed the SetRootClip call in the XWayland output-hotplug
      handler when running rootless (e.g. as a part of Weston/Mutter), since
      the root window has no storage, so generating exposures will result in
      writes to invalid memory.
      
      Unfortunately, preventing the segfault also breaks sprite confinement.
      SetRootClip updates winSize and borderSize for the root window, which
      when combined with RRScreenSizeChanged calling ScreenRestructured,
      generates a new sprite-confinment area to update it to the whole screen.
      
      Removing this call results in the window geometry being reported
      correctly, but winSize/borderSize never changing from their values at
      startup, i.e. out of sync with the root window geometry / screen
      information in the connection info / XRandR.
      
      This patch introduces a hybrid mode, where we update winSize and
      borderSize for the root window, enabling sprite confinement to work
      correctly, but keep the clip emptied so exposures are never ge...
      e957a2e5
  19. 01 Dec, 2015 1 commit
  20. 30 Nov, 2015 2 commits
  21. 07 Oct, 2015 2 commits
  22. 05 Oct, 2015 1 commit
  23. 25 Sep, 2015 3 commits
  24. 24 Sep, 2015 1 commit
  25. 12 Aug, 2015 1 commit
    • Adam Jackson's avatar
      xwayland: Don't (double) destroy RANDR resources in CloseScreen · 11f4cc47
      Adam Jackson authored and Keith Packard's avatar Keith Packard committed
      
      
      By the time we get here we've already been through FreeAllResources,
      which has already torn down the RANDR objects, so on the second
      regeneration you get:
      
          Invalid read of size 4
             at 0x51C6F0: RRCrtcDestroy (rrcrtc.c:659)
             by 0x4285F5: xwl_output_destroy (xwayland-output.c:191)
             by 0x426464: xwl_close_screen (xwayland.c:112)
             by 0x4B7F77: CursorCloseScreen (cursor.c:187)
             by 0x536013: AnimCurCloseScreen (animcur.c:106)
             by 0x539841: present_close_screen (present_screen.c:64)
             by 0x43E496: dix_main (main.c:351)
             by 0x30D70206FF: (below main) (libc-start.c:289)
           Address 0x4cc6640 is 0 bytes inside a block of size 728 free'd
             at 0x4A07D6A: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
             by 0x51BCCF: RRCrtcDestroyResource (rrcrtc.c:689)
             by 0x45CD91: doFreeResource (resource.c:872)
             by 0x45DE56: FreeClientResources (resource.c:1138)
             by 0x45DF06: FreeAllResources (resource.c:1153)
             by 0x43E3BD: dix_main (main.c:321)
             by 0x30D70206FF: (below main) (libc-start.c:289)
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      11f4cc47
  26. 11 May, 2015 1 commit
  27. 07 May, 2015 1 commit
  28. 03 Apr, 2014 1 commit
    • Kristian Høgsberg's avatar
      Xwayland DDX · 6e539d88
      Kristian Høgsberg authored
      
      
      Started out as an Xorg module to be used from Xorg drivers to let
      Xorg run under a wayland server.  The idea was to be able to reuse the
      2D acceleration from the Xorg driver.  Now with glamor being credible,
      a better plan is to just make Xwayland its own DDX, similar to Xwin
      and Xquartz.  This is a much better fit, as much of the code in the
      original approach had to hack around Xorg doing Xorg things like take
      over the VT, probe input devices and read config files.  Another big win
      is that Xwayland dosn't need to be setuid root.
      
      The Xwayland support for DRI3, Glamor and render nodes was done by
      Axel Davy <axel.davy@ens.fr>, who also did a lot of work on the rebase
      to the Xwayland DDX.
      
      Contributions from:
      
        Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
        Corentin Chary <corentin.chary@gmail.com>
        Daniel Stone <daniel@fooishbar.org>
        Kristian Høgsberg <krh@bitplanet.net>
        Robert Bragg <robert@linux.intel.com>
        Scott Moreau <oreaus@gmail.com>
        Tiago Vignatti <tiago.vignatti@intel.com>
        Giovanni Campagna <gcampagn@redhat.com>
        Jonas Ådahl <jadahl@gmail.com>
        Ray Strode <rstrode@redhat.com>
        Trevor McCort <tjmccort@gmail.com>
        Rui Matos <tiagomatos@gmail.com>
        Axel Davy <axel.davy@ens.fr>
        Jasper St. Pierre <jstpierre@mecheye.net>
      Signed-off-by: default avatarKristian Høgsberg <krh@bitplanet.net>
      Reviewed-by: default avatarAxel Davy <axel.davy@ens.fr>
      6e539d88