An error occurred fetching the project authors.
  1. 24 Feb, 2023 1 commit
  2. 13 Dec, 2022 1 commit
  3. 09 Dec, 2022 1 commit
    • Alan Previn's avatar
      drm/i915/pxp: Promote pxp subsystem to top-level of i915 · f67986b0
      Alan Previn authored
      Starting with MTL, there will be two GT-tiles, a render and media
      tile. PXP as a service for supporting workloads with protected
      contexts and protected buffers can be subscribed by process
      workloads on any tile. However, depending on the platform,
      only one of the tiles is used for control events pertaining to PXP
      operation (such as creating the arbitration session and session
      tear-down).
      
      PXP as a global feature is accessible via batch buffer instructions
      on any engine/tile and the coherency across tiles is handled implicitly
      by the HW. In fact, for the foreseeable future, we are expecting this
      single-control-tile for the PXP subsystem.
      
      In MTL, it's the standalone media tile (not the root tile) because
      it contains the VDBOX and KCR engine (among the assets PXP relies on
      for those events).
      
      Looking at the current code design, each tile is represented by the
      intel_gt structure while the intel_pxp structure currently hangs off the
      intel_gt structure.
      
      Keeping the intel_pxp structure within the intel_gt structure makes some
      internal functionalities more straight forward but adds code complexity to
      code readability and maintainibility to many external-to-pxp subsystems
      which may need to pick the correct intel_gt structure. An example of this
      would be the intel_pxp_is_active or intel_pxp_is_enabled functionality
      which should be viewed as a global level inquiry, not a per-gt inquiry.
      
      That said, this series promotes the intel_pxp structure into the
      drm_i915_private structure making it a top-level subsystem and the PXP
      subsystem will select the control gt internally and keep a pointer to
      it for internal reference.
      
      This promotion comes with two noteworthy changes:
      
      1. Exported pxp functions that are called by external subsystems
         (such as intel_pxp_enabled/active) will have to check implicitly
         if i915->pxp is valid as that structure will not be allocated
         for HW that doesn't support PXP.
      
      2. Since GT is now considered a soft-dependency of PXP we are
         ensuring that GT init happens before PXP init and vice versa
         for fini. This causes a minor ordering change whereby we previously
         called intel_pxp_suspend after intel_uc_suspend but now is before
         i915_gem_suspend_late but the change is required for correct
         dependency flows. Additionally, this re-order change doesn't
         have any impact because at that point in either case, the top level
         entry to i915 won't observe any PXP events (since the GPU was
         quiesced during suspend_prepare). Also, any PXP event doesn't
         really matter when we disable the PXP HW (global GT irqs are
         already off anyway, so even if there was a bug that generated
         spurious events we wouldn't see it and we would just clean it
         up on resume which is okay since the default fallback action
         for PXP would be to keep the sessions off at this suspend stage).
      
      Changes from prior revs:
        v11: - Reformat a comment (Tvrtko).
        v10: - Change the code flow for intel_pxp_init to make it more
               cleaner and readible with better comments explaining the
               difference between full-PXP-feature vs the partial-teelink
               inits depending on the platform. Additionally, only do
               the pxp allocation when we are certain the subsystem is
               needed. (Tvrtko).
         v9: - Cosmetic cleanups in supported/enabled/active. (Daniele).
             - Add comments for intel_pxp_init and pxp_get_ctrl_gt that
               explain the functional flow for when PXP is not supported
               but the backend-assets are needed for HuC authentication
               (Daniele and Tvrtko).
             - Fix two remaining functions that are accessible outside
               PXP that need to be checking pxp ptrs before using them:
               intel_pxp_irq_handler and intel_pxp_huc_load_and_auth
               (Tvrtko and Daniele).
             - User helper macro in pxp-debugfs (Tvrtko).
         v8: - Remove pxp_to_gt macro (Daniele).
             - Fix a bug in pxp_get_ctrl_gt for the case of MTL and we don't
               support GSC-FW on it. (Daniele).
             - Leave i915->pxp as NULL if we dont support PXP and in line
               with that, do additional validity check on i915->pxp for
               intel_pxp_is_supported/enabled/active (Daniele).
             - Remove unncessary include header from intel_gt_debugfs.c
               and check drm_minor i915->drm.primary (Daniele).
             - Other cosmetics / minor issues / more comments on suspend
               flow order change (Daniele).
         v7: - Drop i915_dev_to_pxp and in intel_pxp_init use 'i915->pxp'
               through out instead of local variable newpxp. (Rodrigo)
             - In the case intel_pxp_fini is called during driver unload but
               after i915 loading failed without pxp being allocated, check
               i915->pxp before referencing it. (Alan)
         v6: - Remove HAS_PXP macro and replace it with intel_pxp_is_supported
               because : [1] introduction of 'ctrl_gt' means we correct this
               for MTL's upcoming series now. [2] Also, this has little impact
               globally as its only used by PXP-internal callers at the moment.
             - Change intel_pxp_init/fini to take in i915 as its input to avoid
               ptr-to-ptr in init/fini calls.(Jani).
             - Remove the backpointer from pxp->i915 since we can use
               pxp->ctrl_gt->i915 if we need it. (Rodrigo).
         v5: - Switch from series to single patch (Rodrigo).
             - change function name from pxp_get_kcr_owner_gt to
               pxp_get_ctrl_gt.
             - Fix CI BAT failure by removing redundant call to intel_pxp_fini
               from driver-remove.
             - NOTE: remaining open still persists on using ptr-to-ptr
               and back-ptr.
         v4: - Instead of maintaining intel_pxp as an intel_gt structure member
               and creating a number of convoluted helpers that takes in i915 as
               input and redirects to the correct intel_gt or takes any intel_gt
               and internally replaces with the correct intel_gt, promote it to
               be a top-level i915 structure.
         v3: - Rename gt level helper functions to "intel_pxp_is_enabled/
               supported/ active_on_gt" (Daniele)
             - Upgrade _gt_supports_pxp to replace what was intel_gtpxp_is
               supported as the new intel_pxp_is_supported_on_gt to check for
               PXP feature support vs the tee support for huc authentication.
               Fix pxp-debugfs-registration to use only the former to decide
               support. (Daniele)
             - Couple minor optimizations.
         v2: - Avoid introduction of new device info or gt variables and use
               existing checks / macros to differentiate the correct GT->PXP
               control ownership (Daniele Ceraolo Spurio)
             - Don't reuse the updated global-checkers for per-GT callers (such
               as other files within PXP) to avoid unnecessary GT-reparsing,
               expose a replacement helper like the prior ones. (Daniele).
         v1: - Add one more patch to the series for the intel_pxp suspend/resume
               for similar refactoring
      
      References: https://patchwork.freedesktop.org/patch/msgid/20221202011407.4068371-1-alan.previn.teres.alexis@intel.comSigned-off-by: default avatarAlan Previn <alan.previn.teres.alexis@intel.com>
      Reviewed-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Acked-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221208180542.998148-1-alan.previn.teres.alexis@intel.com
      f67986b0
  4. 06 Dec, 2022 1 commit
  5. 29 Nov, 2022 1 commit
  6. 14 Nov, 2022 1 commit
  7. 31 Oct, 2022 1 commit
    • Imre Deak's avatar
      drm/i915/tgl+: Add locking around DKL PHY register accesses · d7164a50
      Imre Deak authored
      Accessing the TypeC DKL PHY registers during modeset-commit,
      -verification, DP link-retraining and AUX power well toggling is racy
      due to these code paths being concurrent and the PHY register bank
      selection register (HIP_INDEX_REG) being shared between PHY instances
      (aka TC ports) and the bank selection being not atomic wrt. the actual
      PHY register access.
      
      Add the required locking around each PHY register bank selection->
      register access sequence.
      
      Kudos to Ville for noticing the race conditions.
      
      v2:
      - Add the DKL PHY register accessors to intel_dkl_phy.[ch]. (Jani)
      - Make the DKL_REG_TC_PORT macro independent of PHY internals.
      - Move initing the DKL PHY lock to a more logical place.
      
      v3:
      - Fix parameter reuse in the DKL_REG_TC_PORT definition.
      - Document the usage of phy_lock.
      
      v4:
      - Fix adding TC_PORT_1 offset in the DKL_REG_TC_PORT definition.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: <stable@vger.kernel.org> # v5.5+
      Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221025114457.2191004-1-imre.deak@intel.com
      (cherry picked from commit 89cb0ba4)
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      d7164a50
  8. 26 Oct, 2022 1 commit
    • Imre Deak's avatar
      drm/i915/tgl+: Add locking around DKL PHY register accesses · 89cb0ba4
      Imre Deak authored
      Accessing the TypeC DKL PHY registers during modeset-commit,
      -verification, DP link-retraining and AUX power well toggling is racy
      due to these code paths being concurrent and the PHY register bank
      selection register (HIP_INDEX_REG) being shared between PHY instances
      (aka TC ports) and the bank selection being not atomic wrt. the actual
      PHY register access.
      
      Add the required locking around each PHY register bank selection->
      register access sequence.
      
      Kudos to Ville for noticing the race conditions.
      
      v2:
      - Add the DKL PHY register accessors to intel_dkl_phy.[ch]. (Jani)
      - Make the DKL_REG_TC_PORT macro independent of PHY internals.
      - Move initing the DKL PHY lock to a more logical place.
      
      v3:
      - Fix parameter reuse in the DKL_REG_TC_PORT definition.
      - Document the usage of phy_lock.
      
      v4:
      - Fix adding TC_PORT_1 offset in the DKL_REG_TC_PORT definition.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: <stable@vger.kernel.org> # v5.5+
      Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221025114457.2191004-1-imre.deak@intel.com
      89cb0ba4
  9. 17 Oct, 2022 1 commit
  10. 11 Oct, 2022 1 commit
  11. 10 Oct, 2022 1 commit
  12. 24 Sep, 2022 1 commit
  13. 16 Sep, 2022 1 commit
  14. 13 Sep, 2022 1 commit
  15. 12 Sep, 2022 5 commits
  16. 09 Sep, 2022 1 commit
  17. 01 Sep, 2022 1 commit
  18. 31 Aug, 2022 2 commits
  19. 29 Aug, 2022 4 commits
  20. 24 Aug, 2022 2 commits
  21. 30 Jun, 2022 2 commits
  22. 27 Jun, 2022 2 commits
  23. 23 Jun, 2022 1 commit
  24. 20 Jun, 2022 1 commit
    • Thomas Hellström's avatar
      drm/i915: Improve on suspend / resume time with VT-d enabled · 2ef6efa7
      Thomas Hellström authored
      When DMAR / VT-d is enabled, the display engine uses overfetching,
      presumably to deal with the increased latency. To avoid display engine
      errors and DMAR faults, as a workaround the GGTT is populated with scatch
      PTEs when VT-d is enabled. However starting with gen10, Write-combined
      writing of scratch PTES is no longer possible and as a result, populating
      the full GGTT with scratch PTEs like on resume becomes very slow as
      uncached access is needed.
      
      Therefore, on integrated GPUs utilize the fact that the PTEs are stored in
      stolen memory which retain content across S3 suspend. Don't clear the PTEs
      on suspend and resume. This improves on resume time with around 100 ms.
      While 100+ms might appear like a short time it's 10% to 20% of total resume
      time and important in some applications.
      
      One notable exception is Intel Rapid Start Technology which may cause
      stolen memory to be lost across what the OS percieves as S3 suspend.
      If IRST is enabled or if we can't detect whether IRST is enabled, retain
      the old workaround, clearing and re-instating PTEs.
      
      As an additional measure, if we detect that the last ggtt pte was lost
      during suspend, print a warning and re-populate the GGTT ptes
      
      On discrete GPUs, the display engine scans out from LMEM which isn't
      subject to DMAR, and presumably the workaround is therefore not needed,
      but that needs to be verified and disabling the workaround for dGPU,
      if possible, will be deferred to a follow-up patch.
      
      v2:
      - Rely on retained ptes to also speed up suspend and resume re-binding.
      - Re-build GGTT ptes if Intel rst is enabled.
      v3:
      - Re-build GGTT ptes also if we can't detect whether Intel rst is enabled,
        and if the guard page PTE and end of GGTT was lost.
      v4:
      - Fix some kerneldoc issues (Matthew Auld), rebase.
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220617152856.249295-1-thomas.hellstrom@linux.intel.com
      2ef6efa7
  25. 26 May, 2022 1 commit
  26. 20 May, 2022 1 commit
  27. 16 May, 2022 1 commit
  28. 21 Apr, 2022 1 commit
  29. 05 Apr, 2022 1 commit