1. 19 12月, 2016 1 次提交
    • C
      drm/i915: Unify active context tracking between legacy/execlists/guc · e8a9c58f
      Chris Wilson 提交于
      The requests conversion introduced a nasty bug where we could generate a
      new request in the middle of constructing a request if we needed to idle
      the system in order to evict space for a context. The request to idle
      would be executed (and waited upon) before the current one, creating a
      minor havoc in the seqno accounting, as we will consider the current
      request to already be completed (prior to deferred seqno assignment) but
      ring->last_retired_head would have been updated and still could allow
      us to overwrite the current request before execution.
      
      We also employed two different mechanisms to track the active context
      until it was switched out. The legacy method allowed for waiting upon an
      active context (it could forcibly evict any vma, including context's),
      but the execlists method took a step backwards by pinning the vma for
      the entire active lifespan of the context (the only way to evict was to
      idle the entire GPU, not individual contexts). However, to circumvent
      the tricky issue of locking (i.e. we cannot take struct_mutex at the
      time of i915_gem_request_submit(), where we would want to move the
      previous context onto the active tracker and unpin it), we take the
      execlists approach and keep the contexts pinned until retirement.
      The benefit of the execlists approach, more important for execlists than
      legacy, was the reduction in work in pinning the context for each
      request - as the context was kept pinned until idle, it could short
      circuit the pinning for all active contexts.
      
      We introduce new engine vfuncs to pin and unpin the context
      respectively. The context is pinned at the start of the request, and
      only unpinned when the following request is retired (this ensures that
      the context is idle and coherent in main memory before we unpin it). We
      move the engine->last_context tracking into the retirement itself
      (rather than during request submission) in order to allow the submission
      to be reordered or unwound without undue difficultly.
      
      And finally an ulterior motive for unifying context handling was to
      prepare for mock requests.
      
      v2: Rename to last_retired_context, split out legacy_context tracking
      for MI_SET_CONTEXT.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161218153724.8439-3-chris@chris-wilson.co.uk
      e8a9c58f
  2. 09 12月, 2016 1 次提交
    • I
      drm/i915/gen9: Fix PCODE polling during CDCLK change notification · a0b8a1fe
      Imre Deak 提交于
      commit 848496e5
      Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Date:   Wed Jul 13 16:32:03 2016 +0300
      
          drm/i915: Wait up to 3ms for the pcu to ack the cdclk change request on SKL
      
      increased the timeout to match the spec, but we still see a timeout on
      at least one SKL. A CDCLK change request following the failed one will
      succeed nevertheless.
      
      I could reproduce this problem easily by running kms_pipe_crc_basic in a
      loop. In all failure cases _wait_for() was pre-empted for >3ms and so in
      the worst case - when the pre-emption happened right after calculating
      timeout__ in _wait_for() - we called skl_cdclk_wait_for_pcu_ready() only
      once which failed and so _wait_for() timed out. As opposed to this the
      spec says to keep retrying the request for at most a 3ms period.
      
      To fix this send the first request explicitly to guarantee that there is
      3ms between the first and last request. Though this matches the spec, I
      noticed that in rare cases this can still time out if we sent only a few
      requests (in the worst case 2) _and_ PCODE is busy for some reason even
      after a previous request and a 3ms delay. To work around this retry the
      polling with pre-emption disabled to maximize the number of requests.
      Also increase the timeout to 10ms to account for interrupts that could
      reduce the number of requests. With this change I couldn't trigger
      the problem.
      
      v2:
      - Use 1ms poll period instead of 10us. (Chris)
      v3:
      - Poll with pre-emption disabled to increase the number of request
        attempts. (Ville, Chris)
      - Factor out a helper to poll, it's also needed by the next patch.
      v4:
      - Pass reply_mask, reply to skl_pcode_request(), instead of assuming the
        reply is generic. (Ville)
      v5:
      - List the request specific timeout values as code comment. (Ville)
      v6:
      - Try the poll first with preemption enabled.
      - Add code comment about first request being queued by PCODE. (Art)
      - Add timeout_base_ms argument. (Ville)
      v7:
      - Clarify code comment about first queued request. (Chris)
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Art Runyan <arthur.j.runyan@intel.com>
      Cc: <stable@vger.kernel.org> # v4.2- : 3b2c1710 : drm/i915: Wait up to 3ms
      Cc: <stable@vger.kernel.org> # v4.2-
      Fixes: 5d96d8af ("drm/i915/skl: Deinit/init the display at suspend/resume")
      Reference: https://bugs.freedesktop.org/show_bug.cgi?id=97929
      Testcase: igt/kms_pipe_crc_basic/suspend-read-crc-pipe-B
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/1480955258-26311-1-git-send-email-imre.deak@intel.com
      a0b8a1fe
  3. 08 12月, 2016 2 次提交
  4. 07 12月, 2016 2 次提交
  5. 06 12月, 2016 1 次提交
  6. 05 12月, 2016 4 次提交
  7. 02 12月, 2016 6 次提交
  8. 30 11月, 2016 2 次提交
  9. 29 11月, 2016 3 次提交
    • C
      drm/i915: Convert vm->dev backpointer to vm->i915 · 49d73912
      Chris Wilson 提交于
      99% of the time we access i915_address_space->dev we want the i915
      device and not the drm device, so let's store the drm_i915_private
      backpointer instead. The only real complication here are the inlines
      in i915_vma.h where drm_i915_private is not yet defined and so we have
      to choose an alternate path for our asserts.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161129095008.32622-1-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      49d73912
    • M
      drm/i915: drop the struct_mutex when wedged or trying to reset · ddbb271a
      Matthew Auld 提交于
      We grab the struct_mutex in intel_crtc_page_flip, but if we are wedged
      or a reset is in progress we bail early but never seem to actually
      release the lock.
      
      Fixes: 7f1847eb ("drm/i915: Simplify checking of GPU reset_counter in display pageflips")
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161128103648.9235-1-matthew.auld@intel.comReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: <stable@vger.kernel.org> # v4.7+
      ddbb271a
    • C
      drm/i915: Move priority bumping for flips earlier · 92117f0b
      Chris Wilson 提交于
      David found another issue with priority bumping from mmioflips, where we
      are accessing the requests concurrently to them being retired and freed.
      Whilst we are skipping the dependency if has been submitted, that is not
      sufficient to stop the dependency from disappearing if another thread
      retires that request. To prevent we can either employ the struct_mutex (or a
      request mutex in the future) to serialise retiring before it is freed.
      Alternatively, we need to keep the dependencies alive using RCU whilst
      they are being accessed via the DFS.
      
      [ 1746.698111] general protection fault: 0000 [#1] PREEMPT SMP
      [ 1746.698305] Modules linked in: snd_hda_intel snd_hda_codec snd_hwdep x86_pkg_temp_thermal snd_hda_core coretemp crct10dif_pclmul crc32_pclmul snd_pcm ghash_clmulni_intel mei_me mei i915 e1000e ptp pps_core i2c_hid
      [ 1746.698750] CPU: 1 PID: 6716 Comm: kworker/u8:2 Not tainted 4.9.0-rc6-CI-Nightly_816+ #1
      [ 1746.698871] Hardware name: GIGABYTE GB-BKi7A-7500/MFLP7AP-00, BIOS F1 07/27/2016
      [ 1746.699125] Workqueue: events_unbound intel_mmio_flip_work_func [i915]
      [ 1746.699266] task: ffff880260a5e800 task.stack: ffffc90000f6c000
      [ 1746.699361] RIP: 0010:[<ffffffffa006595d>]  [<ffffffffa006595d>] execlists_schedule+0x8d/0x300 [i915]
      [ 1746.699632] RSP: 0018:ffffc90000f6fcd8  EFLAGS: 00010206
      [ 1746.699724] RAX: dead0000000000f8 RBX: ffff8801f64b2bf0 RCX: ffff8801f64b2c10
      [ 1746.699842] RDX: dead000000000100 RSI: 0000000000000000 RDI: ffff8801f64b0458
      [ 1746.699972] RBP: ffffc90000f6fd68 R08: ffff88026488dc00 R09: 0000000000000002
      [ 1746.700090] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000400
      [ 1746.700195] R13: ffffc90000f6fcf0 R14: ffff88020955aa40 R15: ffff88020955aa68
      [ 1746.700307] FS:  0000000000000000(0000) GS:ffff88026dc80000(0000) knlGS:0000000000000000
      [ 1746.700435] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 1746.700532] CR2: 0000000002a69e90 CR3: 0000000002c07000 CR4: 00000000003406e0
      [ 1746.700635] Stack:
      [ 1746.700682]  ffff880260a5e880 ffffc90000f6fd50 ffffffff810af69a ffffc90000f6fd28
      [ 1746.700827]  ffff88020955a628 ffff8801e1eaebf0 0000000000000020 0000000000000000
      [ 1746.700947]  00000196af1edc96 ffff88025dfa4000 ffff8801f0b030a8 ffffc90000f6fcf0
      [ 1746.701071] Call Trace:
      [ 1746.701117]  [<ffffffff810af69a>] ? dequeue_entity+0x25a/0xb50
      [ 1746.701260]  [<ffffffffa00516be>] fence_set_priority+0x7e/0x80 [i915]
      [ 1746.701406]  [<ffffffffa0051a15>] i915_gem_object_wait_priority+0x85/0x160 [i915]
      [ 1746.701599]  [<ffffffffa008ccd7>] intel_mmio_flip_work_func+0x47/0x2b0 [i915]
      [ 1746.701717]  [<ffffffff81094c4d>] process_one_work+0x14d/0x470
      [ 1746.701809]  [<ffffffff81094fb3>] worker_thread+0x43/0x4e0
      [ 1746.701888]  [<ffffffff81094f70>] ? process_one_work+0x470/0x470
      [ 1746.701969]  [<ffffffff81094f70>] ? process_one_work+0x470/0x470
      [ 1746.702072]  [<ffffffff8109a4d5>] kthread+0xc5/0xe0
      [ 1746.702152]  [<ffffffff81771c59>] ? _raw_spin_unlock_irq+0x9/0x10
      [ 1746.702234]  [<ffffffff8109a410>] ? kthread_park+0x60/0x60
      [ 1746.702318]  [<ffffffff81772272>] ret_from_fork+0x22/0x30
      [ 1746.702387] Code: 89 42 08 48 8b 45 88 48 89 55 c0 4c 89 6d c8 4c 8d 70 d8 4d 8d 7e 28 4d 39 ef 74 72 49 8b 1e 48 8b 13 48 39 d3 48 8d 42 f8 74 3e <48> 8b 10 8b 52 38 41 39 d4 7e 26 48 8b 50 30 48 8b 78 28 48 8d
      [ 1746.702921] RIP  [<ffffffffa006595d>] execlists_schedule+0x8d/0x300 [i915]
      Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.703027]  RSP <ffffc90000f6fcd8>
      
      Fixes: 27745e82 ("drm/i915/execlists: Use a local lock for dfs_link access")
      Fixes: 9a151987 ("drm/i915: Add execution priority boosting for mmioflips")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: David Weinehall <david.weinehall@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161128143649.4289-1-chris@chris-wilson.co.ukReviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      92117f0b
  10. 25 11月, 2016 1 次提交
  11. 24 11月, 2016 7 次提交
  12. 19 11月, 2016 1 次提交
  13. 18 11月, 2016 2 次提交
  14. 17 11月, 2016 7 次提交