1. 12 12月, 2018 2 次提交
  2. 06 12月, 2018 1 次提交
  3. 01 12月, 2018 3 次提交
  4. 30 11月, 2018 1 次提交
  5. 29 11月, 2018 3 次提交
    • N
      drm/amdgpu: Set FreeSync state using drm VRR properties · bb47de73
      Nicholas Kazlauskas 提交于
      Support for AMDGPU specific FreeSync properties and ioctls are dropped
      from amdgpu_dm in favor of supporting drm variable refresh rate
      properties.
      
      The notify_freesync and set_freesync_property functions are dropped
      from amdgpu_display_funcs.
      
      The drm vrr_capable property is now attached to any DP/HDMI connector.
      Its value is updated accordingly to the connector's FreeSync capabiltiy.
      
      The freesync_enable logic and ioctl control has has been dropped in
      favor of utilizing the vrr_enabled on the drm CRTC. This allows for more
      fine grained atomic control over which CRTCs should support variable
      refresh rate.
      
      To handle state changes for vrr_enabled it was easiest to drop the
      forced modeset on freesync_enabled change. This patch now performs the
      required stream updates when planes are flipped.
      
      This is done for a few reasons:
      
      (1) VRR stream updates can be done in the fast update path
      
      (2) amdgpu_dm_atomic_check would need to be hacked apart to check
          desired variable refresh state and capability before the CRTC
          disable pass.
      
      (3) Performing VRR stream updates on-flip is needed for enabling BTR
          support.
      
      VRR packets and timing adjustments are now tracked and compared to
      previous values sent to the hardware.
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      bb47de73
    • D
      drm/amd/display: Fix compile error with ACPI disabled · 8bcbc9ef
      David Francis 提交于
      The fallback code for getting default backlight caps was using
      the wrong variable name.  Fix it.
      
      Fixes: https://lists.freedesktop.org/archives/dri-devel/2018-November/197752.htmlSigned-off-by: NDavid Francis <David.Francis@amd.com>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      8bcbc9ef
    • N
      drm/amd/display: Use private obj helpers for dm_atomic_state · eb3dc897
      Nicholas Kazlauskas 提交于
      [Why]
      Two non-blocking commits in succession can result in a sequence where
      the same dc->current_state is queried for both commits.
      
      1. 1st commit -> check -> commit -> swaps atomic state -> queues work
      2. 2nd commit -> check -> commit -> swaps atomic state -> queues work
      3. 1st commit work finishes
      
      The issue with this sequence is that the same dc->current_state is
      read in both atomic checks. If the first commit modifies streams or
      planes those will be missing from the dc->current_state for the
      second atomic check. This result in many stream and plane errors in
      atomic commit tail.
      
      [How]
      The driver still needs to track old to new state to determine if the
      commit in its current implementation. Updating the dc_state in
      atomic tail is wrong since the dc_state swap should be happening as
      part of drm_atomic_helper_swap_state *before* the worker queue kicks
      its work off.
      
      The simplest replacement for the subclassing (which doesn't properly
      manage the old to new atomic state swap) is to use the drm private
      object helpers. While some of the dc_state members could be merged
      into dm_crtc_state or dm_plane_state and copied over that way it is
      easier for now to just treat the whole dc_state structure as a single
      private object.
      
      This allows amdgpu_dm to drop the dc->current_state copy from within
      atomic check. It's replaced by a copy from the current atomic state
      which is propagated correctly for the sequence described above.
      
      Since access to the dm_state private object is now locked this should
      also fix issues that could arise if submitting non-blocking commits
      from different threads.
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      eb3dc897
  6. 27 11月, 2018 5 次提交
  7. 22 11月, 2018 1 次提交
  8. 20 11月, 2018 1 次提交
  9. 08 11月, 2018 3 次提交
  10. 07 11月, 2018 6 次提交
  11. 06 11月, 2018 4 次提交
  12. 31 10月, 2018 1 次提交
  13. 10 10月, 2018 1 次提交
    • S
      drm/amd/display: Signal hw_done() after waiting for flip_done() · 717276b9
      Shirish S 提交于
      In amdgpu_dm_commit_tail(), wait until flip_done() is signaled before
      we signal hw_done().
      
      [Why]
      
      This is to temporarily address a paging error that occurs when a
      nonblocking commit contends with another commit, particularly in a
      mirrored display configuration where at least 2 CRTCs are updated.
      The error occurs in drm_atomic_helper_wait_for_flip_done(), when we
      attempt to access the contents of new_crtc_state->commit.
      
      Here's the sequence for a mirrored 2 display setup (irrelevant steps
      left out for clarity):
      
      **THREAD 1**                        | **THREAD 2**
                                          |
      Initialize atomic state for flip    |
                                          |
      Queue worker                        |
                                         ...
      
                                          | Do work for flip
                                          |
                                          | Signal hw_done() on CRTC 1
                                          | Signal hw_done() on CRTC 2
                                          |
                                          | Wait for flip_done() on CRTC 1
      
                                      <---- **PREEMPTED BY THREAD 1**
      
      Initialize atomic state for cursor  |
      update (1)                          |
                                          |
      Do cursor update work on both CRTCs |
                                          |
      Clear atomic state (2)              |
      **DONE**                            |
                                         ...
                                          |
                                          | Wait for flip_done() on CRTC 2
                                          | *ERROR*
                                          |
      
      The issue starts with (1). When the atomic state is initialized, the
      current CRTC states are duplicated to be the new_crtc_states, and
      referenced to be the old_crtc_states. (The new_crtc_states are to be
      filled with update data.)
      
      Some things to note:
      
      * Due to the mirrored configuration, the cursor updates on both CRTCs.
      
      * At this point, the pflip IRQ has already been handled, and flip_done
        signaled on all CRTCs. The cursor commit can therefore continue.
      
      * The old_crtc_states used by the cursor update are the **same states**
        as the new_crtc_states used by the flip worker.
      
      At (2), the old_crtc_state is freed (*), and the cursor commit
      completes. We then context switch back to the flip worker, where we
      attempt to access the new_crtc_state->commit object. This is
      problematic, as this state has already been freed.
      
      (*) Technically, 'state->crtcs[i].state' is freed, which was made to
          reference old_crtc_state in drm_atomic_helper_swap_state()
      
      [How]
      
      By moving hw_done() after wait_for_flip_done(), we're guaranteed that
      the new_crtc_state (from the flip worker's perspective) still exists.
      This is because any other commit will be blocked, waiting for the
      hw_done() signal.
      
      Note that both the i915 and imx drivers have this sequence flipped
      already, masking this problem.
      Signed-off-by: NShirish S <shirish.s@amd.com>
      Signed-off-by: NLeo Li <sunpeng.li@amd.com>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      717276b9
  14. 06 10月, 2018 1 次提交
  15. 04 10月, 2018 1 次提交
    • S
      drm/amd/display: Signal hw_done() after waiting for flip_done() · 987bf116
      Shirish S 提交于
      In amdgpu_dm_commit_tail(), wait until flip_done() is signaled before
      we signal hw_done().
      
      [Why]
      
      This is to temporarily address a paging error that occurs when a
      nonblocking commit contends with another commit, particularly in a
      mirrored display configuration where at least 2 CRTCs are updated.
      The error occurs in drm_atomic_helper_wait_for_flip_done(), when we
      attempt to access the contents of new_crtc_state->commit.
      
      Here's the sequence for a mirrored 2 display setup (irrelevant steps
      left out for clarity):
      
      **THREAD 1**                        | **THREAD 2**
                                          |
      Initialize atomic state for flip    |
                                          |
      Queue worker                        |
                                         ...
      
                                          | Do work for flip
                                          |
                                          | Signal hw_done() on CRTC 1
                                          | Signal hw_done() on CRTC 2
                                          |
                                          | Wait for flip_done() on CRTC 1
      
                                      <---- **PREEMPTED BY THREAD 1**
      
      Initialize atomic state for cursor  |
      update (1)                          |
                                          |
      Do cursor update work on both CRTCs |
                                          |
      Clear atomic state (2)              |
      **DONE**                            |
                                         ...
                                          |
                                          | Wait for flip_done() on CRTC 2
                                          | *ERROR*
                                          |
      
      The issue starts with (1). When the atomic state is initialized, the
      current CRTC states are duplicated to be the new_crtc_states, and
      referenced to be the old_crtc_states. (The new_crtc_states are to be
      filled with update data.)
      
      Some things to note:
      
      * Due to the mirrored configuration, the cursor updates on both CRTCs.
      
      * At this point, the pflip IRQ has already been handled, and flip_done
        signaled on all CRTCs. The cursor commit can therefore continue.
      
      * The old_crtc_states used by the cursor update are the **same states**
        as the new_crtc_states used by the flip worker.
      
      At (2), the old_crtc_state is freed (*), and the cursor commit
      completes. We then context switch back to the flip worker, where we
      attempt to access the new_crtc_state->commit object. This is
      problematic, as this state has already been freed.
      
      (*) Technically, 'state->crtcs[i].state' is freed, which was made to
          reference old_crtc_state in drm_atomic_helper_swap_state()
      
      [How]
      
      By moving hw_done() after wait_for_flip_done(), we're guaranteed that
      the new_crtc_state (from the flip worker's perspective) still exists.
      This is because any other commit will be blocked, waiting for the
      hw_done() signal.
      
      Note that both the i915 and imx drivers have this sequence flipped
      already, masking this problem.
      Signed-off-by: NShirish S <shirish.s@amd.com>
      Signed-off-by: NLeo Li <sunpeng.li@amd.com>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      987bf116
  16. 27 9月, 2018 5 次提交
  17. 15 9月, 2018 1 次提交