1. 08 2月, 2017 1 次提交
  2. 04 2月, 2017 1 次提交
  3. 03 2月, 2017 1 次提交
    • C
      drm: Improve drm_mm search (and fix topdown allocation) with rbtrees · 4e64e553
      Chris Wilson 提交于
      The drm_mm range manager claimed to support top-down insertion, but it
      was neither searching for the top-most hole that could fit the
      allocation request nor fitting the request to the hole correctly.
      
      In order to search the range efficiently, we create a secondary index
      for the holes using either their size or their address. This index
      allows us to find the smallest hole or the hole at the bottom or top of
      the range efficiently, whilst keeping the hole stack to rapidly service
      evictions.
      
      v2: Search for holes both high and low. Rename flags to mode.
      v3: Discover rb_entry_safe() and use it!
      v4: Kerneldoc for enum drm_mm_insert_mode.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Lucas Stach <l.stach@pengutronix.de>
      Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Sinclair Yeh <syeh@vmware.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: Sinclair Yeh <syeh@vmware.com> # vmwgfx
      Reviewed-by: Lucas Stach <l.stach@pengutronix.de> #etnaviv
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170202210438.28702-1-chris@chris-wilson.co.uk
      4e64e553
  4. 28 1月, 2017 2 次提交
  5. 19 1月, 2017 1 次提交
  6. 11 1月, 2017 1 次提交
  7. 31 12月, 2016 1 次提交
  8. 19 12月, 2016 1 次提交
  9. 06 12月, 2016 2 次提交
    • C
      drm/i915: Fix i915_gem_evict_for_vma (soft-pinning) · 172ae5b4
      Chris Wilson 提交于
      Soft-pinning depends upon being able to check for availabilty of an
      interval and evict overlapping object from a drm_mm range manager very
      quickly. Currently it uses a linear list, and so performance is dire and
      not suitable as a general replacement. Worse, the current code will oops
      if it tries to evict an active buffer.
      
      It also helps if the routine reports the correct error codes as expected
      by its callers and emits a tracepoint upon use.
      
      For posterity since the wrong patch was pushed (i.e. that missed these
      key points and had known bugs), this is the changelog that should have
      been on commit 506a8e87 ("drm/i915: Add soft-pinning API for
      execbuffer"):
      
      Userspace can pass in an offset that it presumes the object is located
      at. The kernel will then do its utmost to fit the object into that
      location. The assumption is that userspace is handling its own object
      locations (for example along with full-ppgtt) and that the kernel will
      rarely have to make space for the user's requests.
      
      This extends the DRM_IOCTL_I915_GEM_EXECBUFFER2 to do the following:
      * if the user supplies a virtual address via the execobject->offset
        *and* sets the EXEC_OBJECT_PINNED flag in execobject->flags, then
        that object is placed at that offset in the address space selected
        by the context specifier in execbuffer.
      * the location must be aligned to the GTT page size, 4096 bytes
      * as the object is placed exactly as specified, it may be used by this
        execbuffer call without relocations pointing to it
      
      It may fail to do so if:
      * EINVAL is returned if the object does not have a 4096 byte aligned
        address
      * the object conflicts with another pinned object (either pinned by
        hardware in that address space, e.g. scanouts in the aliasing ppgtt)
        or within the same batch.
        EBUSY is returned if the location is pinned by hardware
        EINVAL is returned if the location is already in use by the batch
      * EINVAL is returned if the object conflicts with its own alignment (as meets
        the hardware requirements) or if the placement of the object does not fit
        within the address space
      
      All other execbuffer errors apply.
      
      Presence of this execbuf extension may be queried by passing
      I915_PARAM_HAS_EXEC_SOFTPIN to DRM_IOCTL_I915_GETPARAM and checking for
      a reported value of 1 (or greater).
      
      v2: Combine the hole/adjusted-hole ENOSPC checks
      v3: More color, more splitting, more blurb.
      
      Fixes: 506a8e87 ("drm/i915: Add soft-pinning API for execbuffer")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161205142941.21965-2-chris@chris-wilson.co.uk
      172ae5b4
    • C
      drm/i915: Mark all non-vma being inserted into the address spaces · 85fd4f58
      Chris Wilson 提交于
      We need to distinguish between full i915_vma structs and simple
      drm_mm_nodes when considering eviction (i.e. we must be careful not to
      treat a mere drm_mm_node as a much larger i915_vma causing memory
      corruption, if we are lucky). To do this, color these not-a-vma with -1
      (I915_COLOR_UNEVICTABLE).
      
      v2...v200: New name for -1.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161205142941.21965-1-chris@chris-wilson.co.uk
      85fd4f58
  10. 24 11月, 2016 1 次提交
  11. 21 11月, 2016 1 次提交
  12. 18 11月, 2016 1 次提交
  13. 17 11月, 2016 1 次提交
  14. 11 11月, 2016 3 次提交
  15. 08 11月, 2016 1 次提交
  16. 03 11月, 2016 1 次提交
  17. 29 10月, 2016 5 次提交
  18. 18 10月, 2016 1 次提交
    • C
      drm/i915: Restrict pagefault disabling to just around copy_from_user() · ebc0808f
      Chris Wilson 提交于
      When handling execbuf relocations, we play a delicate dance with
      pagefault. We first try to access the user pages underneath our
      struct_mutex. However, if those pages were inside a GEM object, we may
      trigger a pagefault and deadlock as i915_gem_fault() tries to
      recursively acquire struct_mutex. Instead, we choose to disable
      pagefaulting around the copy_from_user whilst inside the struct_mutex
      and handle the EFAULT by falling back to a copy outside the
      struct_mutex.
      
      We however presumed that disabling pagefaults would be expensive. It is
      just an operation on the local current task. Cheap enough that we can
      restrict the disable/enable to the critical section around the copy, and
      so avoid having to handle the atomic sections within the relocation
      handling itself.
      
      v2: Just illustrate the broken error handling rather than argue why it
      is safer to ignore it, for now.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161018120251.25043-4-chris@chris-wilson.co.uk
      ebc0808f
  19. 14 10月, 2016 3 次提交
  20. 10 10月, 2016 1 次提交
  21. 07 10月, 2016 1 次提交
  22. 04 10月, 2016 1 次提交
  23. 28 9月, 2016 1 次提交
    • A
      get rid of separate multipage fault-in primitives · 4bce9f6e
      Al Viro 提交于
      * the only remaining callers of "short" fault-ins are just as happy with generic
      variants (both in lib/iov_iter.c); switch them to multipage variants, kill the
      "short" ones
      * rename the multipage variants to now available plain ones.
      * get rid of compat macro defining iov_iter_fault_in_multipage_readable by
      expanding it in its only user.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      4bce9f6e
  24. 09 9月, 2016 2 次提交
  25. 01 9月, 2016 1 次提交
  26. 27 8月, 2016 1 次提交
  27. 22 8月, 2016 1 次提交
  28. 20 8月, 2016 1 次提交
  29. 19 8月, 2016 1 次提交
    • C
      drm/i915/cmdparser: Use cached vmappings · 0b537272
      Chris Wilson 提交于
      The single largest factor in the overhead of parsing the commands is the
      setup of the virtual mapping to provide a continuous block for the batch
      buffer. If we keep those vmappings around (against the better judgement
      of mm/vmalloc.c, which we offset by handwaving and looking suggestively
      at the shrinker) we can dramatically improve the performance of the
      parser for small batches (such as media workloads). Furthermore, we can
      use the prepare shmem read/write functions to determine  how best we
      need to clflush the range (rather than every page of the object).
      
      The impact of caching both src/dst vmaps is +80% on ivb and +140% on byt
      for the throughput on small batches. (Caching just the dst vmap and
      iterating over the src, doing a page by page copy is roughly 5% slower
      on both platforms. That may be an acceptable trade-off to eliminate one
      cached vmapping, and we may be able to reduce the per-page copying overhead
      further.) For *this* simple test case, the cmdparser is now within a
      factor of 2 of ideal performance.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.william.auld@gmail.com>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20160818161718.27187-33-chris@chris-wilson.co.uk
      0b537272