Skip to content
Snippets Groups Projects
  1. Jun 30, 2022
    • Olivier Fourdan's avatar
      xwayland: add a fixed geometry size for rootful · b0cee5e7
      Olivier Fourdan authored
      
      When running rootless as well as rootful, Xwayland gets its outputs
      configuration from the Wayland compositor.
      
      When running rootful, it means that we end up with a large black
      surface the size of all monitors combined, that's not very convenient
      and there is no way for set the desired size of the Xwayland window.
      
      Add a new command line option "-geometry" to force a specific mode when
      running rootful for the user to specify the root window size to use for
      Xwayland.
      
      That option has no effect when Xwayland is running rootless.
      
      v2: Not using libxcvt as the mode may not be a valid CVT mode.
      v3: Add a set of XRandR modes and the RR hooks to make that work.
          Update the man page for Xwayland.
      v4: Add RandR 1.0 support for older clients
      v5: Fix XVidMode failing with a BadMatch
      v6: Add a separate xwl_output specifically for fixed mode, instead of
          using the existing output list - that will allow for further
          improvements like a fullscreen mode eventually.
      v7: Sort the RR modes
      v8: Fix RandR 1.0
      v9: Add physical size
      v10: Cleanup
      
      Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Closes: xorg/xserver#1338
      b0cee5e7
    • Olivier Fourdan's avatar
      xwayland: update_screen_size() takes a screen argument · 5cc0319c
      Olivier Fourdan authored
      
      update_screen_size() takes an xwl_output argument, mostly for historical
      reasons, whereas it actually applies to a screen (as its name implies).
      
      Reshuffle the code to take an xwl_screen instead, in preparation for
      the geometry mode in Xwayland - No functional change.
      
      Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      5cc0319c
    • Olivier Fourdan's avatar
      xwayland: make the output serials belong to the screen · eae3c06c
      Olivier Fourdan authored
      
      Xwayland uses an output serial number it increments each time a new
      Wayland output is added.
      
      On server regeneration, that static value is not cleared, and therfore
      the output numbers keep increasing each time the Xserver restarts.
      
      To avoid that issue, make the output serial part of the xwl_screen,
      which gets recreated on server regeneration, so that index is reset to 0
      automatically on server regeneration.
      
      Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      eae3c06c
    • Olivier Fourdan's avatar
      xwayland: catch SetWindowPixmap() even when rootful · a4aba5ab
      Olivier Fourdan authored
      
      Xwayland's own SetWindowPixmap() handler would be ignored when running
      rootful.
      
      This is fine as long as we do not plan to resize the root window,
      however this is becoming problematic if we plan to resize the root
      window dynamically when running rootful.
      
      Just add the xwl_window_set_window_pixmap() handler regardless of
      rootful/rootless mode.
      
      Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      a4aba5ab
    • zhoulei's avatar
      xwayland: Change randr_output status when call xwl_output_remove() · 2ec7c168
      zhoulei authored
      
      The function xwl_output_remove() is called when removing a monitor, but
      the actual status of the RandR output does not change.
      
      So, when RRTellChanged() is called from update_screen_size(), it won't
      have the output connection status up to date in the RandR event
      RROutputChangeNotifyEvent and X11 applications relying on that event
      like Qt will fail to emit their signal QGuiApplication::screenRemoved.
      
      To avoid that issue, make sure to mark the RandR output as disconnected
      prior to call xwl_output_remove().
      
      Fix commit 204f10c2 ("xwayland: Call RRTellChanged if the RandR configuration may have changed")
      
      Signed-off-by: default avatarzhoulei <zhoulei@kylinos.cn>
      Signed-off-by: default avatarMorose <chenlinxiang@kylinos.cn>
      Acked-by: default avatarMichel Dänzer <mdaenzer@redhat.com>
      Reviewed-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      2ec7c168
  2. Jun 27, 2022
    • Adam Jackson's avatar
      ephyr: Sync even less in ephyrInternalDamageRedisplay · cf30498f
      Adam Jackson authored
      
      If we have multiple damage rects we would sync (if we would sync) after
      every hostx_paint_rect. For shm images you'd rather push all the
      ShmPutImage requests and wait after the last one.
      
            before                  after   Operation
      ------------   --------------------   -------------------------
       232000000.0    240000000.0 (1.034)   Dot
        41500000.0     41400000.0 (0.998)   1x1 rectangle
        11400000.0     11400000.0 (1.000)   10x10 rectangle
          553000.0       553000.0 (1.000)   100x100 rectangle
           37300.0        38500.0 (1.032)   500x500 rectangle
          831000.0      1140000.0 (1.372)   PutImage 10x10 square
           65200.0       134000.0 (2.055)   PutImage 100x100 square
            3410.0         3500.0 (1.026)   PutImage 500x500 square
          810000.0      1150000.0 (1.420)   ShmPutImage 10x10 square
          346000.0       364000.0 (1.052)   ShmPutImage 100x100 square
           22400.0        22800.0 (1.018)   ShmPutImage 500x500 square
      
      Reviewed-by: Emma Anholt's avatarEmma Anholt <emma@anholt.net>
      cf30498f
    • Adam Jackson's avatar
      ephyr: Sync less in hostx_paint_rect · 7f884899
      Adam Jackson authored
      
      Move the xcb_aux_sync into the shm path, where we do still need it to
      synchronize access with the host. In the non-shm path the image is
      copied to the host anyway so the sync just adds latency and keeps you
      from using all your network bandwidth.
      
      Only the non-shm-putimage path benefits from this, but the benefit is
      significant even on the local machine (here a 3.2GHz Core i7-8700, using
      XEPHYR_NO_SHM=1):
      
            before                  after   Operation
      ------------   --------------------   -------------------------
       228000000.0    225000000.0 (0.987)   Dot
        40900000.0     41600000.0 (1.017)   1x1 rectangle
        10400000.0     10700000.0 (1.029)   10x10 rectangle
          477000.0       471000.0 (0.987)   100x100 rectangle
           30900.0        31800.0 (1.029)   500x500 rectangle
          760000.0       981000.0 (1.291)   PutImage 10x10 square
           14700.0        19200.0 (1.306)   PutImage 100x100 square
             320.0          382.0 (1.194)   PutImage 500x500 square
          749000.0       984000.0 (1.314)   ShmPutImage 10x10 square
          268000.0       304000.0 (1.134)   ShmPutImage 100x100 square
           16600.0        18500.0 (1.114)   ShmPutImage 500x500 square
      
      Reviewed-by: Emma Anholt's avatarEmma Anholt <emma@anholt.net>
      7f884899
    • Morose's avatar
      xwayland: Fix check logic in sprite_check_lost_focus() · 92a00f52
      Morose authored and Olivier Fourdan's avatar Olivier Fourdan committed
      
      When the pointer leaves an X11 window, and enters a Wayland native
      window, Xwayland has no idea about Wayland native windows and may
      generate the wrong crossing events to another X11 window instead.
      
      To avoid that issue, Xwayland implements its own XYToWindow() handler to
      compare the Wayland focused surface with the X11 window found in the
      window tree.
      
      Commit 59ad0e6a ("xwayland: Fix use after free of cursors") changed the
      logic in sprite_check_lost_focus() to use IsParent() to compare the
      windows, which works when the X11 window is reparented by the window
      manager, but fails in the case of an override redirect window.
      
      To fix the issue, also check whether last_xwindow is the window itself.
      
      Signed-off-by: default avatarMorose <chenlinxiang@kylinos.cn>
      Fixes: 59ad0e6a - xwayland: Fix use after free of cursors
      Reviewed-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      92a00f52
  3. Jun 26, 2022
    • Jeremy Huddleston Sequoia's avatar
    • Jeremy Huddleston Sequoia's avatar
      XQuartz: Build the bundle trampoline when using meson · b00cf4ae
      Jeremy Huddleston Sequoia authored
      
      This brings the change for e1fdc856 into meson based builds
      
      Signed-off-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      b00cf4ae
    • Jeremy Huddleston Sequoia's avatar
    • Jeremy Huddleston Sequoia's avatar
      tests: Fix build failure from missing micmap.c · 6645ff59
      Jeremy Huddleston Sequoia authored
      
      FAILED: test/tests
      clang  -o test/tests test/tests.p/.._mi_miinitext.c.o test/tests.p/fixes.c.o test/tests.p/input.c.o test/tests.p/list.c.o test/tests.p/misc.c.o test/tests.p/signal-logging.c.o test/tests.p/string.c.o test/tests.p/test_xkb.c.o test/tests.p/tests-common.c.o test/tests.p/tests.c.o test/tests.p/touch.c.o test/tests.p/xfree86.c.o test/tests.p/xtest.c.o test/tests.p/hashtabletest.c.o -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,error -fvisibility=hidden -O0 -g3 -gdwarf-2 -mmacosx-version-min=10.9 -Werror=unguarded-availability-new -Werror=format -Werror=objc-method-access -Werror=incompatible-pointer-types -F/Applications/Utilities/XQuartz.app/Contents/Frameworks -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk -arch x86_64 -O0 -g3 -gdwarf-2 -mmacosx-version-min=10.9 -Werror=unguarded-availability-new -Werror=format -Werror=objc-method-access -Werror=incompatible-pointer-types -F/Applications/Utilities/XQuartz.app/Contents/Frameworks -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk -arch x86_64 -Wl,-rpath,/opt/X11/lib mi/liblibxserver_mi.a dix/liblibxserver_dix.a composite/liblibxserver_composite.a damageext/liblibxserver_damageext.a dbe/liblibxserver_dbe.a randr/liblibxserver_randr.a miext/damage/liblibxserver_miext_damage.a render/liblibxserver_render.a present/liblibxserver_present.a Xext/liblibxserver_xext.a miext/sync/liblibxserver_miext_sync.a xfixes/liblibxserver_xfixes.a Xi/liblibxserver_xi.a xkb/liblibxserver_xkb.a record/liblibxserver_record.a os/liblibxserver_os.a os/liblibxlibc.a glx/liblibglxvnd.a hw/xfree86/common/libxorg_common.a hw/xfree86/loader/libxorg_loader.a hw/xfree86/ddc/libxorg_ddc.a hw/xfree86/xkb/libxorg_xkb.a hw/xfree86/i2c/libxorg_i2c.a hw/xfree86/modes/libxorg_modes.a hw/xfree86/os-support/libxorg_os_support.a hw/xfree86/parser/libxorg_parser.a hw/xfree86/ramdac/libxorg_ramdac.a fb/liblibxserver_fb.a Xext/liblibxserver_xext_vidmode.a dix/liblibxserver_main.a config/liblibxserver_config.a /opt/X11/lib/libpixman-1.dylib /opt/X11/lib/libxcvt.dylib /opt/X11/lib/libxkbfile.dylib /opt/X11/lib/libXfont2.dylib /opt/X11/lib/libXdmcp.dylib -lm /opt/X11/lib/libxshmfence.dylib -ldl -lpthread /opt/X11/lib/libXau.dylib /opt/X11/lib/libGL.dylib
      Undefined symbols for architecture x86_64:
        "_micmapScrPrivateKeyRec", referenced from:
            _DGAInstallCmap in libxorg_common.a(xf86DGA.c.o)
            _xf86HandleColormaps in libxorg_common.a(xf86cmap.c.o)
            _CMapInstallColormap in libxorg_common.a(xf86cmap.c.o)
            _CMapEnterVT in libxorg_common.a(xf86cmap.c.o)
            _CMapSwitchMode in libxorg_common.a(xf86cmap.c.o)
            _CMapSetDGAMode in libxorg_common.a(xf86cmap.c.o)
            _CMapChangeGamma in libxorg_common.a(xf86cmap.c.o)
            ...
      ld: symbol(s) not found for architecture x86_64
      
      Signed-off-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      6645ff59
    • Jeremy Huddleston Sequoia's avatar
    • Jeremy Huddleston Sequoia's avatar
      print_edid: Fix a format string error · 199b8c08
      Jeremy Huddleston Sequoia authored
      
      ../hw/xfree86/ddc/print_edid.c:511:20: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
                         det_mon->type - DS_VENDOR);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~
      
      Signed-off-by: default avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
      199b8c08
  4. Jun 21, 2022
  5. Jun 20, 2022
  6. Jun 16, 2022
  7. Jun 15, 2022
  8. Jun 14, 2022
  9. May 23, 2022
    • Aaron Plattner's avatar
      os: print registers in the libunwind version of xorg_backtrace() · dc8162d5
      Aaron Plattner authored
      
      If the stack walker finds a signal frame, record the cursor at that point and
      then use unw_get_reg() to query the values of the architecture-specific
      registers at the frame that triggered the signal.
      
      Example output:
      
       (EE) Backtrace:
       (EE) 0: hw/xfree86/Xorg (OsSigHandler+0x25) [0x561458bb8195]
       (EE) 1: <signal handler called>
       (EE) 2: hw/xfree86/Xorg (dix_main+0x9c) [0x561458aead6c]
       (EE) 3: /usr/lib/libc.so.6 (__libc_start_main+0xd5) [0x7f2d23170b25]
       (EE) 4: hw/xfree86/Xorg (_start+0x2e) [0x561458aad8be]
       (EE)
       (EE) Registers at frame #2:
       (EE)   rax: 0x0
       (EE)   rbx: 0x561458c3ae60
       (EE)   rcx: 0x7f2d23328943
       (EE)   rdx: 0x0
       (EE)   rsi: 0x7ffcb6025030
       (EE)   rdi: 0xe
       (EE)   rbp: 0x0
       (EE)   rsp: 0x7ffcb6026430
       (EE)    r8: 0x0
       (EE)    r9: 0x0
       (EE)   r10: 0x8
       (EE)   r11: 0x246
       (EE)   r12: 0x561458aad890
       (EE)   r13: 0x0
       (EE)   r14: 0x0
       (EE)   r15: 0x0
       (EE)
       (EE) Segmentation fault at address 0x0
      
      Signed-off-by: Aaron Plattner's avatarAaron Plattner <aplattner@nvidia.com>
      dc8162d5
    • Aaron Plattner's avatar
      os: print <signal handler called> if unw_is_signal_frame() · a7364193
      Aaron Plattner authored
      
      libunwind has a function to query whether the cursor points to a signal frame.
      Use this to print
      
       1: <signal handler called>
      
      like GDB does, rather than printing something less useful such as
      
       1: /usr/lib/libpthread.so.0 (funlockfile+0x60) [0x7f679838b870]
      
      Signed-off-by: Aaron Plattner's avatarAaron Plattner <aplattner@nvidia.com>
      a7364193
  10. May 18, 2022
    • Autumn Ashton's avatar
      xwayland: Add -force-xrandr-emulation switch · 7cdcdfea
      Autumn Ashton authored and Olivier Fourdan's avatar Olivier Fourdan committed
      
      Adds a -force-xrandr-emulation cmdline switch that always exposes extra
      modes when viewporter isn't exposed by the Wayland compositor.
      
      Having the additional modes exposed by the X server is important for
      games to function and be configured
      
      Compositors, such as Gamescope (the compositor for Steam Deck),
      support only a single window that is rendered in the centre of the
      screen that is scaled up to fill the screen by the compositor based
      on some user scaling settings.
      
      Exposing viewporter, wouldn't make sense here, and could mislead native
      Wayland clients, so exposing dummy modesets in X is preferred here.
      
      Signed-off-by: default avatarJoshua Ashton <joshua@froggi.es>
      Reviewed-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      7cdcdfea
  11. May 12, 2022
  12. Apr 20, 2022
    • Olivier Fourdan's avatar
      xwayland/output: Set the "RANDR Emulation" property · 7b7170ec
      Olivier Fourdan authored
      
      Xwayland does not change the actual XRANDR setup for real, it just
      emulates the resolution changes using viewports in Wayland.
      
      With a single output, if an X11 applications tries to change the CRTC
      back to the native mode, RRCrtcSet() will simply ignore the request as
      no actual change is induced by this.
      
      Set the property "RANDR Emulation" on all Xwayland outputs to make sure
      the optimizations in RRCrtcSet() get skipped and Xwayland can receive
      and act upon the client request.
      
      Also make sure we do not allow that property to be changed by X11
      clients.
      
      v2: Prevent X11 clients from changing the property value
          (Pekka Paalanen <pekka.paalanen@collabora.com>)
      
      Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Closes: xorg/xserver#1305
      7b7170ec
    • Olivier Fourdan's avatar
      randr: Add "RANDR Emulation" property · 0904421f
      Olivier Fourdan authored
      
      When RANDR is emulated as with Xwayland, the actual output configuration
      does not change as RANDR is emulated using viewports.
      
      As a result, changes to the CRTC may be skipped, resulting in the
      configuration being (wrongly) assumed to be unchanged.
      
      Add a new output property "RANDR Emulation" that the DDX can set to
      force RRCrtcSet() to reconfigure the CRTC regardless of the change.
      
      Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      0904421f
    • Olivier Fourdan's avatar
      randr: No need to check RRGetOutputProperty() twice · 97260384
      Olivier Fourdan authored and Olivier Fourdan's avatar Olivier Fourdan committed
      
      The function rrGetPixmapSharingSyncProp() will check for the PRIME sync
      property "PRIME Synchronization" on each output and return false if
      any of the output has this property set to false.
      
      To do so, it will call RRGetOutputProperty() twice for each output, once
      with pending true and once with pending false to cover both
      possibilities.
      
      However, reading the implementation of RRGetOutputProperty(), it appears
      that if the property is not pending, the code will return the current
      value even if invoked with pending true.
      
      So the second call to RRGetOutputProperty() with pending false seems
      superfluous.
      
      Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Fixes: df8e8693 - randr: Add ability to turn PRIME sync off
      Reviewed-by: default avatarAlex Goins <agoins@nvidia.com>
      Tested-by: default avatarAlex Goins <agoins@nvidia.com>
      97260384
  13. Apr 19, 2022
  14. Apr 05, 2022
  15. Apr 02, 2022
Loading