1. 28 4月, 2017 1 次提交
    • J
      drm/i915: Sanitize engine context sizes · 63ffbcda
      Joonas Lahtinen 提交于
      Pre-calculate engine context size based on engine class and device
      generation and store it in the engine instance.
      
      v2:
      - Squash and get rid of hw_context_size (Chris)
      
      v3:
      - Move after MMIO init for probing on Gen7 and 8 (Chris)
      - Retained rounding (Tvrtko)
      v4:
      - Rebase for deferred legacy context allocation
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Oscar Mateo <oscar.mateo@intel.com>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: intel-gvt-dev@lists.freedesktop.org
      Acked-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      63ffbcda
  2. 21 4月, 2017 1 次提交
  3. 12 4月, 2017 3 次提交
    • C
      drm/i915: Pretend the engine is always idle when mocking · 8968a364
      Chris Wilson 提交于
      If we have a mock engine and it has no more requests in flight, report
      it as idle as there is no hardware to contradict us! Otherwise we
      attempt to query the hw that doesn't exist and find that the hw hasn't
      set its idle bit and we get upset.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170411234427.14841-2-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      8968a364
    • C
      drm/i915: Lie and treat all engines as idle if wedged · a8e9a419
      Chris Wilson 提交于
      Similar to commit 8490ae20 ("drm/i915: Suppress busy status for
      engines if wedged") we also want to report intel_engine_is_idle() as
      true as well as the main intel_engines_are_idle(), as we now check that
      the engines are idle when overwriting the HWS page. This is not true
      whilst we are setting the device as wedged, at least according to our
      bookkeeping, so we have to lie to ourselves!
      
      [  383.588601] [drm:i915_reset [i915]] *ERROR* Failed to reset chip: -110
      [  383.588685] ------------[ cut here ]------------
      [  383.588755] WARNING: CPU: 0 PID: 12 at drivers/gpu/drm/i915/intel_engine_cs.c:226 intel_engine_init_global_seqno+0x222/0x290 [i915]
      [  383.588757] WARN_ON(!intel_engine_is_idle(engine))
      [  383.588759] Modules linked in: ctr ccm snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core arc4 iwldvm mac80211 snd_pcm snd_hwdep snd_seq_midi snd_seq_midi_event rfcomm bnep snd_rawmidi intel_powerclamp coretemp dm_multipath iwlwifi crct10dif_pclmul snd_seq crc32_pclmul ghash_clmulni_intel btusb aesni_intel btrtl btbcm aes_x86_64 crypto_simd cryptd btintel snd_timer glue_helper bluetooth intel_ips snd_seq_device cfg80211 snd soundcore binfmt_misc mei_me mei dm_mirror dm_region_hash dm_log i915 intel_gtt i2c_algo_bit drm_kms_helper cfbfillrect syscopyarea cfbimgblt sysfillrect sysimgblt fb_sys_fops cfbcopyarea prime_numbers ahci libahci drm e1000e
      [  383.588851] CPU: 0 PID: 12 Comm: migration/0 Not tainted 4.11.0-rc5+ #207
      [  383.588853] Hardware name: LENOVO 514328U/514328U, BIOS 6QET44WW (1.14 ) 04/20/2010
      [  383.588855] Call Trace:
      [  383.588866]  dump_stack+0x63/0x90
      [  383.588871]  __warn+0xc7/0xf0
      [  383.588876]  warn_slowpath_fmt+0x4a/0x50
      [  383.588883]  ? set_next_entity+0x821/0x910
      [  383.588943]  intel_engine_init_global_seqno+0x222/0x290 [i915]
      [  383.588998]  __i915_gem_set_wedged_BKL+0xa4/0x190 [i915]
      [  383.589003]  ? __switch_to+0x215/0x390
      [  383.589008]  multi_cpu_stop+0xbb/0xe0
      [  383.589012]  ? cpu_stop_queue_work+0x90/0x90
      [  383.589016]  cpu_stopper_thread+0x82/0x110
      [  383.589021]  smpboot_thread_fn+0x137/0x190
      [  383.589026]  kthread+0xf7/0x130
      [  383.589030]  ? sort_range+0x20/0x20
      [  383.589034]  ? kthread_park+0x90/0x90
      [  383.589040]  ret_from_fork+0x2c/0x40
      
      Fixes: 2ca9faa5 ("drm/i915: Assert the engine is idle before overwiting the HWS")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170411190042.25662-1-chris@chris-wilson.co.uk
      a8e9a419
    • C
      drm/i915: Bail if we do not setup the RCS engine · 5f9be054
      Chris Wilson 提交于
      In places, we assume that RCS exists. This has been true forever, but
      let us catch this failure during bringup by adding an explicit check
      that we do have an RCS engine.
      
      v2: Make use of HAS_ENGINE (Tvrtko)
      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/20170411165658.23828-1-chris@chris-wilson.co.uk
      5f9be054
  4. 11 4月, 2017 5 次提交
  5. 07 4月, 2017 1 次提交
  6. 31 3月, 2017 1 次提交
  7. 30 3月, 2017 1 次提交
  8. 21 3月, 2017 2 次提交
  9. 17 3月, 2017 2 次提交
  10. 16 3月, 2017 1 次提交
    • C
      drm/i915: Replace irq_seqno_barrier on hws write with a clflush · 14a6bbf9
      Chris Wilson 提交于
      When manually overwriting the HWS, rather than assume irq_seqno_barrier
      does the right thing, we can explicitly flush the cacheline instead.
      This avoids us calling the engine->irq_seqno_barrier() from an illegal
      context:
      
      [ 1472.651797] BUG: scheduling while atomic: migration/0/11/0x00000002
      [ 1472.651807] Modules linked in: ctr ccm arc4 snd_hda_codec_hdmi bnep rfcomm iwldvm snd_hda_codec_conexant snd_hda_codec_generic snd_hda_intel mac80211 snd_hda_codec snd_hda_core snd_pcm dm_multipath snd_hwdep intel_powerclamp coretemp snd_seq_midi crct10dif_pclmul snd_seq_midi_event crc32_pclmul iwlwifi ghash_clmulni_intel btusb snd_rawmidi btrtl aesni_intel btbcm aes_x86_64 crypto_simd btintel cryptd glue_helper bluetooth snd_seq cfg80211 snd_timer snd_seq_device intel_ips binfmt_misc snd mei_me soundcore mei dm_mirror dm_region_hash dm_log i915 intel_gtt i2c_algo_bit drm_kms_helper cfbfillrect syscopyarea cfbimgblt sysfillrect sysimgblt fb_sys_fops cfbcopyarea prime_numbers e1000e drm ahci libahci
      [ 1472.651897] CPU: 0 PID: 11 Comm: migration/0 Tainted: G     U          4.11.0-rc1+ #203
      [ 1472.651899] Hardware name: LENOVO 514328U/514328U, BIOS 6QET44WW (1.14 ) 04/20/2010
      [ 1472.651900] Call Trace:
      [ 1472.651913]  dump_stack+0x63/0x90
      [ 1472.651922]  __schedule_bug+0x5d/0x6b
      [ 1472.651930]  __schedule+0x46a/0x5f0
      [ 1472.651934]  schedule+0x38/0x90
      [ 1472.651938]  schedule_hrtimeout_range_clock+0x85/0x110
      [ 1472.651945]  ? hrtimer_init+0x10/0x10
      [ 1472.651949]  schedule_hrtimeout_range+0xe/0x10
      [ 1472.651952]  usleep_range+0x4d/0x60
      [ 1472.652037]  gen5_seqno_barrier+0x13/0x20 [i915]
      [ 1472.652101]  intel_engine_init_global_seqno+0xd7/0x160 [i915]
      [ 1472.652160]  __i915_gem_set_wedged_BKL+0xa0/0x180 [i915]
      [ 1472.652166]  multi_cpu_stop+0xbb/0xe0
      [ 1472.652170]  ? cpu_stop_queue_work+0x90/0x90
      [ 1472.652174]  cpu_stopper_thread+0x82/0x110
      [ 1472.652179]  smpboot_thread_fn+0x137/0x190
      [ 1472.652184]  kthread+0xf7/0x130
      [ 1472.652187]  ? sort_range+0x20/0x20
      [ 1472.652191]  ? kthread_park+0x90/0x90
      [ 1472.652195]  ret_from_fork+0x2c/0x40
      
      Testcase: igt/gem_eio #ilk
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170314111452.9375-1-chris@chris-wilson.co.ukReviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      14a6bbf9
  11. 04 3月, 2017 1 次提交
  12. 03 3月, 2017 2 次提交
  13. 02 3月, 2017 1 次提交
  14. 23 2月, 2017 1 次提交
  15. 17 2月, 2017 2 次提交
  16. 14 2月, 2017 1 次提交
  17. 24 1月, 2017 1 次提交
  18. 19 1月, 2017 1 次提交
  19. 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
  20. 02 12月, 2016 2 次提交
  21. 15 11月, 2016 3 次提交
  22. 02 11月, 2016 1 次提交
  23. 29 10月, 2016 4 次提交
  24. 25 10月, 2016 1 次提交
    • C
      dma-buf: Rename struct fence to dma_fence · f54d1867
      Chris Wilson 提交于
      I plan to usurp the short name of struct fence for a core kernel struct,
      and so I need to rename the specialised fence/timeline for DMA
      operations to make room.
      
      A consensus was reached in
      https://lists.freedesktop.org/archives/dri-devel/2016-July/113083.html
      that making clear this fence applies to DMA operations was a good thing.
      Since then the patch has grown a bit as usage increases, so hopefully it
      remains a good thing!
      
      (v2...: rebase, rerun spatch)
      v3: Compile on msm, spotted a manual fixup that I broke.
      v4: Try again for msm, sorry Daniel
      
      coccinelle script:
      @@
      
      @@
      - struct fence
      + struct dma_fence
      @@
      
      @@
      - struct fence_ops
      + struct dma_fence_ops
      @@
      
      @@
      - struct fence_cb
      + struct dma_fence_cb
      @@
      
      @@
      - struct fence_array
      + struct dma_fence_array
      @@
      
      @@
      - enum fence_flag_bits
      + enum dma_fence_flag_bits
      @@
      
      @@
      (
      - fence_init
      + dma_fence_init
      |
      - fence_release
      + dma_fence_release
      |
      - fence_free
      + dma_fence_free
      |
      - fence_get
      + dma_fence_get
      |
      - fence_get_rcu
      + dma_fence_get_rcu
      |
      - fence_put
      + dma_fence_put
      |
      - fence_signal
      + dma_fence_signal
      |
      - fence_signal_locked
      + dma_fence_signal_locked
      |
      - fence_default_wait
      + dma_fence_default_wait
      |
      - fence_add_callback
      + dma_fence_add_callback
      |
      - fence_remove_callback
      + dma_fence_remove_callback
      |
      - fence_enable_sw_signaling
      + dma_fence_enable_sw_signaling
      |
      - fence_is_signaled_locked
      + dma_fence_is_signaled_locked
      |
      - fence_is_signaled
      + dma_fence_is_signaled
      |
      - fence_is_later
      + dma_fence_is_later
      |
      - fence_later
      + dma_fence_later
      |
      - fence_wait_timeout
      + dma_fence_wait_timeout
      |
      - fence_wait_any_timeout
      + dma_fence_wait_any_timeout
      |
      - fence_wait
      + dma_fence_wait
      |
      - fence_context_alloc
      + dma_fence_context_alloc
      |
      - fence_array_create
      + dma_fence_array_create
      |
      - to_fence_array
      + to_dma_fence_array
      |
      - fence_is_array
      + dma_fence_is_array
      |
      - trace_fence_emit
      + trace_dma_fence_emit
      |
      - FENCE_TRACE
      + DMA_FENCE_TRACE
      |
      - FENCE_WARN
      + DMA_FENCE_WARN
      |
      - FENCE_ERR
      + DMA_FENCE_ERR
      )
       (
       ...
       )
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Acked-by: NSumit Semwal <sumit.semwal@linaro.org>
      Acked-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161025120045.28839-1-chris@chris-wilson.co.uk
      f54d1867