1. 19 7月, 2016 2 次提交
  2. 05 7月, 2016 1 次提交
  3. 04 7月, 2016 2 次提交
  4. 22 6月, 2016 1 次提交
  5. 24 5月, 2016 2 次提交
  6. 23 5月, 2016 1 次提交
    • L
      x86: remove pointless uaccess_32.h complexity · 5b09c3ed
      Linus Torvalds 提交于
      I'm looking at trying to possibly merge the 32-bit and 64-bit versions
      of the x86 uaccess.h implementation, but first this needs to be cleaned
      up.
      
      For example, the 32-bit version of "__copy_to_user_inatomic()" is mostly
      the special cases for the constant size, and it's actually never
      relevant.  Every user except for one aren't actually using a constant
      size anyway, and the one user that uses it is better off just using
      __put_user() instead.
      
      So get rid of the unnecessary complexity.
      
      [ The same cleanup should likely happen to __copy_from_user_inatomic()
        as well, but that one has a lot more users that I need to take a look
        at first ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5b09c3ed
  7. 09 5月, 2016 1 次提交
  8. 30 4月, 2016 1 次提交
  9. 28 4月, 2016 1 次提交
  10. 14 4月, 2016 1 次提交
    • C
      drm/i915: Late request cancellations are harmful · aa9b7810
      Chris Wilson 提交于
      Conceptually, each request is a record of a hardware transaction - we
      build up a list of pending commands and then either commit them to
      hardware, or cancel them. However, whilst building up the list of
      pending commands, we may modify state outside of the request and make
      references to the pending request. If we do so and then cancel that
      request, external objects then point to the deleted request leading to
      both graphical and memory corruption.
      
      The easiest example is to consider object/VMA tracking. When we mark an
      object as active in a request, we store a pointer to this, the most
      recent request, in the object. Then we want to free that object, we wait
      for the most recent request to be idle before proceeding (otherwise the
      hardware will write to pages now owned by the system, or we will attempt
      to read from those pages before the hardware is finished writing). If
      the request was cancelled instead, that wait completes immediately. As a
      result, all requests must be committed and not cancelled if the external
      state is unknown.
      
      All that remains of i915_gem_request_cancel() users are just a couple of
      extremely unlikely allocation failures, so remove the API entirely.
      
      A consequence of committing all incomplete requests is that we generate
      excess breadcrumbs and fill the ring much more often with dummy work. We
      have completely undone the outstanding_last_seqno optimisation.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93907Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1460565315-7748-16-git-send-email-chris@chris-wilson.co.uk
      aa9b7810
  11. 12 4月, 2016 1 次提交
  12. 31 3月, 2016 2 次提交
  13. 18 3月, 2016 1 次提交
  14. 16 3月, 2016 5 次提交
  15. 26 2月, 2016 1 次提交
  16. 29 1月, 2016 1 次提交
  17. 28 1月, 2016 1 次提交
  18. 21 1月, 2016 2 次提交
  19. 19 1月, 2016 1 次提交
  20. 13 1月, 2016 1 次提交
  21. 12 1月, 2016 1 次提交
    • V
      drm/i915: Use MI_BATCH_BUFFER_START on 830/845 · 9d611c03
      Ville Syrjälä 提交于
      MI_BATCH_BUFFER is nasty since it requires that userspace pass in the
      correct batch length.
      
      Let's switch to using MI_BATCH_BUFFER_START instead (like we do on
      other platforms). Then we don't have to specify the batch length
      at all, and the CS will instead execute until it sees the
      MI_BATCH_BUFFER_END.
      
      We still need the batch length since we do the CS TLB workaround
      and copy the batch into the permanently pinned scratch object
      and execute it from there. But for this we can simply use the
      batch object length when the user hasn't specified the actual
      batch length. So specifying the batch length becomes just a
      way to optimize the batch copy a little bit.
      
      We lost batch_len from a bunch of igts (including the quiesce batch)
      so without this igt is utterly broken on 830/845. Also some igts such
      as gem_cpu_reloc never specified the batch_len and so didn't work.
      With MI_BATCH_BUFFER_START we don't have to fix up igt every time
      someone forgets that 830/845 exist.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1450110229-30450-11-git-send-email-ville.syrjala@linux.intel.comReviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      9d611c03
  22. 05 1月, 2016 1 次提交
  23. 12 12月, 2015 1 次提交
    • D
      drm/i915: mark GEM object pages dirty when mapped & written by the CPU · 033908ae
      Dave Gordon 提交于
      In various places, a single page of a (regular) GEM object is mapped into
      CPU address space and updated. In each such case, either the page or the
      the object should be marked dirty, to ensure that the modifications are
      not discarded if the object is evicted under memory pressure.
      
      The typical sequence is:
      	va = kmap_atomic(i915_gem_object_get_page(obj, pageno));
      	*(va+offset) = ...
      	kunmap_atomic(va);
      
      Here we introduce i915_gem_object_get_dirty_page(), which performs the
      same operation as i915_gem_object_get_page() but with the side-effect
      of marking the returned page dirty in the pagecache.  This will ensure
      that if the object is subsequently evicted (due to memory pressure),
      the changes are written to backing store rather than discarded.
      
      Note that it works only for regular (shmfs-backed) GEM objects, but (at
      least for now) those are the only ones that are updated in this way --
      the objects in question are contexts and batchbuffers, which are always
      shmfs-backed.
      
      Separate patches deal with the cases where whole objects are (or may
      be) dirtied.
      
      v3: Mark two more pages dirty in the page-boundary-crossing
          cases of the execbuffer relocation code [Chris Wilson]
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449773486-30822-2-git-send-email-david.s.gordon@intel.comReviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      033908ae
  24. 09 12月, 2015 1 次提交
    • C
      drm/i915: Add soft-pinning API for execbuffer · 506a8e87
      Chris Wilson 提交于
      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.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      
      v2: Fixed incorrect eviction found by Michal Winiarski - fix suggested by Chris
      Wilson.  Fixed incorrect error paths causing crash found by Michal Winiarski.
      (Not published externally)
      
      v3: Rebased because of trivial conflict in object_bind_to_vm.  Fixed eviction
      to allow eviction of soft-pinned objects when another soft-pinned object used
      by a subsequent execbuffer overlaps reported by Michal Winiarski.
      (Not published externally)
      
      v4: Moved soft-pinned objects to the front of ordered_vmas so that they are
      pinned first after an address conflict happens to avoid repeated conflicts in
      rare cases (Suggested by Chris Wilson).  Expanded comment on
      drm_i915_gem_exec_object2.offset to cover this new API.
      
      v5: Added I915_PARAM_HAS_EXEC_SOFTPIN parameter for detecting this capability
      (Kristian). Added check for multiple pinnings on eviction (Akash). Made sure
      buffers are not considered misplaced without the user specifying
      EXEC_OBJECT_SUPPORTS_48B_ADDRESS.  User must assume responsibility for any
      addressing workarounds.  Updated object2.offset field comment again to clarify
      NO_RELOC case (Chris).  checkpatch cleanup.
      
      v6: Trivial rebase on latest drm-intel-nightly
      
      v7: Catch attempts to pin above the max virtual address size and return
      EINVAL (Tvrtko). Decouple EXEC_OBJECT_SUPPORTS_48B_ADDRESS and
      EXEC_OBJECT_PINNED flags, user must pass both flags in any attempt to pin
      something at an offset above 4GB (Chris, Daniel Vetter).
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Akash Goel <akash.goel@intel.com>
      Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
      Cc: Michal Winiarski <michal.winiarski@intel.com>
      Cc: Zou Nanhai <nanhai.zou@intel.com>
      Cc: Kristian Høgsberg <hoegsberg@gmail.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Acked-by: PDT
      Signed-off-by: NThomas Daniel <thomas.daniel@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449575707-20933-1-git-send-email-thomas.daniel@intel.com
      506a8e87
  25. 18 11月, 2015 1 次提交
  26. 07 10月, 2015 1 次提交
  27. 02 10月, 2015 1 次提交
    • M
      drm/i915: Wa32bitGeneralStateOffset & Wa32bitInstructionBaseOffset · 101b506a
      Michel Thierry 提交于
      There are some allocations that must be only referenced by 32-bit
      offsets. To limit the chances of having the first 4GB already full,
      objects not requiring this workaround use DRM_MM_SEARCH_BELOW/
      DRM_MM_CREATE_TOP flags
      
      In specific, any resource used with flat/heapless (0x00000000-0xfffff000)
      General State Heap (GSH) or Instruction State Heap (ISH) must be in a
      32-bit range, because the General State Offset and Instruction State
      Offset are limited to 32-bits.
      
      Objects must have EXEC_OBJECT_SUPPORTS_48B_ADDRESS flag to indicate if
      they can be allocated above the 32-bit address range. To limit the
      chances of having the first 4GB already full, objects will use
      DRM_MM_SEARCH_BELOW + DRM_MM_CREATE_TOP flags when possible.
      
      The libdrm user of the EXEC_OBJECT_SUPPORTS_48B_ADDRESS flag is here:
      http://lists.freedesktop.org/archives/intel-gfx/2015-September/075836.html
      
      v2: Changed flag logic from neeeds_32b, to supports_48b.
      v3: Moved 48-bit support flag back to exec_object. (Chris, Daniel)
      v4: Split pin flags into PIN_ZONE_4G and PIN_HIGH; update PIN_OFFSET_MASK
      to use last PIN_ defined instead of hard-coded value; use correct limit
      check in eb_vma_misplaced. (Chris)
      v5: Don't touch PIN_OFFSET_MASK and update workaround comment (Chris)
      v6: Apply pin-high for ggtt too (Chris)
      v7: Handle simultaneous pin-high and pin-mappable end correctly (Akash)
          Fix check for entries currently using +4GB addresses, use min_t and
          other polish in object_bind_to_vm (Chris)
      v8: Commit message updated to point to libdrm patch.
      v9: vmas are allocated in the correct ozone, so only check flag when the
          vma has not been allocated. (Chris)
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v4)
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      101b506a
  28. 14 9月, 2015 1 次提交
    • N
      drm/i915: Split alloc from init for lrc · e84fe803
      Nick Hoath 提交于
      Extend init/init_hw split to context init.
         - Move context initialisation in to i915_gem_init_hw
         - Move one off initialisation for render ring to
              i915_gem_validate_context
         - Move default context initialisation to logical_ring_init
      
      Rename intel_lr_context_deferred_create to
      intel_lr_context_deferred_alloc, to reflect reduced functionality &
      alloc/init split.
      
      This patch is intended to split out the allocation of resources &
      initialisation to allow easier reuse of code for resume/gpu reset.
      
      v2: Removed function ptr wrapping of do_switch_context (Daniel Vetter)
          Left ->init_context int intel_lr_context_deferred_alloc
          (Daniel Vetter)
          Remove unnecessary init flag & ring type test. (Daniel Vetter)
          Improve commit message (Daniel Vetter)
      v3: On init/reinit, set the hw next sequence number to the sw next
          sequence number. This is set to 1 at driver load time. This prevents
          the seqno being reset on reinit (Chris Wilson)
      v4: Set seqno back to ~0 - 0x1000 at start-of-day, and increment by 0x100
          on reset.
          This makes it obvious which bbs are which after a reset. (David Gordon
          & John Harrison)
          Rebase.
      v5: Rebase. Fixed rebase breakage. Put context pinning in separate
          function. Removed code churn. (Thomas Daniel)
      v6: Cleanup up issues introduced in v2 & v5 (Thomas Daniel)
      
      Issue: VIZ-4798
      Signed-off-by: NNick Hoath <nicholas.hoath@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: John Harrison <john.c.harrison@intel.com>
      Cc: David Gordon <david.s.gordon@intel.com>
      Cc: Thomas Daniel <thomas.daniel@intel.com>
      Reviewed-by: NThomas Daniel <thomas.daniel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e84fe803
  29. 02 9月, 2015 1 次提交
    • C
      drm/i915: Always mark the object as dirty when used by the GPU · 51bc1404
      Chris Wilson 提交于
      There have been many hard to track down bugs whereby userspace forgot to
      flag a write buffer and then cause graphics corruption or a hung GPU
      when that buffer was later purged under memory pressure (as the buffer
      appeared clean, its pages would have been evicted rather than preserved
      and any changes more recent than in the backing storage would be lost).
      In retrospect this is a rare optimisation against memory pressure,
      already the slow path. If we always mark the buffer as dirty when
      accessed by the GPU, anything not used can still be evicted cheaply
      (ideal behaviour for mark-and-sweep eviction) but we do not run the risk
      of corruption. For correct read serialisation, userspace still has to
      notify when the GPU writes to an object. However, there are certain
      situations under which userspace may wish to tell white lies to the
      kernel...
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Kristian Høgsberg <krh@bitplanet.net>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: "Goel, Akash" <akash.goel@intel.co>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      51bc1404
  30. 06 7月, 2015 1 次提交
    • A
      drm/i915: Expose I915_EXEC_RESOURCE_STREAMER flag and getparam · a9ed33ca
      Abdiel Janulgue 提交于
      Ensures that the batch buffer is executed by the resource streamer.
      And will let userspace know whether Resource Streamer is supported in
      the kernel.
      
      v2: Don't skip 1<<15 for the exec flags (Jani Nikula)
      v3: Use HAS_RESOURCE_STREAMER macro for execbuf validation (Chris Wilson)
      
      (from getparam patch)
      
      v2: Update I915_PARAM_HAS_RESOURCE_STREAMER so it's after
          I915_PARAM_HAS_GPU_RESET.
      v3: Only advertise RS support for hardware that supports it.
      v4: Add HAS_RESOURCE_STREAMER() macro (Chris)
      
      Testcase: igt/gem_exec_params
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Kenneth Graunke <kenneth@whitecape.org>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NAbdiel Janulgue <abdiel.janulgue@linux.intel.com>
      [danvet: squash in getparam patch since it'd break bisect, suggested
      by Chris.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a9ed33ca
  31. 23 6月, 2015 1 次提交
    • J
      drm/i915: Move the request/file and request/pid association to creation time · fcfa423c
      John Harrison 提交于
      In _i915_add_request(), the request is associated with a userland client.
      Specifically it is linked to the 'file' structure and the current user process
      is recorded. One problem here is that the current user process is not
      necessarily the same as when the request was submitted to the driver. This is
      especially true when the GPU scheduler arrives and decouples driver submission
      from hardware submission. Note also that it is only in the case where the add
      request comes from an execbuff call that there is a client to associate. Any
      other add request call is kernel only so does not need to do it.
      
      This patch moves the client association into a separate function. This is then
      called from the execbuffer code path itself at a sensible time. It also removes
      the now redundant 'file' pointer from the add request parameter list.
      
      An extra cleanup of the client association is also added to the request clean up
      code for the eventuality where the request is killed after association but
      before being submitted (e.g. due to out of memory error somewhere). Once the
      submission has happened, the request is on the request list and the regular
      request list removal will clear the association. Note that this still needs to
      happen at this point in time because the request might be kept floating around
      much longer (due to someone holding a reference count) and the client should not
      be worrying about this request after it has been retired.
      
      For: VIZ-5115
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Reviewed-by: NTomas Elf <tomas.elf@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fcfa423c