1. 12 6月, 2019 1 次提交
    • N
      drm/amd/display: Don't set mode_changed=false if the stream was removed · 7e930949
      Nicholas Kazlauskas 提交于
      [Why]
      When switching from vt to desktop with EDID emulation we can receive
      an atomic commit such that we have a crtc where mode_changed = true.
      
      During the dm_update_crtc_state disable pass we remove the stream from
      the context and free it on the dm_new_crtc_state.
      
      During the enable pass we compare the new provisional stream to the
      dm_old_crtc_state->stream and determine that the stream is unchanged
      and no scaling has been changed.
      
      Following this, new_crtc_state->mode_changed is then set to false.
      The connectors haven't changed and the CRTC active state hasn't changed
      so drm_atomic_crtc_needs_modeset returns false, so we jump to
      skip_modeset and we hit:
      
      BUG_ON(dm_new_crtc_state->stream == NULL);
      
      ...since the old stream is gone from the context and the new stream is
      also still NULL.
      
      [How]
      Ensure that we still a stream to reuse before checking if we can reuse
      the old stream without a full modeset.
      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>
      7e930949
  2. 06 6月, 2019 1 次提交
  3. 03 6月, 2019 2 次提交
  4. 31 5月, 2019 4 次提交
  5. 29 5月, 2019 1 次提交
  6. 25 5月, 2019 6 次提交
  7. 24 5月, 2019 1 次提交
  8. 21 5月, 2019 1 次提交
  9. 06 5月, 2019 1 次提交
  10. 30 4月, 2019 9 次提交
    • M
      drm/amd/display: Compensate for pre-DCE12 BTR-VRR hw limitations. (v3) · 09aef2c4
      Mario Kleiner 提交于
      Pre-DCE12 needs special treatment for BTR / low framerate
      compensation for more stable behaviour:
      
      According to comments in the code and some testing on DCE-8
      and DCE-11, DCE-11 and earlier only apply VTOTAL_MIN/MAX
      programming with a lag of one frame, so the special BTR hw
      programming for intermediate fixed duration frames must be
      done inside the current frame at flip submission in atomic
      commit tail, ie. one vblank earlier, and the fixed refresh
      intermediate frame mode must be also terminated one vblank
      earlier on pre-DCE12 display engines.
      
      To achieve proper termination on < DCE-12 shift the point
      when the switch-back from fixed vblank duration to variable
      vblank duration happens from the start of VBLANK (vblank irq,
      as done on DCE-12+) to back-porch or end of VBLANK (handled
      by vupdate irq handler). We must leave the switch-back code
      inside VBLANK irq for DCE12+, as before.
      
      Doing this, we get much better behaviour of BTR for up-sweeps,
      ie. going from short to long frame durations (~high to low fps)
      and for constant framerate flips, as tested on DCE-8 and
      DCE-11. Behaviour is still not quite as good as on DCN-1
      though.
      
      On down-sweeps, going from long to short frame durations
      (low fps to high fps) < DCE-12 is a little bit improved,
      although by far not as much as for up-sweeps and constant
      fps.
      
      v2: Fix some wrong locking, as pointed out by Nicholas.
      v3: Simplify if-condition in vupdate-irq - nit by Nicholas.
      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>
      09aef2c4
    • N
      drm/amd/display: Expose DRM_FORMAT_RGB565 on overlay planes · 7267a1a9
      Nicholas Kazlauskas 提交于
      RGB565 support isn't restricted to just the primary plane in DC, so
      also expose support for it on overlays.
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NDavid Francis <david.francis@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      7267a1a9
    • N
      drm/amd/display: Do VRR transition before enable_crc_interrupts · 057be086
      Nicholas Kazlauskas 提交于
      [Why]
      Originally we did the amdgpu_dm_handle_vrr_transition call before
      interrupts were enabled. After the interrupt toggling logic was
      moved around for support enabling CRTCs with no primary planes
      active this was no longer being called in the case where there
      wasn't a modeset.
      
      This fixes failures in igt@kms_vrr@* with error
      "Timed out: Waiting for vblank event".
      
      [How]
      Shift them back into the loop that always ran before interrupts were
      enabled.
      
      Pull out the logic that updated VRR state into the same loop since
      there's no reason these need to be split.
      
      In the case where we're going from VRR off, no planes to VRR on, some
      active planes we'll still be covered for having the VRR vupdate
      handler enabled - vblank will be re-enabled at this point, it will
      see that VRR is active and set the vupdate interrupt on there.
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NDavid Francis <David.Francis@amd.com>
      Acked-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      057be086
    • T
      drm/amd/display: Add power down display on boot flag · 27eaa492
      Thomas Lim 提交于
      [Why]
      
      Due to the generic introduction of seamless boot, the display is no
      longer blanked upon boot. However, this causes corruption on some
      systems that does not lock the memory in the non-secure boot case,
      resulting in brief corruption on boot due to garbage being written into
      the frame buffer.
      
      [How]
      Add a flag, read during DC init, to determine whether display should be
      blanked on boot. Default to true.
      Signed-off-by: NThomas Lim <Thomas.Lim@amd.com>
      Reviewed-by: NAric Cyr <Aric.Cyr@amd.com>
      Acked-by: NAnthony Koo <Anthony.Koo@amd.com>
      Acked-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      27eaa492
    • N
      drm/amd/display: Allow commits with no planes active · bc92c065
      Nicholas Kazlauskas 提交于
      [Why]
      Many userspace applications (and IGT) seem to expect that most drivers
      can keep a CRTC active and enabled if there are no primary or overlay
      planes.
      
      DC is setup to handle this but only in the case where there are
      absolutely no planes on the CRTC - no primary, cursor, or overlay.
      
      [How]
      Add a check to reject commits that have cursor planes enabled and
      nothing else on CRTCs since we can't handle that. The new helper
      does_crtc_have_active_cursor is used for this.
      
      In atomic commit tail, we need to let DC know that there are zero
      planes enabled when doing stream updates to let it disable and blank
      pipes as appropriate.
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NDavid Francis <David.Francis@amd.com>
      Acked-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      bc92c065
    • N
      drm/amd/display: Split enabling CRTC interrupts into two passes · b5e83f6f
      Nicholas Kazlauskas 提交于
      [Why]
      When disabling all the pipes for a CRTC the page-flip interrupt also
      gets disabled on Raven. We can't re-enable the page-flip interrupt
      unless we give DC at least one active DC plane.
      
      We currently enable interrupts after the call to dc_commit_state since
      there's currently no valid sequence that should disable all the planes
      or re-enable planes for a CRTC without first going through
      dc_commit_state.
      
      If we were to allow for a CRTC to be enabled with no primary plane this
      would not be the case - the call to dc_commit_updates_for_stream would
      enable the planes when going from zero to at least one active plane,
      but manage_dm_interrupts would have been called too early.
      
      This results in a page-flip timeout on any subsequent commits since we
      think the page-flip are now enabled when they're actually disabled.
      
      We need to enable interrupts after the call to
      dc_commit_updates_for_stream.
      
      [How]
      Split enabling interrupts into two passes. One pass before
      dc_commit_updates_for_stream and one after it.
      
      Shifting all the interrupts to be strictly below the call doesn't
      currently work even though it should in theory. We end up queuing
      off the vblank event to be handle by the flip handler before it's
      actually enabled in some cases, particularly:
      
      old_crtc_state->active = false -> new_crtc_state->active = true
      
      The framebuffer states haven't changed and we can technically still
      do a "pageflip" in this case and send back the event.
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NDavid Francis <David.Francis@amd.com>
      Acked-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      b5e83f6f
    • N
      drm/amd/display: Fix CRC vblank refs when changing interrupts · e39575b9
      Nicholas Kazlauskas 提交于
      [Why]
      We only currently drop the vblank reference when the stream is
      being removed from the context. We should be dropping it whenever we
      disable interrupts and reaquiring it after we re-enable them.
      
      We also never get the extra reference correctly when re-enabling
      interrupts, since grabbing the reference has the following condition:
      
      if (!crtc_state->crc_enabled && enable)
              drm_crtc_vblank_get(crtc);
      
      This means that crc_enabled must be *false* in order to grab the extra
      reference.
      
      [How]
      Always drop the ref whenever we're disabling interrupts.
      
      Only disable CRC capture when the stream is being removed.
      
      Always grab the ref by setting dm_new_crtc_state->crc_enabled = false
      before the call to re-enable CRC capture.
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NDavid Francis <David.Francis@amd.com>
      Acked-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      e39575b9
    • N
      drm/amd/display: Disable cursors before disabling planes · 8ad27806
      Nicholas Kazlauskas 提交于
      [Why]
      We can't do cursor programming after the planes have been disabled
      since there won't be any pipes - leading to lock warnings and the wrong
      cursor state being left in the registers.
      
      When we re-enable the planes after the previous cursor state will also
      remain if we don't have a cursor plane.
      
      [How]
      If we're disabling the planes then do the cursor programming first.
      If we're not disabling the planes then do the cursor programming after.
      
      Introduce the amdgpu_dm_commit_cursors helper to avoid code duplication
      for both of these cases.
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NDavid Francis <David.Francis@amd.com>
      Acked-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      8ad27806
    • N
      drm/amd/display: Refactor CRTC interrupt toggling logic · d6ef9b41
      Nicholas Kazlauskas 提交于
      [Why]
      The vblank and pageflip interrupts should only be enabled for a CRTC
      that's enabled and has active planes.
      
      The current logic takes care of this, but isn't setup to handle the case
      where the active plane count goes to zero but the stream remains
      enabled.
      
      We currently block this case since we don't allow commits that enable a
      CRTC with no active planes, but shouldn't be any reason we can't support
      this from a hardware perspective and many userspace applications expect
      to be able to do it (like IGT).
      
      [How]
      The count_crtc_active_planes function fills in the number of
      "active_planes" on the dm_crtc_state. This should be the same as
      DC's plane_count on the stream_status but easier to access since we
      don't need to lock the private atomic state with the DC context.
      
      Add the "interrupts_enabled" flag to the dm_crtc_state and set it based
      on whether the stream exists and if there are active planes on the
      stream.
      
      Update the disable and enable logic to make use of this new flag.
      
      There shouldn't be any functional change (yet) with this patch.
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NDavid Francis <David.Francis@amd.com>
      Acked-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      d6ef9b41
  11. 24 4月, 2019 2 次提交
  12. 20 4月, 2019 1 次提交
  13. 15 4月, 2019 10 次提交