1. 29 1月, 2019 1 次提交
    • N
      drm/amd/display: Enable vblank interrupt during CRC capture · 428da2bd
      Nicholas Kazlauskas 提交于
      [Why]
      In order to read CRC events when CRC capture is enabled the vblank
      interrput handler needs to be running for the CRTC. The handler is
      enabled while there is an active vblank reference.
      
      When running IGT tests there will often be no active vblank reference
      but the test expects to read a CRC value. This is valid usage (and
      works on i915 since they have a CRC interrupt handler) so the reference
      to the vblank should be grabbed while capture is active.
      
      This issue was found running:
      
      igt@kms_plane_multiple@atomic-pipe-b-tiling-none
      
      The pipe-b is the only one in the initial commit and was not previously
      active so no vblank reference is grabbed. The vblank interrupt is
      not enabled and the test times out.
      
      [How]
      Keep a reference to the vblank as long as CRC capture is enabled.
      If userspace never explicitly disables it then the reference is
      also dropped when removing the CRTC from the context (stream = NULL).
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NHarry Wentland <Harry.Wentland@amd.com>
      Reviewed-by: NSun peng Li <Sunpeng.Li@amd.com>
      Acked-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      428da2bd
  2. 26 1月, 2019 6 次提交
  3. 15 1月, 2019 10 次提交
  4. 21 12月, 2018 1 次提交
  5. 19 12月, 2018 2 次提交
    • N
      drm/amd/display: Add below the range support for FreeSync · 180db303
      Nicholas Kazlauskas 提交于
      [Why]
      When the flip-rate is below the minimum supported variable refresh rate
      range for the monitor the front porch wait will timeout and be
      frequently misaligned resulting in stuttering and/or flickering.
      
      The FreeSync module can still maintain a smooth and flicker free
      image when the monitor has a refresh rate range such that the maximum
      refresh > 2 * minimum refresh by utilizing low framerate compensation,
      "below the range".
      
      [How]
      Hook up the pre-flip and post-flip handlers from the FreeSync module.
      These adjust the minimum/maximum vrr range to duplicate frames
      when appropriate by tracking flip timestamps.
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Acked-by: NLeo Li <sunpeng.li@amd.com>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      180db303
    • N
      drm/amd/display: Skip fast cursor updates for fb changes · 77acd1cd
      Nicholas Kazlauskas 提交于
      [Why]
      The behavior of drm_atomic_helper_cleanup_planes differs depending on
      whether the commit was asynchronous or not. When it's called from
      amdgpu_dm_atomic_commit_tail during a typical atomic commit the
      plane state has been swapped so it calls cleanup_fb on the old plane
      state.
      
      However, in the asynchronous commit codepath the call to
      drm_atomic_helper_commit also calls dm_plane_helper_cleanup_fb after
      atomic_async_update has been called. Since the plane state is updated
      in place and has not been swapped the cleanup_fb call affects the new
      plane state.
      
      This results in a use after free for the given sequence:
      
      - Fast update, fb1 pin/ref, fb1 unpin/unref
      - Fast update, fb2 pin/ref, fb2 unpin/unref
      - Slow update, fb1 pin/ref, fb2 unpin/unref
      - Fast update, fb2 pin/ref -> use after free. bug
      
      [How]
      Disallow framebuffer changes in the fast path. Since this includes
      a NULL framebuffer, this means that only framebuffers that have
      been previously pin+ref at least once will be used, preventing a
      use after free.
      
      This has a significant throughput reduction for cursor updates where
      the framebuffer changes. For most desktop usage this isn't a problem,
      but it does introduce performance regressions for two specific IGT
      tests:
      
      - cursor-vs-flip-toggle
      - cursor-vs-flip-varying-size
      
      Fixes: 2cc751931afc ("drm/amd/display: Add fast path for cursor plane updates")
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NAndrey Grodzovsky <andrey.grodzovsky@amd.com>
      Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      77acd1cd
  6. 13 12月, 2018 1 次提交
  7. 12 12月, 2018 3 次提交
  8. 06 12月, 2018 1 次提交
  9. 05 12月, 2018 1 次提交
    • N
      drm/amd/display: Fix overflow/truncation from strncpy. · 090afc1e
      Nicholas Kazlauskas 提交于
      [Why]
      
      New GCC warnings for stringop-truncation and stringop-overflow help
      catch common misuse of strncpy. This patch suppresses these warnings
      by fixing bugs identified by them.
      
      [How]
      
      Since the parameter passed for name in amdpgu_dm_create_common_mode has
      no fixed length, if the string is >= DRM_DISPLAY_MODE_LEN then
      mode->name will not be null-terminated.
      
      The truncation in fill_audio_info won't actually occur (and the string
      will be null-terminated since the buffer is initialized to zero), but
      the warning can be suppressed by using the proper buffer size.
      
      This patch fixes both issues by using the real size for the buffer and
      making use of strscpy (which always terminates).
      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>
      090afc1e
  10. 01 12月, 2018 3 次提交
  11. 30 11月, 2018 2 次提交
  12. 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
  13. 27 11月, 2018 5 次提交
  14. 22 11月, 2018 1 次提交