1. 16 Nov, 2016 3 commits
    • Gustavo Padovan's avatar
      drm/fence: add fence timeline to drm_crtc · 6d6003c4
      Gustavo Padovan authored
      Create one timeline context for each CRTC to be able to handle out-fences
      and signal them. It adds a few members to struct drm_crtc: fence_context,
      where we store the context we get from fence_context_alloc(), the
      fence seqno and the fence lock, that we pass in fence_init() to be
      used by the fence.
      
      v2: Comment by Daniel Stone:
      	- add BUG_ON() to fence_to_crtc() macro
      
      v3: Comment by Ville Syrjälä
      	- Use more meaningful name as crtc timeline name
      
      v4: Comments by Brian Starkey
      	- Use even more meaninful name for the crtc timeline
      	- add doc for timeline_name
          Comment by Daniel Vetter
      	- use in-line style for comments
      
          - rebase after fence -> dma_fence rename
      
      v5: Comment by Daniel Vetter
      	- Add doc for drm_crtc_fence_ops
      
      v6: Comment by Chris Wilson
      	- Move fence_to_crtc to drm_crtc.c
      	- Move export of drm_crtc_fence_ops to drm_crtc_internal.h
      
          - rebase against latest drm-misc
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v5)
      Reviewed-by: Sean Paul <seanpaul@chromium.org> (v5)
      Tested-by: Robert Foss <robert.foss@collabora.com> (v5)
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479220628-10204-1-git-send-email-gustavo@padovan.org
      6d6003c4
    • Gustavo Padovan's avatar
      drm/fence: add in-fences support · 96260142
      Gustavo Padovan authored
      There is now a new property called IN_FENCE_FD attached to every plane
      state that receives sync_file fds from userspace via the atomic commit
      IOCTL.
      
      The fd is then translated to a fence (that may be a fence_array
      subclass or just a normal fence) and then used by DRM to fence_wait() for
      all fences in the sync_file to signal. So it only commits when all
      framebuffers are ready to scanout.
      
      v2: Comments by Daniel Vetter:
      	- remove set state->fence = NULL in destroy phase
      	- accept fence -1 as valid and just return 0
      	- do not call fence_get() - sync_file_fences_get() already calls it
      	- fence_put() if state->fence is already set, in case userspace
      	set the property more than once.
      
      v3: WARN_ON if fence is set but state has no FB
      
      v4: Comment from Maarten Lankhorst
      	- allow set fence with no related fb
      
      v5: rename FENCE_FD to IN_FENCE_FD
      
      v6: Comments by Daniel Vetter:
      	- rename plane_state->in_fence back to "fence"
      	- re-introduce WARN_ON if fence set but no fb
      
           - rebase after fence -> dma_fence rename
      
      v7: Comments by Brian Starkey
      	- set state->fence to NULL when duplicating the state
      	- fail if IN_FENCE_FD was already set
      
      v8: rebase against latest drm-misc
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Reviewed-by: default avatarBrian Starkey <brian.starkey@arm.com>
      Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
      Tested-by: default avatarRobert Foss <robert.foss@collabora.com>
      [danvet: Rebase onto extracted drm_mode_config.[hc].]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      96260142
    • Jianqun Xu's avatar
      drm/bridge: analogix_dp: return error if transfer none byte · 19423ba7
      Jianqun Xu authored
      Reference from drm_dp_aux description (about transfer):
      Upon success, the implementation should return the number of payload bytes
      that were transferred, or a negative error-code on failure. Helpers
      propagate errors from the .transfer() function, with the exception of
      the -EBUSY error, which causes a transaction to be retried. On a short,
      helpers will return -EPROTO to make it simpler to check for failure.
      
      The analogix_dp_transfer will return num_transferred, but if there is none
      byte been transferred, the return value will be 0, which means success, we
      should return error-code if transfer none byte.
      
      for (retry = 0; retry < 32; retry++) {
      	err = aux->transfer(aux, &msg);
      	if (err < 0) {
      		if (err == -EBUSY)
      			continue;
      
      		goto unlock;
      	}
      }
      
      Cc: zain wang <wzz@rock-chips.com>
      Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
      Signed-off-by: default avatarJianqun Xu <jay.xu@rock-chips.com>
      Signed-off-by: default avatarArchit Taneja <architt@codeaurora.org>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479255219-7243-1-git-send-email-jay.xu@rock-chips.com
      19423ba7
  2. 15 Nov, 2016 24 commits
  3. 14 Nov, 2016 13 commits