1. 03 5月, 2018 1 次提交
    • C
      drm/i915: Move timeline from GTT to ring · 65fcb806
      Chris Wilson 提交于
      In the future, we want to move a request between engines. To achieve
      this, we first realise that we have two timelines in effect here. The
      first runs through the GTT is required for ordering vma access, which is
      tracked currently by engine. The second is implied by sequential
      execution of commands inside the ringbuffer. This timeline is one that
      maps to userspace's expectations when submitting requests (i.e. given the
      same context, batch A is executed before batch B). As the rings's
      timelines map to userspace and the GTT timeline an implementation
      detail, move the timeline from the GTT into the ring itself (per-context
      in logical-ring-contexts/execlists, or a global per-engine timeline for
      the shared ringbuffers in legacy submission.
      
      The two timelines are still assumed to be equivalent at the moment (no
      migrating requests between engines yet) and so we can simply move from
      one to the other without adding extra ordering.
      
      v2: Reinforce that one isn't allowed to mix the engine execution
      timeline with the client timeline from userspace (on the ring).
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180502163839.3248-1-chris@chris-wilson.co.uk
      65fcb806
  2. 02 5月, 2018 1 次提交
  3. 30 4月, 2018 2 次提交
  4. 26 4月, 2018 1 次提交
  5. 24 4月, 2018 3 次提交
  6. 19 4月, 2018 2 次提交
  7. 13 4月, 2018 1 次提交
  8. 12 4月, 2018 2 次提交
    • O
      drm/i915: Move a bunch of workaround-related code to its own file · 7d3c425f
      Oscar Mateo 提交于
      This has grown to be a sizable amount of code, so move it to
      its own file before we try to refactor anything. For the moment,
      we are leaving behind the WA BB code and the WAs that get applied
      (incorrectly) in init_clock_gating, but we will deal with it later.
      
      v2: Use intel_ prefix for code that deals with the hardware (Chris)
      v3: Rebased
      v4:
        - Rebased
        - New license header
      v5:
        - Rebased
        - Added some organisational notes to the file (Chris)
      v6: Include DOC section in the documentation build (Jani)
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      [ickle: appease checkpatch, mostly]
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/1523376767-18480-1-git-send-email-oscar.mateo@intel.com
      7d3c425f
    • C
      drm/i915/execlists: Set queue priority from secondary port · 15c83c43
      Chris Wilson 提交于
      We can refine our current execlists->queue_priority if we inspect
      ELSP[1] rather than the head of the unsubmitted queue. Currently, we use
      the unsubmitted queue and say that if a subsequent request is more
      important than the current queue, we will rerun the submission tasklet
      to evaluate the need for preemption. However, we only want to preempt if
      we need to jump ahead of a currently executing request in ELSP. The
      second reason for running the submission tasklet is amalgamate requests
      into the active context on ELSP[0] to avoid a stall when ELSP[0] drains.
      (Though repeatedly amalgamating requests into the active context and
      triggering many lite-restore is off question gain, the goal really is to
      put a context into ELSP[1] to cover the interrupt.) So if instead of
      looking at the head of the queue, we look at the context in ELSP[1] we
      can answer both of the questions more accurately -- we don't need to
      rerun the submission tasklet unless our new request is important enough
      to feed into, at least, ELSP[1].
      
      v2: Add some comments from the discussion with Tvrtko.
      v3: More commentary to cross-reference queue_request()
      
      References: f6322edd ("drm/i915/preemption: Allow preemption between submission ports")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180411103929.27374-1-chris@chris-wilson.co.uk
      15c83c43
  9. 27 3月, 2018 1 次提交
  10. 20 3月, 2018 1 次提交
  11. 15 3月, 2018 3 次提交
  12. 14 3月, 2018 1 次提交
    • C
      drm/i915: Check rq->timeline before deference · ab268151
      Chris Wilson 提交于
      Not only is the context suspect to disappearing, but so is it's
      timeline. Under a lockless inspection of the requests for
      debugging from intel_engine_dump(), the context may already have been
      freed and we have to check before chasing the dangling pointer.
      
      [28033.681755] Modules linked in: vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_intel crct10dif_pclmul crc32_pclmul snd_hda_codec snd_hwdep snd_hda_core ghash_clmulni_intel snd_pcm mei_me mei i915 r8169 mii prime_numbers i2c_hid
      [28033.681796] CPU: 3 PID: 3058 Comm: gem_exec_schedu Tainted: G     U           4.16.0-rc5+ #9
      [28033.681804] Hardware name: Acer Aspire E5-575G/Ironman_SK  , BIOS V1.12 08/02/2016
      [28033.681834] RIP: 0010:print_request+0x2b/0xb0 [i915]
      [28033.681840] RSP: 0018:ffffc90004afbc18 EFLAGS: 00010202
      [28033.681847] RAX: 6b6b6b6b6b6b6b6b RBX: ffff8801921b5a40 RCX: 0000000000000006
      [28033.681854] RDX: ffffc90004afbc60 RSI: ffff8801921b5a40 RDI: 0000000000000004
      [28033.681861] RBP: ffffc90004afbd80 R08: 0000000000000000 R09: 0000000000000001
      [28033.681868] R10: ffffc90004afbbd0 R11: ffffc90004afbc73 R12: ffffc90004afbc60
      [28033.681875] R13: ffffc90004afbd80 R14: ffff8801d40ec670 R15: ffff8801921b5a40
      [28033.681883] FS:  00007fbba5f6c8c0(0000) GS:ffff8801e8400000(0000) knlGS:0000000000000000
      [28033.681891] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [28033.681897] CR2: 00007fbba5f8f000 CR3: 00000001b2efa002 CR4: 00000000003606e0
      [28033.681904] Call Trace:
      [28033.681932]  intel_engine_print_registers+0x6a7/0x930 [i915]
      [28033.681962]  intel_engine_dump+0x30d/0x740 [i915]
      [28033.681971]  ? seq_printf+0x3a/0x50
      [28033.681995]  i915_engine_info+0xb8/0xe0 [i915]
      [28033.682003]  ? drm_get_color_range_name+0x20/0x20
      [28033.682010]  seq_read+0xe1/0x440
      [28033.682018]  full_proxy_read+0x51/0x80
      [28033.682025]  __vfs_read+0x21/0x130
      [28033.682031]  ? do_sys_open+0x134/0x220
      [28033.682037]  ? kmem_cache_free+0x177/0x2b0
      [28033.682043]  vfs_read+0xa1/0x150
      [28033.682049]  SyS_read+0x40/0xa0
      [28033.682055]  do_syscall_64+0x6b/0x1b0
      [28033.682063]  entry_SYSCALL_64_after_hwframe+0x42/0xb7
      [28033.682069] RIP: 0033:0x7fbba4655d11
      [28033.682074] RSP: 002b:00007ffd8c49da58 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
      [28033.682082] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fbba4655d11
      [28033.682089] RDX: 000000000000003f RSI: 00005647bfbfc260 RDI: 0000000000000006
      [28033.682096] RBP: 000000000000003f R08: 00000000ffffffff R09: 0000000000000000
      [28033.682104] R10: 0000000000000000 R11: 0000000000000246 R12: 00005647bfbfc260
      [28033.682111] R13: 0000000000000006 R14: 0000000000000000 R15: 00005647bfbfc260
      [28033.682119] Code: 41 55 41 54 49 89 d4 55 53 48 89 fd 48 8b 86 c8 00 00 00 48 8b 3d d6 1e 14 e2 48 89 f3 48 2b be a8 02 00 00 48 8b 80 b0 00 00 00 <4c> 8b 68 18 e8 bc 80 02 e1 8b 8b 70 02 00 00 8b b3 28 02 00 00
      [28033.682206] RIP: print_request+0x2b/0xb0 [i915] RSP: ffffc90004afbc18
      Reported-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180314101630.8933-1-chris@chris-wilson.co.uk
      ab268151
  13. 10 3月, 2018 1 次提交
  14. 09 3月, 2018 1 次提交
  15. 07 3月, 2018 2 次提交
  16. 28 2月, 2018 1 次提交
    • C
      drm/i915: Don't deref request->ctx inside unlocked print_request() · 367a35a6
      Chris Wilson 提交于
      Although we protect the request itself, we don't lock inside
      intel_engine_dump() and so the request maybe retired as we peek into it.
      One consequence is that the request->ctx may be freed before we
      dereference it, leading to a use-after-free. Replace the hw_id we are
      peeking from inside request->ctx with the request->fence.context, with
      which we can still track from which context the request originated
      (although to tie to HW reports requires a little more legwork, but is
      good enough to follow the GEM traces).
      
      [52640.729670] general protection fault: 0000 [#2] SMP
      [52640.729694] Dumping ftrace buffer:
      [52640.729701]    (ftrace buffer empty)
      [52640.729705] Modules linked in: vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic x86_pkg_\
      temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul snd_hda_intel snd_hda_codec snd_hwdep gha\
      sh_clmulni_intel snd_hda_core snd_pcm mei_me mei i915 r8169 mii prime_numbers i2c_hid
      [52640.729748] CPU: 2 PID: 4335 Comm: gem_exec_schedu Tainted: G     UD W        4.16.0-rc3+ #7
      [52640.729759] Hardware name: Acer Aspire E5-575G/Ironman_SK  , BIOS V1.12 08/02/2016
      [52640.729803] RIP: 0010:print_request+0x2b/0xb0 [i915]
      [52640.729811] RSP: 0018:ffffc90001453c18 EFLAGS: 00010206
      [52640.729820] RAX: 6b6b6b6b6b6b6b6b RBX: ffff8801e0292d40 RCX: 0000000000000006
      [52640.729829] RDX: ffffc90001453c60 RSI: ffff8801e0292d40 RDI: 0000000000000003
      [52640.729838] RBP: ffffc90001453d80 R08: 0000000000000000 R09: 0000000000000001
      [52640.729847] R10: ffffc90001453bd0 R11: ffffc90001453c73 R12: ffffc90001453c60
      [52640.729856] R13: ffffc90001453d80 R14: ffff8801d5a683c8 R15: ffff8801e0292d40
      [52640.729866] FS:  00007f1ee50548c0(0000) GS:ffff8801e8200000(0000) knlGS:0000000000000000
      [52640.729876] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [52640.729884] CR2: 00007f1ee5077000 CR3: 00000001d9411004 CR4: 00000000003606e0
      [52640.729893] Call Trace:
      [52640.729922]  intel_engine_print_registers+0x623/0x890 [i915]
      [52640.729948]  intel_engine_dump+0x4a3/0x590 [i915]
      [52640.729957]  ? seq_printf+0x3a/0x50
      [52640.729977]  i915_engine_info+0xb8/0xe0 [i915]
      [52640.729984]  ? drm_mode_gamma_get_ioctl+0xf0/0xf0
      [52640.729990]  seq_read+0xd5/0x410
      [52640.729997]  full_proxy_read+0x4b/0x70
      [52640.730004]  __vfs_read+0x1e/0x120
      [52640.730009]  ? do_sys_open+0x134/0x220
      [52640.730015]  ? kmem_cache_free+0x174/0x2b0
      [52640.730021]  vfs_read+0xa1/0x150
      [52640.730026]  SyS_read+0x40/0xa0
      [52640.730032]  do_syscall_64+0x65/0x1a0
      [52640.730038]  entry_SYSCALL_64_after_hwframe+0x42/0xb7
      Reported-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180228094732.28462-1-chris@chris-wilson.co.uk
      367a35a6
  17. 24 2月, 2018 1 次提交
  18. 22 2月, 2018 1 次提交
  19. 14 2月, 2018 1 次提交
  20. 13 2月, 2018 1 次提交
  21. 12 2月, 2018 2 次提交
  22. 09 2月, 2018 1 次提交
  23. 08 2月, 2018 1 次提交
  24. 01 2月, 2018 1 次提交
  25. 23 1月, 2018 1 次提交
  26. 20 1月, 2018 2 次提交
  27. 15 1月, 2018 1 次提交
  28. 11 1月, 2018 2 次提交
  29. 06 1月, 2018 1 次提交