1. 15 Mar, 2015 1 commit
  2. 04 Mar, 2015 1 commit
  3. 10 Apr, 2014 1 commit
  4. 03 Apr, 2014 2 commits
    • Michel Dänzer's avatar
      drm/mm: Fix search for smallest hole satisfying constraints · 145bccd2
      Michel Dänzer authored
      entry->size is the size of the node, not the size of the hole after it.
      So the code would actually find the hole which can satisfy the
      constraints and which is preceded by the smallest node, not the smallest
      hole satisfying the constraints.
      Reported-by: default avatar"Huang, FrankR" <FrankR.Huang@amd.com>
      Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      145bccd2
    • Lauri Kasanen's avatar
      drm: Add support for two-ended allocation, v3 · 62347f9e
      Lauri Kasanen authored
      Clients like i915 need to segregate cache domains within the GTT which
      can lead to small amounts of fragmentation. By allocating the uncached
      buffers from the bottom and the cacheable buffers from the top, we can
      reduce the amount of wasted space and also optimize allocation of the
      mappable portion of the GTT to only those buffers that require CPU
      access through the GTT.
      
      For other drivers, allocating small bos from one end and large ones
      from the other helps improve the quality of fragmentation.
      
      Based on drm_mm work by Chris Wilson.
      
      v3: Changed to use a TTM placement flag
      v2: Updated kerneldoc
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Christian König <deathsimple@vodafone.de>
      Signed-off-by: default avatarLauri Kasanen <cand@gmx.com>
      Signed-off-by: default avatarDavid Airlie <airlied@redhat.com>
      62347f9e
  5. 13 Mar, 2014 3 commits
  6. 22 Aug, 2013 1 commit
    • Ben Widawsky's avatar
      drm: WARN when removing unallocated node · 3ef80a81
      Ben Widawsky authored
      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: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Acked-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      3ef80a81
  7. 06 Aug, 2013 2 commits
    • David Herrmann's avatar
      drm/mm: remove unused API · c700c67b
      David Herrmann authored
      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: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      c700c67b
    • David Herrmann's avatar
      drm/mm: add "best_match" flag to drm_mm_insert_node() · 31e5d7c6
      David Herrmann authored
      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: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      31e5d7c6
  8. 08 Jul, 2013 2 commits
    • Ben Widawsky's avatar
      drm: Change create block to reserve node · 338710e7
      Ben Widawsky authored
      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: default avatarBen Widawsky <ben@bwidawsk.net>
      Acked-by: default avatarDavid Airlie <airlied@linux.ie>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      338710e7
    • Ben Widawsky's avatar
      drm: pre allocate node for create_block · b3a070cc
      Ben Widawsky authored
      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: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Acked-by: default avatarDavid Airlie <airlied@linux.ie>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      b3a070cc
  9. 03 Jul, 2013 2 commits
  10. 01 Jul, 2013 1 commit
  11. 30 Apr, 2013 1 commit
    • Daniel Vetter's avatar
      drm/mm: fix dump table BUG · 3a359f0b
      Daniel Vetter authored
      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: default avatarChristopher 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: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      3a359f0b
  12. 08 Jan, 2013 1 commit
    • Chris Wilson's avatar
      drm: Only evict the blocks required to create the requested hole · 901593f2
      Chris Wilson authored
      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: default avatarChris 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: default avatarNorbert Preining <preining@logic.at>
      Acked-by: Dave Airlie <airlied@gmail.com
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      901593f2
  13. 18 Dec, 2012 1 commit
  14. 30 Nov, 2012 2 commits
  15. 02 Oct, 2012 1 commit
  16. 15 Jul, 2012 1 commit
    • Chris Wilson's avatar
      drm: Add colouring to the range allocator · 6b9d89b4
      Chris Wilson authored
      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: default avatarChris 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: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@gmail.com>
      6b9d89b4
  17. 31 Oct, 2011 1 commit
  18. 08 May, 2011 1 commit
  19. 31 Mar, 2011 1 commit
  20. 22 Feb, 2011 4 commits
  21. 27 Oct, 2010 1 commit
  22. 26 Aug, 2010 1 commit
  23. 06 Jul, 2010 5 commits
  24. 14 Feb, 2010 1 commit
  25. 22 Dec, 2009 1 commit
  26. 09 Dec, 2009 1 commit