1. 18 3月, 2014 1 次提交
    • D
      drm/i915: Fix up the forcewake timer initialization · 05efeebd
      Daniel Vetter 提交于
      This is a regression introduced in
      
      commit 0294ae7b
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Thu Mar 13 12:00:29 2014 +0000
      
          drm/i915: Consolidate forcewake resetting to a single function
      
      The reordered setup sequence ended up calling del_timer_sync before
      the timer was set up correctly, resulting in endless hilarity when
      loading the driver.
      
      Compared to Ben's patch (which moved around the setup_timer call to
      sanitize_early) this moves the sanitize_early call around in the
      driver load call. This way we avoid calling setup_timer again in the
      resume code (where we also call sanitize_early).
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Tested-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76242Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      05efeebd
  2. 14 3月, 2014 1 次提交
  3. 13 3月, 2014 1 次提交
  4. 08 3月, 2014 1 次提交
  5. 06 3月, 2014 12 次提交
  6. 22 1月, 2014 1 次提交
  7. 18 12月, 2013 1 次提交
    • B
      drm/i915: Get context early in execbuf · 41bde553
      Ben Widawsky 提交于
      We need to have the address space when reserving space for the objects.
      Since the address space and context are tied together, and reserve
      occurs before context switch (for good reason), we must lookup our
      context earlier in the process.
      
      This leaves some room for optimizations where we no longer need to use
      ctx_id in certain places. This will be addressed in a subsequent patch.
      
      Important tricky bit:
      Because slow relocations during execbuffer drop struct_mutex
      
      Perhaps it would be best to acquire the reference when we get the
      context, but I'll save that for another day (note I have written the
      patch before, and I found the changes required to be uglier than this).
      
      Note that since we currently access everything via context id, and not
      the data structure this is fine, though not desirable. The next change
      attempts to get the context only once via the context ID idr lookup, and
      as such, the following can happen:
      
      CTX-A is created, refcount = 1
      CTX-A execbuf, mutex dropped
      close IOCTL called on CTX-A, refcount = 0
      CTX-A resumes in execbuf.
      
      v2: Rebased on top of
      commit b6359918
      Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Date:   Wed Oct 30 15:44:16 2013 +0200
      
          drm/i915: add i915_get_reset_stats_ioctl
      
      v3: Rebased on top of
      commit 25b3dfc8
      Author: Mika Westerberg <mika.westerberg@linux.intel.com>
      Date:   Tue Nov 12 11:57:30 2013 +0200
      
      Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Date:   Tue Nov 26 16:14:33 2013 +0200
      
          drm/i915: check context reset stats before relocations
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      41bde553
  8. 14 12月, 2013 1 次提交
  9. 13 12月, 2013 1 次提交
  10. 11 12月, 2013 2 次提交
    • P
      drm/i915: add some runtime PM get/put calls · c8c8fb33
      Paulo Zanoni 提交于
      These are needed when we cat the debugfs and sysfs files.
      
      V2: - Rebase
      V3: - Rebase
      V4: - Rebase
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c8c8fb33
    • P
      drm/i915: add initial Runtime PM functions · 8a187455
      Paulo Zanoni 提交于
      This patch adds the initial infrastructure to allow a Runtime PM
      implementation that sets the device to its D3 state. The patch just
      adds the necessary callbacks and the initial infrastructure.
      
      We still don't have any platform that actually uses this
      infrastructure, we still don't call get/put in all the places we need
      to, and we don't have any function to save/restore the state of the
      registers. This is not a problem since no platform uses the code added
      by this patch. We have a few people simultaneously working on runtime
      PM, so this initial code could help everybody make their plans.
      
      V2: - Move some functions to intel_pm.c
          - Remove useless pm_runtime_allow() call at init
          - Remove useless pm_runtime_mark_last_busy() call at get
          - Use pm_runtime_get_sync() instead of 2 calls
          - Add a WARN to check if we're really awake
      
      V3: - Rebase.
      
      V4: - Don't need to call pci_{save,restore}_state and
            pci_set_power_sate, since they're already called by the PCI
            layer
          - Remove wrong pm_runtime_enable() call at init_runtime_pm
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8a187455
  11. 09 12月, 2013 1 次提交
    • D
      drm/i915: Remove duplicate intel_uncore_forcewake_reset. · c461562e
      Deepak S 提交于
      Since early sanitize and uncore sanitize are called one after the other,
      I think, we can remove second forcewake reset which was are calling
      twice in both the functions.
      
      Note that this is merge fallout between
      
      commit ef46e0d2
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Sat Nov 16 16:00:09 2013 +0100
      
          drm/i915: restore the early forcewake cleanup
      
      and
      
      commit 521198a2
      Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Date:   Fri Aug 23 16:52:30 2013 +0300
      
          drm/i915: sanitize forcewake registers on reset
      Signed-off-by: NDeepak S <deepak.s@intel.com>
      [danvet: Explain how this came to be.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c461562e
  12. 04 12月, 2013 2 次提交
    • D
      drm/i915/vlv: Update Wait for FIFO and wait for 20 free entries. v3 · 5135d64b
      Deepak S 提交于
      On VLV, FIFO will be shared by both SW and HW. So, we read the
      free entries through register and update dev_priv variable
      and wait for only 20 entries to be free
      
      From Deepak's follow-up mail explaining why vlv is special:
      
      "On SB, Out of 64 FIFO Entries, 20 Entries will be used by HW and
      remaining 44 will be used by the SW,. I think due to this reason, we
      have a threshold of 20 Entries."
      
      "On VLV, HW and SW can access all 64 fifo entries, I don't think
      having a threshold of 20 Entries is mandatory on VLV. Also, since both
      SW and HW can access all 64 Entries. I think on VLV, we need to update
      the fifo_count before waiting for the FIFO."
      
      v2: Apply mask when we read the number of free FIFO entries (Ville).
      
      v3: Mask applied after reading the register (Deepak).
      Signed-off-by: NDeepak S <deepak.s@intel.com>
      [danvet: Add further explanation from Deepak to commit message.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5135d64b
    • V
      drm/i915: Add REG_WRITE_FOOTER · 0d965301
      Ville Syrjälä 提交于
      Add a REG_WRITE_FOOTER macro as a counterpart to the REG_WRITE_HEADER.
      The current code has the spin_lock() in the HEADER, but the
      spin_unlock() is open coded, which looks rather confusing on the first
      glance. A bit of additional symmetry might help.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0d965301
  13. 28 11月, 2013 6 次提交
  14. 19 11月, 2013 1 次提交
  15. 18 11月, 2013 1 次提交
    • D
      drm/i915: restore the early forcewake cleanup · ef46e0d2
      Daniel Vetter 提交于
      Some BIOS just leak the forcewak bits, which we clean up.
      Unfortunately this has been broken in
      
      commit 521198a2
      Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Date:   Fri Aug 23 16:52:30 2013 +0300
      
          drm/i915: sanitize forcewake registers on reset
      
      To make this work both for resets and for BIOS takeover just add the
      forcewake clearing call back to intel_uncore_early_sanitize.
      
      We need to clear the forcewake in early sanitize so that the forcewak
      dance in intel_uncore_init (to figure out whether we have mt or legacy
      forcewake on ivb) works. That cleanup fits in nicely with the general
      topic of early_sanitize to prepare for the very first mmio ops.
      
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reported-by: NJörg Otte <jrg.otte@gmail.com>
      Cc: Jörg Otte <jrg.otte@gmail.com>
      References: https://lkml.org/lkml/2013/11/16/40
      Cc: stable@vger.kernel.org (for 3.12 only)
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ef46e0d2
  16. 14 11月, 2013 1 次提交
  17. 13 11月, 2013 1 次提交
  18. 12 11月, 2013 1 次提交
    • M
      drm/i915: add i915_get_reset_stats_ioctl · b6359918
      Mika Kuoppala 提交于
      This ioctl returns reset stats for specified context.
      
      The struct returned contains context loss counters.
      
      reset_count:    all resets across all contexts
      batch_active:   active batches lost on resets
      batch_pending:  pending batches lost on resets
      
      v2: get rid of state tracking completely and deliver only counts. Idea
          from Chris Wilson.
      
      v3: fix commit message
      
      v4: default context handled inside i915_gem_context_get_hang_stats
      
      v5: reset_count only for priviledged process
      
      v6: ctx=0 needs CAP_SYS_ADMIN for batch_* counters (Chris Wilson)
      
      v7: context hang stats never returns NULL
      
      v8: rebased on top of reworked context hang stats
          DRM_RENDER_ALLOW for ioctl
      
      v9: use DEFAULT_CONTEXT_ID. Improve comments for ioctl struct members
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Cc: Ian Romanick <idr@freedesktop.org>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: NIan Romanick <ian.d.romanick@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b6359918
  19. 09 11月, 2013 2 次提交
  20. 08 11月, 2013 1 次提交
    • B
      drm/i915/bdw: Handle forcewake for writes on gen8 · ab2aa47e
      Ben Widawsky 提交于
      GEN8 removes the GT FIFO which we've all come to know and love. Instead
      it offers a wider range of optimized registers which always keep a
      shadowed copy, and are fed to the GPU when it wakes.
      
      How this is implemented in hardware is still somewhat of a mystery. As
      far as I can tell, the basic design is as follows:
      
      If the register is not optimized, you must use the old forcewake
      mechanism to bring the GT out of sleep. [1]
      
      If register is in the optimized list the write will signal that the
      GT should begin to come out of whatever sleep state it is in.
      
      While the GT is coming out of sleep, the requested write will be stored
      in an intermediate shadow register.
      
      Do to the fact that the implementation details are not clear, I see
      several risks:
      1. Order is not preserved as it is with GT FIFO. If we issue multiple
      writes to optimized registers, where order matters, we may need to
      serialize it with forcewake.
      2. The optimized registers have only 1 shadowed slot, meaning if we
      issue multiple writes to the same register, and those values need to
      reach the GPU in order, forcewake will be required.
      
      [1] We could implement a SW queue the way the GT FIFO used to work if
      desired.
      
      NOTE: Compile tested only until we get real silicon.
      
      v2:
      - Use a default case to make future platforms also work.
      - Get rid of IS_BROADWELL since that's not yet defined, but we want to
        MMIO as soon as possible.
      
      v3: Apply suggestions from Mika's review:
      - s/optimized/shadowed/
      - invert the logic of the helper so that it does what it says (the
        code itself was correct, just confusing to read).
      
      v4:
      - Squash in lost break.
      
      Signed-off-by: Ben Widawsky <ben@bwidawsk.net> (v1)
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ab2aa47e
  21. 10 10月, 2013 1 次提交