1. 22 Jun, 2019 1 commit
  2. 19 Dec, 2018 2 commits
    • Ulrich Sibiller's avatar
      fb: fix fast-path blt detection · 034228d7
      Ulrich Sibiller authored
      Backport of this commit:
      
        commit a2880699e8f1f576e1a48ebf25e8982463323f84
        Author: Keith Packard <keithp@keithp.com>
        Date:   Tue Mar 25 08:21:16 2014 -0700
      
          fb: fix fast-path blt detection
      
          The width parameter is used to disable the blit fast-path (memcpy) when
              source and destination rows overlap in memory. This check was added in [0].
      
          Unfortunately, the calculation to determine if source and destination
          lines overlapped was incorrect:
            (1) it converts width from pixels to bytes, but width is actually in
                bits, not pixels.
            (2) it adds this byte offset to dst/srcLine, which implicitly converts
                the offset from bytes to sizeof(FbBits).
      
          Fix both of these by converting addresses to byte pointers and width
          to bytes and doing comparisons on the resulting byte address.
      
          For example:
          A 32-bpp 1366 pixel-wide row will have
            width = 1366 * 32 = 43712 bits
            bpp = 32
            (bpp >> 3) = 4
            width * (bpp >> 3) = 174848 FbBits
            (FbBits *)width => 699392 bytes
      
          So, "careful" was true if the destination line was within 699392 bytes,
          instead of just within its 1366 * 4 = 5464 byte row.
      
          This bug causes us to take the slow path for large non-overlapping rows
          that are "close" in memory.  As a data point, XGetImage(1366x768) on my
          ARM chromebook was taking ~140 ms, but with this fixed, it now takes
          about 60 ms.
            XGetImage() -> exaGetImage() -> fbGetImage -> fbBlt()
      
          [0] commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce
          Author: Adam Jackson <ajax@redhat.com>
          Date:   Thu Apr 21 16:37:11 2011 -0400
      
              fb: Fix memcpy abuse
      
              The memcpy fast path implicitly assumes that the copy walks
              left-to-right.  That's not something memcpy guarantees, and newer glibc
              on some processors will indeed break that assumption.  Since we walk a
              line at a time, check the source and destination against the width of
              the blit to determine whether we can be sloppy enough to allow memcpy.
              (Having done this, we can remove the check for !reverse as well.)
      
          v3: Convert to byte units
      
          This first checks to make sure the blt is byte aligned, converts all
          of the data to byte units and then compares for byte address range
          overlap between source and dest.
      Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: 's avatarDaniel Kurtz <djkurtz@chromium.org>
      034228d7
    • Ulrich Sibiller's avatar
      fb: Fix memcpy abuse · 020ef045
      Ulrich Sibiller authored
      Fixes ArcticaProject/nx-libs#750
      
      Backport of this commit:
      
      commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce
      Author: Adam Jackson <ajax@redhat.com>
      Date:   Thu Apr 21 16:37:11 2011 -0400
      
          fb: Fix memcpy abuse
      
          The memcpy fast path implicitly assumes that the copy walks
          left-to-right.  That's not something memcpy guarantees, and newer glibc
          on some processors will indeed break that assumption.  Since we walk a
          line at a time, check the source and destination against the width of
          the blit to determine whether we can be sloppy enough to allow memcpy.
          (Having done this, we can remove the check for !reverse as well.)
      
          On an Intel Core i7-2630QM with an NVIDIA GeForce GTX 460M running in
          NoAccel, the broken code and various fixes for -copywinwin{10,100,500}
          gives (edited to fit in 80 columns):
      
          1: Disable the fastpath entirely
          2: Replace memcpy with memmove
          3: This fix
          4: The code before this fix
      
            1            2                 3                 4           Operation
            ------   ---------------   ---------------   ---------------   ------------
            258000   269000 (  1.04)   544000 (  2.11)   552000 (  2.14)   Copy 10x10
             21300    23000 (  1.08)    43700 (  2.05)    47100 (  2.21)   Copy 100x100
               960      962 (  1.00)     1990 (  2.09)     1990 (  2.07)   Copy 500x500
      
          So it's a modest performance hit, but correctness demands it, and it's
          probably worth keeping the 2x speedup from having the fast path in the
          first place.
      Signed-off-by: 's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
      020ef045
  3. 05 Feb, 2018 1 commit
  4. 19 Apr, 2017 1 commit
  5. 10 Apr, 2017 3 commits
  6. 10 Mar, 2017 1 commit
    • Ulrich Sibiller's avatar
      fb: fix compiler warning · c1ed0056
      Ulrich Sibiller authored
      fbtrap.c: In function ‘fbRasterizeTrapezoid’:
      fbtrap.c:113:12: warning: variable ‘x_off_fixed’ set but not used [-Wunused-but-set-variable]
           xFixed x_off_fixed;
      c1ed0056
  7. 03 Mar, 2017 3 commits
    • Ulrich Sibiller's avatar
      replace (DE)ALLOCATE_LOCAL by malloc/free · 06bb154d
      Ulrich Sibiller authored
      This is basically a backport of the following commits + replacing
      xalloc/xfree by malloc/free. Fixes ArcticaProject/nx-libs#358.
      
         commit 2761c103311a1160bc483fd0367d654733df8598
         Author: Daniel Stone <daniel@fooishbar.org>
         Date:   Mon Nov 5 14:03:26 2007 +0000
      
             OS: Remove usage of alloca
      
             Replace with heap allocations.
      
         commit 5e363500c86042c394595e1a6633581eb8fcd1bb
         Author: Daniel Stone <daniel@fooishbar.org>
         Date:   Mon Nov 5 14:38:28 2007 +0000
      
             OS: Remove ALLOCATE_LOCAL from os.h
      
             Remove ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK from os.h, and
             remove the include of Xalloca.h as well.
      06bb154d
    • Ulrich Sibiller's avatar
      replace (DE)ALLOCATE_LOCAL by malloc/free · 09ef9991
      Ulrich Sibiller authored
      This is basically a backport of the following commits + replacing
      xalloc/xfree by malloc/free. Fixes ArcticaProject/nx-libs#358.
      
         commit 2761c103311a1160bc483fd0367d654733df8598
         Author: Daniel Stone <daniel@fooishbar.org>
         Date:   Mon Nov 5 14:03:26 2007 +0000
      
             OS: Remove usage of alloca
      
             Replace with heap allocations.
      
         commit 5e363500c86042c394595e1a6633581eb8fcd1bb
         Author: Daniel Stone <daniel@fooishbar.org>
         Date:   Mon Nov 5 14:38:28 2007 +0000
      
             OS: Remove ALLOCATE_LOCAL from os.h
      
             Remove ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK from os.h, and
             remove the include of Xalloca.h as well.
      09ef9991
    • Mike Gabriel's avatar
      Xserver/fb/fboverlay.c: Define -DMITSHM at build as it is used in fboverlay.c. · 269651e4
      Mike Gabriel authored
       Fixes ArcticaProject/nx-libs#237.
      269651e4
  8. 01 Mar, 2017 1 commit
  9. 08 Feb, 2017 1 commit
  10. 04 Dec, 2016 1 commit
  11. 03 Nov, 2016 2 commits
  12. 02 Nov, 2016 2 commits
  13. 31 Oct, 2016 1 commit
  14. 30 Oct, 2016 1 commit
  15. 20 Oct, 2016 1 commit
  16. 05 Jul, 2016 3 commits
    • Mike Gabriel's avatar
      VCS info lines: Remove ancient X.org / XFree86 VCS info line from code files. · 6144b615
      Mike Gabriel authored
       This has already been started while replacing copyright info in file
       headers and has now been completed with this commit.
      6144b615
    • Adam Jackson's avatar
      Remove fbpseudocolor · 7e21611d
      Adam Jackson authored
       "An experimental pseudocolor emulation layer.  Not fully completed,
       currently only works for 16bpp."  That was almost four years ago.
       It still doesn't work, only one driver even attempts to use it, it
       contains an ad-hoc implementation of damage, and should really be
       done up in Composite now anyway.
      
       Backport to nx-libs: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
      7e21611d
    • Cyril Brulebois's avatar
      fb: Mark some variables as unused. · 3a54da8b
      Cyril Brulebois authored
       There's no use for the values set through the various macro calls
       (fbGetDrawable and fbGetDrawablePixmap), so mark those variables as unused.
      
       The following warnings go away accordingly:
       |   CC     libfb_la-fb24_32.lo
       | fb24_32.c: In function 'fb24_32ReformatTile':
       | fb24_32.c:544:19: warning: variable 'newYoff' set but not used [-Wunused-but-set-variable]
       | fb24_32.c:544:10: warning: variable 'newXoff' set but not used [-Wunused-but-set-variable]
       | fb24_32.c:543:19: warning: variable 'oldYoff' set but not used [-Wunused-but-set-variable]
       | fb24_32.c:543:10: warning: variable 'oldXoff' set but not used [-Wunused-but-set-variable]
       |   CC     libfb_la-fbfill.lo
       | fbfill.c: In function 'fbFill':
       | fbfill.c:72:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
       | fbfill.c:72:11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]
       | fbfill.c:100:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
       | fbfill.c:100:11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]
       | fbfill.c:142:20: warning: variable 'tileYoff' set but not used [-Wunused-but-set-variable]
       | fbfill.c:142:10: warning: variable 'tileXoff' set but not used [-Wunused-but-set-variable]
       |   CC     libfb_la-fbgc.lo
       | fbgc.c: In function 'fbPadPixmap':
       | fbgc.c:92:19: warning: variable 'yOff' set but not used [-Wunused-but-set-variable]
       | fbgc.c:92:13: warning: variable 'xOff' set but not used [-Wunused-but-set-variable]
       | fbgc.c: In function 'fbCanEvenStipple':
       | fbgc.c:166:23: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
       | fbgc.c:166:13: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]
       |   CC     libfb_la-fbpush.lo
       | fbpush.c: In function 'fbPushPixels':
       | fbpush.c:238:20: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
       | fbpush.c:238:10: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]
      Reviewed-by: 's avatarJeremy Huddleston <jeremyhu@apple.com>
      Signed-off-by: 's avatarCyril Brulebois <kibi@debian.org>
       Backport to nx-libs: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
      3a54da8b
  17. 02 Jul, 2016 3 commits
  18. 24 Jun, 2016 1 commit
  19. 21 Jun, 2016 1 commit
    • Mike Gabriel's avatar
      Move each screen's root-window pointer into ScreenRec. · c61bb8cc
      Mike Gabriel authored
       Backported from X.org:
      
       commit e7fae9ecc42ab5e73b89117722dbf4117d928f9a
       Author: Jamey Sharp <jamey@minilop.net>
       Date:   Sat May 22 00:26:28 2010 -0700
      
          Move each screen's root-window pointer into ScreenRec.
      
          Many references to the WindowTable array already had the corresponding
          screen pointer handy, which meant they usually looked like
          "WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of
          keeping this information in a parallel array simplifies those
          expressions, and eliminates a MAXSCREENS-sized array.
      
          Since dix uses this data, a screen private entry isn't appropriate.
      
          xf86-video-dummy currently uses WindowTable, so it needs to be updated
          to reflect this change.
      Signed-off-by: 's avatarJamey Sharp <jamey@minilop.net>
      Reviewed-by: 's avatarTiago Vignatti <tiago.vignatti@nokia.com>
          Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
      
       Backport to nx-libs: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
      c61bb8cc
  20. 02 May, 2016 3 commits
    • Mike Gabriel's avatar
      Change region implementation names to eliminate the 'mi' prefix · b0e69fe3
      Mike Gabriel authored
      This prepares the file to be moved from mi to dix. This patch
      was done mechanically with the included scripts 'fix-miregion' run over
      the entire X server and 'fix-miregion-private' run over
      include/regionstr.h and mi/miregion.c.
      
      v1: Keith Packard <keithp@keithp.com>
      v2: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> (backported to nx-libs)
      b0e69fe3
    • Mike Gabriel's avatar
    • Mike Gabriel's avatar
      Rename region macros to eliminate screen argument · 63f1fff8
      Mike Gabriel authored
      This is a huge mechanical patch and a few small fixups required to finish
      the job. They were reviewed separately, but because the server does not
      build without both pieces, I've merged them together at this time.
      
      The mechanical changes were performed by running the included
      'fix-region' script over the whole nx-X11/programs/Xserver tree:
      
      $ cd nx-X11/programs/Xserver && ( git ls-files | grep -v '^fix-' | xargs ./fix-region; )
      
      And then, the white space errors in the resulting patch were fixed
      using the provided fix-patch-whitespace script.
      
      $ sh ./fix-patch-whitespace
      
      Thanks to Jamey Sharp for the mighty fine sed-generating sed script.
      
      v1: Keith Packard <keithp@keithp.com> (X.Org xserver commit: 2dc138922b7588515d5f2447e4b9dcdc0bef15e0)
      v2: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> (apply fix-region script to nx-libs)
      63f1fff8
  21. 28 Dec, 2015 2 commits
    • Mike Gabriel's avatar
      Clear header file namespace separation (<X11/...> vs. <nx-X11/...>). · 433d8186
      Mike Gabriel authored
       In the process of building nxagent against more and more system-wide installed
       X.org libraries, we come to the limit of including structs from this (bundled
       nx-X11) and that (system-wide X.Org) library.
      
       This commit introduces a clear namespace separation of headers provided by
       nx-X11 and headers provided by X.Org. This approach is only temporary as we
       want to drop all nx-X11 bundled libraries from nx-libs.
      
       However, for a while we need to make this separation clear and also ship
       some reduced fake X.Org headers that avoid pulling in libX* and libNX_X*
       symbols at the same time.
      
       This patch has been tested on Debian jessie and unstable and requires no
       overall testing on various distros and distro versions, as we finally will
       drop all libNX_X* libraries and build against X.org's client libs.
      
       For now, this hack eases our development / cleanup process.
      433d8186
    • Keith Packard's avatar
      Replace 'pointer' type with 'void *' · 68dd0b52
      Keith Packard authored
       This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
       is used throughout the X server for other things, and having duplicate
       names generates compiler warnings.
      Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: 's avatarEric Anholt <eric@anholt.net>
       Rebased against NX: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
      68dd0b52
  22. 22 Apr, 2015 1 commit
  23. 02 Feb, 2015 1 commit
  24. 10 Oct, 2011 2 commits