Skip to content
Commits on Source (33)
  • Peter Hutterer's avatar
    dix: check_modmap_change() returns Success, not true · 051a0efc
    Peter Hutterer authored
    
    
    Not sure what if anything calls XSetDeviceModifierMapping() but this would've
    failed all the time. check_modmap_change() returns Success but we were
    treating it like a boolean. Fix this.
    
    Reported-by: default avatarAdam Jackson <ajax@redhat.com>
    Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: default avatarKeith Packard <keithp@keithp.com>
    (cherry picked from commit 4fe02b8d)
    051a0efc
  • Alex Goins's avatar
    randr: rrCheckPixmapBounding should only increase screen size · 5396a4aa
    Alex Goins authored
    The purpose of rrCheckPixmapBounding() is to make sure that the fb is large
    enough to accommodate the region scanned out by a GPU screen. Currently, however,
    it will actually shrink the fb if it's larger than it needs to be.
    
    This is a problem when combining PRIME output slaving with arbitrary transforms
    with xrandr.
    
    Although arbitrary transforms are not supposed to constrain the size of the fb
    (https://lists.freedesktop.org/archives/xorg-devel/2018-January/055563.html
    
    ),
    xrandr will use RRSetScreenSize to resize the desktop to accommodate scaling
    transforms, e.g. scaling a 1920x1080 display to 3840x2160 will result in a
    desktop size of 3840x2160.
    
    In the case of PRIME, rrCheckPixmapBounding() will be called after
    RRSetScreenSize() and it will resize the fb back down to what it would be
    without the scaling transform, e.g. 1920x1080. This represents divergence in
    behavior between PRIME and non-PRIME outputs.
    
    I had originally made rrCheckPixmapBounding() account for arbitrary transforms,
    but realized that the fb being large enough to accommodate arbitrary transforms
    is not a hard requirement enforced in the server. Instead, this change simply
    makes it so that rrCheckPixmapBounding() will only resize the fb to be larger
    than it already is, preventing it from stepping on prior requests to increase
    the size of the fb.
    
    Signed-off-by: default avatarAlex Goins <agoins@nvidia.com>
    Reviewed-by: default avatarKeith Packard <keithp@keithp.com>
    Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit a90f3372)
    5396a4aa
  • Jim Qu's avatar
    modesetting: code refactor for PRIME sync · cd19a752
    Jim Qu authored
    
    
    The X will be crashed on the system with other DDX driver,
    such as amdgpu.
    
    show the log like:
    
    randr: falling back to unsynchronized pixmap sharing
    (EE)
    (EE) Backtrace:
    (EE) 0: /usr/lib/xorg/Xorg (xorg_backtrace+0x4e)
    (EE) 1: /usr/lib/xorg/Xorg (0x55cb0151a000+0x1b5ce9)
    (EE) 2: /lib/x86_64-linux-gnu/libpthread.so.0 (0x7f1587a1d000+0x11390)
    (EE)
    (EE) Segmentation fault at address 0x0
    (EE)
    
    The issue is that modesetting as the master, and amdgpu as the slave.
    Thus, when the master attempts to access pSlavePixPriv in ms_dirty_update(),
    problems result due to the fact that it's accessing AMD's 'ppriv' using the
    modesetting structure definition.
    
    Apart from fixing crash issue, the patch fix other issue in master interface
    in which driver should refer to master pixmap.
    
    Signed-off-by: default avatarJim Qu <Jim.Qu@amd.com>
    Reviewed-by: default avatarAlex Goins <agoins@nvidia.com>
    (cherry picked from commit f79e5368)
    cd19a752
  • Scott Anderson's avatar
    xwayland: use wayland axis_discrete event · 48300a77
    Scott Anderson authored
    
    
    This prevents multiple scroll events happening for wayland compositors
    which send axis values other than 10. For example, libinput will
    typically return 15 for each scroll wheel step, and if a wayland
    compositor sends those to xwayland without normalising them, 2 scroll
    wheel steps will end up as 3 xorg scroll events. By listening for the
    discrete_axis event, this will now correctly send only 2 xorg scroll
    events.
    
    The wayland protocol gurantees that there will always be an axis event
    following an axis_discrete event. However, it does not gurantee that
    other events (including other axis_discrete+axis pairs) will not happen
    in between them. So we must keep a list of outstanding axis_discrete
    events.
    
    Signed-off-by: default avatarScott Anderson <scott@anderso.nz>
    Reviewed-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit cd285922)
    48300a77
  • Lionel Landwerlin's avatar
    present: fix freed pointer access · 1b0db2c7
    Lionel Landwerlin authored
    
    
    When a vblank has been marked as aborted, it's going to be free in the
    flip_notify function when stopped. We can't notify it after it's
    stopped because the pointer is invalid.
    
    Valgrind backtrace:
    
    ==5331== Invalid read of size 8
    ==5331==    at 0x212B4D: present_vblank_notify (present_vblank.c:34)
    ==5331==    by 0x21439B: present_wnmd_flip_notify (present_wnmd.c:194)
    ==5331==    by 0x21439B: present_wnmd_event_notify (present_wnmd.c:228)
    ==5331==    by 0x156216: xwl_present_sync_callback (xwayland-present.c:282)
    ==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==  Address 0x1b44dc98 is 40 bytes inside a block of size 184 free'd
    ==5331==    at 0x48369EB: free (vg_replace_malloc.c:530)
    ==5331==    by 0x213B0A: present_wnmd_free_idle_vblanks (present_wnmd.c:118)
    ==5331==    by 0x213B0A: present_wnmd_flips_stop (present_wnmd.c:161)
    ==5331==    by 0x2143EF: present_wnmd_flip_notify (present_wnmd.c:192)
    ==5331==    by 0x2143EF: present_wnmd_event_notify (present_wnmd.c:228)
    ==5331==    by 0x156216: xwl_present_sync_callback (xwayland-present.c:282)
    ==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==  Block was alloc'd at
    ==5331==    at 0x48377D5: calloc (vg_replace_malloc.c:711)
    ==5331==    by 0x212D9F: present_vblank_create (present_vblank.c:69)
    ==5331==    by 0x214014: present_wnmd_pixmap (present_wnmd.c:610)
    ==5331==    by 0x21576C: proc_present_pixmap (present_request.c:150)
    ==5331==    by 0x27599D: Dispatch (dispatch.c:479)
    ==5331==    by 0x279945: dix_main (main.c:276)
    ==5331==    by 0x633AB16: (below main) (libc-start.c:310)
    
    v2: Still notify aborted flips (Roman)
    
    Signed-off-by: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
    Reviewed-by: default avatarDaniel Stone <daniels@collabora.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107314
    
    
    Reviewed-by: default avatarRoman Gilg <subdiff@gmail.com>
    Tested-by: default avatarRoman Gilg <subdiff@gmail.com>
    (cherry picked from commit ce271535)
    1b0db2c7
  • Olivier Fourdan's avatar
    glx: check for indirect context in CreateContextAttribsARB() · 1191b23f
    Olivier Fourdan authored
    Commit 99f0365b "Add a command line argument for disabling indirect GLX"
    added a test to check if indirect context are enabled in
    `DoCreateContext()` but `__glXDisp_CreateContextAttribsARB()` doesn't
    use `DoCreateContext()` and doesn't check if indirect context is
    enabled.
    
    As a result, clients can still manage to create indirect contexts using
    `glXCreateContextAttribsARB()` even if indirect contexts are disabled,
    which can possibly crash Xservers such as Xwayland or Xephyr when the
    context is destroyed.
    
    To avoid the issue, check for `enableIndirectGLX` in
    `__glXDisp_CreateContextAttribsARB()` as well.
    
    Fixes: 99f0365b "Add a command line argument for disabling indirect GLX"
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107508
    
    
    Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
    (cherry picked from commit 75448671)
    1191b23f
  • Lionel Landwerlin's avatar
    xwayland: fix access to invalid pointer · 8dd7173e
    Lionel Landwerlin authored
    
    
    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: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
    Reviewed-by: default avatarDaniel Stone <daniels@collabora.com>
    (cherry picked from commit 53ce2ba0)
    8dd7173e
  • Olivier Fourdan's avatar
    xwayland: Remove xwl_present_window from privates on cleanup · cffac815
    Olivier Fourdan authored
    Xwayland's `xwl_destroy_window()` invokes `xwl_present_cleanup()`
    before the common `DestroyWindow()`.
    
    But then `DestroyWindow()` calls `present_destroy_window()` which will
    possibly end up in `xwl_present_abort_vblank()` which will try to access
    data that was previously freed by `xwl_present_cleanup()`:
    
      Invalid read of size 8
         at 0x434184: xwl_present_abort_vblank (xwayland-present.c:378)
         by 0x53785B: present_wnmd_abort_vblank (present_wnmd.c:651)
         by 0x53695A: present_free_window_vblank (present_screen.c:87)
         by 0x53695A: present_destroy_window (present_screen.c:152)
         by 0x42A90D: xwl_destroy_window (xwayland.c:653)
         by 0x584298: compDestroyWindow (compwindow.c:613)
         by 0x53CEE3: damageDestroyWindow (damage.c:1570)
         by 0x4F1BB8: DbeDestroyWindow (dbe.c:1326)
         by 0x46F7F6: FreeWindowResources (window.c:1031)
         by 0x472847: DeleteWindow (window.c:1099)
         by 0x46B54C: doFreeResource (resource.c:880)
         by 0x46C706: FreeClientResources (resource.c:1146)
         by 0x446ADE: CloseDownClient (dispatch.c:3473)
       Address 0x182abde0 is 80 bytes inside a block of size 112 free'd
         at 0x4C2FDAC: free (vg_replace_malloc.c:530)
         by 0x42A937: xwl_destroy_window (xwayland.c:647)
         by 0x584298: compDestroyWindow (compwindow.c:613)
         by 0x53CEE3: damageDestroyWindow (damage.c:1570)
         by 0x4F1BB8: DbeDestroyWindow (dbe.c:1326)
         by 0x46F7F6: FreeWindowResources (window.c:1031)
         by 0x472847: DeleteWindow (window.c:1099)
         by 0x46B54C: doFreeResource (resource.c:880)
         by 0x46C706: FreeClientResources (resource.c:1146)
         by 0x446ADE: CloseDownClient (dispatch.c:3473)
         by 0x446DA5: ProcKillClient (dispatch.c:3279)
         by 0x4476AF: Dispatch (dispatch.c:479)
       Block was alloc'd at
         at 0x4C30B06: calloc (vg_replace_malloc.c:711)
         by 0x433F46: xwl_present_window_get_priv (xwayland-present.c:54)
         by 0x434228: xwl_present_get_crtc (xwayland-present.c:302)
         by 0x539728: proc_present_query_capabilities (present_request.c:227)
         by 0x4476AF: Dispatch (dispatch.c:479)
         by 0x44B5B5: dix_main (main.c:276)
         by 0x75F611A: (below main) (libc-start.c:308)
    
    This is because `xwl_present_cleanup()` frees the memory but does not
    remove it from the window's privates, and `xwl_present_abort_vblank()`
    will still find it and hence try to access that freed memory...
    
    Remove `xwl_present_window` from window's privates on cleanup so that no
    other function can find and reuse that data once it's freed.
    
    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1616269
    
    
    Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
    (cherry picked from commit 3f31f569)
    cffac815
  • Adam Jackson's avatar
    modesetting: Lie less in the man page · fdb80a32
    Adam Jackson authored
    
    
    We don't support 8bpp, and we do have acceleration.
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    (cherry picked from commit 0dc2c419)
    fdb80a32
  • Adam Jackson's avatar
    modesetting: Document Option "DoubleShadow" in the man page · 8e646ca9
    Adam Jackson authored
    
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    (cherry picked from commit c4f3e42f)
    8e646ca9
  • Dave Airlie's avatar
    shm: move shmsize verify before allocating the drawable. · bdeab786
    Dave Airlie authored
    
    
    Otherwise if the VERIFY_SHMSIZE macro fails we leak the drawables
    we allocated earlier.
    
    Noticed by coverity scan.
    
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    (cherry picked from commit 3439929c)
    bdeab786
  • Dave Airlie's avatar
    xi: free modifiers_failed on error path. (v2) · 26a83f98
    Dave Airlie authored
    
    
    Pointed out by coverity.
    
    v2: set modifies_failed to NULL at start (whot)
    
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    (cherry picked from commit 51ae6126)
    26a83f98
  • Dave Airlie's avatar
    fboverlay: move bpp checks above malloc · bb384d0b
    Dave Airlie authored
    
    
    Avoids having to free the malloced object.
    
    Pointed out by coverity.
    
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    (cherry picked from commit c7fa6a0a)
    bb384d0b
  • Dave Airlie's avatar
    glamor: fix leak of fs_getcolor_source. · 795c58a1
    Dave Airlie authored
    
    
    This is created using XNFstrdup, so it needs to be freed.
    
    Pointed out by coverity.
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    (cherry picked from commit f0a5c0d1)
    795c58a1
  • Dave Airlie's avatar
    modesetting: get pEnt after error checks · 66d36010
    Dave Airlie authored
    
    
    This saves us having to make sure we clean it up.
    
    Pointed out by coverity.
    
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    (cherry picked from commit b6c29a88)
    66d36010
  • Dave Airlie's avatar
    posix_tty: free leak of xf86SetStrOption return value. · 83ef0283
    Dave Airlie authored
    
    
    Pointed out by coverity.
    
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    (cherry picked from commit cad3a1a8)
    83ef0283
  • Dave Airlie's avatar
    xkb: fix what looks to be a copy-paste error with first vs firstMM · fcbdb7c8
    Dave Airlie authored
    
    
    Pointed out by coverity.
    
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    (cherry picked from commit 75839395)
    fcbdb7c8
  • Dave Airlie's avatar
    mibltblt: free prgnSrcClip on error path. · 64a7aac2
    Dave Airlie authored
    
    
    Pointed out by coverity.
    
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    (cherry picked from commit c4591ea1)
    64a7aac2
  • Dave Airlie's avatar
    devices: break after finding and removing device from lists · cc4051ad
    Dave Airlie authored
    
    
    Coverity complains about a use after free in here after the
    freeing, I can't follow the linked list so well, but whot
    says the device can only be on one list once, so break should
    fix it.
    
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    (cherry picked from commit ba0f5d85)
    cc4051ad
  • Adam Jackson's avatar
    xfree86: Fix Option "MaxClients" validation · fb01b238
    Adam Jackson authored
    
    
    The old code would not in fact validate the option value, though it
    might complain about it in the log. It also didn't let you set some
    legal values that the -maxclients command line option would.
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    (cherry picked from commit 7d689f04)
    fb01b238
  • Olivier Fourdan's avatar
    xwayland: Use `double` for `xwl_tablet_tool` · c26a47b4
    Olivier Fourdan authored
    
    
    So we do not lose subpixel precision in Xwayland.
    
    Suggested-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
    Closes: https://gitlab.freedesktop.org/libinput/libinput/issues/138
    (cherry picked from commit 734b2d69)
    c26a47b4
  • Cedric Roux's avatar
    miext/damage: take care of the coordinate mode in damagePolyPoint · 94033359
    Cedric Roux authored
    
    
    The mode (CoordModeOrigin or CoordModePrevious) was not taken into
    account when computing the box. The result was a bad drawing of
    points in some situations (on my hardware/software configuration,
    calling XDrawString followed by XDrawPoints in the mode
    CoordModePrevious).
    
    Signed-off-by: default avatarCedric Roux <sed@free.fr>
    Signed-off-by: default avatarEric Anholt <eric@anholt.net>
    (cherry picked from commit bc36594e)
    94033359
  • Adam Jackson's avatar
    modesetting: Don't free(dst) in drmmode_prop_info_copy · a41b6ef2
    Adam Jackson authored
    
    
    The destination is always either on the stack or in the middle of some
    struct.
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    (cherry picked from commit 43a0f9a5)
    a41b6ef2
  • Pierre Ossman's avatar
    Switch automatic composite update to WorkQueue · b1215fb0
    Pierre Ossman authored
    It is currently (ab)using the screen BlockHandler callback to do
    this. But this can cause problems with other extension as their
    block handlers might have executed before Composite's. And the
    operations Composite does might result in them wanting to change
    timeouts.
    
    Practically this caused problems for TigerVNC's VNC extension which
    failed to send out updates for Composite's screen updates.
    
    (cherry picked from commit 1bd5d0a5)
    b1215fb0
  • Alexander Volkov's avatar
    os/xdmcp: Don't create a new socket in XdmcpReset() · b58aa8ed
    Alexander Volkov authored
    
    
    xdmcpSocket survives during the reset, there is no
    need to create a new one.
    
    This commit restores logic that was broken by
    49c0f241 in Xorg 1.19.
    
    Signed-off-by: default avatarAlexander Volkov <a.volkov@rusbitech.ru>
    (cherry picked from commit 32677ce0)
    b58aa8ed
  • Adam Jackson's avatar
    glamor_egl: Don't initialize on llvmpipe · 1e3c5d61
    Adam Jackson authored
    
    
    Mesa started supporting GL_OES_EGL_image on llvmpipe in 17.3, after this
    commit:
    
        commit bbdeddd5fd0b797e1e281f058338b3da4d98029d
        Author: Gurchetan Singh <gurchetansingh@chromium.org>
        Date:   Tue Aug 1 14:49:33 2017 -0700
    
            st/dri: add drisw image extension
    
    That's pretty cool, but it means glamor now thinks it can initialize on
    llvmpipe. This is almost certainly not what anyone wants, as glamor on
    llvmpipe is pretty much uniformly slower than fb.
    
    This fixes both Xorg and Xwayland to refuse glamor in such a setup.
    Xephyr is left alone, both because glamor is not the default there and
    because Xephyr+glamor+llvmpipe is one of the easier ways to get xts to
    exercise glamor.
    
    The (very small) downside of this change is that you lose DRI3 support.
    This wouldn't have helped you very much (since an lp glamor blit is
    slower than a pixman blit), but it would eliminate the PutImage overhead
    for llvmpipe's glXSwapBuffers. A future change should add DRI3 support
    for the fb-only case.
    
    Reviewed-by: default avatarEric Anholt <eric@anholt.net>
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    (cherry picked from commit 0a9415cf)
    1e3c5d61
  • Adam Jackson's avatar
    glamor/egl: Avoid crashing on broken configurations · 4795c069
    Adam Jackson authored
    
    
    0a9415cf apparently can tickle bugs in the GL stack where glGetString
    returns NULL, presumably because the eglMakeCurrent() didn't manage to
    actually install a dispatch table and you're hitting a stub function.
    That's clearly not our bug, but if it happens we should at least not
    crash. Notice this case and fail gently.
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    (cherry picked from commit af151895)
    4795c069
  • Adam Jackson's avatar
  • Adam Jackson's avatar
    xserver 1.20.2 · 2a0c6c15
    Adam Jackson authored
    
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    2a0c6c15
  • Andreas Boll's avatar
    Merge tag 'xorg-server-1.20.2' into debian-unstable · 90c8d721
    Andreas Boll authored
    xorg-server-1.20.2
    90c8d721
  • Andreas Boll's avatar
    Bump changelog · 17bb0f0f
    Andreas Boll authored
    17bb0f0f
  • Andreas Boll's avatar
    Close some bugs · bb492a1e
    Andreas Boll authored
    bb492a1e
  • Andreas Boll's avatar
    44caf375
......@@ -834,6 +834,19 @@ ProcPanoramiXShmGetImage(ClientPtr client)
return BadMatch;
}
if (format == ZPixmap) {
widthBytesLine = PixmapBytePad(w, pDraw->depth);
length = widthBytesLine * h;
}
else {
widthBytesLine = PixmapBytePad(w, 1);
lenPer = widthBytesLine * h;
plane = ((Mask) 1) << (pDraw->depth - 1);
length = lenPer * Ones(planemask & (plane | (plane - 1)));
}
VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
drawables = calloc(PanoramiXNumScreens, sizeof(DrawablePtr));
if (!drawables)
return BadAlloc;
......@@ -856,18 +869,6 @@ ProcPanoramiXShmGetImage(ClientPtr client)
.depth = pDraw->depth
};
if (format == ZPixmap) {
widthBytesLine = PixmapBytePad(w, pDraw->depth);
length = widthBytesLine * h;
}
else {
widthBytesLine = PixmapBytePad(w, 1);
lenPer = widthBytesLine * h;
plane = ((Mask) 1) << (pDraw->depth - 1);
length = lenPer * Ones(planemask & (plane | (plane - 1)));
}
VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
xgi.size = length;
if (length == 0) { /* nothing to do */
......
......@@ -88,7 +88,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
};
int i, ret = Success;
uint32_t *modifiers;
xXIGrabModifierInfo *modifiers_failed;
xXIGrabModifierInfo *modifiers_failed = NULL;
GrabMask mask = { 0 };
GrabParameters param;
void *tmp;
......@@ -232,8 +232,8 @@ ProcXIPassiveGrabDevice(ClientPtr client)
if (rep.num_modifiers)
WriteToClient(client, rep.length * 4, modifiers_failed);
free(modifiers_failed);
out:
free(modifiers_failed);
xi2mask_free(&mask.xi2mask);
return ret;
}
......
......@@ -47,24 +47,18 @@
#include "compint.h"
static void
compScreenUpdate(ScreenPtr pScreen)
{
compCheckTree(pScreen);
compPaintChildrenToWindow(pScreen->root);
}
static void
compBlockHandler(ScreenPtr pScreen, void *pTimeout)
static Bool
compScreenUpdate(ClientPtr pClient, void *closure)
{
ScreenPtr pScreen = closure;
CompScreenPtr cs = GetCompScreen(pScreen);
pScreen->BlockHandler = cs->BlockHandler;
compScreenUpdate(pScreen);
(*pScreen->BlockHandler) (pScreen, pTimeout);
compCheckTree(pScreen);
compPaintChildrenToWindow(pScreen->root);
/* Next damage will restore the block handler */
cs->BlockHandler = NULL;
/* Next damage will restore the worker */
cs->pendingScreenUpdate = FALSE;
return TRUE;
}
void
......@@ -87,9 +81,9 @@ compReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure)
CompScreenPtr cs = GetCompScreen(pScreen);
CompWindowPtr cw = GetCompWindow(pWin);
if (!cs->BlockHandler) {
cs->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = compBlockHandler;
if (!cs->pendingScreenUpdate) {
QueueWorkProc(compScreenUpdate, serverClient, pScreen);
cs->pendingScreenUpdate = TRUE;
}
cw->damaged = TRUE;
......
......@@ -387,6 +387,8 @@ compScreenInit(ScreenPtr pScreen)
cs->pOverlayWin = NULL;
cs->pOverlayClients = NULL;
cs->pendingScreenUpdate = FALSE;
cs->numAlternateVisuals = 0;
cs->alternateVisuals = NULL;
cs->numImplicitRedirectExceptions = 0;
......@@ -442,8 +444,6 @@ compScreenInit(ScreenPtr pScreen)
cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
cs->BlockHandler = NULL;
cs->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = compCloseScreen;
......
......@@ -156,7 +156,8 @@ typedef struct _CompScreen {
*/
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
ScreenBlockHandlerProcPtr BlockHandler;
Bool pendingScreenUpdate;
CloseScreenProcPtr CloseScreen;
int numAlternateVisuals;
VisualID *alternateVisuals;
......
......@@ -26,9 +26,9 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.60)
AC_INIT([xorg-server], 1.20.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="2018-08-07"
RELEASE_NAME="Kale Salad"
AC_INIT([xorg-server], 1.20.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
RELEASE_DATE="2018-10-15"
RELEASE_NAME="Tofu Biryani"
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
......
xorg-server (2:1.20.2-1) UNRELEASED; urgency=medium
* New upstream release.
- Fixes various crashes with xwayland (Closes: #777625, #881891,
#911146).
- Fixes a crash when running the X server inside virtualbox
(Closes: #911680).
* Drop 08_dont-init-glamor-on-llvmpipe.diff, upstream.
-- Andreas Boll <aboll@debian.org> Wed, 24 Oct 2018 13:32:00 +0200
xorg-server (2:1.20.1-5) unstable; urgency=medium
[ Timo Aaltonen ]
......
commit 0a9415cf793babed1f28c61f8047d51de04f1528
Author: Adam Jackson <ajax@redhat.com>
Date: Fri Sep 14 11:33:43 2018 -0400
glamor_egl: Don't initialize on llvmpipe
Mesa started supporting GL_OES_EGL_image on llvmpipe in 17.3, after this
commit:
commit bbdeddd5fd0b797e1e281f058338b3da4d98029d
Author: Gurchetan Singh <gurchetansingh@chromium.org>
Date: Tue Aug 1 14:49:33 2017 -0700
st/dri: add drisw image extension
That's pretty cool, but it means glamor now thinks it can initialize on
llvmpipe. This is almost certainly not what anyone wants, as glamor on
llvmpipe is pretty much uniformly slower than fb.
This fixes both Xorg and Xwayland to refuse glamor in such a setup.
Xephyr is left alone, both because glamor is not the default there and
because Xephyr+glamor+llvmpipe is one of the easier ways to get xts to
exercise glamor.
The (very small) downside of this change is that you lose DRI3 support.
This wouldn't have helped you very much (since an lp glamor blit is
slower than a pixman blit), but it would eliminate the PutImage overhead
for llvmpipe's glXSwapBuffers. A future change should add DRI3 support
for the fb-only case.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index df278b1a1..9b930d603 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -898,6 +898,7 @@ Bool
glamor_egl_init(ScrnInfoPtr scrn, int fd)
{
struct glamor_egl_screen_private *glamor_egl;
+ const GLubyte *renderer;
glamor_egl = calloc(sizeof(*glamor_egl), 1);
if (glamor_egl == NULL)
@@ -992,6 +993,14 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
"Failed to make EGL context current\n");
goto error;
}
+
+ renderer = glGetString(GL_RENDERER);
+ if (strstr((const char *)renderer, "llvmpipe")) {
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
+ "Refusing to try glamor on llvmpipe\n");
+ goto error;
+ }
+
/*
* Force the next glamor_make_current call to set the right context
* (in case of multiple GPUs using glamor)
@@ -1005,7 +1014,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
}
xf86DrvMsg(scrn->scrnIndex, X_INFO, "glamor X acceleration enabled on %s\n",
- glGetString(GL_RENDERER));
+ renderer);
#ifdef GBM_BO_WITH_MODIFIERS
if (epoxy_has_egl_extension(glamor_egl->display,
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index 06fcf5239..25a354bf7 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -843,6 +843,11 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen)
goto error;
}
+ if (strstr((const char *)glGetString(GL_RENDERER), "llvmpipe")) {
+ ErrorF("Refusing to try glamor on llvmpipe\n");
+ goto error;
+ }
+
if (!epoxy_has_gl_extension("GL_OES_EGL_image")) {
ErrorF("GL_OES_EGL_image not available\n");
goto error;
......@@ -6,4 +6,3 @@
05_Revert-Unload-submodules.diff
06_use-intel-only-on-pre-gen4.diff
07_use-modesetting-driver-by-default-on-GeForce.diff
08_dont-init-glamor-on-llvmpipe.diff
......@@ -1177,6 +1177,7 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent)
flags[tmp->id] = IsMaster(tmp) ? XIMasterRemoved : XISlaveRemoved;
CloseDevice(tmp);
ret = Success;
break;
}
}
......@@ -1193,6 +1194,7 @@ RemoveDevice(DeviceIntPtr dev, BOOL sendevent)
prev->next = next;
ret = Success;
break;
}
}
......
......@@ -282,7 +282,7 @@ change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *modkeymap,
else if (!IsFloating(dev) &&
GetMaster(dev, MASTER_KEYBOARD)->lastSlave == dev) {
/* If this fails, expect the results to be weird. */
if (check_modmap_change(client, dev->master, modmap))
if (check_modmap_change(client, dev->master, modmap) == Success)
do_modmap_change(client, dev->master, modmap);
}
......
......@@ -279,11 +279,11 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
(&fbOverlayScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
return FALSE;
pScrPriv = malloc(sizeof(FbOverlayScrPrivRec));
if (!pScrPriv)
if (bpp1 == 24 || bpp2 == 24)
return FALSE;
if (bpp1 == 24 || bpp2 == 24)
pScrPriv = malloc(sizeof(FbOverlayScrPrivRec));
if (!pScrPriv)
return FALSE;
if (!fbInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &depth1,
......
......@@ -892,6 +892,7 @@ Bool
glamor_egl_init(ScrnInfoPtr scrn, int fd)
{
struct glamor_egl_screen_private *glamor_egl;
const GLubyte *renderer;
glamor_egl = calloc(sizeof(*glamor_egl), 1);
if (glamor_egl == NULL)
......@@ -986,6 +987,19 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
"Failed to make EGL context current\n");
goto error;
}
renderer = glGetString(GL_RENDERER);
if (!renderer) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"glGetString() returned NULL, your GL is broken\n");
goto error;
}
if (strstr((const char *)renderer, "llvmpipe")) {
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"Refusing to try glamor on llvmpipe\n");
goto error;
}
/*
* Force the next glamor_make_current call to set the right context
* (in case of multiple GPUs using glamor)
......@@ -999,7 +1013,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
}
xf86DrvMsg(scrn->scrnIndex, X_INFO, "glamor X acceleration enabled on %s\n",
glGetString(GL_RENDERER));
renderer);
#ifdef GBM_BO_WITH_MODIFIERS
if (epoxy_has_egl_extension(glamor_egl->display,
......
......@@ -38,7 +38,7 @@
#define RADIAL_SMALL_STOPS (6 + 2)
#define RADIAL_LARGE_STOPS (16 + 2)
static const char *
static char *
_glamor_create_getcolor_fs_source(ScreenPtr screen, int stops_count,
int use_array)
{
......@@ -310,7 +310,7 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count,
"}\n"\
"\n"\
"%s\n" /* fs_getcolor_source */
const char *fs_getcolor_source;
char *fs_getcolor_source;
glamor_priv = glamor_get_screen_private(screen);
......@@ -343,6 +343,7 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count,
fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, gradient_fs);
free(gradient_fs);
free(fs_getcolor_source);
glAttachShader(gradient_prog, vs_prog);
glAttachShader(gradient_prog, fs_prog);
......@@ -493,7 +494,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count,
"}\n"\
"\n"\
"%s" /* fs_getcolor_source */
const char *fs_getcolor_source;
char *fs_getcolor_source;
glamor_priv = glamor_get_screen_private(screen);
......@@ -522,6 +523,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count,
fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, gradient_fs);
free(gradient_fs);
free(fs_getcolor_source);
glAttachShader(gradient_prog, vs_prog);
glAttachShader(gradient_prog, fs_prog);
......
......@@ -28,6 +28,7 @@
#include "glxserver.h"
#include "glxext.h"
#include "indirect_dispatch.h"
#include "opaque.h"
#define ALL_VALID_FLAGS \
(GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB \
......@@ -320,6 +321,17 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
err = BadAlloc;
}
else {
/* Only allow creating indirect GLX contexts if allowed by
* server command line. Indirect GLX is of limited use (since
* it's only GL 1.4), it's slower than direct contexts, and
* it's a massive attack surface for buffer overflow type
* errors.
*/
if (!enableIndirectGLX) {
client->errorValue = req->isDirect;
return BadValue;
}
ctx = glxScreen->createContext(glxScreen, config, shareCtx,
req->numAttribs, (uint32_t *) attribs,
&err);
......
......@@ -939,11 +939,13 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
from = X_CMDLINE;
i = -1;
if (xf86GetOptValInteger(FlagOptions, FLAG_MAX_CLIENTS, &i)) {
if (i != 64 && i != 128 && i != 256 && i != 512)
ErrorF("MaxClients must be one of 64, 128, 256 or 512\n");
if (Ones(i) != 1 || i < 64 || i > 2048) {
ErrorF("MaxClients must be one of 64, 128, 256, 512, 1024, or 2048\n");
} else {
from = X_CONFIG;
LimitClients = i;
}
}
xf86Msg(from, "Max clients allowed: %i, resource mask: 0x%x\n",
LimitClients, RESOURCE_ID_MASK);
}
......
......@@ -640,8 +640,9 @@ ms_dirty_update(ScreenPtr screen, int *timeout)
xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) {
region = DamageRegion(ent->damage);
if (RegionNotEmpty(region)) {
if (!screen->isGPU) {
msPixmapPrivPtr ppriv =
msGetPixmapPriv(&ms->drmmode, ent->slave_dst);
msGetPixmapPriv(&ms->drmmode, ent->slave_dst->master_pixmap);
if (ppriv->notify_on_damage) {
ppriv->notify_on_damage = FALSE;
......@@ -653,6 +654,7 @@ ms_dirty_update(ScreenPtr screen, int *timeout)
/* Requested manual updating */
if (ppriv->defer_dirty_update)
continue;
}
redisplay_dirty(screen, ent, timeout);
DamageEmpty(ent->damage);
......@@ -898,8 +900,6 @@ PreInit(ScrnInfoPtr pScrn, int flags)
if (pScrn->numEntities != 1)
return FALSE;
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if (flags & PROBE_DETECT) {
return FALSE;
}
......@@ -908,6 +908,8 @@ PreInit(ScrnInfoPtr pScrn, int flags)
if (!GetRec(pScrn))
return FALSE;
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
ms = modesettingPTR(pScrn);
ms->SaveGeneration = -1;
ms->pEnt = pEnt;
......@@ -1251,8 +1253,8 @@ msStartFlippingPixmapTracking(RRCrtcPtr crtc, DrawablePtr src,
ScreenPtr pScreen = src->pScreen;
modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen));
msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1),
ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2);
msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1->master_pixmap),
ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2->master_pixmap);
if (!PixmapStartDirtyTracking(src, slave_dst1, x, y,
dst_x, dst_y, rotation)) {
......@@ -1280,10 +1282,10 @@ msStartFlippingPixmapTracking(RRCrtcPtr crtc, DrawablePtr src,
static Bool
msPresentSharedPixmap(PixmapPtr slave_dst)
{
ScreenPtr pScreen = slave_dst->drawable.pScreen;
ScreenPtr pScreen = slave_dst->master_pixmap->drawable.pScreen;
modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen));
msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, slave_dst);
msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, slave_dst->master_pixmap);
RegionPtr region = DamageRegion(ppriv->dirty->damage);
......@@ -1304,8 +1306,8 @@ msStopFlippingPixmapTracking(DrawablePtr src,
ScreenPtr pScreen = src->pScreen;
modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen));
msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1),
ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2);
msPixmapPrivPtr ppriv1 = msGetPixmapPriv(&ms->drmmode, slave_dst1->master_pixmap),
ppriv2 = msGetPixmapPriv(&ms->drmmode, slave_dst2->master_pixmap);
Bool ret = TRUE;
......@@ -1471,7 +1473,7 @@ msRequestSharedPixmapNotifyDamage(PixmapPtr ppix)
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
modesettingPtr ms = modesettingPTR(scrn);
msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix);
msPixmapPrivPtr ppriv = msGetPixmapPriv(&ms->drmmode, ppix->master_pixmap);
ppriv->notify_on_damage = TRUE;
......
......@@ -398,7 +398,6 @@ drmmode_prop_info_copy(drmmode_prop_info_ptr dst,
err:
while (i--)
free(dst[i].enum_values);
free(dst);
return FALSE;
}
......
......@@ -14,10 +14,13 @@ modesetting \- video driver for framebuffer device
.fi
.SH DESCRIPTION
.B modesetting
is an @xservername@ driver for KMS devices. This is a non-accelerated
driver, the following framebuffer depths are supported: 8, 15, 16, 24.
All visual types are supported for depth 8, and TrueColor visual is
supported for the other depths. RandR 1.2 is supported.
is an @xservername@ driver for KMS devices. This driver supports
TrueColor visuals at framebuffer depths of 15, 16, 24, and 30. RandR
1.2 is supported for multi-head configurations. Acceleration is available
through glamor for devices supporting at least OpenGL ES 2.0 or OpenGL 2.1.
If glamor is not enabled, a shadow framebuffer is configured based on the
KMS drivers' preference (unless the framebuffer is 24 bits per pixel, in
which case the shadow framebuffer is always used).
.SH SUPPORTED HARDWARE
The
.B modesetting
......@@ -51,8 +54,18 @@ The framebuffer device to use. Default: /dev/dri/card0.
.BI "Option \*qShadowFB\*q \*q" boolean \*q
Enable or disable use of the shadow framebuffer layer. Default: on.
.TP
.BI "Option \*qDoubleShadow\*q \*q" boolean \*q
Double-buffer shadow updates. When enabled, the driver will keep two copies of
the shadow framebuffer. When the shadow framebuffer is flushed, the old and new
versions of the shadow are compared, and only tiles that have actually changed
are uploaded to the device. This is an optimization for server-class GPUs with
a remote display function (typically VNC), where remote updates are triggered
by any framebuffer write, so minimizing the amount of data uploaded is crucial.
This defaults to enabled for ASPEED and Matrox G200 devices, and disabled
otherwise.
.TP
.BI "Option \*qAccelMethod\*q \*q" string \*q
One of \*qglamor\*q or \*qnone\*q. Default: glamor
One of \*qglamor\*q or \*qnone\*q. Default: glamor.
.TP
.BI "Option \*qPageFlip\*q \*q" boolean \*q
Enable DRI3 page flipping. The default is
......
......@@ -329,6 +329,22 @@ fbdev_open(int scrnIndex, const char *dev, char **namep)
return -1;
}
/* only touch non-PCI devices on this path */
{
char buf[PATH_MAX];
char *sysfs_path = NULL;
char *node = strrchr(dev, '/') + 1;
if (asprintf(&sysfs_path, "/sys/class/graphics/%s", node) < 0 ||
readlink(sysfs_path, buf, sizeof(buf) < 0) ||
strstr(buf, "devices/pci")) {
free(sysfs_path);
close(fd);
return -1;
}
free(sysfs_path);
}
if (namep) {
if (-1 == ioctl(fd, FBIOGET_FSCREENINFO, (void *) (&fix))) {
*namep = NULL;
......