1. 20 Jul, 2021 1 commit
  2. 16 Apr, 2021 1 commit
  3. 09 Jul, 2020 1 commit
  4. 07 Aug, 2019 1 commit
    • Dave Airlie's avatar
      xf86: autobind GPUs to the screen · 078277e4
      Dave Airlie authored
      This is a modified version of a patch we've been carry-ing in Fedora and
      RHEL for years now. This patch automatically adds secondary GPUs to the
      master as output sink / offload source making e.g. the use of
      slave-outputs just work, with requiring the user to manually run
      "xrandr --setprovideroutputsource" before he can hookup an external
      monitor to his hybrid graphics laptop.
      
      There is one problem with this patch, which is why it was not upstreamed
      before. What to do when a secondary GPU gets detected really is a policy
      decission (e.g. one may want to autobind PCI GPUs but not USB ones) and
      as such should be under control of the Desktop Environment.
      
      Unconditionally adding autobinding support to the xserver will result
      in races between the DE dealing with the hotplug of a secondary GPU
      and the server itself dealing with it.
      
      However we've waited for years for any Desktop Environments to actually
      start doing some sort of autoconfiguration of secondary GPUs and there
      is sti...
      078277e4
  5. 02 Aug, 2018 1 commit
  6. 27 Feb, 2018 2 commits
    • Keith Packard's avatar
      Add RandR leases with modesetting driver support [v6] · e4e34476
      Keith Packard authored and Adam Jackson's avatar Adam Jackson committed
      
      
      This adds support for RandR CRTC/Output leases through the modesetting
      driver, creating a lease using new kernel infrastructure and returning
      that to a client through an fd which will have access to only those
      resources.
      
      v2:	Restore CRTC mode when leases terminate
      
      	When a lease terminates for a crtc we have saved data for, go
      	ahead and restore the saved mode.
      
      v3:	Report RR_Rotate_0 rotations for leased crtcs.
      
      	Ignore leased CRTCs when selecting screen size.
      
      	Stop leasing encoders, the kernel doesn't do that anymore.
      
      	Turn off crtc->enabled while leased so that modesetting
      	ignores them.
      
      	Check lease status before calling any driver mode functions
      
      	When starting a lease, mark leased CRTCs as disabled and hide
      	their cursors. Also, check to see if there are other
      	non-leased CRTCs which are driving leased Outputs and mark
      	them as disabled as well. Sometimes an application will lease
      	an idle crtc instead of the one already associated with the
      	leased output.
      
      	When terminating a lease, reset any CRTCs which are driving
      	outputs that are no longer leased so that they start working
      	again.
      
      	This required splitting the DIX level lease termination code
      	into two pieces, one to remove the lease from the system
      	(RRLeaseTerminated) and a new function that frees the lease
      	data structure (RRLeaseFree).
      
      v4:	Report RR_Rotate_0 rotation for leased crtcs.
      
      v5: Terminate all leases on server reset.
      
      	Leases hang around after the associated client exits so that
      	the client doesn't need to occupy an X server client slot and
      	consume a file descriptor once it has gotten the output
      	resources necessary.
      
      	Any leases still hanging around when the X server resets or
      	shuts down need to be cleaned up by calling the kernel to
      	terminate the lease and freeing any DIX structures.
      
      	Note that we cannot simply use the existing
      	drmmode_terminate_lease function on each lease as that wants
      	to also reset the video mode, and during server shut down that
      
         modesetting: Validate leases on VT enter
      
      	The kernel doesn't allow any master ioctls to run when another
      	VT is active, including simple things like listing the active
      	leases. To deal with that, we check the list of leases
      	whenever the X server VT is activated.
      
         xfree86: hide disabled cursors when resetting after lease termination
      
      	The lessee may well have played with cursors and left one
      	active on our screen. Just tell the kernel to turn it off.
      
      v6:	Add meson build infrastructure
      
      [Also bumped libdrm requirement - ajax]
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      e4e34476
    • Keith Packard's avatar
      randr: Support "non-desktop" property · 39573605
      Keith Packard authored and Adam Jackson's avatar Adam Jackson committed
      
      
      Tracks changes to the non-desktop property so that when non-zero,
      outputs will always appear to be disconnected.
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@nwnk.net>
      39573605
  7. 22 Jan, 2018 1 commit
  8. 15 Aug, 2017 1 commit
    • Michel Dänzer's avatar
      Make PixmapDirtyUpdateRec::src a DrawablePtr · 8e3b26ce
      Michel Dänzer authored and Michel Dänzer's avatar Michel Dänzer committed
      
      
      This allows making the master screen's pixmap_dirty_list entries
      explicitly reflect that we're now tracking the root window instead of
      the screen pixmap, in order to allow Present page flipping on master
      outputs while there are active slave outputs.
      
      Define HAS_DIRTYTRACKING_DRAWABLE_SRC for drivers to check, but leave
      HAS_DIRTYTRACKING_ROTATION defined as well to make things slightly
      easier for drivers.
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      8e3b26ce
  9. 13 Sep, 2016 1 commit
  10. 05 Jul, 2016 1 commit
    • Alex Goins's avatar
      randr: Add ability to turn PRIME sync off · df8e8693
      Alex Goins authored and Adam Jackson's avatar Adam Jackson committed
      
      
      Adds an output parameter to disable PRIME synchronization.
      
      Output parameter is created when the user calls 'xrandr
      --setprovideroutputsource <sink> <source>' to prevent polluting output
      parameters of non-PRIME configurations.
      
      Defaults to on, so if the user wants PRIME synchronization they don't need
      to do anything.
      
      If the user wishes to disable PRIME synchronization when they first set up
      PRIME, they can run 'xrandr --output <output> --set "PRIME Synchronization"
      0' after running 'xrandr --setprovideroutputsource <sink> <source>', but
      before 'xrandr --auto'.
      
      If the user wishes to enable or disable PRIME synchronization after PRIME has
      already been set up, they can run 'xrandr --output <output> --set "PRIME
      Synchronization" <0 or 1>' at any time, xrandr will trigger a modeset, which
      will tear down and setup PRIME in the configuration they requested on CRTCs
      associated with that output.
      
      randrstr.h:
          Add central definition of the output property name.
      
      rrcrtc.c:
          Add function rrGetPixmapSharingSyncProp() to query the status of the
          output property.
      
          Add function rrSetPixmapSharingSyncProp() to set the output property.
      
          Add 'sync' parameter to rrSetupPixmapSharing(), which when false will
          use single buffering even if the required ABI functions are supported.
          Changes rrSetupPixmapSharing() to only report an error if falling back
          to single buffering when the user requested synchronization.
      
          Change RRCrtcSet() to use rrPixmapSharingSyncProp() to query the status
          of the output property and feed it into rrSetupPixmapSharing() using
          the 'sync' parameter.
      
      rrprovider.c:
          Add RR(Init/Fini)PrimeSyncProps(), functions to create and destroy the
          PRIME synchronization output property.
      
          Add a call to RRInitPrimeSyncProps() in
          ProcRRSetProviderOutputSource(), such that the output property is
          created when the user requests PRIME.
      
          Add a call to RRFiniPrimeSyncProps() in RRProviderDestroy().
      
      v1: Initial commit
      v2: Unchanged
      v3: Add /* TODO */ for handling different sources with different outputs
          Make rrSetupPixmapSharing() set the output property to 0 if it has to fall
          back, to avoid user confusion.
          Make rr(Get)PixmapSharingSyncProp() check the current value if there isn't a
          pending value
      v4: Unchanged
      v5: Unchanged
      v6: Rebase onto ToT
      v7: Unchanged
      Signed-off-by: Alex Goins's avatarAlex Goins <agoins@nvidia.com>
      df8e8693
  11. 28 Jun, 2016 2 commits
    • Alex Goins's avatar
      randr/xf86: Add PRIME Synchronization / Double Buffer · 1bdbc7e7
      Alex Goins authored and Adam Jackson's avatar Adam Jackson committed
      
      
      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
    • Alex Goins's avatar
      xf86: Add PRIME flipping functions to Screen · b601f96a
      Alex Goins authored and Adam Jackson's avatar Adam Jackson committed
      
      
      Adds typedefs for (*RRStartFlippingPixmapTrackingProcPtr),
      (*RREnableSharedPixmapFlippingProcPtr),
      and (*RRDisableSharedPixmapFlippingProcPtr) in randrstr.h.
      
      Adds typedefs for (*PresentSharedPixmapProcPtr),
      (*SharedPixmapNotifyDamageProcPtr),
      (*RequestSharedPixmapNotifyDamageProcPtr), and
      (*StopFlippingPixmapTrackingProcPtr) in scrnintstr.h.
      
      Adds RR(Enable/Disable)SharedPixmapFlipping, and
      RRStartFlippingPixmapTracking to rrScrnPrivRec.
      
      Adds StopFlippingPixmapTracking, PresentSharedPixmap,
      SharedPixmapNotifyDamage, and RequestSharedPixmapNotifyDamage to ScreenRec.
      
      rrScrnPrivRec used for functions that use RandR-private data types, and
      ScreenRec used for the rest.
      
      RREnableSharedPixmapFlipping will allow the sink driver to setup for
      flipping between two shared pixmaps.
      
      RRDisableSharedPixmapFlipping will allow the sink driver to do teardown
      associated with flipping between two shared pixmaps.
      
      (RRStart/Stop)FlippingPixmapTracking are merely the double-buffered
      equivalents of (Start/Stop)PixmapTracking, allowing the source driver to do
      whatever setup and teardown necessary for presenting on the two shared
      pixmaps.
      
      PresentSharedPixmap is a function exposed by the source driver for the X
      server or sink driver to call to request a present on a given shared
      pixmap.  This way, presents can be driven by the sink's vblank instead of a
      timer or similar mechanism.
      
      SharedPixmapNotifyDamage and RequestSharedPixmapNotifyDamage are OPTIONAL
      (even for double-buffered PRIME) functions exposed by the sink driver and
      the source driver, respectively. By calling
      master->RequestSharedPixmapNotifyDamage(ppix), the sink driver can request
      for the source driver to call slave->SharedPixmapNotifyDamage(ppix) in
      response to damage on the master screen pixmap tracked by ppix.
      
      v1: Initial commit
      v2: Rename PresentTrackedFlippingPixmap to PresentSharedPixmap
          Add SharedPixmapNotifyDamage / RequestSharedPixmapNotifyDamage
      v3: Add RRCrtcPtr as a parameter to StartFlippingPixmapTracking
          Move functions that use RandR-private data types to rrScrnPrivRec.
      v4: Unchanged
      v5: Add front and back parameters to RREnableSharedPixmapFlippingProcPtr
      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>
      b601f96a
  12. 08 Jul, 2015 1 commit
  13. 27 Apr, 2015 1 commit
  14. 31 Mar, 2015 1 commit
    • Keith Packard's avatar
      randr: Add Monitor support (v1.1) · 7e1f86d4
      Keith Packard authored
      
      
      Store the user-defined monitors in the RandR screen private.
      
      Generate a list of monitors from both the user-defined ones and from
      any outputs not mentioned in one of the user-defined monitors. This list
      covers both the outputs in the main screen as well as any slaves.
      
      v1.1: airlied: fix up primary skipping bug,
      fix wrong height initialiser
      add get_active flag from updated protocol.
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      7e1f86d4
  15. 12 Nov, 2014 1 commit
  16. 12 Jan, 2014 1 commit
  17. 30 Oct, 2013 2 commits
  18. 30 Apr, 2013 1 commit
  19. 01 Mar, 2013 1 commit
  20. 08 Feb, 2013 1 commit
  21. 05 Nov, 2012 1 commit
  22. 10 Jul, 2012 1 commit
  23. 07 Jul, 2012 4 commits
  24. 06 Jul, 2012 1 commit
    • Dave Airlie's avatar
      randr: add provider object and provider property support (v6) · 66d92afe
      Dave Airlie authored
      
      
      This adds the initial provider object and provider property
      support to the randr dix code.
      
      v2: destroy provider in screen close
      v2.1: fix whitespace
      
      v3: update for latest rev of protocol + renumber after 1.4 tearout.
      
      v4: fix logic issue, thanks Samsagax on irc
      
      v5: keithp's review: fix current_role, fix copyrights, fix master
      reporting crtc/outputs.
      
      v6: port to new randr interface, drop all set role bits for now
      
      v7: drop devPrivate in provider, not needed, add BadMatch returns
      for NULL SetProviderOffloadSink and SetProviderOutputSource, drop
      the old typedef.
      Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      66d92afe
  25. 05 Jun, 2012 1 commit
  26. 14 May, 2012 1 commit
  27. 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
  28. 23 Nov, 2011 1 commit
  29. 14 Mar, 2011 1 commit
  30. 23 Feb, 2011 5 commits