1. 01 11月, 2016 1 次提交
    • C
      drm/i915: Track pages pinned due to swizzling quirk · bc0629a7
      Chris Wilson 提交于
      If we have a tiled object and an unknown CPU swizzle pattern, we pin the
      pages to prevent the object from being swapped out (and us corrupting
      the contents as we do not know the access pattern and so cannot convert
      it to linear and back to tiled on reuse). This requires us to remember
      to drop the extra pinning when freeing the object, or else we trigger
      warnings about the pin leak. In commit fbbd37b3 ("drm/i915: Move
      object release to a freelist + worker"), the object free path was
      deferred to a worker, but the unpinning of the quirk, along with marking
      the object as reclaimable, was left on the immediate path (so that if
      required we could reclaim the pages under memory pressure as early as
      possible). However, this split introduced a bug where the pages were no
      longer being unpinned if they were marked as unneeded.
      
      [  231.800401] WARNING: CPU: 1 PID: 90 at drivers/gpu/drm/i915/i915_gem.c:4275 __i915_gem_free_objects+0x326/0x3c0 [i915]
      [  231.800403] WARN_ON(i915_gem_object_has_pinned_pages(obj))
      [  231.800405] Modules linked in:
      [  231.800406]  snd_hda_intel i915 snd_hda_codec_generic mei_me snd_hda_codec coretemp snd_hwdep mei lpc_ich snd_hda_core snd_pcm e1000e ptp pps_core [last unloaded: i915]
      [  231.800426] CPU: 1 PID: 90 Comm: kworker/1:4 Tainted: G     U          4.9.0-rc2-CI-CI_DRM_1780+ #1
      [  231.800428] Hardware name: LENOVO 7465CTO/7465CTO, BIOS 6DET44WW (2.08 ) 04/22/2009
      [  231.800456] Workqueue: events __i915_gem_free_work [i915]
      [  231.800459]  ffffc9000034fc80 ffffffff8142dd65 ffffc9000034fcd0 0000000000000000
      [  231.800465]  ffffc9000034fcc0 ffffffff8107e4e6 000010b300000001 0000000000001000
      [  231.800469]  ffff88011d3db740 ffff880130ef0000 0000000000000000 ffff880130ef5ea0
      [  231.800474] Call Trace:
      [  231.800479]  [<ffffffff8142dd65>] dump_stack+0x67/0x92
      [  231.800484]  [<ffffffff8107e4e6>] __warn+0xc6/0xe0
      [  231.800487]  [<ffffffff8107e54a>] warn_slowpath_fmt+0x4a/0x50
      [  231.800491]  [<ffffffff811d12ac>] ? kmem_cache_free+0x2dc/0x340
      [  231.800520]  [<ffffffffa009ef36>] __i915_gem_free_objects+0x326/0x3c0 [i915]
      [  231.800548]  [<ffffffffa009effe>] __i915_gem_free_work+0x2e/0x50 [i915]
      [  231.800552]  [<ffffffff8109c27c>] process_one_work+0x1ec/0x6b0
      [  231.800555]  [<ffffffff8109c1f6>] ? process_one_work+0x166/0x6b0
      [  231.800558]  [<ffffffff8109c789>] worker_thread+0x49/0x490
      [  231.800561]  [<ffffffff8109c740>] ? process_one_work+0x6b0/0x6b0
      [  231.800563]  [<ffffffff8109c740>] ? process_one_work+0x6b0/0x6b0
      [  231.800566]  [<ffffffff810a2aab>] kthread+0xeb/0x110
      [  231.800569]  [<ffffffff810a29c0>] ? kthread_park+0x60/0x60
      [  231.800573]  [<ffffffff818164a7>] ret_from_fork+0x27/0x40
      
      Moving to a separate flag for tracking the quirked pin is overkill for
      the bug (since we only have to interchange the two tests in
      i915_gem_free_object) but it does reduce a complicated test on all
      objects and provide a sanitycheck for uncommon code paths.
      
      Fixes: fbbd37b3 ("drm/i915: Move object release to a freelist + worker")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161101100317.11129-2-chris@chris-wilson.co.uk
      bc0629a7
  2. 29 10月, 2016 4 次提交
  3. 24 10月, 2016 1 次提交
  4. 14 10月, 2016 2 次提交
  5. 19 8月, 2016 2 次提交
  6. 15 8月, 2016 2 次提交
  7. 05 8月, 2016 5 次提交
  8. 04 8月, 2016 3 次提交
  9. 20 7月, 2016 3 次提交
  10. 04 7月, 2016 1 次提交
  11. 17 5月, 2016 1 次提交
  12. 11 5月, 2016 1 次提交
  13. 04 5月, 2016 1 次提交
  14. 18 11月, 2015 1 次提交
  15. 30 7月, 2015 1 次提交
    • C
      drm/i915: Declare the swizzling unknown for L-shaped configurations · 5eb3e5a5
      Chris Wilson 提交于
      The old style of memory interleaving swizzled upto the end of the
      first even bank of memory, and then used the remainder as unswizzled on
      the unpaired bank - i.e. swizzling is not constant for all memory. This
      causes problems when we try to migrate memory and so the kernel prevents
      migration at all when we detect L-shaped inconsistent swizzling.
      However, this issue also extends to userspace who try to manually detile
      into memory as the swizzling for an individual page is unknown (it
      depends on its physical address only known to the kernel), userspace
      cannot correctly swizzle.
      
      Note that this is a new attempt for the previously merged one,
      reverted in
      
      commit d82c0ba6
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Tue Jul 14 12:29:27 2015 +0200
      
          Revert "drm/i915: Declare the swizzling unknown for L-shaped configurations"
      
      This is cc: stable since we need it to fix up troubles with wc cpu
      mmaps that userspace recently started to use widely.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91105Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      [danvet: Add note about previous (failed attempt).]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5eb3e5a5
  16. 27 7月, 2015 2 次提交
  17. 14 7月, 2015 1 次提交
  18. 09 7月, 2015 1 次提交
    • C
      drm/i915: Declare the swizzling unknown for L-shaped configurations · 19ee835c
      Chris Wilson 提交于
      The old style of memory interleaving swizzled upto the end of the
      first even bank of memory, and then used the remainder as unswizzled on
      the unpaired bank - i.e. swizzling is not constant for all memory. This
      causes problems when we try to migrate memory and so the kernel prevents
      migration at all when we detect L-shaped inconsistent swizzling.
      However, this issue also extends to userspace who try to manually detile
      into memory as the swizzling for an individual page is unknown (it
      depends on its physical address only known to the kernel), userspace
      cannot correctly swizzle objects.
      
      v2: Mark the global swizzling as unknown rather than adjust the value
      reported to userspace.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91105Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      19ee835c
  19. 16 4月, 2015 1 次提交
  20. 24 2月, 2015 1 次提交
  21. 03 12月, 2014 1 次提交
  22. 20 11月, 2014 1 次提交
  23. 11 11月, 2014 1 次提交
    • C
      drm/i915: Fix obj->map_and_fenceable across tiling changes · e9d784d5
      Chris Wilson 提交于
      As obj->map_and_fenceable computation has changed to only be set when
      the object is bound inside the global GTT (and is suitable aligned to a
      fence region) we need to accommodate those changes when the tiling is
      adjusted. The easiest solution is to unbind from the global GTT if we
      are currently fenceable, but will not be after the tiling change.
      
      The bug has been exposed by
      
      commit f8fcadba218fe6d23b2e353fea1cf0a4be4c9454
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Fri Oct 31 13:53:52 2014 +0000
      
          drm/i915: Only mark as map-and-fenceable when bound into the GGTT
      
      which tried to fix an oversight from
      
      commit e6a84468
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Mon Aug 11 12:00:12 2014 +0200
      
          drm/i915: Force CPU relocations if not GTT mapped
      
      which changed the handling of obj->map_and_fenceable.
      
      Note that the alignment check is a vestige from our attempts to reduce
      the alignment requirements of tiled but unfenced buffers on
      gen2/3. Also, that was when unbinding from the GTT meant UC writes and
      clflushing, so we went to great pains to avoid such.
      
      That leaves the actual bug of setting map_and_fenceable to true if we're
      not bound to ggtt, which violates the change introduced in the above
      patch. Unbinding in that case really looks like the simplest and safest
      option, we have to do it anyway.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85896
      Testcase: igt/gem_concurrent_blit/gttX*
      Tested-by: huax.lu@intel.com
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Tested-by: NValtteri Rantala <valtteri.rantala@intel.com>
      [Jani: amend commit message per input from Daniel and bisect result from
      Valtteri]
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      e9d784d5
  24. 08 11月, 2014 1 次提交
  25. 24 10月, 2014 1 次提交
    • J
      drm/i915: preserve swizzle settings if necessary v4 · d9ceb816
      Jesse Barnes 提交于
      Some machines (like MBAs) might use a tiled framebuffer but not enable
      display swizzling at boot time.  We want to preserve that configuration
      if possible to prevent a boot time mode set.  On IVB+ it shouldn't
      affect performance anyway since the memory controller does internal
      swizzling anyway.
      
      For most other configs we'll be able to enable swizzling at boot time,
      since the initial framebuffer won't be tiled, thus we won't see any
      corruption when we enable it.
      
      v2: preserve swizzling if BIOS had it set (Daniel)
      v3: preserve swizzling only if we inherited a tiled framebuffer (Daniel)
          check display swizzle setting in detect_bit_6_swizzle (Daniel)
          use gen6 as cutoff point (Daniel)
      v4: fixup swizzle preserve again, had wrong init order (Daniel)
      Reported-by: NKristian Høgsberg <hoegsberg@gmail.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d9ceb816