1. 22 6月, 2019 6 次提交
  2. 21 6月, 2019 3 次提交
  3. 14 6月, 2019 1 次提交
    • G
      amdgpu_dm: no need to check return value of debugfs_create functions · 4be8be78
      Greg Kroah-Hartman 提交于
      When calling debugfs functions, there is no need to ever check the
      return value.  The function can work or not, but the code logic should
      never do something different based on this.
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Cc: David Francis <David.Francis@amd.com>
      Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
      Cc: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
      Cc: Anthony Koo <Anthony.Koo@amd.com>
      Cc: hersen wu <hersenxs.wu@amd.com>
      Cc: "Leo (Hanghong) Ma" <hanghong.ma@amd.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      4be8be78
  4. 12 6月, 2019 6 次提交
    • N
      drm/amd/display: Rework CRTC color management · 7cd4b700
      Nicholas Kazlauskas 提交于
      [Why]
      To prepare for the upcoming DRM plane color management properties
      we need to correct a lot of wrong behavior and assumptions made for
      CRTC color management.
      
      The documentation added by this commit in amdgpu_dm_color explains
      how the HW color pipeline works and its limitations with the DRM
      interface.
      
      The current implementation does the following wrong:
      - Implicit sRGB DGM when no CRTC DGM is set
      - Implicit sRGB RGM when no CRTC RGM is set
      - No way to specify a non-linear DGM matrix that produces correct output
      - No way to specify a correct RGM when a linear DGM is used
      
      We had workarounds for passing kms_color tests but not all of the
      behavior we had wrong was covered by these tests (especially when
      it comes to non-linear DGM). Testing both DGM and RGM at the same time
      isn't something kms_color tests well either.
      
      [How]
      The specifics for how color management works in AMDGPU and the new
      behavior can be found by reading the documentation added to
      amdgpu_dm_color.c from this patch.
      
      All of the incorrect cases from the old implementation have been
      addressed for the atomic interface, but there still a few TODOs for
      the legacy one.
      
      Note: this does cause regressions for kms_color@pipe-a-ctm-* over HDMI.
      
      The result looks correct from visual inspection but the CRC no longer
      matches. For reference, the test was previously doing the following:
      
      linear degamma -> CTM -> sRGB regamma -> RGB to YUV (709) -> ...
      
      Now the test is doing:
      
      linear degamma -> CTM -> linear regamma -> RGB to YUV (709) -> ...
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NSun peng Li <Sunpeng.Li@amd.com>
      Acked-by: NBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      7cd4b700
    • N
      drm/amd/display: Set default ABM level to module parameter · c3e50f89
      Nicholas Kazlauskas 提交于
      [Why]
      The module parameter to specify the default ABM level is now defined,
      so hook it up in DM.
      
      [How]
      On connector reset specify the default level. DC will program this as
      part of the modeset since it gets passed onto the stream in
      dm_update_crtc_state.
      
      It's only set for eDP connectors, but it doesn't matter if this is
      specified for connectors or hardware that doesn't support ABM.
      
      It's DC's responsibility to check that ABM can be set or adjusted, and
      DC does check that the DMCU firmware is running and if there's backlight
      control available.
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NDavid Francis <david.francis@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      c3e50f89
    • N
      drm/amd/display: Enable fast plane updates when state->allow_modeset = true · 37fb6e8a
      Nicholas Kazlauskas 提交于
      [Why]
      Whenever the a modeset is allowed (but not neccessarily required) we
      currently recreate all the planes in the state. Most IGT tests and
      legacy IOCTLs create atomic commits with this flag set, so the pipes
      are often unnecessarily reprogrammed.
      
      Poor performance and stuttering can occur when many of these commits
      are frequently issued.
      
      This flag was needed when the appropriate conditions for checking
      whether the planes needed a reset were not in place, but
      should_reset_plane should cover everything needed now.
      
      [How]
      Drop the check for state->allow_modeset in should_reset_plane.
      
      All planes on a CRTC should reset in the following conditions:
      - The CRTC needs a modeset
      - The CRTC degamma changes
      - Planes are added or removed to the CRTC
      
      These conditions are all covered in should_reset_plane.
      
      We still can't drop the format change check in should_reset_plane since
      fill_dc_plane_info_and_addr isn't called when validating the state, so
      we can't tell if a FULL update is needed or not.
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NDavid Francis <david.francis@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      37fb6e8a
    • N
      drm/amd/display: Use current connector state if NULL when checking bpc · 01933ba4
      Nicholas Kazlauskas 提交于
      [Why]
      The old logic for checking which output depth to use relied on using
      the current connector state rather than the new proposed state. This
      was a problem when performing atomic commits since we weren't verifying
      it against the incoming max_requested_bpc.
      
      But switching this to only use the new state and not the current state
      breaks filtering modes - it'll always assume that the maximum bpc
      supported by the display is in use, which will cause certain modes
      like 1440p@144Hz to be filtered even when using 8bpc.
      
      [How]
      Still use the connector->state if we aren't passed an explicit state.
      This will respect the max_bpc the user currently has when filtering
      modes.
      
      Also remember to reset the default max_requested_bpc to 8 whenever
      connector reset is called to retain old behavior when using the new
      property.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110845Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@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>
      01933ba4
    • N
      drm/amd/display: Always allocate initial connector state state · f04bee34
      Nicholas Kazlauskas 提交于
      [Why]
      Unlike our regular connectors, MST connectors don't start off with
      an initial connector state. This causes a NULL pointer dereference to
      occur when attaching the bpc property since it tries to modify the
      connector state.
      
      We need an initial connector state on the connector to avoid the crash.
      
      [How]
      Use our reset helper to allocate an initial state and reset the values
      to their defaults. We were already doing this before, just not for
      MST connectors.
      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>
      f04bee34
    • 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
  5. 06 6月, 2019 1 次提交
  6. 03 6月, 2019 2 次提交
  7. 31 5月, 2019 4 次提交
  8. 29 5月, 2019 1 次提交
  9. 25 5月, 2019 6 次提交
  10. 24 5月, 2019 1 次提交
  11. 21 5月, 2019 1 次提交
  12. 06 5月, 2019 1 次提交
  13. 30 4月, 2019 7 次提交
    • 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