1. 05 Jul, 2012 20 commits
    • Daniel Vetter's avatar
      drm/i915: don't return a spurious -EIO from intel_ring_begin · de2b9985
      Daniel Vetter authored
      The issue with this check is that it results in userspace receiving an
      -EIO while the gpu reset hasn't completed, resulting in fallback to sw
      rendering or worse.
      
      Now there's also a stern comment in intel_ring_wait_seqno saying that
      intel_ring_begin should not return -EAGAIN, ever, because some callers
      can't handle that. But after an audit of the callsites I don't see any
      issues. I guess the last problematic spot disappeared with the removal
      of the pipelined fencing code.
      
      So do the right thing and call check_wedge, which should properly
      decide whether an -EAGAIN or -EIO is appropriate if wedged is set.
      
      Note that the early check for a wedged gpu before touching the ring is
      rather important (and it took me quite some time of acting like the
      densest doofus to figure that out): If we don't do that and the gpu
      died for good, not having been resurrect by the reset code, userspace
      can merrily fill up the entire ring until it notices that something is
      amiss.
      
      Allowing userspace to emit more render, despite that we know that it
      will fail can't lead to anything good (and by experience can lead to
      all sorts of havoc, including angering the OOM gods and hard-hanging
      the hw for good).
      
      v2: Fix EAGAIN mispell, noticed by Chris Wilson.
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      de2b9985
    • Daniel Vetter's avatar
      drm/i915: properly SIGBUS on I/O errors · a9340cca
      Daniel Vetter authored
      ... instead of looping endless with no hope of ever serving that
      page-fault. We only need to break out of this loop when the gpu died,
      to run the reset work (and hopefully resurrect it).
      
      To clarify questions Chris raised on irc: This is about handling I/O
      errors not from our own code, but e.g. when the disk died when trying
      to swap in a gem bo. So this patch remidies the issue that the current
      handling only handles gpu-death-induced cases of -EIO. Admittedly,
      dying disks are much rarer than hanging gpus ...To clarify questions
      Chris raised on irc: This is about handling I/O errors not from our
      own code, but e.g. when the disk died when trying to swap in a gem bo.
      So this patch remidies the issue that the current handling only
      handles gpu-death-induced cases of -EIO. Admittedly, dying disks are
      much rarer than hanging gpus ...
      
      This seems to have been lost in:
      
      commit d9bc7e9f
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Mon Feb 7 13:09:31 2011 +0000
      
          drm/i915: Fix infinite loop regression from 21dd3734Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      a9340cca
    • Daniel Vetter's avatar
      drm/i915: don't hang userspace when the gpu reset is stuck · 0a6759c6
      Daniel Vetter authored
      With the gpu reset no longer using a trylock we've increased the
      chances of userspace getting stuck quite a bit. To make that
      (hopefully) rare case more paletable time out when waiting for the gpu
      reset code to complete and signal this little issue to the caller by
      returning -EIO.
      
      This should help userspace to somewhat gracefully fall back and
      hopefully allow the user to grab some logs and reboot the machine
      (instead of staring at a frozen X screen in agony).
      
      Suggested by Chris Wilson because I've been stubborn about allowing
      the gpu reset code no to fail, ever (by removing the trylock).
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      0a6759c6
    • Daniel Vetter's avatar
      drm/i915: non-interruptible sleeps can't handle -EAGAIN · d6b2c790
      Daniel Vetter authored
      So don't return -EAGAIN, even in the case of a gpu hang. Remap it to
      -EIO instead. Note that this isn't really an issue with
      interruptability, but more that we have quite a few codepaths (mostly
      around kms stuff) that simply can't handle any errors and hence not
      even -EAGAIN. Instead of adding proper failure paths so that we could
      restart these ioctls we've opted for the cheap way out of sleeping
      non-interruptibly.  Which works everywhere but when the gpu dies,
      which this patch fixes.
      
      So essentially interruptible == false means 'wait for the gpu or die
      trying'.'
      
      This patch is a bit ugly because intel_ring_begin is all non-interruptible
      and hence only returns -EIO. But as the comment in there says,
      auditing all the callsites would be a pain.
      
      To avoid duplicating code, reuse i915_gem_check_wedge in __wait_seqno
      and intel_wait_ring_buffer. Also use the opportunity to clarify the
      different cases in i915_gem_check_wedge a bit with comments.
      
      v2: Don't access dev_priv->mm.interruptible from check_wedge - we
      might not hold dev->struct_mutex, making this racy. Instead pass
      interruptible in as a parameter. I've noticed this because I've hit a
      BUG_ON(!mutex_is_locked) at the top of check_wedge. This has been
      added in
      
      commit b4aca010
      Author: Ben Widawsky <ben@bwidawsk.net>
      Date:   Wed Apr 25 20:50:12 2012 -0700
      
          drm/i915: extract some common olr+wedge code
      
      although that commit is missing any justification for this. I guess
      it's just copy&paste, because the same commit add the same BUG_ON
      check to check_olr, where it indeed makes sense.
      
      But in check_wedge everything we access is protected by other means,
      so this is superflous. And because it now gets in the way (we add a
      new caller in __wait_seqno, which can be called without
      dev->struct_mutext) let's just remove it.
      
      v3: Group all the i915_gem_check_wedge refactoring into this patch, so
      that this patch here is all about not returning -EAGAIN to callsites
      that can't handle syscall restarting.
      
      v4: Add clarification what interuptible == fales means in our code,
      requested by Ben Widawsky.
      
      v5: Fix EAGAIN mispell noticed by Chris Wilson.
      Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      d6b2c790
    • Daniel Vetter's avatar
      drm/i915: don't trylock in the gpu reset code · d54a02c0
      Daniel Vetter authored
      Simply failing to reset the gpu because someone else might still hold
      the mutex isn't a great idea - I see reliable silent reset failures.
      And gpu reset simply needs to be reliable and Just Work.
      
      "But ... the deadlocks!"
      
      We already kick all processes waiting for the gpu before launching the
      reset work item. New waiters need to check the wedging state anyway
      and then bail out. If we have places that can deadlock, we simply need
      to fix them.
      
      "But ... testing!"
      
      We have the gpu hangman, and if the current gpu load gem_exec_nop
      isn't good enough to hit a specific case, we can add a new one.
      
      "But ...  don't we return -EAGAIN for non-interruptible calls to
      wait_seqno now?"
      
      Yep, but this problem already exists in the current code. A follow up
      patch will remedy this by returning -EIO for non-interruptible sleeps
      if the gpu died and the low-level wait bails out with -EAGAIN.
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      d54a02c0
    • Paulo Zanoni's avatar
      drm/i915: fix PIPE_DDI_PORT_MASK · 4c3c115a
      Paulo Zanoni authored
      Only bits 30:28, bit 31 is PIPE_DDI_FUNC_ENABLE.
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      4c3c115a
    • Eugeni Dodonov's avatar
      drm/i915: prevent bogus intel_update_fbc notifications · 4c243e25
      Eugeni Dodonov authored
      This pollutes dmesg output even if we do not have FBC for the device, so
      move the DRM_DEBUG_KMS statement lower.
      
      v2: just kill the message as suggested by Daniel.
      Signed-off-by: default avatarEugeni Dodonov <eugeni.dodonov@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      4c243e25
    • Eugeni Dodonov's avatar
      drm/i915: re-initialize DDI buffer translations after resume · a8f78b58
      Eugeni Dodonov authored
      This is necessary for the modesetting to work correctly after a
      suspend-resume cycle. Without this, the pipes and clocks got the correct
      configuration, but the underlying DDI buffers configuration was lost.
      Signed-off-by: default avatarEugeni Dodonov <eugeni.dodonov@intel.com>
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      a8f78b58
    • Paulo Zanoni's avatar
      drm/i915: don't ironlake_init_pch_refclk() on LPT · 40579abe
      Paulo Zanoni authored
      This function is used to set the PCH_DREF_CONTROL register, which does
      not exist on LPT anymore.
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      40579abe
    • Paulo Zanoni's avatar
      drm/i915: get rid of dev_priv->info->has_pch_split · 45e6e3a1
      Paulo Zanoni authored
      Previously we had has_pch_split to tell us whether we had a PCH or not
      and we also had dev_priv->pch_type to tell us which kind of PCH it
      was, but it could only be used if we were 100% sure we did have a PCH.
      Now that PCH_NONE was added to dev_priv->pch_type we don't need
      has_pch_split anymore: we can just check for pch_type != PCH_NONE.
      
      The HAS_PCH_{IBX,CPT,LPT} macros use dev_priv->pch_type, so they can
      only be called after intel_detect_pch. The HAS_PCH_SPLIT macro looks
      at dev_priv->info->has_pch_split, which is available earlier.
      
      Since the goal is to implement HAS_PCH_SPLIT using dev_priv->pch_type
      instead of dev_priv->info->has_pch_split, we need to make sure that
      intel_detect_pch is called before any calls to HAS_PCH_SPLIT are made.
      So we moved the intel_detect_pch call to an earlier stage.
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      45e6e3a1
    • Paulo Zanoni's avatar
      drm/i915: add PCH_NONE to enum intel_pch · f0350830
      Paulo Zanoni authored
      And rely on the fact that it's 0 to assume that machines without a PCH
      will have PCH_NONE as dev_priv->pch_type.
      
      Just today I finally realized that HAS_PCH_IBX is true for machines
      without a PCH. IMHO this is totally counter-intuitive and I don't
      think it's a good idea to assume that we're going to check for
      HAS_PCH_IBX only after we check for HAS_PCH_SPLIT.
      
      I believe that in the future we'll have more PCH types and checks
      like:
      
          if (HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev))
      
      will become more and more common. There's a good chance that we may
      break non-PCH machines by adding these checks in code that runs on all
      machines. I also believe that the HAS_PCH_SPLIT check will become less
      common as we add more and more different PCH types. We'll probably
      start replacing checks like:
      
          if (HAS_PCH_SPLIT(dev))
              foo();
          else
              bar();
      
      with:
      
          if (HAS_PCH_NEW(dev))
              baz();
          else if (HAS_PCH_OLD(dev) || HAS_PCH_IBX(dev))
              foo();
          else
              bar();
      
      and this may break gen 2/3/4.
      
      As far as we have investigated, this patch will affect the behavior of
      intel_hdmi_dpms and intel_dp_link_down on gen 4. In both functions the
      code inside the HAS_PCH_IBX check is for IBX-specific workarounds, so
      we should be safe. If we start bisecting gen 2/3/4 bugs to this commit
      we should consider replacing the HAS_PCH_IBX checks with something
      else.
      
      V2: Improve commit message, list possible side effects and solution.
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      f0350830
    • Jesse Barnes's avatar
      drm/i915: prefer wide & slow to fast & narrow in DP configs · 2514bc51
      Jesse Barnes authored
      High frequency link configurations have the potential to cause trouble
      with long and/or cheap cables, so prefer slow and wide configurations
      instead.  This patch has the potential to cause trouble for eDP
      configurations that lie about available lanes, so if we run into that we
      can make it conditional on eDP.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45801
      Tested-by: peter@colberg.org
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      2514bc51
    • Daniel Vetter's avatar
      drm/i915: fix up ilk rc6 disabling confusion · 930ebb46
      Daniel Vetter authored
      While creating the new enable/disable_gt_powersave functions in
      
      commit 8090c6b9
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Sun Jun 24 16:42:32 2012 +0200
      
          drm/i915: wrap up gt powersave enabling functions
      
      I've botched up the handling of ironlake_disable_rc6. Fix this up by
      calling it at the right place. Note though that ironlake_disable_rc6
      does a bit more than just disabling rc6 - it also tears down all the
      allocated context objects.
      
      Hence we need to move intel_teardown_rc6 out and directly call it from
      intel_modeset_cleanup.
      
      Also properly mark ironlake_enable_rc6 as static and kill the un-used
      declaration in i915_drv.h.
      
      Note: In review a question popped out why disable_rc6 also tears down
      the backing object and why we should move that out - it's simply for
      consistency with gen6+ rps code, which does it that way.
      
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Reviewed-by: default avatarEugeni Dodonov <eugeni.dodonov@intel.com>
      Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      930ebb46
    • Eugeni Dodonov's avatar
      drm/i915: move force wake support into intel_pm · 6590190d
      Eugeni Dodonov authored
      This commit moves force wake support routines into intel_pm modules, and
      exports the gen6_gt_check_fifodbg routine (used in I915_READ).
      Signed-off-by: default avatarEugeni Dodonov <eugeni.dodonov@intel.com>
      Acked-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      6590190d
    • Eugeni Dodonov's avatar
      drm/i915: enable RC6 workaround on Haswell · 1544d9d5
      Eugeni Dodonov authored
      For Haswell, on some of the early hardware revisions, it is possible to
      run into issues when RC6 state is enabled and when pipes change state.
      
      v2: add comment saying that this is for early revisions only.
      
      v3: beautify as suggested by Daniel Vetter.
      Signed-off-by: default avatarEugeni Dodonov <eugeni.dodonov@intel.com>
      Acked-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      1544d9d5
    • Eugeni Dodonov's avatar
      drm/i915: introduce haswell_init_clock_gating · cad2a2d7
      Eugeni Dodonov authored
      This is based on Ivy Bridge clock gating for now, but is subject to
      changes in the future.
      
      Note: Compared to the ivb clock gating this drops the the IDICOS
      medium uncore sharing tuned in
      
      commit 20848223
      Author: Ben Widawsky <ben@bwidawsk.net>
      Date:   Fri May 4 18:58:59 2012 -0700
      
          drm/i915: set IDICOS to medium uncore resources
      
      Eugeni wants to benchmark the effect of this first.
      Signed-off-by: default avatarEugeni Dodonov <eugeni.dodonov@intel.com>
      [danvet: added note]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      cad2a2d7
    • Eugeni Dodonov's avatar
      drm/i915: disable RC6 when disabling rps · 88509484
      Eugeni Dodonov authored
      We weren't disabling RC6 bits when bringing down RPS.
      Signed-off-by: default avatarEugeni Dodonov <eugeni.dodonov@intel.com>
      Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      88509484
    • Eugeni Dodonov's avatar
      drm/i915: enable RC6 by default on Haswell · 4a637c2c
      Eugeni Dodonov authored
      It should be working so let's turn it on by default and catch any possible
      issues faster.
      Signed-off-by: default avatarEugeni Dodonov <eugeni.dodonov@intel.com>
      Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      4a637c2c
    • Eugeni Dodonov's avatar
      drm/i915: slightly improve gt enable/disable routines · 7cf50fc8
      Eugeni Dodonov authored
      Just a cosmetic change to simplify the if statement.
      Signed-off-by: default avatarEugeni Dodonov <eugeni.dodonov@intel.com>
      Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      7cf50fc8
    • Eugeni Dodonov's avatar
      drm/i915: add RPS configuration for Haswell · 5a7dc92a
      Eugeni Dodonov authored
      Most of the RPS and RC6 enabling functionality is similar to what we had
      on Gen6/Gen7, so we preserve most of the registers.
      
      Note that Haswell only has RC6, so account for that as well. As suggested
      by Daniel Vetter, to reduce the amount of changes in the patch, we still
      write the RC6p/RC6pp thresholds, but those are ignored on Haswell.
      
      Note: Some discussion about the nature of the new tuning constants
      popped up in review - the answer is that we don't know why they've
      changed, but the guide from VPG with the magic numbers simply has
      different values now.
      
      v2: Squash fix for ?: vs | operation precende bug into this patch.
      Signed-off-by: default avatarEugeni Dodonov <eugeni.dodonov@intel.com>
      Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
      [danvet: Added note to commit message. Squashed fix.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      5a7dc92a
  2. 03 Jul, 2012 3 commits
  3. 29 Jun, 2012 1 commit
  4. 28 Jun, 2012 2 commits
  5. 27 Jun, 2012 3 commits
  6. 25 Jun, 2012 6 commits
  7. 24 Jun, 2012 5 commits