1. 18 Jul, 2012 8 commits
  2. 17 Jul, 2012 17 commits
  3. 15 Jul, 2012 2 commits
  4. 14 Jul, 2012 1 commit
    • Dave Airlie's avatar
      Merge tag 'drm-intel-next-2012-07-06' of... · 12f0e670
      Dave Airlie authored
      Merge tag 'drm-intel-next-2012-07-06' of git://people.freedesktop.org/~danvet/drm-intel into drm-next
      
      Daniel writes:
      New pull for -next. Highlights:
      - rc6/turbo support for hsw (Eugeni)
      - improve corner-case of the reset handling code - gpu reset handling
        should be rock-solid now
      - support for fb offset > 4096 pixels on gen4+ (yeah, you need some fairly
        big screens to hit that)
      - the "Flush Me Harder" patch to fix the gen6+ fallout from disabling the
        flushing_list
      - no more /dev/agpgart on gen6+!
      - HAS_PCH_xxx improvements from Paulo
      - a few minor bits&pieces all over, most of it in thew hsw code
      
      * tag 'drm-intel-next-2012-07-06' of git://people.freedesktop.org/~danvet/drm-intel: (40 commits)
        drm/i915: program FDI_RX TP and FDI delays
        drm/i915: introduce for_each_encoder_on_crtc
        drm/i915: adjust framebuffer base address on gen4+
        drm/i915: introduce crtc->dspaddr_offset
        drm/i915: Reject page flips with changed format/offset/pitch
        drm/i915: Zero initialize mode_cmd
        drm/i915: don't return a spurious -EIO from intel_ring_begin
        drm/i915: properly SIGBUS on I/O errors
        drm/i915: don't hang userspace when the gpu reset is stuck
        drm/i915: non-interruptible sleeps can't handle -EAGAIN
        drm/i915: don't trylock in the gpu reset code
        drm/i915: fix PIPE_DDI_PORT_MASK
        drm/i915: prevent bogus intel_update_fbc notifications
        drm/i915: re-initialize DDI buffer translations after resume
        drm/i915: don't ironlake_init_pch_refclk() on LPT
        drm/i915: get rid of dev_priv->info->has_pch_split
        drm/i915: add PCH_NONE to enum intel_pch
        drm/i915: prefer wide & slow to fast & narrow in DP configs
        drm/i915: fix up ilk rc6 disabling confusion
        drm/i915: move force wake support into intel_pm
        ...
      12f0e670
  5. 05 Jul, 2012 12 commits
    • Eugeni Dodonov's avatar
      drm/i915: program FDI_RX TP and FDI delays · 4acf5186
      Eugeni Dodonov authored
      This is required for a stable FDI connection.
      
      v2: fix and simplify the FDI_RX_MISC bits as noticed by Paulo Zanoni.
      
      CC: Paulo Zanoni <paulo.r.zanoni@intel.com>
      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>
      4acf5186
    • Daniel Vetter's avatar
      drm/i915: introduce for_each_encoder_on_crtc · 6c2b7c12
      Daniel Vetter authored
      We already have this pattern at quite a few places, and moving part of
      the modeset helper stuff into the driver will add more.
      
      v2: Don't clobber the crtc struct name with the macro parameter ...
      
      v3: Convert two more places noticed by Paulo Zanoni.
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      6c2b7c12
    • Daniel Vetter's avatar
      drm/i915: adjust framebuffer base address on gen4+ · c2c75131
      Daniel Vetter authored
      The tileoffset register only supports a limited offset in x/y of 4096,
      so for giant screen configuration with a shared fb we wrap around.
      
      Fix this by computing a linear offset in tiles (pages) and only use
      the tileoffset register to offset within the tile.
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      c2c75131
    • Daniel Vetter's avatar
      drm/i915: introduce crtc->dspaddr_offset · e506a0c6
      Daniel Vetter authored
      To avoid recomputing the display framebuffer offset on gen2/3
      pageflips. This is also prep work to do similar trickery on gen4+
      
      Also:
      - kill "Start", such upper-case remnants from the ddx must surely die.
      - rename "Offset" to linear_offset, to make it clearer that on gen4+
        this is only used by the hw for linear buffers, for tiled buffers it
        uses the TILEOFF register.
      - call DSAPADDR DSPLINOFF on gen4+ for the same reason (and because
        the documentation really renamed the register).
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      e506a0c6
    • Ville Syrjälä's avatar
      drm/i915: Reject page flips with changed format/offset/pitch · e6a595d2
      Ville Syrjälä authored
      MI display flips can't handle some changes in the framebuffer
      format or layout. Return an error in such cases.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      e6a595d2
    • Ville Syrjälä's avatar
      drm/i915: Zero initialize mode_cmd · 3a7f2f6a
      Ville Syrjälä authored
      Zero initialize the mode_cmd structure when creating the kernel
      framebuffer. Avoids having uninitialized data in offsets[0] for
      instance.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      3a7f2f6a
    • 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