1. 23 Mar, 2017 1 commit
  2. 21 Mar, 2017 1 commit
  3. 08 Feb, 2017 1 commit
    • Michael Thayer's avatar
      xfree86: Immediately handle failure to set HW cursor, v5 · c02f6a68
      Michael Thayer authored
      Based on v4 by Alexandre Courbot <acourbot@nvidia.com>
      
      There is currently no reliable way to report failure to set a HW
      cursor. Still such failures can happen if e.g. the MODE_CURSOR DRM
      ioctl fails (which currently happens at least with modesetting on Tegra
      for format incompatibility reasons).
      
      As failures are currently handled by setting the HW cursor size to
      (0,0), the fallback to SW cursor will not happen until the next time the
      cursor changes and xf86CursorSetCursor() is called again. In the
      meantime, the cursor will be invisible to the user.
      
      This patch addresses that by adding _xf86CrtcFuncs::set_cursor_check and
      _xf86CursorInfoRec::ShowCursorCheck hook variants that return booleans.
      This allows to propagate errors up to xf86CursorSetCursor(), which can
      then fall back to using the SW cursor immediately.
      
      v5: Updated the patch to apply to current git HEAD, split up into two
      patches (server and modesetting driver) and adjusted the code slightly
      to match surrounding code.  I also removed the new exported function
      ShowCursorCheck(), as instead just changing ShowCursor() to return Bool
      should not affect its current callers.
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: Michael Thayer's avatarMichael Thayer <michael.thayer@oracle.com>
      c02f6a68
  4. 02 Jan, 2017 1 commit
  5. 28 Sep, 2016 2 commits
  6. 16 Sep, 2016 1 commit
  7. 13 Sep, 2016 2 commits
    • Hans de Goede's avatar
      xf86Cursor: Deal with rotation on GPU screens using a hw-cursor · df88008f
      Hans de Goede authored
      When a slave-output is rotated the transformation is done on the blit
      from master to slave GPU, so crtc->transform_in_use is not set, but we
      still need to adjust the mouse position for things to work.
      
      This commit modifies xf86_crtc_transform_cursor_position to not rely
      on crtc->f_framebuffer_to_crtc, so that it can be used with GPU screens
      too and always calls it for crtcs with any form of rotation.
      
      Note not using crtc->f_framebuffer_to_crtc means that crtc->transform
      will not be taken into account, that is ok, because when we've a transform
      active hw-cursors are not used and xf86_crtc_transform_cursor_position
      will never get called.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-and-Tested-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
      df88008f
    • Hans de Goede's avatar
      xf86Cursor: Fix xf86_crtc_rotate_coord using width/height wrongly · f82fd470
      Hans de Goede authored
      xf86_crtc_rotate_coord should be the exact inverse operation of
      xf86_crtc_rotate_coord_back, but when calculating x / y for 90 / 270
      degrees rotation it was using height to calculate x / width to calculate y,
      instead of the otherway around.
      
      This was likely not noticed before since xf86_crtc_rotate_coord
      until now was only used with cursor_info->MaxWidth and
      cursor_info->MaxHeight, which are usally the same.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
      f82fd470
  8. 10 Aug, 2016 1 commit
  9. 02 Aug, 2016 1 commit
  10. 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
  11. 27 Jul, 2016 1 commit
  12. 18 Jul, 2016 1 commit
  13. 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
  14. 21 Jun, 2016 3 commits
  15. 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
  16. 30 May, 2016 2 commits
  17. 26 May, 2016 1 commit
    • Keith Packard's avatar
      xfree86: Set xf86CrtcConfigRec cursor pointer to NULL in HideCursor · f5670b4a
      Keith Packard authored
      This makes the cursor pointer held by xf86Cursors.c get reset to NULL
      whenever the cursor isn't displayed, and means that the reference
      count held in xf86Cursor.c is sufficient to cover the reference in
      xf86Cursors.c.
      
      As HideCursor may be called in the cursor loading path after
      UseHWCursor or UseHWCursorARGB when HARDWARE_CURSOR_UPDATE_UNHIDDEN
      isn't set in the Flags field, the setting of the cursor pointer had to
      be moved to the LoadCursor paths.
      
      LoadCursorARGBCheck gets the cursor pointer, but LoadCursorImageCheck
      does not. For LoadCursorImageCheck, I added a new function,
      xf86CurrentCursor, which returns the current cursor. With this new
      function, we can eliminate the cursor pointer from the
      xf86CrtcConfigRec, once drivers are converted over to use it.
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      Acked-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      f5670b4a
  18. 04 May, 2016 1 commit
  19. 28 Mar, 2016 1 commit
  20. 09 Mar, 2016 3 commits
  21. 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
  22. 23 Sep, 2015 1 commit
  23. 21 Sep, 2015 1 commit
  24. 08 Jul, 2015 1 commit
    • Dave Airlie's avatar
      prime: add rotation support for offloaded outputs (v2) · 90db5edf
      Dave Airlie authored
      One of the lacking features with output offloading was
      that screen rotation didn't work at all.
      
      This patch makes 0/90/180/270 rotation work with USB output
      and GPU outputs.
      
      When it allocates the shared pixmap it allocates it rotated,
      and any updates to the shared pixmap are done using a composite
      path that does the rotation. The slave GPU then doesn't need
      to know about the rotation and just displays the pixmap.
      
      v2:
      rewrite the sync dirty helper to use the dst pixmap, and
      avoid any strange hobbits and rotations.
      
      This breaks ABI in two places.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      90db5edf
  25. 30 Jun, 2015 2 commits
  26. 07 May, 2015 1 commit
  27. 27 Apr, 2015 3 commits
  28. 21 Apr, 2015 1 commit
  29. 31 Mar, 2015 1 commit