1. 22 1月, 2013 1 次提交
  2. 20 1月, 2013 3 次提交
    • D
      drm/i915: clear up wedged transitions · 1f83fee0
      Daniel Vetter 提交于
      We have two important transitions of the wedged state in the current
      code:
      
      - 0 -> 1: This means a hang has been detected, and signals to everyone
        that they please get of any locks, so that the reset work item can
        do its job.
      
      - 1 -> 0: The reset handler has completed.
      
      Now the last transition mixes up two states: "Reset completed and
      successful" and "Reset failed". To distinguish these two we do some
      tricks with the reset completion, but I simply could not convince
      myself that this doesn't race under odd circumstances.
      
      Hence split this up, and add a new terminal state indicating that the
      hw is gone for good.
      
      Also add explicit #defines for both states, update comments.
      
      v2: Split out the reset handling bugfix for the throttle ioctl.
      
      v3: s/tmp/wedged/ sugested by Chris Wilson. Also fixup up a rebase
      error which prevented this patch from actually compiling.
      
      v4: To unify the wedged state with the reset counter, keep the
      reset-in-progress state just as a flag. The terminally-wedged state is
      now denoted with a big number.
      
      v5: Add a comment to the reset_counter special values explaining that
      WEDGED & RESET_IN_PROGRESS needs to be true for the code to be
      correct.
      
      v6: Fixup logic errors introduced with the wedged+reset_counter
      unification. Since WEDGED implies reset-in-progress (in a way we're
      terminally stuck in the dead-but-reset-not-completed state), we need
      ensure that we check for this everywhere. The specific bug was in
      wait_for_error, which would simply have timed out.
      
      v7: Extract an inline i915_reset_in_progress helper to make the code
      more readable. Also annote the reset-in-progress case with an
      unlikely, to help the compiler optimize the fastpath. Do the same for
      the terminally wedged case with i915_terminally_wedged.
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1f83fee0
    • D
      drm/i915: move wedged to the other gpu error handling stuff · 33196ded
      Daniel Vetter 提交于
      And to make Ben Widawsky happier, use the gpu_error instead of
      the entire device as the argument in some functions.
      
      Drop the outdated comment on ->wedged for now, a follow-up patch will
      change the semantics and add a proper comment again.
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      33196ded
    • V
      drm/i915: Fix RGB color range property for PCH platforms · 3685a8f3
      Ville Syrjälä 提交于
      The RGB color range select bit on the DP/SDVO/HDMI registers
      disappeared when PCH was introduced, and instead a new PIPECONF bit
      was added that performs the same function.
      
      Add a new INTEL_MODE_LIMITED_COLOR_RANGE private mode flag, and set
      it in the encoder mode_fixup if limited color range is requested.
      Set the the PIPECONF bit 13 based on the flag.
      
      Experimentation showed that simply toggling the bit while the pipe is
      active doesn't work. We need to restart the pipe, which luckily already
      happens.
      
      The DP/SDVO/HDMI bit 8 is marked MBZ in the docs, so avoid setting it,
      although it doesn't seem to do any harm in practice.
      
      TODO:
      - the PIPECONF bit too seems to have disappeared from HSW. Need a
        volunteer to test if it's just a documentation issue or if it's really
        gone. If the bit is gone and no easy replacement is found, then I suppose
        we may need to use the pipe CSC unit to perform the range compression.
      
      v2: Use mode private_flags instead of intel_encoder virtual functions
      v3: Moved the intel_dp color_range handling after bpc check to help
          later patches
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46800Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3685a8f3
  3. 18 1月, 2013 2 次提交
    • B
      drm/i915: Create a gtt structure · 5d4545ae
      Ben Widawsky 提交于
      The purpose of the gtt structure is to help isolate our gtt specific
      properties from the rest of the code (in doing so it help us finish the
      isolation from the AGP connection).
      
      The following members are pulled out (and renamed):
      gtt_start
      gtt_total
      gtt_mappable_end
      gtt_mappable
      gtt_base_addr
      gsm
      
      The gtt structure will serve as a nice place to put gen specific gtt
      routines in upcoming patches. As far as what else I feel belongs in this
      structure: it is meant to encapsulate the GTT's physical properties.
      This is why I've not added fields which track various drm_mm properties,
      or things like gtt_mtrr (which is itself a pretty transient field).
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      [Ben modified commit messages]
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5d4545ae
    • D
      drm/i915: wake up all pageflip waiters · 2c10d571
      Daniel Vetter 提交于
      Otherwise it seems like we can get stuck with concurrent waiters.
      Right now this /shouldn't/ be a problem, since all pending pageflip
      waiters are serialized by the one mode_config.mutex, so there's at
      most on waiter. But better paranoid than sorry, since this is tricky
      code.
      
      v2: WARN_ON(waitqueue_active) before waiting, as suggested by Chris
      Wilson.
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2c10d571
  4. 21 12月, 2012 1 次提交
  5. 19 12月, 2012 2 次提交
    • K
      i915: ensure that VGA plane is disabled · 0fde901f
      Krzysztof Mazur 提交于
      Some broken systems (like HP nc6120) in some cases, usually after LID
      close/open, enable VGA plane, making display unusable (black screen on LVDS,
      some strange mode on VGA output). We used to disable VGA plane only once at
      startup. Now we also check, if VGA plane is still disabled while changing
      mode, and fix that if something changed it.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57434Signed-off-by: NKrzysztof Mazur <krzysiek@podlesie.net>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0fde901f
    • D
      drm/i915: don't disable disconnected outputs · b0a2658a
      Daniel Vetter 提交于
      This piece of neat lore has been ported painstakingly and bug-for-bug
      compatible from the old crtc helper code.
      
      Imo it's utter nonsense.
      
      If you disconnected a cable and before you reconnect it, userspace (or
      the kernel) does an set_crtc call, this will result in that connector
      getting disabled. Which will result in a nice black screen when
      plugging in the cable again.
      
      There's absolutely no reason the kernel does such policy enforcements
      - if userspace tries to set up a mode on something disconnected we
      might fail loudly (since the dp link training fails), but silently
      adjusting the output configuration behind userspace's back is a recipe
      for disaster. Specifically I think that this could explain some of our
      MI_WAIT hangs around suspend, where userspace issues a scanline wait
      on a disable pipe. This mechanisims here could explain how that pipe
      got disabled without userspace noticing.
      
      Note that this fixes a NULL deref at BIOS takeover when the firmware
      sets up a disconnected output in a clone configuration with a
      connected output on the 2nd pipe: When doing the full modeset we don't
      have a mode for the 2nd pipe and OOPS. On the first pipe this doesn't
      matter, since at boot-up the fbdev helpers will set up the choosen
      configuration on that on first. Since this is now the umptenth bug
      around handling this imo brain-dead semantics correctly, I think it's
      time to kill it and see whether there's any userspace out there which
      relies on this.
      
      It also nicely demonstrates that we have a tiny window where DP
      hotplug can still kill the driver.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58396
      Cc: stable@vger.kernel.org
      Tested-by: NPeter Ujfalusi <peter.ujfalusi@gmail.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b0a2658a
  6. 18 12月, 2012 1 次提交
    • D
      drm/i915: fixup overlay stolen memory leak · 4d7bb011
      Daniel Vetter 提交于
      We need to clean up the overlay first, before taking down the
      stolen memory allocator.
      
      This regression has been introducec in
      
      commit 80405138
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Thu Nov 15 11:32:29 2012 +0000
      
          drm/i915: Allocate overlay registers from stolen memory
      
      v2: Rework the patch a bit as suggested by Chris Wilson:
      - move the overlay teardown up, into the modeset cleanup
      - move the stolen mm takedown into i915_gem_cleanup_stolen
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4d7bb011
  7. 17 12月, 2012 3 次提交
  8. 14 12月, 2012 2 次提交
  9. 13 12月, 2012 1 次提交
    • D
      drm/i915: rework locking for intel_dpio|sbi_read|write · 09153000
      Daniel Vetter 提交于
      Spinning for up to 200 us with interrupts locked out is not good. So
      let's just spin (and even that seems to be excessive).
      
      And we don't call these functions from interrupt context, so this is
      not required. Besides that doing anything in interrupt contexts which
      might take a few hundred us is a no-go. So just convert the entire
      thing to a mutex. Also move the mutex-grabbing out of the read/write
      functions (add a WARN_ON(!is_locked)) instead) since all callers are
      nicely grouped together.
      
      Finally the real motivation for this change: Dont grab the modeset
      mutex in the dpio debugfs file, we don't need that consistency. And
      correctness of the dpio interface is ensured with the dpio_lock.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      09153000
  10. 11 12月, 2012 1 次提交
    • D
      drm/i915: disable cpt phase pointer fdi rx workaround · 539526b4
      Daniel Vetter 提交于
      We've originally added this in
      
      commit 291427f5
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Fri Jul 29 12:42:37 2011 -0700
      
          drm/i915: apply phase pointer override on SNB+ too
      
      and then copy-pasted it over to ivb/ppt. The w/a was originally added
      for ilk/ibx in
      
      commit 5b2adf89
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Thu Oct 7 16:01:15 2010 -0700
      
          drm/i915: add Ironlake clock gating workaround for FDI link training
      
      and fixed up a bit in
      
      commit 6f06ce18
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Tue Jan 4 15:09:38 2011 -0800
      
          drm/i915: set phase sync pointer override enable before setting phase sync pointer
      
      It turns out that this w/a isn't actually required on cpt/ppt and
      positively harmful on ivb/ppt when using fdi B/C links - it results in
      a black screen occasionally, with seemingfully everything working as
      it should. The only failure indication I've found in the hw is that
      eventually (but not right after the modeset completes) a pipe underrun
      is signalled.
      
      Big thanks to Arthur Runyan for all the ideas for registers to check
      and changes to test, otherwise I couldn't ever have tracked this down!
      
      Cc: "Runyan, Arthur J" <arthur.j.runyan@intel.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      539526b4
  11. 10 12月, 2012 3 次提交
  12. 08 12月, 2012 1 次提交
  13. 06 12月, 2012 5 次提交
    • D
      drm/i915: extract common link_m_n helpers · e69d0bc1
      Daniel Vetter 提交于
      Both the dp and fdi code use the exact same computations (ignore minor
      differences in conversion between bits and bytes).
      
      This makes it even more apparent that we have a _massive_ mess between
      cpu transcoder/fdi link/pch transcoder and pch link settings. And also
      that we have hilarious amounts of confusion between edp and dp
      (despite that they're identical at a link level).
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e69d0bc1
    • D
      drm/i915: drop unnecessary clearing of pch dp transcoder timings · 2f0c2ad1
      Daniel Vetter 提交于
      This has originally been added in
      
      commit 8db9d77b
      Author: Zhenyu Wang <zhenyuw@linux.intel.com>
      Date:   Wed Apr 7 16:15:54 2010 +0800
      
          drm/i915: Support for Cougarpoint PCH display pipeline
      
      probably to combat issues with hw state left behind by the BIOS. And
      indeed, I've checked out that specific revision, and there is no DP
      support yet. So the pch dp transcoder won't be correctly disabled, and
      that's important since it requires a rether special disable dance:
      Just writing 0 to TRANS_DP_CTL won't cut it, since we need to select
      the NONE port when disabling, too.
      
      And indeed, things seem to still work, so let's just remove this.
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2f0c2ad1
    • D
      drm/i915: move set_pll_edp to intel_dp.c · ea9b6006
      Daniel Vetter 提交于
      Now that we enable the cpu edp pll in intel_dp->pre_enable and no
      longer in crtc_mode_set, we can also move the modeset part to the
      intel_dp->mode_set callback. Previously this was not possible because
      the encoder ->mode_set callbacks are called after the crtc mode set
      callback.
      
      v2: Rebase on top of copy&pasted hsw crtc_mode_set.
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ea9b6006
    • D
      drm/i915: rip out pre-DDI stuff from haswell_crtc_mode_set · ed7ef439
      Daniel Vetter 提交于
      Especially getting rid of all things lvds is ... great!
      
      v2: Drop the two additional pre-hsw hunks noticed by Paulo Zanoni.
      
      v3:
      - handle DP ports correctly (spoted by Paulo)
      - don't leave {} behind for a single-line block (again spotted by
        Paulo)
      - kill another if (IBX || CPT) block
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ed7ef439
    • C
      drm/i915: Close race between processing unpin task and queueing the flip · e7d841ca
      Chris Wilson 提交于
      Before queuing the flip but crucially after attaching the unpin-work to
      the crtc, we continue to setup the unpin-work. However, should the
      hardware fire early, we see the connected unpin-work and queue the task.
      The task then promptly runs and unpins the fb before we finish taking
      the required references or even pinning it... Havoc.
      
      To close the race, we use the flip-pending atomic to indicate when the
      flip is finally setup and enqueued. So during the flip-done processing,
      we can check more accurately whether the flip was expected.
      
      v2: Add the appropriate mb() to ensure that the writes to the page-flip
      worker are complete prior to marking it active and emitting the MI_FLIP.
      On the read side, the mb should be enforced by the spinlocks.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      [danvet: Review the barriers a bit, we need a write barrier both
      before and after updating ->pending. Similarly we need a read barrier
      in the interrupt handler both before and after reading ->pending. With
      well-ordered irqs only one barrier in each place should be required,
      but since this patch explicitly sets out to combat spurious interrupts
      with is staged activation of the unpin work we need to go full-bore on
      the barriers, too. Discussed with Chris Wilson on irc and changes
      acked by him.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e7d841ca
  14. 04 12月, 2012 1 次提交
    • D
      drm/i915: fixup sparse warnings · 1a240d4d
      Daniel Vetter 提交于
      - __iomem where there is none (I love how we mix these things up).
      - Use gfp_t instead of an other plain type.
      - Unconfuse one place about enum pipe vs enum transcoder - for the pch
        transcoder we actually use the pipe enum. Fixup the other cases
        where we assign the pipe to the cpu transcoder with explicit casts.
      - Declare the mch_lock properly in a header.
      
      There is still a decent mess in intel_bios.c about __iomem, but heck,
      this is x86 and we're allowed to do that.
      
      Makes-sparse-happy: Chris Wilson <chris@chris-wilson.co.uk>
      [danvet: Use a space after the cast consistently and fix up the
      newly-added cast in i915_irq.c to properly use __iomem.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1a240d4d
  15. 01 12月, 2012 1 次提交
    • C
      drm/i915: Delay allocation of stolen space for FBC · 11be49eb
      Chris Wilson 提交于
      As FBC is commonly disabled due to limitations of the chipset upon
      output configurations, on many systems FBC is never enabled. For those
      systems, it is advantageous to make use of the stolen memory for other
      objects and so we defer allocation of the FBC chunk until we actually
      require it. This increases the likelihood of that allocation failing,
      but that in turns means that we are already taking advantage of the
      stolen memory!
      
      As well as delaying the allocation from driver initialisation until the
      first use of FBC, we also return the stolen block after we finish using
      it - allowing greater flexibility in our usage of stolen space. A side
      effect of this is that we can then attempt to allocate only the required
      amount of space (with a little slack to reduce reallocation rate and
      avoid fragmentation).
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      11be49eb
  16. 29 11月, 2012 9 次提交
  17. 23 11月, 2012 1 次提交
    • J
      drm/i915: do not default to 18 bpp for eDP if missing from VBT · 9a30a61f
      Jani Nikula 提交于
      commit 500a8cc4
      Author: Zhenyu Wang <zhenyuw@linux.intel.com>
      Date:   Wed Jan 13 11:19:52 2010 +0800
      
          drm/i915: parse eDP panel color depth from VBT block
      
      originally introduced parsing bpp for eDP from VBT, with a default of 18
      bpp if the eDP BIOS data block is not present. Turns out that default seems
      to break the Macbook Pro with retina display, as noted in
      
      commit 4344b813
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Aug 10 11:10:20 2012 +0200
      
          drm/i915: ignore eDP bpc settings from vbt
      
      Since we can't ignore bpc settings from VBT completely after all, get rid
      of the default. Do not clamp eDP to 18 bpp by default if the eDP BDB is
      missing from VBT.
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Tested-by: NHenrik Rydberg <rydberg@euromail.se>
      [danvet: paste in the updated commit message from irc.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9a30a61f
  18. 22 11月, 2012 2 次提交