1. 15 4月, 2019 13 次提交
  2. 11 4月, 2019 4 次提交
  3. 04 4月, 2019 1 次提交
  4. 03 4月, 2019 5 次提交
    • M
      drm/amd/display: Make pageflip event delivery compatible with VRR. · 71bbe51a
      Mario Kleiner 提交于
      We want vblank counts and timestamps of flip completion as sent
      in pageflip completion events to be consistent with the vblank
      count and timestamp of the vblank of flip completion, like in non
      VRR mode.
      
      In VRR mode, drm_update_vblank_count() - and thereby vblank
      count and timestamp updates - must be delayed until after the
      end of front-porch of each vblank, as it is only safe to
      calculate vblank timestamps outside of the front-porch, when
      we actually know when the vblank will end or has ended.
      
      The function drm_update_vblank_count() which updates timestamps
      and counts gets called by drm_crtc_accurate_vblank_count() or by
      drm_crtc_handle_vblank().
      
      Therefore we must make sure that pageflip events for a completed
      flip are only sent out after drm_crtc_accurate_vblank_count() or
      drm_crtc_handle_vblank() is executed, after end of front-porch
      for the vblank of flip completion.
      
      Two cases:
      
      a) Pageflip irq handler executes inside front-porch:
         In this case we must defer sending pageflip events until
         drm_crtc_handle_vblank() executes after end of front-porch,
         and thereby calculates proper vblank count and timestamp.
         Iow. the pflip irq handler must just arm a pageflip event
         to be sent out by drm_crtc_handle_vblank() later on.
      
      b) Pageflip irq handler executes after end of front-porch, e.g.,
         after flip completion in back-porch or due to a massively
         delayed handler invocation into the active scanout of the new
         frame. In this case we can call drm_crtc_accurate_vblank_count()
         to safely force calculation of a proper vblank count and
         timestamp, and must send the pageflip completion event
         ourselves from the pageflip irq handler.
      
         This is the same behaviour as needed for standard fixed refresh
         rate mode.
      
      To decide from within pageflip handler if we are in case a) or b),
      we check the current scanout position against the boundary of
      front-porch. In non-VRR mode we just do what we did in the past.
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Reviewed-by: NNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      71bbe51a
    • M
      drm/amd/display: In VRR mode, do DRM core vblank handling at end of vblank. (v2) · d2574c33
      Mario Kleiner 提交于
      In VRR mode, proper vblank/pageflip timestamps can only be computed
      after the display scanout position has left front-porch. Therefore
      delay calls to drm_crtc_handle_vblank(), and thereby calls to
      drm_update_vblank_count() and pageflip event delivery, to after the
      end of front-porch when in VRR mode.
      
      We add a new vupdate irq, which triggers at the end of the vupdate
      interval, ie. at the end of vblank, and calls the core vblank handler
      function. The new irq handler is not executed in standard non-VRR
      mode, so vblank handling for fixed refresh rate mode is identical
      to the past implementation.
      
      v2: Implement feedback by Nicholas and Paul Menzel.
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Acked-by: NHarry Wentland <harry.wentland@amd.com>
      Reviewed-by: NNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      d2574c33
    • M
      drm/amd/display: Rework vrr flip throttling for late vblank irq. · fdd1fe57
      Mario Kleiner 提交于
      For throttling to work correctly, we always need a baseline vblank
      count last_flip_vblank that increments at start of front-porch.
      
      This is the case for drm_crtc_vblank_count() in non-VRR mode, where
      the vblank irq fires at start of front-porch and triggers DRM core
      vblank handling, but it is no longer the case in VRR mode, where
      core vblank handling is done later, after end of front-porch.
      
      Therefore drm_crtc_vblank_count() is no longer useful for this.
      We also can't use drm_crtc_accurate_vblank_count(), as that would
      screw up vblank timestamps in VRR mode when called in front-porch.
      
      To solve this, use the cooked hardware vblank counter returned by
      amdgpu_get_vblank_counter_kms() instead, as that one is cooked to
      always increment at start of front-porch, independent of when
      vblank related irq's fire.
      
      This patch allows vblank irq handling to happen anywhere within
      vblank of even after it, without a negative impact on flip
      throttling, so followup patches can shift the vblank core
      handling trigger point wherever they need it.
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Reviewed-by: NNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      fdd1fe57
    • M
      drm/amd/display: Prevent vblank irq disable while VRR is active. (v3) · 66b0c973
      Mario Kleiner 提交于
      During VRR mode we can not allow vblank irq dis-/enable
      transitions, as an enable after a disable can happen at
      an arbitrary time during the video refresh cycle, e.g.,
      with a high likelyhood inside vblank front-porch. An
      enable during front-porch would cause vblank timestamp
      updates/calculations which are completely bogus, given
      the code can't know when the vblank will end as long
      as we are in front-porch with no page flip completed.
      
      Hold a permanent vblank reference on the crtc while
      in active VRR mode to prevent a vblank disable, and
      drop the reference again when switching back to fixed
      refresh rate non-VRR mode.
      
      v2: Make sure transition is also handled if vrr is
          disabled and stream gets disabled in the same
          atomic commit by moving the call to the transition
          function outside of plane commit.
          Suggested by Nicholas.
      
      v3: Trivial rebase onto previous patch.
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Reviewed-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      66b0c973
    • M
      drm/amd/display: Update VRR state earlier in atomic_commit_tail. · e854194c
      Mario Kleiner 提交于
      We need the VRR active/inactive state info earlier in
      the commit sequence, so VRR related setup functions like
      amdgpu_dm_handle_vrr_transition() know the final VRR state
      when they need to do their hw setup work.
      
      Split update_freesync_state_on_stream() into an early part,
      that can run at the beginning of commit tail before the
      vrr transition handling, and a late part that must run after
      vrr transition handling inside the commit planes code for
      enabled crtc's.
      
      Suggested by Nicholas Kazlauskas.
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Reviewed-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      e854194c
  5. 21 3月, 2019 6 次提交
  6. 20 3月, 2019 10 次提交
  7. 06 3月, 2019 1 次提交