1. 10 Aug, 2016 1 commit
  2. 28 Jul, 2016 2 commits
    • Michel Dänzer's avatar
      xfree86: Hook up colormaps and RandR 1.2 gamma code v6 · b4e46c04
      Michel Dänzer authored
      Instead of breaking the former when the driver supports the latter,
      hook them up so that the hardware LUTs reflect the combination of the
      current colourmap and gamma states. I.e. combine the colourmap, the
      global gamma value/ramp and the RandR 1.2 per-CRTC gamma ramps into one
      combined LUT per CRTC.
      
      Fixes e.g. gamma sliders not working in games.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27222
      
      v2:
      * Initialize palette_size and palette struct members, fixes crash on
        server startup.
      v3:
      * Free randrp->palette in xf86RandR12CloseScreen, fixes memory leak.
      v4:
      * Call CMapUnwrapScreen if xf86RandR12InitGamma fails (Emil Velikov).
      * Still allow xf86HandleColormaps to be called with a NULL loadPalette
        parameter in the xf86_crtc_supports_gamma case.
      v5:
      * Clean up inner loops in xf86RandR12CrtcComputeGamma (Keith Packard)
      * Move palette update out of per-CRTC loop in xf86RandR12LoadPalette
        (Keith Packard)
      v6:
      * Handle reallocarray failure in xf86RandR12LoadPalette (Keith Packard)
      Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      b4e46c04
    • Michel Dänzer's avatar
      xfree86/modes: Remove xf86RandR12CrtcGetGamma · 17213b74
      Michel Dänzer authored
      This would normally return the same values the core RandR code passed to
      xf86RandR12CrtcSetGamma before, which is rather pointless. The only
      possible exception would be if a driver tried initializing
      crtc->gamma_red/green/blue to reflect the hardware LUT state on startup,
      but that can't work correctly if whatever set the LUT before the server
      started was running at a different depth.
      
      Even the pointless round-trip case will no longer work with the
      following change.
      Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      17213b74
  3. 27 Jul, 2016 1 commit
  4. 28 Jun, 2016 1 commit
    • Alex Goins's avatar
      randr/xf86: Add PRIME Synchronization / Double Buffer · 1bdbc7e7
      Alex Goins authored
      Changes PRIME to use double buffering and synchronization if all required
      driver functions are available.
      
      rrcrtc.c:
          Changes rrSetupPixmapSharing() to use double buffering and
          synchronization in the case that all required driver functions are
          available. Otherwise, falls back to unsynchronized single buffer.
      
          Changes RRCrtcDetachScanoutPixmap() to properly clean up in the case of
          double buffering.
      
          Moves StopPixmapTracking() from rrDestroySharedPixmap() to
          RRCrtcDetachScanoutPixmap().
      
          Changes RRReplaceScanoutPixmap() to fail if we are using double buffering,
          as it would need a second ppix parameter to function with double buffering,
          and AFAICT no driver I've implemented double buffered source support in uses
          RRReplaceScanoutPixmap().
      
      randrstr.h:
          Adds scanout_pixmap_back to struct _rrCrtc to facilitate PRIME
          double buffering.
      
      xf86Crtc.h:
          Adds current_scanout_back to _xf86Crtc to facilitate detection
          of changes to it in xf86RandR12CrtcSet().
      
      xf86RandR12.c:
          Changes xf86RandR12CrtcSet() to detect changes in
          scanout_pixmap_back.
      
          Adds scanout_pixmap_back to struct _rrCrtc to facilitate PRIME double
          buffering.
      
      v1: Initial commit
      v2: Rename PresentTrackedFlippingPixmap to PresentSharedPixmap
      v3: Refactor to accomodate moving (rr)StartFlippingPixmapTracking and
          (rr)(Enable/Disable)SharedPixmapFlipping to rrScrPrivRec from ScreenRec
          Add fallback if flipping funcs fail
      v4: Detach scanout pixmap when destroying scanout_pixmap_back, to avoid
          dangling pointers in some drivers
      v5: Disable RRReplaceScanoutPixmap for double-buffered PRIME, it would need an
          ABI change with support for 2 pixmaps if it were to be supported, but AFAICT
          no driver that actually supports double-buffered PRIME uses it.
          Refactor to use rrEnableSharedPixmapFlipping() as a substitute for
          rrCrtcSetScanoutPixmap() in the flipping case.
          Remove extraneous pSlaveScrPriv from DetachScanoutPixmap()
          Remove extraneous protopix and pScrPriv from rrSetupPixmapSharing()
      v6: Rebase onto ToT
      v7: Unchanged
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: Alex Goins's avatarAlex Goins <agoins@nvidia.com>
      1bdbc7e7
  5. 17 Jun, 2016 1 commit
    • Hans de Goede's avatar
      xrandrprovider: Do not use separate lists for unbound / source / offload slaves · 5c7af02b
      Hans de Goede authored
      A single provider can be both a offload and source slave at the same time,
      the use of seperate lists breaks in this case e.g. :
      
      xrandr --listproviders
      Providers: number : 2
      Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting
      Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting
      
      xrandr --setprovideroutputsource 1 0x7b
      xrandr --listproviders
      Providers: number : 2
      Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
      Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting
      
      xrandr --setprovideroffloadsink 1 0x7b
      xrandr --listproviders
      Providers: number : 3
      Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting
      Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
      Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
      
      Not good. The problem is that the provider with id 0x46 now is on both
      the output_slave_list and the offload_slave_list of the master screen.
      
      This commit fixes this by unifying all 3 lists into a single slaves list.
      
      Note that this does change the struct _Screen definition, so this is an ABI
      break. I do not expect any of the drivers to actually use the removed / changed
      fields so a recompile should suffice.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      5c7af02b
  6. 22 Feb, 2016 1 commit
    • Daniel Stone's avatar
      dix: Add hybrid full-size/empty-clip mode to SetRootClip · e957a2e5
      Daniel Stone authored
      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 generated.
      Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      Tested-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      e957a2e5
  7. 21 Sep, 2015 1 commit
  8. 27 Apr, 2015 1 commit
  9. 21 Apr, 2015 1 commit
  10. 12 Nov, 2014 1 commit
  11. 22 Apr, 2014 1 commit
  12. 23 Jan, 2014 1 commit
  13. 12 Jan, 2014 1 commit
  14. 25 Jul, 2013 1 commit
    • Aaron Plattner's avatar
      xfree86: detach scanout pixmaps when detaching output GPUs · bdd1e22c
      Aaron Plattner authored
      Commit 8f4640bd fixed a bit of a
      chicken-and-egg problem by detaching GPU screens when their providers
      are destroyed, which happens before CloseScreen is called.  However,
      this created a new problem: the GPU screen tears down its RandR crtc
      objects during CloseScreen and if one of them is active, it tries to
      detach the scanout pixmap then.  This crashes because
      RRCrtcDetachScanoutPixmap tries to get the master screen's screen
      pixmap, but crtc->pScreen->current_master is already NULL at that
      point.
      
      It doesn't make sense for an unbound GPU screen to still be scanning
      out its former master screen's pixmap, so detach them first when the
      provider is destroyed.
      Signed-off-by: Aaron Plattner's avatarAaron Plattner <aplattner@nvidia.com>
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      bdd1e22c
  15. 30 Apr, 2013 1 commit
  16. 08 Apr, 2013 1 commit
  17. 01 Mar, 2013 1 commit
  18. 06 Aug, 2012 1 commit
  19. 11 Jul, 2012 1 commit
    • Maarten Lankhorst's avatar
      xfree86: Strip dangling pointers from desiredMode · deb08658
      Maarten Lankhorst authored
      Based on the original patch by Chris Wilson, which was a better fix than mine.
      
      We stash a copy of the desiredMode on the crtc so that we can restore it
      after a vt switch. This copy is a simple memcpy and so also stashes a
      references to the pointers contained within the desiredMode. Those
      pointers are freed the next time the outputs are probed and mode list
      rebuilt, resulting in us chasing those dangling pointers on the next
      mode switch.
      
      ==22787== Invalid read of size 1
      ==22787==    at 0x40293C2: __GI_strlen (in
      /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==22787==    by 0x668F875: strdup (strdup.c:42)
      ==22787==    by 0x5DBA00: XNFstrdup (utils.c:1124)
      ==22787==    by 0x4D72ED: xf86DuplicateMode (xf86Modes.c:209)
      ==22787==    by 0x4CA848: xf86CrtcSetModeTransform (xf86Crtc.c:276)
      ==22787==    by 0x4D05B4: xf86SetDesiredModes (xf86Crtc.c:2677)
      ==22787==    by 0xA7479D0: sna_create_screen_resources
      (sna_driver.c:220)
      ==22787==    by 0x4CB914: xf86CrtcCreateScreenResources (xf86Crtc.c:725)
      ==22787==    by 0x425498: main (main.c:216)
      ==22787==  Address 0x72c60e0 is 0 bytes inside a block of size 9 free'd
      ==22787==    at 0x4027AAE: free (in
      /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==22787==    by 0x4A547E: xf86DeleteMode (xf86Mode.c:1984)
      ==22787==    by 0x4CD84F: xf86ProbeOutputModes (xf86Crtc.c:1578)
      ==22787==    by 0x4DC405: xf86RandR12GetInfo12 (xf86RandR12.c:1537)
      ==22787==    by 0x518119: RRGetInfo (rrinfo.c:202)
      ==22787==    by 0x51D997: rrGetScreenResources (rrscreen.c:335)
      ==22787==    by 0x51E0D0: ProcRRGetScreenResources (rrscreen.c:475)
      ==22787==    by 0x513852: ProcRRDispatch (randr.c:493)
      ==22787==    by 0x4346DB: Dispatch (dispatch.c:439)
      ==22787==    by 0x4256E4: main (main.c:287)
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Reported-by: zkabelac's avatarZdenek Kabelac <zdenek.kabelac@gmail.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36108Reviewed-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      deb08658
  20. 07 Jul, 2012 4 commits
  21. 06 Jul, 2012 1 commit
  22. 05 Jun, 2012 1 commit
  23. 21 May, 2012 3 commits
  24. 08 May, 2012 1 commit
    • James Cloos's avatar
      Fix RANDR’s gamma_to_ramp(). · afc153a5
      James Cloos authored
      In order to generate a 256-entry ramp in [0,65535] which covers the full
      range, one must mupliply eight-bit values not by 256 but rather by 257.
      
      Many years back – well before the RANDR extension was written, and
      before xorg@fdo – a similar bug fix was made to the DIX for converting
      client-supplied eight-bit color values into sixteen-bit values.
      
      Noticed by: Elle Stone and Graeme Gill.
      Signed-off-by: James Cloos's avatarJames Cloos <cloos@jhcloos.com>
      afc153a5
  25. 21 Mar, 2012 1 commit
    • Keith Packard's avatar
      Introduce a consistent coding style · 9838b703
      Keith Packard authored
      This is strictly the application of the script 'x-indent-all.sh'
      from util/modular. Compared to the patch that Daniel posted in
      January, I've added a few indent flags:
      
      	-bap
      	-psl
      	-T PrivatePtr
      	-T pmWait
      	-T _XFUNCPROTOBEGIN
      	-T _XFUNCPROTOEND
      	-T _X_EXPORT
      
      The typedefs were needed to make the output of sdksyms.sh match the
      previous output, otherwise, the code is formatted badly enough that
      sdksyms.sh generates incorrect output.
      
      The generated code was compared with the previous version and found to
      be essentially identical -- "assert" line numbers and BUILD_TIME were
      the only differences found.
      
      The comparison was done with this script:
      
      dir1=$1
      dir2=$2
      
      for dir in $dir1 $dir2; do
      	(cd $dir && find . -name '*.o' | while read file; do
      		dir=`dirname $file`
      		base=`basename $file .o`
      		dump=$dir/$base.dump
      		objdump -d $file > $dump
      	done)
      done
      
      find $dir1 -name '*.dump' | while read dump; do
      	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
      	diff -u $dump $otherdump
      done
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      Acked-by: Daniel Stone's avatarDaniel Stone <daniel@fooishbar.org>
      Acked-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      9838b703
  26. 13 Oct, 2011 1 commit
  27. 25 Apr, 2011 1 commit
  28. 28 Mar, 2011 1 commit
  29. 23 Feb, 2011 6 commits