1. 20 11月, 2021 2 次提交
    • M
      drm/i915: Create a dummy object for gen6 ppgtt · b0b0f2d2
      Maarten Lankhorst 提交于
      We currently have to special case vma->obj being NULL because
      of gen6 ppgtt and mock_engine. Fix gen6 ppgtt, so we may soon
      be able to remove a few checks. As the object only exists as
      a fake object pointing to ggtt, we have no backing storage,
      so no real object is created. It just has to look real enough.
      
      Also kill pin_mutex, it's not compatible with ww locking,
      and we can use the vm lock instead.
      
      v2:
        - Drop IS_SHRINKABLE and shorten overly long line
      v3:
        - Checkpatch fix for alignment
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-2-matthew.auld@intel.com
      b0b0f2d2
    • M
      drm/i915: move the pre_pin earlier · 10ceccb8
      Matthew Auld 提交于
      In intel_context_do_pin_ww, when calling into the pre_pin hook(which is
      passed the ww context) it could in theory return -EDEADLK(which is very
      likely with debug kernels), once we start adding more ww locking in there,
      like in the next patch. If so then we need to be mindful of having to
      restart the do_pin at this point.
      
      If this is the kernel_context, or some other early in-kernel context
      where we have yet to setup the default_state, then we always inhibit the
      context restore, and instead rely on the delayed active_release to set
      the CONTEXT_VALID_BIT for us(if we even care), which should indicate
      that we have context switched away, and that our newly saved context
      state should now be valid. However, since we currently grab the active
      reference before the potential ww dance, we can end up setting the
      CONTEXT_VALID_BIT much too early, if we need to backoff, and then upon
      re-trying the do_pin, we could potentially cause the hardware to
      incorrectly load some garbage context state when later context switching
      to that context, but at the very least this will trigger the
      GEM_BUG_ON() in __engine_unpark. For now let's just move any ww dance
      stuff prior to arming the active reference.
      
      For normal user contexts this shouldn't be a concern, since we should
      already have the default_state ready when initialising the lrc state,
      and so there should be no concern with active_release somehow
      prematurely setting the CONTEXT_VALID_BIT.
      
      v2(Thomas):
        - Also re-order the onion unwind
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-1-matthew.auld@intel.com
      10ceccb8
  2. 17 11月, 2021 1 次提交
  3. 16 11月, 2021 2 次提交
  4. 13 11月, 2021 1 次提交
  5. 12 11月, 2021 3 次提交
  6. 11 11月, 2021 3 次提交
  7. 10 11月, 2021 4 次提交
  8. 05 11月, 2021 4 次提交
  9. 04 11月, 2021 4 次提交
  10. 03 11月, 2021 3 次提交
  11. 02 11月, 2021 6 次提交
  12. 01 11月, 2021 1 次提交
  13. 29 10月, 2021 5 次提交
    • D
      drm/i915: Remove some dead struct fwd decl from i915_drv.h · fe6089c1
      Daniel Vetter 提交于
      Gone with userptr rewrite by Maarten in ed29c269 ("drm/i915: Fix
      userptr so we do not have to worry about obj->mm.lock, v7.")
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211022082200.2684194-1-daniel.vetter@ffwll.ch
      fe6089c1
    • M
      drm/i915/gtt: stop caching the scratch page · b0cc4dca
      Matthew Auld 提交于
      Normal users shouldn't be hitting this, likely this would indicate a
      userspace bug. So don't bother caching, which should be safe now that we
      manually flush the page.
      Suggested-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Ramalingam C <ramalingam.c@intel.com>
      Reviewed-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211028092638.3142258-2-matthew.auld@intel.com
      b0cc4dca
    • M
      drm/i915/gtt: flush the scratch page · 2ca77606
      Matthew Auld 提交于
      The scratch page is directly visible in the users address space, and
      while this is forced as CACHE_LLC, by the kernel, we still have to
      contend with things like "Bypass-LLC" MOCS. So just flush no matter
      what.
      
      v2(Thomas):
        - Make sure we use drm_clflush_virt_range here, in case clflush support
          is missing.
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Ramalingam C <ramalingam.c@intel.com>
      Reviewed-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211028092638.3142258-1-matthew.auld@intel.com
      2ca77606
    • 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
  14. 27 10月, 2021 1 次提交