1. 30 Jul, 2020 6 commits
    • hersen wu's avatar
      drm/amd/display: dchubbub p-state warning during surface planes switch · 31f34d19
      hersen wu authored
      [Why]
      ramp_up_dispclk_with_dpp is to change dispclk, dppclk and dprefclk
      according to bandwidth requirement. call stack: rv1_update_clocks -->
      update_clocks --> dcn10_prepare_bandwidth / dcn10_optimize_bandwidth
      --> prepare_bandwidth / optimize_bandwidth. before change dcn hw,
      prepare_bandwidth will be called first to allow enough clock,
      watermark for change, after end of dcn hw change, optimize_bandwidth
      is executed to lower clock to save power for new dcn hw settings.
      
      below is sequence of commit_planes_for_stream:
      step 1: prepare_bandwidth - raise clock to have enough bandwidth
      step 2: lock_doublebuffer_enable
      step 3: pipe_control_lock(true) - make dchubp register change will
      not take effect right way
      step 4: apply_ctx_for_surface - program dchubp
      step 5: pipe_control_lock(false) - dchubp register change take effect
      step 6: optimize_bandwidth --> dc_post_update_surfaces_to_stream
      for full_date, optimize clock to save power
      
      at end of step 1, dcn clocks (dprefclk, dispclk, dppclk) may be
      changed for new dchubp configuration. but real dcn hub dchubps are
      still running with old configuration until end of step 5. this need
      clocks settings at step 1 should not less than that before step 1.
      this is checked by two conditions: 1. if (should_set_clock(safe_to_lower
      , new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz) ||
      new_clocks->dispclk_khz == clk_mgr_base->clks.dispclk_khz)
      2. request_dpp_div = new_clocks->dispclk_khz > new_clocks->dppclk_khz
      
      the second condition is based on new dchubp configuration. dppclk
      for new dchubp may be different from dppclk before step 1.
      for example, before step 1, dchubps are as below:
      pipe 0: recout=(0,40,1920,980) viewport=(0,0,1920,979)
      pipe 1: recout=(0,0,1920,1080) viewport=(0,0,1920,1080)
      for dppclk for pipe0 need dppclk = dispclk
      
      new dchubp pipe split configuration:
      pipe 0: recout=(0,0,960,1080) viewport=(0,0,960,1080)
      pipe 1: recout=(960,0,960,1080) viewport=(960,0,960,1080)
      dppclk only needs dppclk = dispclk /2.
      
      dispclk, dppclk are not lock by otg master lock. they take effect
      after step 1. during this transition, dispclk are the same, but
      dppclk is changed to half of previous clock for old dchubp
      configuration between step 1 and step 6. This may cause p-state
      warning intermittently.
      
      [How]
      for new_clocks->dispclk_khz == clk_mgr_base->clks.dispclk_khz, we
      need make sure dppclk are not changed to less between step 1 and 6.
      for new_clocks->dispclk_khz > clk_mgr_base->clks.dispclk_khz,
      new display clock is raised, but we do not know ratio of
      new_clocks->dispclk_khz and clk_mgr_base->clks.dispclk_khz,
      new_clocks->dispclk_khz /2 does not guarantee equal or higher than
      old dppclk. we could ignore power saving different between
      dppclk = displck and dppclk = dispclk / 2 between step 1 and step 6.
      as long as safe_to_lower = false, set dpclk = dispclk to simplify
      condition check.
      
      CC: Stable <stable@vger.kernel.org>
      Signed-off-by: default avatarHersen Wu <hersenxs.wu@amd.com>
      Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
      Acked-by: default avatarEryk Brol <eryk.brol@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      31f34d19
    • Anthony Koo's avatar
    • Eryk Brol's avatar
      drm/amd/display: DSC Clock enable debugfs write entry · 097e6d98
      Eryk Brol authored
      [Why]
      Need a mechanism to force enable DSC on any connector
      
      [How]
      Debugfs entry overwrites newly added connector's dsc preffered
      settings structure and sets dsc_clock_en flag on it.
      During the attomic commit, depending if connector is SST or
      MST, we will enable DSC manually by overwriting stream's DSC flag.
      Signed-off-by: default avatarEryk Brol <eryk.brol@amd.com>
      Signed-off-by: default avatarMikita Lipski <mikita.lipski@amd.com>
      Reviewed-by: default avatarMikita Lipski <Mikita.Lipski@amd.com>
      Acked-by: default avatarEryk Brol <eryk.brol@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      097e6d98
    • Reza Amini's avatar
      drm/amd/display: Allow asic specific FSFT timing optimization · cc0f379d
      Reza Amini authored
      [Why]
      Each asic can optimize best based on its capabilities
      
      [How]
      Optimizing timing for a new pixel clock
      Signed-off-by: default avatarReza Amini <Reza.Amini@amd.com>
      Reviewed-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
      Acked-by: default avatarEryk Brol <eryk.brol@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      cc0f379d
    • Jun Lei's avatar
      drm/amd/display: Disable idle optimizations before programming DCN · 9b6ca29e
      Jun Lei authored
      [Why]
      Programming DCN is explicitly forbidden during idle optimzations allowed
      state. Existing implemenation relies on OS/DM, which is not robust. Instead
      DC should sequence this.
      
      Note that DC will not re-enter idle optimized state on its own, it is only
      responsible for catching out of sequence calls. It is still DM
      responsibility to sequence appropriate for optimized power, but this change
      removes the requirement for DM to cover the .1% case.
      
      [How]
       - elevate updates during idle optimized state to full updates
       - disable idle power optimizations prior to programming
      Signed-off-by: default avatarJun Lei <jun.lei@amd.com>
      Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
      Acked-by: default avatarEryk Brol <eryk.brol@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      9b6ca29e
    • Stylon Wang's avatar
      drm/amd/display: Fix dmesg warning from setting abm level · 473e2d16
      Stylon Wang authored
      [Why]
      Setting abm level does not correctly update CRTC state. As a result
      no surface update is added to dc stream state and triggers warning.
      
      [How]
      Correctly update CRTC state when setting abm level property.
      
      CC: Stable <stable@vger.kernel.org>
      Signed-off-by: default avatarStylon Wang <stylon.wang@amd.com>
      Reviewed-by: default avatarNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
      Acked-by: default avatarEryk Brol <eryk.brol@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      473e2d16
  2. 28 Jul, 2020 3 commits
  3. 27 Jul, 2020 31 commits