1. 04 Oct, 2023 7 commits
  2. 03 Oct, 2023 2 commits
  3. 02 Oct, 2023 4 commits
  4. 29 Sep, 2023 21 commits
  5. 28 Sep, 2023 6 commits
    • Imre Deak's avatar
      drm/i915/fdi: Recompute state for affected CRTCs on FDI links · f67ff36f
      Imre Deak authored
      Recompute the state of all CRTCs on an FDI link during a modeset that
      may be affected by the modeset of other CRTCs on the same link. This
      ensures that each CRTC on the link maximizes its BW use (after another
      CRTC is disabled).
      
      In practice this means recomputing pipe B's config on IVB if pipe C gets
      disabled.
      
      v2:
      - Add the change recomputing affected CRTC states in a separate patch.
        (Ville)
      v3: (Ville)
      - Constify old and new crtc states.
      - Check for fused off pipe C.
      - Fix new vs. old crtc state mixup.
      - Drop check for pipe C's enabled state.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-12-imre.deak@intel.com
      f67ff36f
    • Imre Deak's avatar
      drm/i915/fdi: Improve FDI BW sharing between pipe B and C · 998d2cd3
      Imre Deak authored
      At the moment modesetting pipe C on IVB will fail if pipe B uses 4 FDI
      lanes. Make the BW sharing more dynamic by trying to reduce pipe B's
      link bpp in this case, until pipe B uses only up to 2 FDI lanes.
      
      For this instead of the encoder compute config retry loop - which
      reduced link bpp only for the encoder's pipe - reduce the maximum link
      bpp for pipe B/C as required after all CRTC states are computed and
      recompute the CRTC states with the new bpp limit.
      
      Atm, all FDI encoder's compute config function returns an error if a BW
      constrain prevents increasing the pipe bpp value. The corresponding
      crtc_state->bw_constrained check can be replaced with checking
      crtc_state->max_link_bpp_x16, add TODO comments for this. SDVO is an
      exception where this case is only handled in the outer config retry
      loop, failing the modeset with a WARN, add a FIXME comment to handle
      this in the encoder code similarly to other encoders.
      
      v2:
      - Don't assume that a CRTC is already in the atomic state, while
        reducing its link bpp.
      - Add DocBook description to intel_fdi_atomic_check_link().
      v3:
      - Enable BW management for FDI links in a separate patch. (Ville)
      v4: (Ville)
      - Fail the SDVO encoder config computation if it doesn't support the
        link bpp limit.
      - Add TODO: comments about checking link_bpp_x16 instead of
        bw_constrained.
      v5:
      - Replace link bpp limit check with a FIXME: comment in
        intel_sdvo_compute_config(). (Ville)
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      [Amended commit message wrt. changes in v5]
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-11-imre.deak@intel.com
      998d2cd3
    • Imre Deak's avatar
      drm/i915: Add helpers for BW management on shared display links · 8ca0b875
      Imre Deak authored
      At the moment a modeset fails if the config computation of a pipe can't
      fit its required BW to the available link BW even though the limitation
      may be resolved by reducing the BW requirement of other pipes.
      
      To improve the above this patch adds helper functions checking the
      overall BW limits after all CRTC states have been computed. If the check
      fails the maximum link bpp for a selected pipe will be reduced and all
      the CRTC states will be recomputed until either the overall BW limit
      check passes, or further bpp reduction is not possible (because all
      pipes/encoders sharing the link BW reached their minimum link bpp).
      
      Atm, the MST encoder allocates twice the required BW for YUV420 format
      streams. A follow-up patchset will fix that, add a code comment about
      this.
      
      This change prepares for upcoming patches enabling the above BW
      management on FDI and MST links.
      
      v2:
      - Rename intel_crtc_state::max_link_bpp to max_link_bpp_x16 and
        intel_link_bw_limits::max_bpp to max_bpp_x16. (Jani)
      v3:
      - Add the helper functions in a separate patch. (Ville)
      - Add the functions to intel_link_bw.c instead of intel_atomic.c (Ville)
      - Return -ENOSPC instead of -EINVAL to userspace in case of a link BW
        limit failure.
      v4:
      - Make intel_atomic_check_config() static.
      v5: (Ville)
      - Rename intel_link_bw_limits::min_bpp_pipes to min_bpp_reached_pipes
        and intel_link_bw_reset_pipe_limit_to_min() to
        intel_link_bw_set_min_bpp_for_pipe().
      - Rename pipe_bpp to link_bpp in intel_link_bw_reduce_bpp().
      - Add FIXME: comment about MST encoder's YUV420 BW allocation and
        tracking the link bpp limit accordingly.
      v6:
      - Move intel_link_bw_compute_pipe_bpp() to intel_fdi.c (Ville)
      - WARN_ON(BIT(pipe) & min_bpp_reached_pipes) in
        intel_link_bw_set_bpp_limit_for_pipe(). (Ville)
      - Rename intel_link_bw_set_min_bpp_for_pipe() to
        intel_link_bw_set_bpp_limit_for_pipe() and
        intel_link_bw_limits::min_bpp_reached_pipes to
        bpp_limit_reached_pipes. (Ville)
      - Remove unused header includes.
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-10-imre.deak@intel.com
      8ca0b875
    • Imre Deak's avatar
      drm/i915: Factor out a helper to check/compute all the CRTC states · 1050e4c2
      Imre Deak authored
      Factor out intel_atomic_check_config() to check and compute all the CRTC
      states. This will be used by a follow up patch to recompute/check the
      state until required by BW limitations between CRTCs.
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-9-imre.deak@intel.com
      1050e4c2
    • Imre Deak's avatar
      drm/i915: Rename intel_modeset_all_pipes() to intel_modeset_all_pipes_late() · e3b26904
      Imre Deak authored
      Rename intel_modeset_all_pipes() to intel_modeset_all_pipes_late() to
      clarify when the function can be called (vs.
      intel_modeset_pipes_in_mask_early()).
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-8-imre.deak@intel.com
      e3b26904
    • Imre Deak's avatar
      drm/i915: Add helper to modeset a set of pipes · fa7a7a1c
      Imre Deak authored
      Add intel_modeset_pipes_in_mask_early() to modeset a provided set of
      pipes, used in a follow-up patch.
      
      As opposed to intel_modeset_all_pipes() which modesets only the active
      pipes - others don't requiring programming the HW - modeset all enabled
      pipes in intel_modeset_pipes_in_mask_early() which may need to recompute
      their state even if they are not active (that is in the DPMS off state).
      
      While at it add DocBook descriptions for the two exported functions.
      
      v2:
      - Add a flag controlling if active planes are force updated as well.
      - Add DockBook descriptions.
      v3:
      - For clarity use _early/_late suffixes for the exported functions
        instead of the update_active_planes parameter. (Ville)
      v4:
      - In intel_modeset_pipes_in_mask_early() update only the crtc
        flags relevant to the early phase. (Ville)
      - Rename intel_modeset_all_pipes() in a separate patch.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-7-imre.deak@intel.com
      fa7a7a1c