1. 08 Aug, 2018 2 commits
  2. 07 Aug, 2018 3 commits
  3. 06 Aug, 2018 4 commits
  4. 03 Aug, 2018 4 commits
  5. 02 Aug, 2018 2 commits
  6. 01 Aug, 2018 3 commits
  7. 31 Jul, 2018 1 commit
    • Chris Wilson's avatar
      drm/i915: Interactive RPS mode · 60548c55
      Chris Wilson authored
      RPS provides a feedback loop where we use the load during the previous
      evaluation interval to decide whether to up or down clock the GPU
      frequency. Our responsiveness is split into 3 regimes, a high and low
      plateau with the intent to keep the gpu clocked high to cover occasional
      stalls under high load, and low despite occasional glitches under steady
      low load, and inbetween. However, we run into situations like kodi where
      we want to stay at low power (video decoding is done efficiently
      inside the fixed function HW and doesn't need high clocks even for high
      bitrate streams), but just occasionally the pipeline is more complex
      than a video decode and we need a smidgen of extra GPU power to present
      on time. In the high power regime, we sample at sub frame intervals with
      a bias to upclocking, and conversely at low power we sample over a few
      frames worth to provide what we consider to be the right levels of
      responsiveness respectively. At low power, we more or less expect to be
      kicked out to high power at the start of a busy sequence by waitboosting.
      
      Prior to commit e9af4ea2 ("drm/i915: Avoid waitboosting on the active
      request") whenever we missed the frame or stalled, we would immediate go
      full throttle and upclock the GPU to max. But in commit e9af4ea2, we
      relaxed the waitboosting to only apply if the pipeline was deep to avoid
      over-committing resources for a near miss. Sadly though, a near miss is
      still a miss, and perceptible as jitter in the frame delivery.
      
      To try and prevent the near miss before having to resort to boosting
      after the fact, we use the pageflip queue as an indication that we are
      in an "interactive" regime and so should sample the load more frequently
      to provide power before the frame misses it vblank. This will make us
      more favorable to providing a small power increase (one or two bins) as
      required rather than going all the way to maximum and then having to
      work back down again. (We still keep the waitboosting mechanism around
      just in case a dramatic change in system load requires urgent uplocking,
      faster than we can provide in a few evaluation intervals.)
      
      v2: Reduce rps_set_interactive to a boolean parameter to avoid the
      confusion of what if they wanted a new power mode after pinning to a
      different mode (which to choose?)
      v3: Only reprogram RPS while the GT is awake, it will be set when we
      wake the GT, and while off warns about being used outside of rpm.
      v4: Fix deferred application of interactive mode
      v5: s/state/interactive/
      v6: Group the mutex with its principle in a substruct
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107111
      Fixes: e9af4ea2 ("drm/i915: Avoid waitboosting on the active request")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180731132629.3381-1-chris@chris-wilson.co.uk
      60548c55
  8. 30 Jul, 2018 4 commits
  9. 27 Jul, 2018 12 commits
  10. 26 Jul, 2018 5 commits
    • Chris Wilson's avatar
      drm/i915/selftests: Exercise resetting in the middle of a wait-on-fence · 6dc17d69
      Chris Wilson authored
      On older HW, gen2/3, fence registers are used for detiling GPU commands
      and as such changing those registers requires serialisation with the
      requests on the GPU. Anything running on the GPU is subject to a hang,
      and so we must be able to recover cleanly in the middle of a stuck wait
      on a fence register.
      
      We can simulate using the fence on the GPU simply by marking the fence
      as active on the request for this vma, the interface being common to all
      gen, thus broadening the test.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180719194746.19111-2-chris@chris-wilson.co.uk
      6dc17d69
    • Chris Wilson's avatar
      drm/i915/selftests: Use a full emulation of a user ppgtt context · ab84a110
      Chris Wilson authored
      To test eviction from a ppgtt, we just want a ppgtt i.e. something other
      than the Global GTT which is shared and used by the kernel for HW
      features like fencing and scanout. However, we also need it to pass
      !i915_is_ggtt() and the simplest way is to emulate a full user context
      rather than the internal kernel context that is used for the GGTT.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180719194746.19111-1-chris@chris-wilson.co.uk
      ab84a110
    • Chris Wilson's avatar
      drm/i915: Don't disable the GPU for older gen on wedging · ec5b65a9
      Chris Wilson authored
      If we issue a device level GPU reset on the older gen, it will disable
      key components of the GMCH and the display engine. The purpose of
      wedging is to simply prevent further GEM usage without disabling KMS, so
      we need to be careful when we do issue the reset on wedging.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180726085033.4044-3-chris@chris-wilson.co.ukReviewed-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
      ec5b65a9
    • Chris Wilson's avatar
      drm/i915: Restore sane defaults for KMS on GEM error load · 7ed43df7
      Chris Wilson authored
      If we fail during GEM initialisation, we scrub the HW state by
      performing a device level GPU resuet. However, we want to leave the
      system in a usable state (with functioning KMS but no GEM) so after
      scrubbing the HW state, we need to restore some sane defaults and
      re-enable the low-level common parts of the GPU (such as the GMCH).
      
      v2: Restore GTT entries.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180726085033.4044-2-chris@chris-wilson.co.ukReviewed-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
      7ed43df7
    • Chris Wilson's avatar
      drm/i915: Protect guc_fini_wq() against module load abort · 52dda80d
      Chris Wilson authored
      Prevent
      [  397.873143] general protection fault: 0000 [#1] PREEMPT SMP PTI
      [  397.873154] CPU: 4 PID: 4799 Comm: drv_module_relo Tainted: G     U            4.18.0-rc6-CI-CI_DRM_4534+ #1
      [  397.873162] Hardware name: Micro-Star International Co., Ltd. MS-7B54/Z370M MORTAR (MS-7B54), BIOS 1.10 12/28/2017
      [  397.873175] RIP: 0010:__lock_acquire+0xf6/0x1b50
      [  397.873179] Code: 85 c0 4c 8b 9d 40 ff ff ff 8b 8d 38 ff ff ff 44 8b 8d 30 ff ff ff 4c 8b 85 28 ff ff ff 44 8b 95 24 ff ff ff 0f 84 54 03 00 00 <f0> ff 80 38 01 00 00 8b 15 45 8c 59 02 45 8b bc 24 70 08 00 00 85
      [  397.873240] RSP: 0018:ffffc90000497b40 EFLAGS: 00010002
      [  397.873246] RAX: 6b6b6b6b6b6b6b6b RBX: 0000000000000001 RCX: 0000000000000000
      [  397.873252] RDX: 0000000000000046 RSI: 0000000000000000 RDI: 0000000000000000
      [  397.873258] RBP: ffffc90000497c20 R08: ffffffff810a25e9 R09: 0000000000000000
      [  397.873264] R10: 0000000000000000 R11: ffff880255c63c28 R12: ffff8801093b2840
      [  397.873270] R13: 0000000000000001 R14: 0000000000000001 R15: 0000000000000246
      [  397.873277] FS:  00007faf88d71980(0000) GS:ffff880266300000(0000) knlGS:0000000000000000
      [  397.873284] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  397.873289] CR2: 000055d866c9ca10 CR3: 000000025472e006 CR4: 00000000003606e0
      [  397.873295] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  397.873301] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  397.873308] Call Trace:
      [  397.873318]  ? lock_acquire+0xa6/0x210
      [  397.873323]  lock_acquire+0xa6/0x210
      [  397.873331]  ? drain_workqueue+0x19/0x180
      [  397.873339]  __mutex_lock+0x89/0x980
      [  397.873346]  ? drain_workqueue+0x19/0x180
      [  397.873352]  ? _raw_spin_unlock_irqrestore+0x4c/0x60
      [  397.873359]  ? trace_hardirqs_on_caller+0xe0/0x1b0
      [  397.873365]  ? drain_workqueue+0x19/0x180
      [  397.873373]  ? debug_object_active_state+0x127/0x150
      [  397.873381]  ? drain_workqueue+0x19/0x180
      [  397.873387]  drain_workqueue+0x19/0x180
      [  397.873395]  destroy_workqueue+0x12/0x1f0
      [  397.873476]  intel_guc_fini_misc+0x36/0x90 [i915]
      [  397.873540]  i915_gem_fini+0x91/0x100 [i915]
      [  397.873588]  i915_driver_unload+0xd2/0x110 [i915]
      [  397.873638]  i915_pci_remove+0x19/0x30 [i915]
      [  397.873646]  pci_device_remove+0x36/0xb0
      [  397.873653]  device_release_driver_internal+0x185/0x250
      [  397.873660]  driver_detach+0x35/0x70
      [  397.873668]  bus_remove_driver+0x53/0xd0
      [  397.873675]  pci_unregister_driver+0x25/0xa0
      [  397.873683]  __se_sys_delete_module+0x162/0x210
      [  397.873691]  ? do_syscall_64+0xd/0x190
      [  397.873697]  do_syscall_64+0x55/0x190
      [  397.873704]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [  397.873710] RIP: 0033:0x7faf884231b7
      [  397.873714] Code: 73 01 c3 48 8b 0d d1 8c 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a1 8c 2c 00 f7 d8 64 89 01 48
      [  397.873775] RSP: 002b:00007ffda4e98cf8 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
      [  397.873784] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007faf884231b7
      [  397.873790] RDX: 0000000000000000 RSI: 0000000000000800 RDI: 000055fbb18f1bd8
      [  397.873796] RBP: 000055fbb18f1b70 R08: 000055fbb18f1bdc R09: 00007ffda4e98d38
      [  397.873802] R10: 00007ffda4e97cf4 R11: 0000000000000206 R12: 000055fbb0d32470
      [  397.873808] R13: 00007ffda4e992e0 R14: 0000000000000000 R15: 0000000000000000
      
      v2: It's use-after-free; not a NULL pointer.
      
      Testcase: igt/drv_module_reload/basic-reload-inject
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Reviewed-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180726085033.4044-1-chris@chris-wilson.co.uk
      52dda80d