1. 05 Apr, 2022 8 commits
  2. 30 Mar, 2022 1 commit
  3. 29 Mar, 2022 3 commits
  4. 28 Mar, 2022 1 commit
  5. 25 Mar, 2022 2 commits
  6. 22 Mar, 2022 20 commits
  7. 21 Mar, 2022 5 commits
    • Vivek Kasireddy's avatar
      drm/i915/gem: Don't evict unmappable VMAs when pinning with PIN_MAPPABLE (v2) · 230523ba
      Vivek Kasireddy authored
      On platforms capable of allowing 8K (7680 x 4320) modes, pinning 2 or
      more framebuffers/scanout buffers results in only one that is mappable/
      fenceable. Therefore, pageflipping between these 2 FBs where only one
      is mappable/fenceable creates latencies large enough to miss alternate
      vblanks thereby producing less optimal framerate.
      
      This mainly happens because when i915_gem_object_pin_to_display_plane()
      is called to pin one of the FB objs, the associated vma is identified
      as misplaced -- because there is no space for it in the aperture --
      and therefore i915_vma_unbind() is called which unbinds and evicts it.
      This misplaced vma gets subseqently pinned only when
      i915_gem_object_ggtt_pin_ww() is called without PIN_MAPPABLE. This whole
      thing results in a latency of ~10ms and happens every other repaint cycle.
      Therefore, to fix this issue, we just ensure that the misplaced VMA
      does not get evicted when we try to pin it with PIN_MAPPABLE -- by
      returning early if the mappable/fenceable flag is not set.
      
      Testcase:
      Running Weston and weston-simple-egl on an Alderlake_S (ADLS) platform
      with a 8K@60 mode results in only ~40 FPS (compared to ~59 FPS with
      this patch). Since upstream Weston submits a frame ~7ms before the
      next vblank, the latencies seen between atomic commit and flip event
      are 7, 24 (7 + 16.66), 7, 24..... suggesting that it misses the
      vblank every other frame.
      
      Here is the ftrace snippet that shows the source of the ~10ms latency:
                    i915_gem_object_pin_to_display_plane() {
      0.102 us   |    i915_gem_object_set_cache_level();
                      i915_gem_object_ggtt_pin_ww() {
      0.390 us   |      i915_vma_instance();
      0.178 us   |      i915_vma_misplaced();
                        i915_vma_unbind() {
                        __i915_active_wait() {
      0.082 us   |        i915_active_acquire_if_busy();
      0.475 us   |      }
                        intel_runtime_pm_get() {
      0.087 us   |        intel_runtime_pm_acquire();
      0.259 us   |      }
                        __i915_active_wait() {
      0.085 us   |        i915_active_acquire_if_busy();
      0.240 us   |      }
                        __i915_vma_evict() {
                          ggtt_unbind_vma() {
                            gen8_ggtt_clear_range() {
      10507.255 us |        }
      10507.689 us |      }
      10508.516 us |   }
      
      v2:
      - Expand the code comments to describe the ping-pong issue.
      
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: default avatarVivek Kasireddy <vivek.kasireddy@intel.com>
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220321005431.1113890-1-vivek.kasireddy@intel.com
      230523ba
    • Sujaritha Sundaresan's avatar
      drm/i915/gt: Add sysfs throttle frequency interfaces · fa68bff7
      Sujaritha Sundaresan authored
      Throttling here refers to the GT frequency being clipped. Each of
      the throttle reason attributes will have a 0 or 1 value depending
      upon whether there is throttling and also the specific reason for
      it.
      
      The following is a brief description of the sysfs throttle
      frequency attributes added:
      
       - throttle_reason_status: when set indicates that there is GT
         frequency clipping.
      
       - throttle_reason_pl1: when set indicates that PBM PL1 (platform
         or package PL1) has caused GT frequency clipping.
      
       - throttle_reason_pl2: when set indicates that PBM PL2 or PL3
         (platform or package PL2 or PL3) has caused GT frequency
         clipping.
      
       - throttle_reason_pl4: when set indicates that PL4 or IccMax has
         caused GT frequency clipping.
      
       - throttle_reason_thermal: when set indicates that Thermal event
         has caused GT frequency clipping.
      
       - throttle_reason_prochot: when set indicates that PROCHOT# has
         caused GT frequency clipping.
      
       - throttle_reason_ratl: when set indicates that Running Average
         Thermal Limit has caused GT frequency clipping.
      
       - throttle_reason_vr_thermalert: when set indicates that Hot VR
         (any processor VR)  has caused GT frequency clipping.
      
       - throttle_reason_vr_tdc: when set indicates that VR TDC
         (Thermal Design Current)  has caused GT frequency clipping.
      Signed-off-by: default avatarSujaritha Sundaresan <sujaritha.sundaresan@intel.com>
      Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Cc: Dale B Stimson <dale.b.stimson@intel.com>
      Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-8-andi.shyti@linux.intel.com
      fa68bff7
    • Andi Shyti's avatar
      drm/i915/gt: Create per-tile RPS sysfs interfaces · 56a709cf
      Andi Shyti authored
      Now tiles have their own sysfs interfaces under the gt/
      directory. Because RPS is a property that can be configured on a
      tile basis, then each tile should have its own interface
      
      The new sysfs structure will have a similar layout for the 4 tile
      case:
      
      /sys/.../card0
               ├── gt
               │   ├── gt0
               │   │   ├── id
               │   │   ├── rc6_enable
               │   │   ├── rc6_residency_ms
               │   │   ├── rps_act_freq_mhz
               │   │   ├── rps_boost_freq_mhz
               │   │   ├── rps_cur_freq_mhz
               │   │   ├── rps_max_freq_mhz
               │   │   ├── rps_min_freq_mhz
               │   │   ├── rps_RP0_freq_mhz
               │   │   ├── rps_RP1_freq_mhz
               │   │   └── rps_RPn_freq_mhz
               .   .
               .   .
               .   .
               │   └── gtN
               │       ├── id
               │       ├── rc6_enable
               │       ├── rc6_residency_ms
               │       ├── rps_act_freq_mhz
               │       ├── rps_boost_freq_mhz
               │       ├── rps_cur_freq_mhz
               │       ├── rps_max_freq_mhz
               │       ├── rps_min_freq_mhz
               │       ├── rps_RP0_freq_mhz
               │       ├── rps_RP1_freq_mhz
               │       └── rps_RPn_freq_mhz
               ├── gt_act_freq_mhz   -+
               ├── gt_boost_freq_mhz  |
               ├── gt_cur_freq_mhz    |    Original interface
               ├── gt_max_freq_mhz    +─-> kept as existing ABI;
               ├── gt_min_freq_mhz    |    it points to gt0/
               ├── gt_RP0_freq_mhz    |
               ├── gt_RP1_freq_mhz    |
               └── gt_RPn_freq_mhz   -+
      
      The existing interfaces have been kept in their original location
      to preserve the existing ABI. They act on all the GTs: when
      writing they loop through all the GTs and write the information
      on each interface. When reading they provide the average value
      from all the GTs.
      
      This patch is not really adding exposing new interfaces (new
      ABI) other than adapting the existing one to more tiles. In any
      case this new set of interfaces will be a basic tool for system
      managers and administrators when using i915.
      Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-7-andi.shyti@linux.intel.com
      56a709cf
    • Andi Shyti's avatar
      drm/i915/gt: Create per-tile RC6 sysfs interface · 80cf8af1
      Andi Shyti authored
      Now tiles have their own sysfs interfaces under the gt/
      directory. Because RC6 is a property that can be configured on a
      tile basis, then each tile should have its own interface
      
      The new sysfs structure will have a similar layout for the 4 tile
      case:
      
      /sys/.../card0
               ├── gt
               │   ├── gt0
               │   │   ├── id
               │   │   ├── rc6_enable
               │   │   ├── rc6_residency_ms
               .   .   .
               .   .   .
               .   .
               │   └── gtN
               │       ├── id
               │       ├── rc6_enable
               │       ├── rc6_residency_ms
               │       .
               │       .
               │
               └── power/                -+
                    ├── rc6_enable        |    Original interface
                    ├── rc6_residency_ms  +->  kept as existing ABI;
                    .                     |    it multiplexes over
                    .                     |    the GTs
                                         -+
      
      The existing interfaces have been kept in their original location
      to preserve the existing ABI. They act on all the GTs: when
      reading they provide the average value from all the GTs.
      
      This patch is not really adding exposing new interfaces (new
      ABI) other than adapting the existing one to more tiles. In any
      case this new set of interfaces will be a basic tool for system
      managers and administrators when using i915.
      Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-6-andi.shyti@linux.intel.com
      80cf8af1
    • Andi Shyti's avatar
      drm/i915/gt: create per-tile sysfs interface · b770bcfa
      Andi Shyti authored
      Now that we have tiles we want each of them to have its own
      interface. A directory "gt/" is created under "cardN/" that will
      contain as many diroctories as the tiles.
      
      In the coming patches tile related interfaces will be added. For
      now the sysfs gt structure simply has an id interface related
      to the current tile count.
      
      The directory structure will follow this scheme:
      
          /sys/.../card0
                   └── gt
                       ├── gt0
                       │   └── id
                       :
      		 :
      		 └─- gtN
                           └── id
      
      This new set of interfaces will be a basic tool for system
      managers and administrators when using i915.
      Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarSujaritha Sundaresan <sujaritha.sundaresan@intel.com>
      Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-5-andi.shyti@linux.intel.com
      b770bcfa