1. 12 9月, 2022 3 次提交
  2. 26 8月, 2022 1 次提交
  3. 09 7月, 2022 1 次提交
    • M
      drm/i915/gt: Add general DSS steering iterator to intel_gt_mcr · 9a92732f
      Matt Roper 提交于
      Although all DSS belong to a single pool on Xe_HP platforms (i.e.,
      they're not organized into slices from a topology point of view), we do
      still need to pass 'group' and 'instance' targets when steering register
      accesses to a specific instance of a per-DSS multicast register.  The
      rules for how to determine group and instance IDs (which previously used
      legacy terms "slice" and "subslice") varies by platform.  Some platforms
      determine steering by gslice membership, some platforms by cslice
      membership, and future platforms may have other rules.
      
      Since looping over each DSS and performing steered unicast register
      accesses is a relatively common pattern, let's add a dedicated iteration
      macro to handle this (and replace the platform-specific "instdone" loop
      we were using previously.  This will avoid the calling code needing to
      figure out the details about how to obtain steering IDs for a specific
      DSS.
      
      Most of the places where we use this new loop are in the GPU errorstate
      code at the moment, but we do have some additional features coming in
      the future that will also need to loop over each DSS and steer some
      register accesses accordingly.
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMatt Atwood <matthew.s.atwood@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220701232006.1016135-1-matthew.d.roper@intel.com
      9a92732f
  4. 28 6月, 2022 1 次提交
  5. 17 6月, 2022 2 次提交
  6. 02 6月, 2022 1 次提交
    • M
      drm/i915/sseu: Disassociate internal subslice mask representation from uapi · b87d3901
      Matt Roper 提交于
      As with EU masks, it's easier to store subslice/DSS masks internally in
      a format that's more natural for the driver to work with, and then only
      covert into the u8[] uapi form when the query ioctl is invoked.  Since
      the hardware design changed significantly with Xe_HP, we'll use a union
      to choose between the old "hsw-style" subslice masks or the newer xehp
      mask.  HSW-style masks will be stored in an array of u8's, indexed by
      slice (there's never more than 6 subslices per slice on older
      platforms).  For Xe_HP and beyond where slices no longer exist, we only
      need a single bitmask.  However we already know that this mask is
      eventually going to grow too large for a simple u64 to hold, so we'll
      represent it in a manner that can be operated on by the utilities in
      linux/bitmap.h.
      
      v2:
       - Fix typo: BIT(s) -> BIT(ss) in gen9_sseu_device_status()
      
      v3:
       - Eliminate sseu->ss_stride and just calculate the stride while
         specifically handling uapi.  (Tvrtko)
       - Use BITMAP_BITS() macro to refer to size of masks rather than
         passing I915_MAX_SS_FUSE_BITS directly.  (Tvrtko)
       - Report compute/geometry DSS masks separately when dumping Xe_HP SSEU
         info.  (Tvrtko)
       - Restore dropped range checks to intel_sseu_has_subslice().  (Tvrtko)
      
      v4:
       - Make the bitmap size macro check the size of the .xehp field rather
         than the containing union.  (Tvrtko)
       - Don't add GEM_BUG_ON() intel_sseu_has_subslice()'s check for whether
         slice or subslice ID exceed sseu->max_[sub]slices; various loops
         in the driver are expected to exceed these, so we should just
         silently return 'false.'
      
      v5:
       - Move XEHP_BITMAP_BITS() to the header so that we can also replace a
         usage of I915_MAX_SS_FUSE_BITS in one of the inline functions.
         (Bala)
       - Change the local variable in intel_slicemask_from_xehp_dssmask() from
         u16 to 'unsigned long' to make it a bit more future-proof.
      
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Acked-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NBalasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220601150725.521468-6-matthew.d.roper@intel.com
      b87d3901
  7. 11 5月, 2022 3 次提交
  8. 20 4月, 2022 1 次提交
  9. 23 3月, 2022 1 次提交
  10. 19 3月, 2022 1 次提交
  11. 05 3月, 2022 1 次提交
  12. 03 3月, 2022 2 次提交
  13. 02 3月, 2022 7 次提交
  14. 22 2月, 2022 1 次提交
  15. 14 2月, 2022 1 次提交
  16. 11 2月, 2022 1 次提交
  17. 02 2月, 2022 1 次提交
  18. 12 1月, 2022 1 次提交
  19. 11 1月, 2022 2 次提交
  20. 10 1月, 2022 1 次提交
  21. 09 12月, 2021 1 次提交
  22. 01 12月, 2021 1 次提交
    • T
      drm/i915: Update error capture code to avoid using the current vma state · ff20afc4
      Thomas Hellström 提交于
      With asynchronous migrations, the vma state may be several migrations
      ahead of the state that matches the request we're capturing.
      Address that by introducing an i915_vma_snapshot structure that
      can be used to snapshot relevant state at request submission.
      In order to make sure we access the correct memory, the snapshots take
      references on relevant sg-tables and memory regions.
      
      Also move the capture list allocation out of the fence signaling
      critical path and use the CONFIG_DRM_I915_CAPTURE_ERROR define to
      avoid compiling in members and functions used for error capture
      when they're not used.
      
      Finally, Introduce lockdep annotation.
      
      v4:
      - Break out the capture allocation mode change to a separate patch.
      v5:
      - Fix compilation error in the !CONFIG_DRM_I915_CAPTURE_ERROR case
        (kernel test robot)
      v6:
      - Use #if IS_ENABLED() instead of #ifdef to match driver style.
      - Move yet another change of allocation mode to the separate patch.
      - Commit message rework due to patch reordering.
      v7:
      - Adjust for removal of region refcounting.
      Signed-off-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: NRamalingam C <ramalingam.c@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211129202245.472043-1-thomas.hellstrom@linux.intel.com
      ff20afc4
  23. 29 10月, 2021 2 次提交
    • U
      drm/i915/pmu: Connect engine busyness stats from GuC to pmu · 77cdd054
      Umesh Nerlige Ramappa 提交于
      With GuC handling scheduling, i915 is not aware of the time that a
      context is scheduled in and out of the engine. Since i915 pmu relies on
      this info to provide engine busyness to the user, GuC shares this info
      with i915 for all engines using shared memory. For each engine, this
      info contains:
      
      - total busyness: total time that the context was running (total)
      - id: id of the running context (id)
      - start timestamp: timestamp when the context started running (start)
      
      At the time (now) of sampling the engine busyness, if the id is valid
      (!= ~0), and start is non-zero, then the context is considered to be
      active and the engine busyness is calculated using the below equation
      
      	engine busyness = total + (now - start)
      
      All times are obtained from the gt clock base. For inactive contexts,
      engine busyness is just equal to the total.
      
      The start and total values provided by GuC are 32 bits and wrap around
      in a few minutes. Since perf pmu provides busyness as 64 bit
      monotonically increasing values, there is a need for this implementation
      to account for overflows and extend the time to 64 bits before returning
      busyness to the user. In order to do that, a worker runs periodically at
      frequency = 1/8th the time it takes for the timestamp to wrap. As an
      example, that would be once in 27 seconds for a gt clock frequency of
      19.2 MHz.
      
      Note:
      There might be an over-accounting of busyness due to the fact that GuC
      may be updating the total and start values while kmd is reading them.
      (i.e kmd may read the updated total and the stale start). In such a
      case, user may see higher busyness value followed by smaller ones which
      would eventually catch up to the higher value.
      
      v2: (Tvrtko)
      - Include details in commit message
      - Move intel engine busyness function into execlist code
      - Use union inside engine->stats
      - Use natural type for ping delay jiffies
      - Drop active_work condition checks
      - Use for_each_engine if iterating all engines
      - Drop seq locking, use spinlock at GuC level to update engine stats
      - Document worker specific details
      
      v3: (Tvrtko/Umesh)
      - Demarcate GuC and execlist stat objects with comments
      - Document known over-accounting issue in commit
      - Provide a consistent view of GuC state
      - Add hooks to gt park/unpark for GuC busyness
      - Stop/start worker in gt park/unpark path
      - Drop inline
      - Move spinlock and worker inits to GuC initialization
      - Drop helpers that are called only once
      
      v4: (Tvrtko/Matt/Umesh)
      - Drop addressed opens from commit message
      - Get runtime pm in ping, remove from the park path
      - Use cancel_delayed_work_sync in disable_submission path
      - Update stats during reset prepare
      - Skip ping if reset in progress
      - Explicitly name execlists and GuC stats objects
      - Since disable_submission is called from many places, move resetting
        stats to intel_guc_submission_reset_prepare
      
      v5: (Tvrtko)
      - Add a trylock helper that does not sleep and synchronize PMU event
        callbacks and worker with gt reset
      
      v6: (CI BAT failures)
      - DUTs using execlist submission failed to boot since __gt_unpark is
        called during i915 load. This ends up calling the GuC busyness unpark
        hook and results in kick-starting an uninitialized worker. Let
        park/unpark hooks check if GuC submission has been initialized.
      - drop cant_sleep() from trylock helper since rcu_read_lock takes care
        of that.
      
      v7: (CI) Fix igt@i915_selftest@live@gt_engines
      - For GuC mode of submission the engine busyness is derived from gt time
        domain. Use gt time elapsed as reference in the selftest.
      - Increase busyness calculation to 10ms duration to ensure batch runs
        longer and falls within the busyness tolerances in selftest.
      
      v8:
      - Use ktime_get in selftest as before
      - intel_reset_trylock_no_wait results in a lockdep splat that is not
        trivial to fix since the PMU callback runs in irq context and the
        reset paths are tightly knit into the driver. The test that uncovers
        this is igt@perf_pmu@faulting-read. Drop intel_reset_trylock_no_wait,
        instead use the reset_count to synchronize with gt reset during pmu
        callback. For the ping, continue to use intel_reset_trylock since ping
        is not run in irq context.
      
      - GuC PM timestamp does not tick when GuC is idle. This can potentially
        result in wrong busyness values when a context is active on the
        engine, but GuC is idle. Use the RING TIMESTAMP as GPU timestamp to
        process the GuC busyness stats. This works since both GuC timestamp and
        RING timestamp are synced with the same clock.
      
      - The busyness stats may get updated after the batch starts running.
        This delay causes the busyness reported for 100us duration to fall
        below 95% in the selftest. The only option at this time is to wait for
        GuC busyness to change from idle to active before we sample busyness
        over a 100us period.
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Signed-off-by: NUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
      Acked-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NMatthew Brost <matthew.brost@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211027004821.66097-2-umesh.nerlige.ramappa@intel.com
      77cdd054
    • U
      drm/i915/pmu: Add a name to the execlists stats · 344e6947
      Umesh Nerlige Ramappa 提交于
      In preparation for GuC pmu stats, add a name to the execlists stats
      structure so that it can be differentiated from the GuC stats.
      Signed-off-by: NUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
      Reviewed-by: NMatthew Brost <matthew.brost@intel.com>
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211027004821.66097-1-umesh.nerlige.ramappa@intel.com
      344e6947
  24. 16 10月, 2021 2 次提交
  25. 24 9月, 2021 1 次提交
    • T
      drm/i915/gt: Register the migrate contexts with their engines · 3e42cc61
      Thomas Hellström 提交于
      Pinned contexts, like the migrate contexts need reset after resume
      since their context image may have been lost. Also the GuC needs to
      register pinned contexts.
      
      Add a list to struct intel_engine_cs where we add all pinned contexts on
      creation, and traverse that list at resume time to reset the pinned
      contexts.
      
      This fixes the kms_pipe_crc_basic@suspend-read-crc-pipe-a selftest for now,
      but proper LMEM backup / restore is needed for full suspend functionality.
      However, note that even with full LMEM backup / restore it may be
      desirable to keep the reset since backing up the migrate context images
      must happen using memcpy() after the migrate context has become inactive,
      and for performance- and other reasons we want to avoid memcpy() from
      LMEM.
      
      Also traverse the list at guc_init_lrc_mapping() calling
      guc_kernel_context_pin() for the pinned contexts, like is already done
      for the kernel context.
      
      v2:
      - Don't reset the contexts on each __engine_unpark() but rather at
        resume time (Chris Wilson).
      v3:
      - Reset contexts in the engine sanitize callback. (Chris Wilson)
      
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Brost Matthew <matthew.brost@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210922062527.865433-6-thomas.hellstrom@linux.intel.com
      3e42cc61