1. 29 8月, 2017 10 次提交
    • J
      drm/syncobj: Add a reset ioctl (v3) · aa4035d2
      Jason Ekstrand 提交于
      This just resets the dma_fence to NULL so it looks like it's never been
      signaled.  This will be useful once we add the new wait API for allowing
      wait on "submit and signal" behavior.
      
      v2:
       - Take an array of sync objects (Dave Airlie)
      v3:
       - Throw -EINVAL if pad != 0
      Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: Christian König <christian.koenig@amd.com> (v1)
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      aa4035d2
    • J
      drm/syncobj: Add a syncobj_array_find helper · 3e6fb72d
      Jason Ekstrand 提交于
      The wait ioctl has a bunch of code to read an syncobj handle array from
      userspace and turn it into an array of syncobj pointers.  We're about to
      add two new IOCTLs which will need to work with arrays of syncobj
      handles so let's make some helpers.
      Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      3e6fb72d
    • J
      drm/syncobj: Allow wait for submit and signal behavior (v5) · e7aca503
      Jason Ekstrand 提交于
      Vulkan VkFence semantics require that the application be able to perform
      a CPU wait on work which may not yet have been submitted.  This is
      perfectly safe because the CPU wait has a timeout which will get
      triggered eventually if no work is ever submitted.  This behavior is
      advantageous for multi-threaded workloads because, so long as all of the
      threads agree on what fences to use up-front, you don't have the extra
      cross-thread synchronization cost of thread A telling thread B that it
      has submitted its dependent work and thread B is now free to wait.
      
      Within a single process, this can be implemented in the userspace driver
      by doing exactly the same kind of tracking the app would have to do
      using posix condition variables or similar.  However, in order for this
      to work cross-process (as is required by VK_KHR_external_fence), we need
      to handle this in the kernel.
      
      This commit adds a WAIT_FOR_SUBMIT flag to DRM_IOCTL_SYNCOBJ_WAIT which
      instructs the IOCTL to wait for the syncobj to have a non-null fence and
      then wait on the fence.  Combined with DRM_IOCTL_SYNCOBJ_RESET, you can
      easily get the Vulkan behavior.
      
      v2:
       - Fix a bug in the invalid syncobj error path
       - Unify the wait-all and wait-any cases
      v3:
       - Unify the timeout == 0 case a bit with the timeout > 0 case
       - Use wait_event_interruptible_timeout
      v4:
       - Use proxy fence
      v5:
       - Revert to a combination of v2 and v3
       - Don't use proxy fences
       - Don't use wait_event_interruptible_timeout because it just adds an
         extra layer of callbacks
      Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Christian König <christian.koenig@amd.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      e7aca503
    • J
      drm/syncobj: Add a CREATE_SIGNALED flag · 1fc08218
      Jason Ekstrand 提交于
      This requests that the driver create the sync object such that it
      already has a signaled dma_fence attached.  Because we don't need
      anything in particular (just something signaled), we use a dummy null
      fence.  This is useful for Vulkan which has a similar flag that can be
      passed to vkCreateFence.
      Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      1fc08218
    • J
      drm/syncobj: Add a callback mechanism for replace_fence (v3) · 9c19fb10
      Jason Ekstrand 提交于
      It is useful in certain circumstances to know when the fence is replaced
      in a syncobj.  Specifically, it may be useful to know when the fence
      goes from NULL to something valid.  This does make syncobj_replace_fence
      a little more expensive because it has to take a lock but, in the common
      case where there is no callback list, it spends a very short amount of
      time inside the lock.
      
      v2:
       - Don't lock in drm_syncobj_fence_get.  We only really need to lock
         around fence_replace to make the callback work.
      v3:
       - Fix the cb_list comment to make kbuild happy
      Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      9c19fb10
    • D
      drm/syncobj: add sync obj wait interface. (v8) · 5e60a10e
      Dave Airlie 提交于
      This interface will allow sync object to be used to back
      Vulkan fences. This API is pretty much the vulkan fence waiting
      API, and I've ported the code from amdgpu.
      
      v2: accept relative timeout, pass remaining time back
      to userspace.
      v3: return to absolute timeouts.
      v4: absolute zero = poll,
          rewrite any/all code to have same operation for arrays
          return -EINVAL for 0 fences.
      v4.1: fixup fences allocation check, use u64_to_user_ptr
      v5: move to sec/nsec, and use timespec64 for calcs.
      v6: use -ETIME and drop the out status flag. (-ETIME
      is suggested by ickle, I can feel a shed painting)
      v7: talked to Daniel/Arnd, use ktime and ns everywhere.
      v8: be more careful in the timeout calculations
          use uint32_t for counter variables so we don't overflow
          graciously handle -ENOINT being returned from dma_fence_wait_timeout
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      Reviewed-by: NJason Ekstrand <jason@jlekstrand.net>
      Acked-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      5e60a10e
    • J
      i915: Use drm_syncobj_fence_get · afca4216
      Jason Ekstrand 提交于
      Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      afca4216
    • J
      drm/syncobj: Add a race-free drm_syncobj_fence_get helper (v2) · 309a5482
      Jason Ekstrand 提交于
      The atomic exchange operation in drm_syncobj_replace_fence is sufficient
      for the case where it races with itself.  However, if you have a race
      between a replace_fence and dma_fence_get(syncobj->fence), you may end
      up with the entire replace_fence happening between the point in time
      where the one thread gets the syncobj->fence pointer and when it calls
      dma_fence_get() on it.  If this happens, then the reference may be
      dropped before we get a chance to get a new one.  The new helper uses
      dma_fence_get_rcu_safe to get rid of the race.
      
      This is also needed because it allows us to do a bit more than just get
      a reference in drm_syncobj_fence_get should we wish to do so.
      
      v2:
       - RCU isn't that scary
       - Call rcu_read_lock/unlock
       - Don't rename fence to _fence
       - Make the helper static inline
      Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
      Acked-by: Christian König <christian.koenig@amd.com> (v1)
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      309a5482
    • J
      drm/syncobj: Rename fence_get to find_fence · afaf5923
      Jason Ekstrand 提交于
      The function has far more in common with drm_syncobj_find than with
      any in the get/put functions.
      Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
      Acked-by: Christian König <christian.koenig@amd.com> (v1)
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      afaf5923
    • J
      drm: kirin: Add mode_valid logic to avoid mode clocks we can't generate · 71f23543
      John Stultz 提交于
      Currently the hikey dsi logic cannot generate accurate byte
      clocks values for all pixel clock values. Thus if a mode clock
      is selected that cannot match the calculated byte clock, the
      device will boot with a blank screen.
      
      This patch uses the new mode_valid callback (many thanks to
      Jose Abreu for upstreaming it!) to ensure we don't select
      modes we cannot generate.
      
      Also, since the ade crtc code will adjust the mode in mode_set,
      this patch also adds a mode_fixup callback which we use to make
      sure we are validating the mode clock that will eventually be
      used.
      
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Xinliang Liu <xinliang.liu@linaro.org>
      Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
      Cc: Rongrong Zou <zourongrong@gmail.com>
      Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
      Cc: Chen Feng <puck.chen@hisilicon.com>
      Cc: Jose Abreu <Jose.Abreu@synopsys.com>
      Cc: Archit Taneja <architt@codeaurora.org>
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Reviewed-by: NXinliang Liu <xinliang.liu@linaro.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      71f23543
  2. 25 8月, 2017 3 次提交
    • D
      Merge tag 'sunxi-drm-for-4.14-2' of... · e47ef302
      Dave Airlie 提交于
      Merge tag 'sunxi-drm-for-4.14-2' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux into drm-next
      
      sun4i DRM changes for 4.14, take 2
      
      A single patch switching to a new OF helper.
      
      * tag 'sunxi-drm-for-4.14-2' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux:
        drm/sun4i: use of_graph_get_remote_endpoint()
      e47ef302
    • D
      Merge tag 'omapdrm-4.14-fixes' of... · 72d45a76
      Dave Airlie 提交于
      Merge tag 'omapdrm-4.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next
      
      omapdrm fixes for 4.14
      
      * fix compilation when compiling omapfb driver
      * WA for OMAP3 endless sync lost issue
      * WA for OMAP5 DSI PLL issue
      * fix analog TV out modecheck
      
      * tag 'omapdrm-4.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
        ARM: OMAP2+: fix missing variable declaration
        drm/omap: work-around for omap3 display enable
        drm/omap: fix i886 work-around
        drm/omap: fix analog tv-out modecheck
      72d45a76
    • D
      Merge tag 'drm-msm-next-2017-08-22' of git://people.freedesktop.org/~robclark/linux into drm-next · cfcfb65a
      Dave Airlie 提交于
      Updates for 4.14..  I have some further patches from Jordan to add
      multiple priority levels and pre-emption, but those will probably be
      for 4.15 to give me time for the mesa parts.
      
      * tag 'drm-msm-next-2017-08-22' of git://people.freedesktop.org/~robclark/linux:
        drm/msm/mdp5: mark runtime_pm functions as __maybe_unused
        drm/msm: remove unused variable
        drm/msm/mdp5: make helper function static
        drm/msm: make msm_framebuffer_init() static
        drm/msm: add helper to allocate stolen fb
        drm/msm: don't track fbdev's gem object separately
        drm/msm: add modeset module param
        drm/msm/mdp5: add tracking for clk enable-count
        drm/msm: remove unused define
        drm/msm: Add a helper function for in-kernel buffer allocations
        drm/msm: Attach the GPU MMU when it is created
        drm/msm: Add A5XX hardware fault detection
        drm/msm: Remove uneeded platform dev members
        drm/msm/mdp5: Set up runtime PM for MDSS
        drm/msm/mdp5: Write to SMP registers even if allocations don't change
        drm/msm/mdp5: Don't use mode_set helper funcs for encoders and CRTCs
        drm/msm/dsi: Implement RPM suspend/resume callbacks
        drm/msm/dsi: Set up runtime PM for DSI
        drm/msm/hdmi: Set up runtime PM for HDMI
        drm/msm/mdp5: Use runtime PM get/put API instead of toggling clocks
      cfcfb65a
  3. 24 8月, 2017 1 次提交
  4. 23 8月, 2017 16 次提交
  5. 22 8月, 2017 10 次提交