1. 16 5月, 2020 5 次提交
  2. 15 5月, 2020 3 次提交
    • S
    • S
      drm/i915: Restrict qgv points which don't have enough bandwidth. · 20f505f2
      Stanislav Lisovskiy 提交于
      According to BSpec 53998, we should try to
      restrict qgv points, which can't provide
      enough bandwidth for desired display configuration.
      
      Currently we are just comparing against all of
      those and take minimum(worst case).
      
      v2: Fixed wrong PCode reply mask, removed hardcoded
          values.
      
      v3: Forbid simultaneous legacy SAGV PCode requests and
          restricting qgv points. Put the actual restriction
          to commit function, added serialization(thanks to Ville)
          to prevent commit being applied out of order in case of
          nonblocking and/or nomodeset commits.
      
      v4:
          - Minor code refactoring, fixed few typos(thanks to James Ausmus)
          - Change the naming of qgv point
            masking/unmasking functions(James Ausmus).
          - Simplify the masking/unmasking operation itself,
            as we don't need to mask only single point per request(James Ausmus)
          - Reject and stick to highest bandwidth point if SAGV
            can't be enabled(BSpec)
      
      v5:
          - Add new mailbox reply codes, which seems to happen during boot
            time for TGL and indicate that QGV setting is not yet available.
      
      v6:
          - Increase number of supported QGV points to be in sync with BSpec.
      
      v7: - Rebased and resolved conflict to fix build failure.
          - Fix NUM_QGV_POINTS to 8 and moved that to header file(James Ausmus)
      
      v8: - Don't report an error if we can't restrict qgv points, as SAGV
            can be disabled by BIOS, which is completely legal. So don't
            make CI panic. Instead if we detect that there is only 1 QGV
            point accessible just analyze if we can fit the required bandwidth
            requirements, but no need in restricting.
      
      v9: - Fix wrong QGV transition if we have 0 planes and no SAGV
            simultaneously.
      
      v10: - Fix CDCLK corruption, because of global state getting serialized
             without modeset, which caused copying of non-calculated cdclk
             to be copied to dev_priv(thanks to Ville for the hint).
      
      v11: - Remove unneeded headers and spaces(Matthew Roper)
           - Remove unneeded intel_qgv_info qi struct from bw check and zero
             out the needed one(Matthew Roper)
           - Changed QGV error message to have more clear meaning(Matthew Roper)
           - Use state->modeset_set instead of any_ms(Matthew Roper)
           - Moved NUM_SAGV_POINTS from i915_reg.h to i915_drv.h where it's used
           - Keep using crtc_state->hw.active instead of .enable(Matthew Roper)
           - Moved unrelated changes to other patch(using latency as parameter
             for plane wm calculation, moved to SAGV refactoring patch)
      
      v12: - Fix rebase conflict with own temporary SAGV/QGV fix.
           - Remove unnecessary mask being zero check when unmasking
             qgv points as this is completely legal(Matt Roper)
           - Check if we are setting the same mask as already being set
             in hardware to prevent error from PCode.
           - Fix error message when restricting/unrestricting qgv points
             to "mask/unmask" which sounds more accurate(Matt Roper)
           - Move sagv status setting to icl_get_bw_info from atomic check
             as this should be calculated only once.(Matt Roper)
           - Edited comments for the case when we can't enable SAGV and
             use only 1 QGV point with highest bandwidth to be more
             understandable.(Matt Roper)
      
      v13: - Moved max_data_rate in bw check to closer scope(Ville Syrjälä)
           - Changed comment for zero new_mask in qgv points masking function
             to better reflect reality(Ville Syrjälä)
           - Simplified bit mask operation in qgv points masking function
             (Ville Syrjälä)
           - Moved intel_qgv_points_mask closer to gen11 SAGV disabling,
             however this still can't be under modeset condition(Ville Syrjälä)
           - Packed qgv_points_mask as u8 and moved closer to pipe_sagv_mask
             (Ville Syrjälä)
           - Extracted PCode changes to separate patch.(Ville Syrjälä)
           - Now treat num_planes 0 same as 1 to avoid confusion and
             returning max_bw as 0, which would prevent choosing QGV
             point having max bandwidth in case if SAGV is not allowed,
             as per BSpec(Ville Syrjälä)
           - Do the actual qgv_points_mask swap in the same place as
             all other global state parts like cdclk are swapped.
             In the next patch, this all will be moved to bw state as
             global state, once new global state patch series from Ville
             lands
      
      v14: - Now using global state to serialize access to qgv points
           - Added global state locking back, otherwise we seem to read
             bw state in a wrong way.
      
      v15: - Added TODO comment for near atomic global state locking in
             bw code.
      
      v16: - Fixed intel_atomic_bw_* functions to be intel_bw_* as discussed
             with Jani Nikula.
           - Take bw_state_changed flag into use.
      
      v17: - Moved qgv point related manipulations next to SAGV code, as
             those are semantically related(Ville Syrjälä)
           - Renamed those into intel_sagv_(pre)|(post)_plane_update
             (Ville Syrjälä)
      
      v18: - Move sagv related calls from commit tail into
             intel_sagv_(pre)|(post)_plane_update(Ville Syrjälä)
      
      v19: - Use intel_atomic_get_bw_(old)|(new)_state which is intended
             for commit tail stage.
      
      v20: - Return max bandwidth for 0 planes(Ville)
           - Constify old_bw_state in bw_atomic_check(Ville)
           - Removed some debugs(Ville)
           - Added data rate to debug print when no QGV points(Ville)
           - Removed some comments(Ville)
      
      v21, v22, v23: - Fixed rebase conflict
      
      v24: - Changed PCode mask to use ICL_ prefix
      v25: - Resolved rebase conflict
      
      v26: - Removed redundant NULL checks(Ville)
           - Removed redundant error prints(Ville)
      
      v27: - Use device specific drm_err(Ville)
           - Fixed parenthesis ident reported by checkpatch
             Line over 100 warns to be fixed together with
             existing code style.
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@intel.com>
      Cc: James Ausmus <james.ausmus@intel.com>
      [vsyrjala: Drop duplicate intel_sagv_{pre,post}_plane_update() prototypes
                 and drop unused NUM_SAGV_POINTS define]
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200514074853.9508-3-stanislav.lisovskiy@intel.com
      20f505f2
    • S
      drm/i915: Add TGL+ SAGV support · 7241c57d
      Stanislav Lisovskiy 提交于
      Starting from TGL we need to have a separate wm0
      values for SAGV and non-SAGV which affects
      how calculations are done.
      
      v2: Remove long lines
      v3: Removed COLOR_PLANE enum references
      v4, v5, v6: Fixed rebase conflict
      v7: - Removed skl_plane_wm_level accessor from skl_allocate_pipe_ddb(Ville)
          - Removed sagv_uv_wm0(Ville)
          - can_sagv->use_sagv_wm(Ville)
      
      v8: - Moved tgl_crtc_can_enable_sagv function up(Ville)
          - Changed comment regarding pipe_wm usage(Ville)
          - Call intel_can_enable_sagv and tgl_compute_sagv_wm only
            for Gen12(Ville)
          - Some sagv debugs removed(Ville)
          - skl_print_wm_changes improvements(Ville)
          - Do assignment instead of memcpy in
            skl_pipe_wm_get_hw_state(Ville)
      
      v9: - Removed can_sagv variable(Ville)
          - Removed spurious line(Ville)
          - Changed u32 to unsigned int as agreed(Ville)
          - Assign sagv only for gen12 in
            skl_pipe_wm_get_hw_state(Ville)
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      [vsyrjala: Remove the dead 'return false' from intel_crtc_can_enable_sagv()]
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200514074853.9508-2-stanislav.lisovskiy@intel.com
      7241c57d
  3. 13 5月, 2020 3 次提交
  4. 11 5月, 2020 1 次提交
  5. 04 5月, 2020 4 次提交
  6. 29 4月, 2020 1 次提交
  7. 21 4月, 2020 1 次提交
  8. 18 4月, 2020 2 次提交
  9. 15 4月, 2020 1 次提交
  10. 05 3月, 2020 4 次提交
  11. 04 3月, 2020 2 次提交
  12. 03 3月, 2020 1 次提交
  13. 02 3月, 2020 4 次提交
  14. 29 2月, 2020 1 次提交
  15. 23 2月, 2020 2 次提交
  16. 06 2月, 2020 4 次提交
    • S
      drm/i915: Correctly map DBUF slices to pipes · ff2cd863
      Stanislav Lisovskiy 提交于
      Added proper DBuf slice mapping to correspondent
      pipes, depending on pipe configuration as stated
      in BSpec.
      
      v2:
          - Remove unneeded braces
          - Stop using macro for DBuf assignments as
            it seems to reduce readability.
      
      v3: Start using enabled slices mask in dev_priv
      
      v4: Renamed "enabled_slices" used in dev_priv
          to "enabled_dbuf_slices_mask"(Matt Roper)
      
      v5: - Removed redundant parameters from
            intel_get_ddb_size function.(Matt Roper)
          - Made i915_possible_dbuf_slices static(Matt Roper)
          - Renamed total_width into total_width_in_range
            so that it now reflects that this is not
            a total pipe width but the one in current
            dbuf slice allowed range for pipe.(Matt Roper)
          - Removed 4th pipe for ICL in DBuf assignment
            table(Matt Roper)
          - Fixed wrong DBuf slice in DBuf table for TGL
            (Matt Roper)
          - Added comment regarding why we currently not
            using pipe ratio for DBuf assignment for ICL
      
      v6: - Changed u32 to unsigned int in
            icl_get_first_dbuf_slice_offset function signature
            (Ville Syrjälä)
          - Changed also u32 to u8 in dbuf slice mask structure
            (Ville Syrjälä)
          - Switched from DBUF_S1_BIT to enum + explicit
            BIT(DBUF_S1) access(Ville Syrjälä)
          - Switched to named initializers in DBuf assignment
            arrays(Ville Syrjälä)
          - DBuf assignment arrays now use autogeneration tool
            from
            https://patchwork.freedesktop.org/series/70493/
            to avoid typos.
          - Renamed i915_find_pipe_conf to *_compute_dbuf_slices
            (Ville Syrjälä)
          - Changed platforms ordering in skl_compute_dbuf_slices
            to be from newest to oldest(Ville Syrjälä)
      
      v7: - Now ORing assigned DBuf slice config always with DBUF_S1
            because slice 1 has to be constantly powered on.
            (Ville Syrjälä)
      
      v8: - Added pipe_name for neater printing(Ville Syrjälä)
          - Renamed width_before_pipe to width_before_pipe_in_range,
            to better reflect that now all the calculations are happening
            inside DBuf range allowed by current pipe configuration mask
            (Ville Syrjälä)
          - Shortened FIXME comment message, regarding constant ORing with
            DBUF_S1(Ville Syrjälä)
          - Added .dbuf_mask named initializer to pipe assignment array
            (Ville Syrjälä)
          - Edited pipe assignment array to use only single DBuf slice
            for gen11 single pipe configurations, until "pipe ratio"
            thing is finally sorted out(Ville Syrjälä)
          - Removed unused parameter crtc_state for now(Ville Syrjälä)
            from icl/tgl_compute_dbuf_slices function
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200202230630.8975-7-stanislav.lisovskiy@intel.com
      ff2cd863
    • S
      drm/i915: Manipulate DBuf slices properly · 0f0f9aee
      Stanislav Lisovskiy 提交于
      Start manipulating DBuf slices as a mask,
      but not as a total number, as current approach
      doesn't give us full control on all combinations
      of slices, which we might need(like enabling S2
      only can't enabled by setting enabled_slices=1).
      
      Removed wrong code from intel_get_ddb_size as
      it doesn't match to BSpec. For now still just
      use DBuf slice until proper algorithm is implemented.
      
      Other minor code refactoring to get prepared
      for major DBuf assignment changes landed:
      - As now enabled slices contain a mask
        we still need some value which should
        reflect how much DBuf slices are supported
        by the platform, now device info contains
        num_supported_dbuf_slices.
      - Removed unneeded assertion as we are now
        manipulating slices in a more proper way.
      
      v2: Start using enabled_slices in dev_priv
      
      v3: "enabled_slices" is now "enabled_dbuf_slices_mask",
          as this now sits in dev_priv independently.
      
      v4: - Fixed debug print formatting to hex(Matt Roper)
          - Optimized dbuf slice updates to be used only
            if slice union is different from current conf(Matt Roper)
          - Fixed some functions to be static(Matt Roper)
          - Created a parameterized version for DBUF_CTL to
            simplify DBuf programming cycle(Matt Roper)
          - Removed unrequred field from GEN10_FEATURES(Matt Roper)
      
      v5: - Removed redundant programming dbuf slices helper(Ville Syrjälä)
          - Started to use parameterized loop for hw readout to get slices
            (Ville Syrjälä)
          - Added back assertion checking amount of DBUF slices enabled
            after DC states 5/6 transition, also added new assertion
            as starting from ICL DMC seems to restore the last DBuf
            power state set, rather than power up all dbuf slices
            as assertion was previously expecting(Ville Syrjälä)
      
      v6: - Now using enum for DBuf slices in this patch (Ville Syrjälä)
          - Removed gen11_assert_dbuf_enabled and put gen9_assert_dbuf_enabled
            back, as we really need to have a single unified assert here
            however currently enabling always slice 1 is enforced by BSpec,
            so we will have to OR enabled slices mask with 1 in order
            to be consistent with BSpec, that way we can unify that
            assertion and against the actual state from the driver, but
            not some hardcoded value.(concluded with Ville)
          - Remove parameterized DBUF_CTL version, to extract it to another
            patch.(Ville Syrjälä)
      v7:
          - Removed unneeded hardcoded return value for older gens from
            intel_enabled_dbuf_slices_mask - this now is handled in a
            unified manner since device info anyway returns max dbuf slices
            as 1 for older platforms(Matthew Roper)
          - Now using INTEL_INFO(dev_priv)->num_supported_dbuf_slices instead
            of intel_dbuf_max_slices function as it is trivial(Matthew Roper)
      
      v8: - Fixed icl_dbuf_disable to disable all dbufs still(Ville Syrjälä)
      
      v9: - Renamed _DBUF_CTL_S to DBUF_CTL_S(Ville Syrjälä)
          - Now using power_domain mutex to protect from race condition, which
            can occur because intel_dbuf_slices_update might be running in
            parallel to gen9_dc_off_power_well_enable being called from
            intel_dp_detect for instance, which causes assertion triggered by
            race condition, as gen9_assert_dbuf_enabled might preempt this
            when registers were already updated, while dev_priv was not.
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200202230630.8975-6-stanislav.lisovskiy@intel.com
      0f0f9aee
    • S
      drm/i915: Introduce parameterized DBUF_CTL · 2570b7e3
      Stanislav Lisovskiy 提交于
      Now start using parameterized DBUF_CTL instead
      of hardcoded, this would allow shorter access
      functions when reading or storing entire state.
      
      Tried to implement it in a MMIO_PIPE manner, however
      DBUF_CTL1 address is higher than DBUF_CTL2, which
      implies that we have to now subtract from base
      rather than add.
      
      v2: - Removed unneeded DBUF_CTL_DIST and DBUF_CTL_ADDR
            macros. Started to use _PICK construct as suggested
            by Matt Roper.
      
      v3: - _DBUF_CTL_S* to DBUF_CTL_S*, changed X to "slice"
            in macro(Ville Syrjälä)
          - Introduced enum for enumerating DBUF slices(Ville Syrjälä)
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200202230630.8975-5-stanislav.lisovskiy@intel.com
      2570b7e3
    • S
      drm/i915: Remove skl_ddl_allocation struct · 072fcc30
      Stanislav Lisovskiy 提交于
      Current consensus that it is redundant as
      we already have skl_ddb_values struct out there,
      also this struct contains only single member
      which makes it unnecessary.
      
      v2: As dirty_pipes soon going to be nuked away
          from skl_ddb_values, evacuating enabled_slices
          to safer in dev_priv.
      
      v3: Changed "enabled_slices" to be "enabled_dbuf_slices_num"
          (Matt Roper)
      
      v4: - Wrapped the line getting number of dbuf slices(Matt Roper)
          - Removed indeed redundant skl_ddb_values declaration(Matt Roper)
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200202230630.8975-2-stanislav.lisovskiy@intel.com
      072fcc30
  17. 31 1月, 2020 1 次提交