1. 27 12月, 2016 4 次提交
  2. 16 12月, 2016 2 次提交
  3. 01 12月, 2016 1 次提交
    • C
      drm: Initialise drm_mm.head_node.allocated · cc98e6ce
      Chris Wilson 提交于
      commit 202b52b7 ("drm: Track drm_mm nodes with an interval tree")
      introduced a requirement that the special drm_mm.head_node was
      initialised and marked as not being allocated. It is a very special node
      that has no side but has a hole that represents the drm_mm address
      space, and holds the list of nodes. Since it is not a real node, it is
      not part of the node rbtree and we detect this as it being unallocated.
      This presumed that drm_mm_init() was initialising it to zero. It happens
      that i915 kzallocs its objects and so it was accidentally setting it,
      but for generic use we cannot make that assumption.
      
      [   22.981519] general protection fault: 0000 [#1] SMP
      [   22.981521] Modules linked in: test_drm_mm(+) ctr ccm arc4 rt2800usb rt2x00usb rt2800lib rt2x00lib crc_ccitt mac80211 cmac rfcomm bnep snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_codec_generic snd_hda_intel dcdbas snd_hda_codec x86_pkg_temp_thermal intel_powerclamp btusb snd_hda_core coretemp crct10dif_pclmul cfg80211 btrtl btbcm btintel bluetooth crc32_pclmul ghash_clmulni_intel aesni_intel snd_pcm i2c_hid aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd snd_timer hid_multitouch snd joydev serio_raw lpc_ich mfd_core i2c_designware_platform i2c_designware_core 8250_dw binfmt_misc soundcore acpi_pad nls_iso8859_1 usbhid hid psmouse ahci libahci [last unloaded: test_drm_mm]
      [   22.981544] CPU: 1 PID: 2088 Comm: drm_mm Tainted: G        W       4.9.0-rc7+ #234
      [   22.981545] Hardware name: Dell Inc. XPS 13 9343/0310JH, BIOS A07 11/11/2015
      [   22.981546] task: ffff88020c971cc0 task.stack: ffffc90001728000
      [   22.981547] RIP: 0010:[<ffffffff814050f0>]  [<ffffffff814050f0>] drm_mm_interval_tree_add_node+0xa0/0xd0
      [   22.981551] RSP: 0018:ffffc9000172ba98  EFLAGS: 00010202
      [   22.981552] RAX: 0f0000c69cf63d80 RBX: ffff88020be00000 RCX: ffff88020be00000
      [   22.981553] RDX: 0000000000000fff RSI: ffffc9000172bc48 RDI: ffffffff810ac4df
      [   22.981553] RBP: ffffc9000172bb08 R08: ffffc9000172bc70 R09: 0000000000000fff
      [   22.981554] R10: ffffffff810ac4d7 R11: 4dc04d8b4cffffe5 R12: 0000000000001000
      [   22.981555] R13: ffffc9000172bbd0 R14: ffffc9000172bbe0 R15: 0000000002000000
      [   22.981556] FS:  00007f80c9fab740(0000) GS:ffff88021f480000(0000) knlGS:0000000000000000
      [   22.981557] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   22.981558] CR2: 00007f80c9fd5000 CR3: 000000020c191000 CR4: 00000000003406e0
      [   22.981559] Stack:
      [   22.981560]  ffffffff81405d09 ffff88020be00000 ffffc9000172bbe0 000000000172bb08
      [   22.981562]  ffffffffffffffff 0000000000000000 0000000000000000 0000000000000000
      [   22.981563]  0000000002000000 0000000002000000 ffffffffa02f3000 ffff88020be00000
      [   22.981565] Call Trace:
      [   22.981568]  [<ffffffff81405d09>] ? drm_mm_insert_node_generic+0x229/0x310
      [   22.981570]  [<ffffffffa02f3000>] ? 0xffffffffa02f3000
      [   22.981572]  [<ffffffffa02903c1>] __subtest_insert_range.constprop.7+0xd1/0x5b0 [test_drm_mm]
      [   22.981575]  [<ffffffff81081222>] ? default_wake_function+0x12/0x20
      [   22.981576]  [<ffffffff81096905>] ? __wake_up_common+0x55/0x90
      [   22.981578]  [<ffffffff81085f42>] ? sched_clock_cpu+0x72/0xa0
      [   22.981581]  [<ffffffff811308ad>] ? irq_work_queue+0xd/0x80
      [   22.981582]  [<ffffffff810abcc4>] ? wake_up_klogd+0x34/0x40
      [   22.981584]  [<ffffffff810ac19d>] ? console_unlock+0x4cd/0x530
      [   22.981585]  [<ffffffff810ac4d7>] ? vprintk_emit+0x2d7/0x490
      [   22.981587]  [<ffffffff810ac82f>] ? vprintk_default+0x1f/0x30
      [   22.981589]  [<ffffffff81146e1c>] ? printk+0x4d/0x4f
      [   22.981590]  [<ffffffffa02f3000>] ? 0xffffffffa02f3000
      [   22.981592]  [<ffffffffa02908b5>] subtest_insert_range+0x15/0x80 [test_drm_mm]
      [   22.981594]  [<ffffffffa02f3088>] test_drm_mm_init+0x88/0x1000 [test_drm_mm]
      [   22.981597]  [<ffffffff8100043d>] do_one_initcall+0x3d/0x150
      [   22.981600]  [<ffffffff8119dfbf>] ? kfree+0x13f/0x180
      [   22.981602]  [<ffffffff811471f2>] do_init_module+0x60/0x1f1
      [   22.981606]  [<ffffffff810db878>] load_module+0x2228/0x2790
      [   22.981608]  [<ffffffff810d8590>] ? __symbol_put+0x40/0x40
      [   22.981612]  [<ffffffff811c52b1>] ? kernel_read+0x41/0x60
      [   22.981614]  [<ffffffff810dbfb6>] SYSC_finit_module+0x96/0xd0
      [   22.981617]  [<ffffffff810dc00e>] SyS_finit_module+0xe/0x10
      [   22.981620]  [<ffffffff816e7aa4>] entry_SYSCALL_64_fastpath+0x17/0x98
      [   22.981622] Code: c7 41 30 00 00 00 00 48 89 e5 48 89 3a 48 c7 c2 20 4e 40 81 e8 b2 a1 f0 ff 5d c3 48 8d 56 78 45 31 d2 48 89 d6 eb 25 48 8b 51 58 <48> 39 50 38 73 04 48 89 50 38 4c 8b 58 28 4c 39 59 48 48 8d 50
      [   22.981651] RIP  [<ffffffff814050f0>] drm_mm_interval_tree_add_node+0xa0/0xd0
      [   22.981655]  RSP <ffffc9000172ba98>
      
      Testcase: igt/drm_mm
      Fixes: 202b52b7 ("drm: Track drm_mm nodes with an interval tree")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.9-rc1+
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161130205126.31106-1-chris@chris-wilson.co.uk
      cc98e6ce
  4. 24 11月, 2016 2 次提交
  5. 08 11月, 2016 2 次提交
  6. 08 8月, 2016 3 次提交
  7. 23 5月, 2016 1 次提交
  8. 08 9月, 2015 1 次提交
  9. 29 5月, 2015 1 次提交
    • R
      drm: clean up drm_mm debugfs output · 2f15791c
      Russell King 提交于
      The drm_mm debugfs output is difficult to read as two different formats
      are used for the addresses:
      
      0x00000080000000-0x0000008000b000: 45056: used
      0x8000b000-0x80016000: 45056: free
      0x00000080016000-0x0000008001b000: 20480: used
      0x8001b000-0x817a1000: 24666112: free
      0x000000817a1000-0x000000817a8000: 28672: used
      0x000000817a8000-0x00000081ba8000: 4194304: used
      
      Fix this by using %#018llx for all addresses, thus making the output:
      
      0x0000000080000000-0x000000008000b000: 45056: used
      0x000000008000b000-0x0000000080016000: 45056: free
      0x0000000080016000-0x000000008001b000: 20480: used
      0x000000008001b000-0x00000000817a1000: 24666112: free
      0x00000000817a1000-0x00000000817a8000: 28672: used
      0x00000000817a8000-0x0000000081ba8000: 4194304: used
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      2f15791c
  10. 16 3月, 2015 1 次提交
  11. 05 3月, 2015 1 次提交
  12. 10 4月, 2014 1 次提交
  13. 04 4月, 2014 2 次提交
  14. 13 3月, 2014 3 次提交
  15. 22 8月, 2013 1 次提交
    • B
      drm: WARN when removing unallocated node · 3ef80a81
      Ben Widawsky 提交于
      The conditional is usually a recoverable driver bug, and so WARNing, and
      preventing the drm_mm code from doing potential damage (BUG) is
      desirable.
      
      This issue was hit and fixed twice while developing the i915 multiple
      address space code. The first fix is the patch just before this, and is
      hit on an not frequently occuring error path. Another was fixed during
      patch iteration, so it's hard to see from the patch:
      
      commit c6cfb325
      Author: Ben Widawsky <ben@bwidawsk.net>
      Date:   Fri Jul 5 14:41:06 2013 -0700
      
          drm/i915: Embed drm_mm_node in i915 gem obj
      
      From the intel-gfx mailing list, we discussed this:
      References: <20130705191235.GA3057@bwidawsk.net>
      
      Cc: Dave Airlie <airlied@redhat.com>
      CC: <dri-devel@lists.freedesktop.org>
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Acked-by: NDave Airlie <airlied@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3ef80a81
  16. 07 8月, 2013 2 次提交
    • D
      drm/mm: remove unused API · c700c67b
      David Herrmann 提交于
      We used to pre-allocate drm_mm nodes and save them in a linked list for
      later usage so we always have spare ones in atomic contexts. However, this
      is really racy if multiple threads are in an atomic context at the same
      time and we don't have enough spare nodes. Moreover, all remaining users
      run in user-context and just lock drm_mm with a spinlock. So we can easily
      preallocate the node, take the spinlock and insert the node.
      
      This may have worked well with BKL in place, however, with today's
      infrastructure it really doesn't make any sense. Besides, most users can
      easily embed drm_mm_node into their objects so no allocation is needed at
      all.
      
      Thus, remove the old pre-alloc API and all the helpers that it provides.
      Drivers have already been converted and we should not use the old API for
      new code, anymore.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c700c67b
    • D
      drm/mm: add "best_match" flag to drm_mm_insert_node() · 31e5d7c6
      David Herrmann 提交于
      Add a "best_match" flag similar to the drm_mm_search_*() helpers so we
      can convert TTM to use them in follow up patches. We can also inline the
      non-generic helpers and move them into the header to allow compile-time
      optimizations.
      
      To make calls to drm_mm_{search,insert}_node() more readable, this
      converts the boolean argument to a flagset. There are pending patches that
      add additional flags for top-down allocators and more.
      
      v2:
       - use flag parameter instead of boolean "best_match"
       - convert *_search_free() helpers to also use flags argument
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      31e5d7c6
  17. 09 7月, 2013 2 次提交
    • B
      drm: Change create block to reserve node · 338710e7
      Ben Widawsky 提交于
      With the previous patch we no longer actually create a node, we simply
      find the correct hole and occupy it. This very well could have been
      squashed with the last patch, but since I already had David's review, I
      figured it's easiest to keep it distinct.
      
      Also update the users in i915. Conveniently this is the only user of the
      interface.
      
      CC: David Airlie <airlied@linux.ie>
      CC: <dri-devel@lists.freedesktop.org>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Acked-by: NDavid Airlie <airlied@linux.ie>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      338710e7
    • B
      drm: pre allocate node for create_block · b3a070cc
      Ben Widawsky 提交于
      For an upcoming patch where we introduce the i915 VMA, it's ideal to
      have the drm_mm_node as part of the VMA struct (ie. it's pre-allocated).
      Part of the conversion to VMAs is to kill off obj->gtt_space. Doing this
      will break a bunch of code, but amongst them are 2 callers of
      drm_mm_create_block(), both related to stolen memory.
      
      It also allows us to embed the drm_mm_node into the object currently
      which provides a nice transition over to the new code.
      
      v2: Reordered to do before ripping out obj->gtt_offset.
      Some minor cleanups made available because of reordering.
      
      v3: s/continue/break on failed stolen node allocation (David)
      Set obj->gtt_space on failed node allocation (David)
      Only unref stolen (fix double free) on failed create_stolen (David)
      Free node, and NULL it in failed create_stolen (David)
      Add back accidentally removed newline (David)
      
      CC: <dri-devel@lists.freedesktop.org>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Acked-by: NDavid Airlie <airlied@linux.ie>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b3a070cc
  18. 04 7月, 2013 2 次提交
  19. 02 7月, 2013 1 次提交
  20. 30 4月, 2013 1 次提交
    • D
      drm/mm: fix dump table BUG · 3a359f0b
      Daniel Vetter 提交于
      In
      
      commit 9e8944ab
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Thu Nov 15 11:32:17 2012 +0000
      
          drm: Introduce an iterator over holes in the drm_mm range manager
      
      helpers and iterators for hole handling have been introduced with some
      debug BUG_ONs sprinkled over. Unfortunately this broke the mm dumper
      which unconditionally tried to compute the size of the very first
      hole.
      
      While at it unify the code a bit with the hole dumping in the loop.
      
      v2: Extract a hole dump helper.
      Reported-by: NChristopher Harvey <charvey@matrox.com>
      Cc: Christopher Harvey <charvey@matrox.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      Acked-by: NDave Airlie <airlied@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3a359f0b
  21. 08 1月, 2013 1 次提交
    • C
      drm: Only evict the blocks required to create the requested hole · 901593f2
      Chris Wilson 提交于
      Avoid clobbering adjacent blocks if they happen to expire earlier and
      amalgamate together to form the requested hole.
      
      In passing this fixes a regression from
      commit ea7b1dd4
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Feb 18 17:59:12 2011 +0100
      
          drm: mm: track free areas implicitly
      
      which swaps the end address for size (with a potential overflow) and
      effectively causes the eviction code to clobber almost all earlier
      buffers above the evictee.
      
      v2: Check the original hole not the adjusted as the coloring may confuse
      us when later searching for the overlapping nodes. Also make sure that
      we do apply the range restriction and color adjustment in the same
      order for both scanning, searching and insertion.
      
      v3: Send the version that was actually tested.
      
      Note that this seems to be ducttape of decent quality ot paper over
      some of our unbind related gpu hangs reported since 3.7. It is not
      fully effective though, and certainly doesn't fix the underlying bug.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      [danvet: Added note plus bugzilla link and tested-by.]
      Cc: stable@vger.kernel.org
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55984Tested-by: NNorbert Preining <preining@logic.at>
      Acked-by: Dave Airlie <airlied@gmail.com
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      901593f2
  22. 19 12月, 2012 1 次提交
  23. 01 12月, 2012 2 次提交
  24. 03 10月, 2012 1 次提交
  25. 16 7月, 2012 1 次提交
    • C
      drm: Add colouring to the range allocator · 6b9d89b4
      Chris Wilson 提交于
      In order to support snoopable memory on non-LLC architectures (so that
      we can bind vgem objects into the i915 GATT for example), we have to
      avoid the prefetcher on the GPU from crossing memory domains and so
      prevent allocation of a snoopable PTE immediately following an uncached
      PTE. To do that, we need to extend the range allocator with support for
      tracking and segregating different node colours.
      
      This will be used by i915 to segregate memory domains within the GTT.
      
      v2: Now with more drm_mm helpers and less driver interference.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Dave Airlie <airlied@redhat.com
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@gmail.com>
      6b9d89b4