1. 28 4月, 2017 2 次提交
  2. 12 4月, 2017 2 次提交
  3. 11 4月, 2017 1 次提交
  4. 07 4月, 2017 5 次提交
  5. 06 4月, 2017 2 次提交
  6. 04 4月, 2017 1 次提交
  7. 31 3月, 2017 4 次提交
  8. 30 3月, 2017 1 次提交
  9. 27 3月, 2017 1 次提交
    • C
      drm/i915: Check we have an wake device before flushing GTT writes · e2a2aa36
      Chris Wilson 提交于
      We can assume that if the device is asleep then all pending GTT writes
      will have been posted, and so we can defer the flush from
      i915_gem_object_flush_gtt_write_domain()
      
      [ 1957.462568] WARNING: CPU: 0 PID: 6132 at drivers/gpu/drm/i915/intel_drv.h:1742 fwtable_read32+0x123/0x150 [i915]
      [ 1957.462582] RPM wakelock ref not held during HW access
      [ 1957.462583] Modules linked in: i915 intel_gtt drm_kms_helper prime_numbers
      [ 1957.462607] CPU: 0 PID: 6132 Comm: gem_concurrent_ Tainted: G     U          4.11.0-rc1+ #464
      [ 1957.462619] Hardware name:                  /        , BIOS PYBSWCEL.86A.0027.2015.0507.1758 05/07/2015
      [ 1957.462630] Call Trace:
      [ 1957.462646]  dump_stack+0x4d/0x6f
      [ 1957.462657]  __warn+0xc1/0xe0
      [ 1957.462667]  warn_slowpath_fmt+0x4a/0x50
      [ 1957.462709]  fwtable_read32+0x123/0x150 [i915]
      [ 1957.462750]  i915_gem_object_flush_gtt_write_domain+0x43/0x70 [i915]
      [ 1957.462791]  i915_gem_object_set_to_cpu_domain+0x46/0xa0 [i915]
      [ 1957.462831]  i915_gem_set_domain_ioctl+0x15d/0x220 [i915]
      [ 1957.462843]  drm_ioctl+0x1d7/0x440
      [ 1957.462885]  ? i915_gem_obj_prepare_shmem_write+0x1d0/0x1d0 [i915]
      [ 1957.462896]  ? pick_next_task_fair+0x436/0x440
      [ 1957.462906]  ? mntput+0x1f/0x30
      [ 1957.462915]  do_vfs_ioctl+0x8f/0x5c0
      [ 1957.462925]  ? __schedule+0x16f/0x5f0
      [ 1957.462935]  ? ____fput+0x9/0x10
      [ 1957.462943]  SyS_ioctl+0x3c/0x70
      [ 1957.462952]  entry_SYSCALL_64_fastpath+0x17/0x98
      [ 1957.462961] RIP: 0033:0x7fc542179ca7
      [ 1957.462968] RSP: 002b:00007ffeef12ff98 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      [ 1957.462982] RAX: ffffffffffffffda RBX: 00007ffeef1301d0 RCX: 00007fc542179ca7
      [ 1957.462990] RDX: 00007ffeef12ffd0 RSI: 00000000400c645f RDI: 0000000000000003
      [ 1957.462999] RBP: 0000000000000003 R08: 000055f433bc7c40 R09: 000000000000002c
      [ 1957.463006] R10: 0000000000000073 R11: 0000000000000246 R12: 0000000000000018
      [ 1957.463015] R13: 000055f432c89d20 R14: 000055f432c87690 R15: 0000000000000000
      
      Fixes: 3b5724d7 ("drm/i915: Wait for writes through the GTT to land before reading back")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170323150053.28582-1-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      e2a2aa36
  10. 23 3月, 2017 3 次提交
  11. 20 3月, 2017 1 次提交
  12. 18 3月, 2017 2 次提交
  13. 17 3月, 2017 2 次提交
  14. 15 3月, 2017 2 次提交
    • A
      drm/i915/guc: Simplify intel_guc_init_hw() · 6cd5a72c
      Arkadiusz Hiler 提交于
      Current version of intel_guc_init_hw() does a lot:
       - cares about submission
       - loads huc
       - implement WA
      
      This change offloads some of the logic to intel_uc_init_hw(), which now
      cares about the above.
      
      v2: rename guc_hw_reset and fix typo in define name (M. Wajdeczko)
      v3: rename once again
      v4: remove spurious comments and add some style (J. Lahtinen)
      v5: flow changes, got rid of dead checks (M. Wajdeczko)
      v6: rebase
      v7: rebase & onion teardown (J. Lahtinen)
      
      Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
      Cc: Michal Winiarski <michal.winiarski@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NArkadiusz Hiler <arkadiusz.hiler@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      6cd5a72c
    • A
      drm/i915/uc: Rename intel_?uc_{setup, load}() to _init_hw() · 882d1db0
      Arkadiusz Hiler 提交于
      GuC historically has two "startup" functions called _init() and _setup()
      
      Then HuC came with it's _init() and _load().
      
      This commit renames intel_guc_setup() and intel_huc_load() to
      *uc_init_hw() as they called from the i915_gem_init_hw().
      
      The aim is to be consistent in that entry points called during
      particular driver init phases (e.g. init_hw) are all suffixed by that
      phase. When reading the leaf functions, it should be clear at what stage
      during the driver load it is called and therefore what operations are
      legal at that point.
      
      Also, since the functions start with intel_guc and intel_huc they take
      appropiate structure.
      
      v2: commit message update (Chris Wilson)
      v3: change taken parameters to be more "semantic" (M. Wajdeczko)
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Michal Winiarski <michal.winiarski@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Signed-off-by: NArkadiusz Hiler <arkadiusz.hiler@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      882d1db0
  15. 14 3月, 2017 3 次提交
  16. 13 3月, 2017 1 次提交
  17. 09 3月, 2017 4 次提交
    • C
      drm/i915: Use pagecache write to prepopulate shmemfs from pwrite-ioctl · 4e6fdafa
      Chris Wilson 提交于
      Before we instantiate/pin the backing store for our use, we
      can prepopulate the shmemfs filp efficiently using a write into the
      pagecache. We avoid the penalty of instantiating all the pages, important
      if the user is just writing to a few and never uses the object on the GPU,
      and using a direct write into shmemfs allows it to avoid the cost of
      retrieving a page (mostly the clear-before-use, but in theory we could
      curtail swapin) before it is overwritten.
      
      This can be extended later to provide additional specialisation for
      other backends (other than shmemfs). For now it provides a defense
      against very large write-only allocations from exhausting all of system
      memory.
      
      v2: Smelling fixes.
      
      Fixes: fe115628 ("drm/i915: Implement pwrite without struct-mutex")
      References: https://bugs.freedesktop.org/show_bug.cgi?id=99107Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.william.auld@gmail.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.10+
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170307120338.7277-2-chris@chris-wilson.co.uk
      (cherry picked from commit 7c55e2c5)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      4e6fdafa
    • C
      drm/i915: Store a permanent error in obj->mm.pages · 0d9dc306
      Chris Wilson 提交于
      Once the object has been truncated, it is unrecoverable. To facilitate
      detection of this state store the error in obj->mm.pages.
      
      This is required for the next patch which should be applied to v4.10
      (via stable), so we also need to mark this patch for backporting. In
      that regard, let's consider this to be a fix/improvement too.
      
      v2: Avoid dereferencing the ERR_PTR when freeing the object.
      
      Fixes: 1233e2db ("drm/i915: Move object backing storage manipulation to its own locking")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.10+
      Link: http://patchwork.freedesktop.org/patch/msgid/20170307132031.32461-1-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      (cherry picked from commit 4e5462ee)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      0d9dc306
    • C
      drm/i915: Squelch any ktime/jiffie rounding errors for wait-ioctl · 89cf83d4
      Chris Wilson 提交于
      We wait upon jiffies, but report the time elapsed using a
      high-resolution timer. This discrepancy can lead to us timing out the
      wait prior to us reporting the elapsed time as complete.
      
      This restores the squelching lost in commit e95433c7 ("drm/i915:
      Rearrange i915_wait_request() accounting with callers").
      
      Fixes: e95433c7 ("drm/i915: Rearrange i915_wait_request() accounting with callers")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.william.auld@gmail.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.10-rc1+
      Cc: stable@vger.kernel.org
      Link: http://patchwork.freedesktop.org/patch/msgid/20170216125441.30923-1-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      (cherry picked from commit c1d2061b)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      89cf83d4
    • C
      drm/i915: Avoiding recursing on ww_mutex inside shrinker · 03d1cac6
      Chris Wilson 提交于
      We have to avoid taking ww_mutex inside the shrinker as we use it as a
      plain mutex type and so need to avoid recursive deadlocks:
      
      [  602.771969] =================================
      [  602.771970] [ INFO: inconsistent lock state ]
      [  602.771973] 4.10.0gpudebug+ #122 Not tainted
      [  602.771974] ---------------------------------
      [  602.771975] inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage.
      [  602.771978] kswapd0/40 [HC0[0]:SC0[0]:HE1:SE1] takes:
      [  602.771979]  (reservation_ww_class_mutex){+.+.?.}, at: [<ffffffffa054680a>] i915_gem_object_wait+0x39a/0x410 [i915]
      [  602.772020] {RECLAIM_FS-ON-W} state was registered at:
      [  602.772024]   mark_held_locks+0x76/0x90
      [  602.772026]   lockdep_trace_alloc+0xb8/0xc0
      [  602.772028]   __kmalloc_track_caller+0x5d/0x130
      [  602.772031]   krealloc+0x89/0xb0
      [  602.772033]   reservation_object_reserve_shared+0xaf/0xd0
      [  602.772055]   i915_gem_do_execbuffer.isra.35+0x1413/0x18b0 [i915]
      [  602.772075]   i915_gem_execbuffer2+0x10e/0x1d0 [i915]
      [  602.772078]   drm_ioctl+0x291/0x480
      [  602.772079]   do_vfs_ioctl+0x695/0x6f0
      [  602.772081]   SyS_ioctl+0x3c/0x70
      [  602.772084]   entry_SYSCALL_64_fastpath+0x18/0xad
      [  602.772085] irq event stamp: 5197423
      [  602.772088] hardirqs last  enabled at (5197423): [<ffffffff8116751d>] kfree+0xdd/0x170
      [  602.772091] hardirqs last disabled at (5197422): [<ffffffff811674f9>] kfree+0xb9/0x170
      [  602.772095] softirqs last  enabled at (5190992): [<ffffffff8107bfe1>] __do_softirq+0x221/0x280
      [  602.772097] softirqs last disabled at (5190575): [<ffffffff8107c294>] irq_exit+0x64/0xc0
      [  602.772099]
                     other info that might help us debug this:
      [  602.772100]  Possible unsafe locking scenario:
      
      [  602.772101]        CPU0
      [  602.772101]        ----
      [  602.772102]   lock(reservation_ww_class_mutex);
      [  602.772104]   <Interrupt>
      [  602.772105]     lock(reservation_ww_class_mutex);
      [  602.772107]
                      *** DEADLOCK ***
      
      [  602.772109] 2 locks held by kswapd0/40:
      [  602.772110]  #0:  (shrinker_rwsem){++++..}, at: [<ffffffff811337b5>] shrink_slab.constprop.62+0x35/0x280
      [  602.772116]  #1:  (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0553957>] i915_gem_shrinker_lock+0x27/0x60 [i915]
      [  602.772141]
                     stack backtrace:
      [  602.772144] CPU: 2 PID: 40 Comm: kswapd0 Not tainted 4.10.0gpudebug+ #122
      [  602.772145] Hardware name: LENOVO 42433ZG/42433ZG, BIOS 8AET64WW (1.44 ) 07/26/2013
      [  602.772147] Call Trace:
      [  602.772151]  dump_stack+0x68/0xa1
      [  602.772153]  print_usage_bug+0x1d4/0x1f0
      [  602.772155]  mark_lock+0x390/0x530
      [  602.772157]  ? print_irq_inversion_bug+0x200/0x200
      [  602.772159]  __lock_acquire+0x405/0x1260
      [  602.772181]  ? i915_gem_object_wait+0x39a/0x410 [i915]
      [  602.772183]  lock_acquire+0x60/0x80
      [  602.772205]  ? i915_gem_object_wait+0x39a/0x410 [i915]
      [  602.772207]  mutex_lock_nested+0x69/0x760
      [  602.772229]  ? i915_gem_object_wait+0x39a/0x410 [i915]
      [  602.772231]  ? kfree+0xdd/0x170
      [  602.772253]  ? i915_gem_object_wait+0x163/0x410 [i915]
      [  602.772255]  ? trace_hardirqs_on_caller+0x18d/0x1c0
      [  602.772256]  ? trace_hardirqs_on+0xd/0x10
      [  602.772278]  i915_gem_object_wait+0x39a/0x410 [i915]
      [  602.772300]  i915_gem_object_unbind+0x5e/0x130 [i915]
      [  602.772323]  i915_gem_shrink+0x22d/0x3d0 [i915]
      [  602.772347]  i915_gem_shrinker_scan+0x3f/0x80 [i915]
      [  602.772349]  shrink_slab.constprop.62+0x1ad/0x280
      [  602.772352]  shrink_node+0x52/0x80
      [  602.772355]  kswapd+0x427/0x5c0
      [  602.772358]  kthread+0x122/0x130
      [  602.772360]  ? try_to_free_pages+0x270/0x270
      [  602.772362]  ? kthread_stop+0x70/0x70
      [  602.772365]  ret_from_fork+0x2e/0x40
      
      v2: Add commentary about the pruning being opportunistic
      Reported-by: NJan Nordholz <jckn@gmx.net>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99977#c10
      Fixes: e54ca977 ("drm/i915: Remove completed fences after a wait")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170308132629.7987-1-chris@chris-wilson.co.uk
      03d1cac6
  18. 08 3月, 2017 2 次提交
  19. 03 3月, 2017 1 次提交