1. 06 3月, 2014 14 次提交
    • M
      drm/i915: Add suspend count to error state · 62d5d69b
      Mika Kuoppala 提交于
      For example if we get bug reports with similar error states and
      suspend count is always 1, that might lead the Sherlocks to
      right general direction.
      Suggested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      62d5d69b
    • M
      drm/i915: Add reset count to error state · 48b031e3
      Mika Kuoppala 提交于
      By default we keep only the error state from first hang. However
      some sneaky user might have cleared the first error state and we
      assume mistakenly that it is from first hang. As sometimes this
      matters, it is better to explicitly store the reset count.
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      48b031e3
    • M
      drm/i915: Add reason for capture in error state · 58174462
      Mika Kuoppala 提交于
      We capture error state not only when the GPU hangs but also on
      other situations as in interrupt errors and in situations where
      we can kick things forward without GPU reset. There will be log
      entry on most of these cases. But as error state capture might be
      only thing we have, if dmesg was not captured. Or as in GEN4 case,
      interrupt error can trigger error state capture without log entry,
      the exact reason why capture was made is hard to decipher.
      
      v2: Split out the the error code stuff to separate patch (Ben)
      
      References: https://bugs.freedesktop.org/show_bug.cgi?id=74193Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      58174462
    • M
      drm/i915: Add error code into error state · cb383002
      Mika Kuoppala 提交于
      commit 011cf577
      Author: Ben Widawsky <benjamin.widawsky@intel.com>
      Date:   Tue Feb 4 12:18:55 2014 +0000
      
          drm/i915: Generate a hang error code
      
      added error code debug into dmesg. Store this also
      with error state to make matching dmesg logs and error
      states easier.
      
      As we need to have full ring state for error code generation,
      do full capture always, print hang message into log and then
      decide if we need to keep the error state.
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cb383002
    • C
      drm/i915: Record pid/comm of hanging task · ab0e7ff9
      Chris Wilson 提交于
      After finding the guilty batch and request, we can use it to find the
      process that submitted the batch and then add the culprit into the error
      state.
      
      This is a slightly different approach from Ben's in that instead of
      adding the extra information into the struct i915_hw_context, we use the
      information already captured in struct drm_file which is then referenced
      from the request.
      
      v2: Also capture the workaround buffer for gen2, so that we can compare
          its contents against the intended batch for the active request.
      
      v3: Rebase (Mika)
      v4: Check for null context (Chris)
          checkpatch warnings fixed
      
      Link: http://lists.freedesktop.org/archives/intel-gfx/2013-August/032280.html
      Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v2)
      Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> (v4)
      Acked-by: NBen Widawsky <ben@bwidawsk.net>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ab0e7ff9
    • C
      drm/i915: Rely on accurate request tracking for finding hung batches · 8d9fc7fd
      Chris Wilson 提交于
      In the past, it was possible to have multiple batches per request due to
      a stray signal or ENOMEM. As a result we had to scan each active object
      (filtered by those having the COMMAND domain) for the one that contained
      the ACTHD pointer. This was then made more complicated by the
      introduction of ppgtt, whereby ACTHD then pointed into the address space
      of the context and so also needed to be taken into account.
      
      This is a fairly robust approach (though the implementation is a little
      fragile and depends upon the per-generation setup, registers and
      parameters). However, due to the requirements for hangstats, we needed a
      robust method for associating batches with a particular request and
      having that we can rely upon it for finding the associated batch object
      for error capture.
      
      If the batch buffer tracking is not robust enough, that should become
      apparent quite quickly through an erroneous error capture. That should
      also help to make sure that the runtime reporting to userspace is
      robust. It also means that we then report the oldest incomplete batch on
      each ring, which can be useful for determining the state of userspace at
      the time of a hang.
      
      v2: Use i915_gem_find_active_request (Mika)
      
      v3: remove check for ring->get_seqno, split long lines (Ben)
      
      v4: check that context is available (Chris)
          checkpatch warnings fixed
      
      Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
      Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> (v3)
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Reviewed-by: Ben Widawsky <ben@bwidawsk.net> (v3)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8d9fc7fd
    • P
      e998c40f
    • P
      drm/i915: kill dev_priv->pc8.gpu_idle · 86c4ec0d
      Paulo Zanoni 提交于
      Since the addition of dev_priv->mm.busy, there's no more need for
      dev_priv->pc8.gpu_idle, so kill it.
      
      Notice that when you remove gpu_idle, hsw_package_c8_gpu_idle and
      hsw_package_c8_gpu_busy become identical to hsw_enable_package_c8 and
      hsw_disable_package_c8, so just use them.
      
      Also, when we boot the machine, dev_priv->mm.busy initially considers
      the machine as idle. This is opposed to dev_priv->pc8.gpu_idle, which
      considered it busy. So dev_priv->pc8.disable_count has to be
      initalized to 1 now.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      86c4ec0d
    • C
      drm/i915: Convert the forcewake worker into a timer func · 8232644c
      Chris Wilson 提交于
      We don't want to suffer scheduling delay when turning off the GPU after
      waking it up to touch registers. Ideally, we only want to keep the GPU
      awake for the register access sequence, with a single forcewake dance on
      the first access and release immediately after the last. We set a timer
      on the first access so that we only dance once and on the next scheduler
      tick, we drop the forcewake again.
      
      This moves the cleanup routine from the common i915 workqueue to a timer
      func so that we don't anger powertop, and drop the forcewake again
      quicker.
      
      v2: Enable the deferred force_wake_put for regular register reads as
          well.
      v3: Beautification and make sure we disable forcewake when shutting
          down.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8232644c
    • C
      drm/i915: Accurately track when we mark the hardware as idle/busy · f62a0076
      Chris Wilson 提交于
      We currently call intel_mark_idle() too often, as we do so as a
      side-effect of processing the request queue. However, we the calls to
      intel_mark_idle() are expected to be paired with a call to
      intel_mark_busy() (or else we try to idle the hardware by accessing
      registers that are already disabled). Make the idle/busy tracking
      explicit to prevent the multiple calls.
      
      v2: We can drop some of the complexity in __i915_add_request() as
      queue_delayed_work() already behaves as we want (not requeuing the item
      if it is already in the queue) and mark_busy/mark_idle imply that the
      idle task is inactive.
      
      v3: We do still need to cancel the pending idle task so that it is sent
      again after the current busy load completes (not in the middle of it).
      Reported-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Tested-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f62a0076
    • I
      drm/i915: use power domain api to check vga power state · 04098753
      Imre Deak 提交于
      This way we can reuse the check on other platforms too. Also factor out
      a version of the function that doesn't check if the power is on, we'll
      need to call this from within the power domain framework.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      04098753
    • I
      drm/i915: use drm_i915_private everywhere in the power domain api · da7e29bd
      Imre Deak 提交于
      The power domains framework is internal to the i915 driver, so pass
      drm_i915_private instead of drm_device to its functions.
      
      Also remove a dangling intel_set_power_well() declaration.
      
      No functional change.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      da7e29bd
    • B
      drm/i915/bdw: Kill ppgtt->num_pt_pages · 5abbcca3
      Ben Widawsky 提交于
      With the original PPGTT implementation if the number of PDPs was not a
      power of two, the number of pages for the page tables would end up being
      rounded up. The code actually had a bug here afaict, but this is a
      theoretical bug as I don't believe this can actually occur with the
      current code/HW..
      
      With the rework of the page table allocations, there is no longer a
      distinction between number of page table pages, and number of page
      directory entries. To avoid confusion, kill the redundant (and newer)
      struct member.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5abbcca3
    • B
      drm/i915/bdw: Reorganize PT allocations · 7ad47cf2
      Ben Widawsky 提交于
      The previous allocation mechanism would get 2 contiguous allocations,
      one for the page directories, and one for the page tables. As each page
      table is 1 page, and there are 512 of these per page directory, this
      goes to 2MB. An unfriendly request at best. Worse still, our HW now
      supports 4 page directories, and a 2MB allocation is not allowed.
      
      In order to fix this, this patch attempts to split up each page table
      allocation into a single, discrete allocation. There is nothing really
      fancy about the patch itself, it just has to manage an extra pointer
      indirection, and have a fancier bit of logic to free up the pages.
      
      To accommodate some of the added complexity, two new helpers are
      introduced to allocate, and free the page table pages.
      
      NOTE: I really wanted to split the way we do allocations, and the way in
      which we identify the page table/page directory being used. I found
      splitting this functionality up to be too unwieldy. I apologize in
      advance to the reviewer. I'd recommend looking at the result, rather
      than the diff.
      
      v2/NOTE2: This patch predated commit:
      6f1cc993
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Tue Dec 31 15:50:31 2013 +0000
      
          drm/i915: Avoid dereference past end of page arr
      
      It fixed the same issue as that patch, but because of the limbo state of
      PPGTT, Chris patch was merged instead. The excess churn is a result of
      my using my original patch, which has my preferred naming. Primarily
      act_* is changed to which_*, but it's mostly the same otherwise. I've
      kept the convention Chris used for the pte wrap (I had something
      slightly different, and broken - but fixable)
      
      v3: Rename which_p[..]e to drop which_ (Chris)
      Remove BUG_ON in inner loop (Chris)
      Redo the pde/pdpe wrap logic (Chris)
      
      v4: s/1MB/2MB in commit message (Imre)
      Plug leaking gen8_pt_pages in both the error path, as well as general
      free case (Imre)
      
      v5: Rename leftover "which_" variables (Imre)
      Add the pde = 0 wrap that was missed from v3 (Imre)
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: Squash in fixup from Ben.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7ad47cf2
  2. 04 3月, 2014 2 次提交
    • B
      drm/i915: Make clear/insert vfuncs args absolute · 782f1495
      Ben Widawsky 提交于
      This patch converts insert_entries and clear_range, both functions which
      are specific to the VM. These functions tend to encapsulate the gen
      specific PTE writes. Passing absolute addresses to the insert_entries,
      and clear_range will help make the logic clearer within the functions as
      to what's going on. Currently, all callers simply do the appropriate
      page shift, which IMO, ends up looking weird with an upcoming change for
      the gen8 page table allocations.
      
      Up until now, the PPGTT was a funky 2 level page table. GEN8 changes
      this to look more like a 3 level page table, and to that extent we need
      a significant amount more memory simply for the page tables. To address
      this, the allocations will be split up in finer amounts.
      
      v2: Replace size_t with uint64_t (Chris, Imre)
      
      v3: Fix size in gen8_ppgtt_init (Ben)
      Fix Size in i915_gem_suspend_gtt_mappings/restore (Imre)
      
      Reviewed-by: Imre Deak <imre.deak@intel.com> (v2)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      782f1495
    • B
      drm/i915: Move ppgtt_release out of the header · 321f2ada
      Ben Widawsky 提交于
      At one time it was expected to be called in multiple places by kref_put.
      At the current time however, it is all contained within
      i915_gem_context.c.
      
      This patch makes an upcoming required addition a bit nicer since it too
      doesn't need to be defined in a header file.
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      321f2ada
  3. 14 2月, 2014 4 次提交
    • D
      drm/i915: Simplify i915_gem_object_ggtt_unpin · b287110e
      Daniel Vetter 提交于
      Split out from Chris vma-bind rework.
      
      Jani wondered why this is save, and the reason is that i915_vma_unbind
      does all these checks, too. So they're redundant.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b287110e
    • D
      drm/i915: split PIN_GLOBAL out from PIN_MAPPABLE · bf3d149b
      Daniel Vetter 提交于
      With abitrary pin flags it makes sense to split out a "please bind
      this into global gtt" from the "please allocate in the mappable
      range".
      
      Use this unconditionally in our global gtt pin helper since this is
      what its callers want. Later patches will drop PIN_MAPPABLE where it's
      not strictly needed.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bf3d149b
    • D
      drm/i915: Consolidate binding parameters into flags · 1ec9e26d
      Daniel Vetter 提交于
      Anything more than just one bool parameter is just a pain to read,
      symbolic constants are much better.
      
      Split out from Chris' vma-binding rework patch.
      
      v2: Undo the behaviour change in object_pin that Chris spotted.
      
      v3: Split out misplaced hunk to handle set_cache_level errors,
      spotted by Jani.
      
      v4: Keep the current over-zealous binding logic in the execbuffer code
      working with a quick hack while the overall binding code gets shuffled
      around.
      
      v5: Reorder the PIN_ flags for more natural patch splitup.
      
      v6: Pull out the PIN_GLOBAL split-up again.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1ec9e26d
    • I
      drm/i915: add unregister callback to connector · 4932e2c3
      Imre Deak 提交于
      Since
      
      commit d9255d57
      Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Date:   Thu Sep 26 20:05:59 2013 -0300
      
      it became clear that we need to separate the unload sequence into two
      parts:
      
      1. remove all interfaces through which new operations on some object
         (crtc, encoder, connector) can be started and make sure all pending
         operations are completed
      2. do the actual tear down of the internal representation of the above
         objects
      
      The above commit achieved this separation for connectors by splitting
      out the sysfs removal part from the connector's destroy callback and
      doing this removal before calling drm_mode_config_cleanup() which does
      the actual tear-down of all the drm objects.
      
      Since we'll have to customize the interface removal part for different
      types of connectors in the upcoming patches, add a new unregister
      callback and move the interface removal part to it.
      
      No functional change.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NAntti Koskipää <antti.koskipaa@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4932e2c3
  4. 13 2月, 2014 8 次提交
  5. 05 2月, 2014 1 次提交
    • A
      drm/i915: Reorganize display pipe register accesses · a57c774a
      Antti Koskipaa 提交于
      RFCv2: Reorganize array indexing so that full offsets can be used as
      is. It makes grepping for registers in i915_reg.h much easier. Also
      move offset arrays to intel_device_info.
      
      v1: Fixed offsets for VLV, proper eDP handling
      
      v2: Fixed BCLRPAT, PIPESRC, PIPECONF and DSP* macros.
      
      v3: Added EDP pipe comment, removed redundant offset arrays for
          MSA_MISC and DDI_FUNC_CTL.
      
      v4: Rename patch and report object size increase.
      
      v5: Change location of commas, add PIPE_EDP into enum pipe
      
      v6: Insert PIPE_EDP_OFFSET into pipe offset array
      
      v7: Set I915_MAX_PIPES back to 3, change more registers accessors
          to use the new macros, get rid of _PIPE_INC and add dev_priv
          as a parameter where required by the new macros.
      
      Upcoming hardware will not have the various display pipe register
      ranges evenly spaced in memory. Change register address calculations
      into array lookups.
      
      Tested on SNB, VLV, IVB, Gen2 and HSW w/eDP.
      
      I left the UMS cruft untouched.
      
      Size differences:
         text    data     bss     dec     hex filename
       596431    4634      56  601121   92c21 i915.ko (new)
       593199    4634      56  597889   91f81 i915.ko (old)
      Signed-off-by: NAntti Koskipaa <antti.koskipaa@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Tested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a57c774a
  6. 04 2月, 2014 1 次提交
  7. 31 1月, 2014 1 次提交
  8. 30 1月, 2014 6 次提交
  9. 28 1月, 2014 3 次提交
    • B
      drm/i915: Create a USES_PPGTT macro · c5dc5cec
      Ben Widawsky 提交于
      There are cases where we want to know if there is a full, or aliased
      PPGTT. Currently, in fact the only distinction we ever need to make is
      when we're using full PPGTT.
      
      This patch is simply to promote readability and clarify for the
      confusing existing usage where "aliasing" meant aliasing and full.
      
      v2: Remove USES_ALIASING_PPGTT since there are currently no cases where
      we need to check if we're using aliasing, but not full PPGTT. (Daniel)
      
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c5dc5cec
    • J
      drm/i915: move module parameters into a struct, in a new file · d330a953
      Jani Nikula 提交于
      With 20+ module parameters, I think referring to them via a struct
      improves clarity over just having a bunch of globals. While at it, move
      the parameter initialization and definitions into a new file
      i915_params.c to reduce clutter in i915_drv.c.
      
      Apart from the ill-named i915_enable_rc6, i915_enable_fbc and
      i915_enable_ppgtt parameters, for which we lose the "i915_" prefix
      internally, the module parameters now look the same both on the kernel
      command line and in code. For example, "i915.modeset".
      
      The downsides of the change are losing static on a couple of variables
      and not having the initialization and module_param_named() right next to
      each other. On the other hand, all module parameters are now defined in
      one place at i915_params.c. Plus you can do this to find all module
      parameter references:
      
      $ git grep "i915\." -- drivers/gpu/drm/i915
      
      v2:
      - move the definitions into a new file
      - s/i915_params/i915/
      - make i915_try_reset i915.reset, for consistency
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d330a953
    • C
      drm/i915: Include HW status page in error capture · f3ce3821
      Chris Wilson 提交于
      Many times in the past we have concluded that the cause of the GPU hang
      has been that the hw status page was stale, usually because the GPU and
      CPU disagreed over the address of the page. Having stumbled across yet
      another issue that seems to be related to the HWSP, it is time to
      include that information in the GPU error dump.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f3ce3821