1. 19 Nov, 2021 4 commits
  2. 16 Nov, 2021 2 commits
  3. 15 Nov, 2021 1 commit
  4. 12 Nov, 2021 1 commit
  5. 11 Nov, 2021 6 commits
  6. 10 Nov, 2021 2 commits
  7. 09 Nov, 2021 2 commits
  8. 05 Nov, 2021 4 commits
  9. 04 Nov, 2021 4 commits
  10. 02 Nov, 2021 8 commits
  11. 01 Nov, 2021 2 commits
    • Thomas Hellström's avatar
      drm/i915: Introduce refcounted sg-tables · cad7109a
      Thomas Hellström authored
      As we start to introduce asynchronous failsafe object migration,
      where we update the object state and then submit asynchronous
      commands we need to record what memory resources are actually used
      by various part of the command stream. Initially for three purposes:
      
      1) Error capture.
      2) Asynchronous migration error recovery.
      3) Asynchronous vma bind.
      
      At the time where these happens, the object state may have been updated
      to be several migrations ahead and object sg-tables discarded.
      
      In order to make it possible to keep sg-tables with memory resource
      information for these operations, introduce refcounted sg-tables that
      aren't freed until the last user is done with them.
      
      The alternative would be to reference information sitting on the
      corresponding ttm_resources which typically have the same lifetime as
      these refcountes sg_tables, but that leads to other awkward constructs:
      Due to the design direction chosen for ttm resource managers that would
      lead to diamond-style inheritance, the LMEM resources may sometimes be
      prematurely freed, and finally the subclassed struct ttm_resource would
      have to bleed into the asynchronous vma bind code.
      
      v3:
      - Address a number of style issues (Matthew Auld)
      v4:
      - Dont check for st->sgl being NULL in i915_ttm_tt__shmem_unpopulate(),
        that should never happen. (Matthew Auld)
      v5:
      - Fix a Potential double-free (Matthew Auld)
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211101122444.114607-1-thomas.hellstrom@linux.intel.com
      cad7109a
    • Cooper Chiou's avatar
      drm/i915: Enable WaProgramMgsrForCorrectSliceSpecificMmioReads for Gen9 · c7d561cf
      Cooper Chiou authored
      This implements WaProgramMgsrForCorrectSliceSpecificMmioReads which
      was omitted by mistake from Gen9 documentation, while it is actually
      applicable to fused off parts.
      
      Workaround consists of making sure MCR packet control register is
      programmed to point to enabled slice/subslice pair before doing any
      MMIO reads from the affected registers.
      
      Failure do to this can result in complete system hangs when running
      certain workloads. Two known cases which can cause system hangs are:
      
      1. "test_basic progvar_prog_scope_uninit" test which is part of
          Khronos OpenCL conformance suite
          (https://github.com/KhronosGroup/OpenCL-CTS) with the Intel
          OpenCL driver (https://github.com/intel/compute-runtime).
      
      2. VP8 media hardware encoding using the full-feature build of the
          Intel media-driver (https://github.com/intel/media-driver) and
          ffmpeg.
      
      For the former case patch was verified to fix the hard system hang
      when executing the OCL test on Intel Pentium CPU 6405U which contains
      fused off GT1 graphics.
      
      Reference: HSD#1508045018,1405586840, BSID#0575
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: William Tseng <william.tseng@intel.com>
      Cc: Shawn C Lee <shawn.c.lee@intel.com>
      Cc: Pawel Wilma <pawel.wilma@intel.com>
      Signed-off-by: default avatarCooper Chiou <cooper.chiou@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Acked-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211025042623.3876-1-cooper.chiou@intel.com
      c7d561cf
  12. 29 Oct, 2021 3 commits
  13. 28 Oct, 2021 1 commit
    • Umesh Nerlige Ramappa's avatar
      drm/i915/pmu: Connect engine busyness stats from GuC to pmu · 77cdd054
      Umesh Nerlige Ramappa authored
      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: default avatarJohn Harrison <John.C.Harrison@Intel.com>
      Signed-off-by: default avatarUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
      Acked-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211027004821.66097-2-umesh.nerlige.ramappa@intel.com
      77cdd054