1. 27 1月, 2015 4 次提交
  2. 15 1月, 2015 1 次提交
  3. 16 12月, 2014 1 次提交
    • B
      drm/i915: Implement a framework for batch buffer pools · 493018dc
      Brad Volkin 提交于
      This adds a small module for managing a pool of batch buffers.
      The only current use case is for the command parser, as described
      in the kerneldoc in the patch. The code is simple, but separating
      it out makes it easier to change the underlying algorithms and to
      extend to future use cases should they arise.
      
      The interface is simple: init to create an empty pool, fini to
      clean it up, get to obtain a new buffer. Note that all buffers are
      expected to be inactive before cleaning up the pool.
      
      Locking is currently based on the caller holding the struct_mutex.
      We already do that in the places where we will use the batch pool
      for the command parser.
      
      v2:
      - s/BUG_ON/WARN_ON/ for locking assertions
      - Remove the cap on pool size
      - Switch from alloc/free to init/fini
      
      v3:
      - Idiomatic looping structure in _fini
      - Correct handling of purged objects
      - Don't return a buffer that's too much larger than needed
      
      v4:
      - Rebased to latest -nightly
      
      v5:
      - Remove _put() function and clean up comments to match
      
      v6:
      - Move purged check inside the loop (danvet, from v4 1/7 feedback)
      
      v7:
      - Use single list instead of two. (Chris W)
      - s/active_list/cache_list
      - Squashed in debug patches (Chris W)
        drm/i915: Add a batch pool debugfs file
      
        It provides some useful information about the buffers in
        the global command parser batch pool.
      
        v2: rebase on global pool instead of per-ring pools
        v3: rebase
      
        drm/i915: Add batch pool details to i915_gem_objects debugfs
      
        To better account for the potentially large memory consumption
        of the batch pool.
      
      v8:
      - Keep cache in LRU order (danvet, from v6 1/5 feedback)
      
      Issue: VIZ-4719
      Signed-off-by: NBrad Volkin <bradley.d.volkin@intel.com>
      Reviewed-By: NJon Bloomfield <jon.bloomfield@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      493018dc
  4. 15 12月, 2014 2 次提交
    • T
      drm/i915: Infrastructure for supporting different GGTT views per object · fe14d5f4
      Tvrtko Ursulin 提交于
      Things like reliable GGTT mappings and mirrored 2d-on-3d display will need
      to map objects into the same address space multiple times.
      
      Added a GGTT view concept and linked it with the VMA to distinguish between
      multiple instances per address space.
      
      New objects and GEM functions which do not take this new view as a parameter
      assume the default of zero (I915_GGTT_VIEW_NORMAL) which preserves the
      previous behaviour.
      
      This now means that objects can have multiple VMA entries so the code which
      assumed there will only be one also had to be modified.
      
      Alternative GGTT views are supposed to borrow DMA addresses from obj->pages
      which is DMA mapped on first VMA instantiation and unmapped on the last one
      going away.
      
      v2:
          * Removed per view special casing in i915_gem_ggtt_prepare /
            finish_object in favour of creating and destroying DMA mappings
            on first VMA instantiation and last VMA destruction. (Daniel Vetter)
          * Simplified i915_vma_unbind which does not need to count the GGTT views.
            (Daniel Vetter)
          * Also moved obj->map_and_fenceable reset under the same check.
          * Checkpatch cleanups.
      
      v3:
          * Only retire objects once the last VMA is unbound.
      
      v4:
          * Keep scatter-gather table for alternative views persistent for the
            lifetime of the VMA.
          * Propagate binding errors to callers and handle appropriately.
      
      v5:
          * Explicitly look for normal GGTT view in i915_gem_obj_bound to align
            usage in i915_gem_object_ggtt_unpin. (Michel Thierry)
          * Change to single if statement in i915_gem_obj_to_ggtt. (Michel Thierry)
          * Removed stray semi-colon in i915_gem_object_set_cache_level.
      
      For: VIZ-4544
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      [danvet: Drop hunk from i915_gem_shrink since it's just prettification
      but upsets a __must_check warning.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fe14d5f4
    • D
      drm/i915: Use BUILD_BUG if possible in the i915 WARN_ON · 5f77eeb0
      Daniel Vetter 提交于
      Faster feedback to errors is always better. This is inspired by the
      addition to WARN_ONs to mask/enable helpers for registers to make sure
      callers have the arguments ordered correctly: Pretty much always the
      arguments are static.
      
      We use WARN_ON(1) a lot in default switch statements though where we
      should always handle all cases. So add a new macro specifically for
      that.
      
      The idea to use __builtin_constant_p is from Chris Wilson.
      
      v2: Use the ({}) gcc-ism to avoid the static inline, suggested by
      Dave. My first attempt used __cond as the temp var, which is the same
      used by BUILD_BUG_ON, but with inverted sense. Hilarity ensued, so
      sprinkle i915 into the name.
      
      Also use a temporary variable to only evaluate the condition once,
      suggested by Damien.
      
      v3: It's crazy but apparently 32bit gcc can't compile out the
      BUILD_BUG_ON in a lot of cases and just falls over. I have no idea
      why, but until clue grows just disable this nifty idea on 32bit
      builds. Reported by 0-day builder.
      
      v4: Got it all wrong, apparently its the gcc version. We need 4.9+.
      Now reported by Imre.
      
      v5: Chris suggested to add the case to MISSING_CASE for speedier
      debug.
      
      v6: Even some gcc 4.9 versions don't see through the maze, so give up
      for now. Keep the skeleton and MISSING_CASE stuff though.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Damien Lespiau <damien.lespiau@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Dave Gordon <david.s.gordon@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      5f77eeb0
  5. 11 12月, 2014 6 次提交
  6. 04 12月, 2014 1 次提交
  7. 03 12月, 2014 8 次提交
  8. 02 12月, 2014 1 次提交
    • T
      drm/i915: Don't pin LRC in GGTT when dumping in debugfs · 064ca1d2
      Thomas Daniel 提交于
      LRC object does not need to be mapped into the GGTT when dumping. A side-effect
      of this patch is that a compiler warning goes away (not checking return value
      of i915_gem_obj_ggtt_pin).
      
      v2: Broke out individual context dumping into a new function as the indentation
      was getting a bit crazy.  Added notification of contexts with no gem object for
      debugging purposes.  Removed unnecessary pin_pages and unpin_pages, replaced
      with explicit get_pages for the context object as there may be no backing store
      allocated at this time (Comment for get_pages says "Ensure that the associated
      pages are gathered from the backing storage and pinned into our object").
      Improved error checking - get_pages and get_page are checked for failure.
      Signed-off-by: NThomas Daniel <thomas.daniel@intel.com>
      [danvet: Align paramter continuation lines properly. Also add some
      braces to the nested loops again for readability.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      064ca1d2
  9. 20 11月, 2014 3 次提交
    • V
      drm/i915: Read power well status before other registers for drpc info · 6b312cd3
      Ville Syrjälä 提交于
      Trying to read the status of the power wells right after taking forcewake
      for the other register reads makes little sense. Most of the time the
      power wells will still be up due to the recent forcewake. Instead do the
      power well status read first, and only then read the register needing
      forcewake. This way the reported power well status can actually reflect
      what's going on in the system.
      
      Cc: Deepak S <deepak.s@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NDeepak S <deepak.s@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6b312cd3
    • D
      drm/i915: Pin tiled objects for L-shaped configs · 656bfa3a
      Daniel Vetter 提交于
      Let's just throw in the towel on this one and take the cheap way out.
      
      Based on a patch from Chris Wilson, but checking for a different bit.
      Chris' patch checked for even bank layout, this one here for a magic
      bit. Given the evidence we've gathered (not much) both work I think,
      but checking for the magic bit might be more accurate.
      
      Anyway, works on my gm45 here.
      
      For paranoi restrict to gen4 (and mobile), since we've only ever seen
      this on gm45 and i965gm.
      
      Also add some debugfs output so that we can skip the tiled swapping
      tests properly in these cases.
      
      v2: Clean up the quirk'ed pin count in free_object to avoid upsetting
      the WARN_ON. Spotted by Chris.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28813
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45092Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      656bfa3a
    • O
      drm/i915/bdw: Pin the context backing objects to GGTT on-demand · dcb4c12a
      Oscar Mateo 提交于
      Up until now, we have pinned every logical ring context backing object
      during creation, and left it pinned until destruction. This made my life
      easier, but it's a harmful thing to do, because we cause fragmentation
      of the GGTT (and, eventually, we would run out of space).
      
      This patch makes the pinning on-demand: the backing objects of the two
      contexts that are written to the ELSP are pinned right before submission
      and unpinned once the hardware is done with them. The only context that
      is still pinned regardless is the global default one, so that the HWS can
      still be accessed in the same way (ring->status_page).
      
      v2: In the early version of this patch, we were pinning the context as
      we put it into the ELSP: on the one hand, this is very efficient because
      only a maximum two contexts are pinned at any given time, but on the other
      hand, we cannot really pin in interrupt time :(
      
      v3: Use a mutex rather than atomic_t to protect pin count to avoid races.
      Do not unpin default context in free_request.
      
      v4: Break out pin and unpin into functions.  Fix style problems reported
      by checkpatch
      
      v5: Remove unpin_lock as all pinning and unpinning is done with the struct
      mutex already locked.  Add WARN_ONs to make sure this is the case in future.
      
      Issue: VIZ-4277
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Signed-off-by: NThomas Daniel <thomas.daniel@intel.com>
      Reviewed-by: NAkash Goel <akash.goels@gmail.com>
      Reviewed-by: Deepak S<deepak.s@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      dcb4c12a
  10. 08 11月, 2014 4 次提交
  11. 05 11月, 2014 1 次提交
    • P
      drm/i915: transform INTEL_OUTPUT_* into an enum · 6847d71b
      Paulo Zanoni 提交于
      Because I got annoyed that I had to document what values "int
      ddi_personality" is supposed to hold.
      
      A good side-effect of this change is that now the compilers can do
      some additional checks on our code, which may prevent some bugs in the
      future. A bad side-effect of this change is that now the compilers do
      some additional checks on our code and complain when a switch
      statement doesn't check for all possible values, so we need to add
      "default" cases to all those switches. Hopefully, this may help
      preventing confusions against DRM_MODE_CONNECTOR_* and
      DRM_MODE_ENCODER_*.
      
      I guess that just by looking at the patch, some people will think this
      change is not worth its benefits. In this case, I don't really mind
      dropping the patch.
      
      Also, there's probably still a few more places where we can
      s/int/enum intel_output_type/, but we can change that later, when we
      spot the places.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Resolve conflict due to reordered patches.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6847d71b
  12. 04 11月, 2014 1 次提交
  13. 24 10月, 2014 4 次提交
  14. 01 10月, 2014 1 次提交
  15. 24 9月, 2014 1 次提交
  16. 19 9月, 2014 1 次提交
    • D
      drm/i915: Clarify event_lock locking, process context · 5e2d7afc
      Daniel Vetter 提交于
      It's good practice to use the more specific versions for irq save
      spinlocks both as executable documentation and to enforce saner
      design. The _irqsave version really should only be used if the calling
      context is unknown and there's a good reason to call a function from
      all kinds of places.
      
      This is the first step whice replaces all occurances of _irqsave in
      process context with the simpler irq disable/enable variants. We don't
      have any funky spinlock nesting going on, especially since the
      event_lock is the outermost of the irq/vblank related spinlocks.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5e2d7afc