1. 26 11月, 2014 1 次提交
    • V
      drm/i915: Cancel vdd off work before suspend · afa4e53a
      Ville Syrjälä 提交于
      Currently we just make sure vdd is off before suspending, but we don't
      cancel the vdd off work. The work wil not touch vdd if
      want_panel_vdd==false so in theory this is fine.
      
      In the past that was perfectly fine since the vdd off work didn't do
      anything when want_panel_vdd==false, so even if the work would have been
      run during system resume before i915 has resumed, nothing would happen.
      
      However since pps_lock() will now grab the power domain references before
      it can check want_panel_vdd, we may end up toggling the power wells on/off
      already before the driver has resumed. That is not really acceptable, so
      cancel the vdd off work when suspending the encoder.
      
      The problem appeared when pps_lock() was introduced in:
       commit 773538e8
       Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
       Date:   Thu Sep 4 14:54:56 2014 +0300
      
          drm/i915: Reset power sequencer pipe tracking when disp2d is off
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      afa4e53a
  2. 24 11月, 2014 1 次提交
    • V
      drm/i915: Ignore SURFLIVE and flip counter when the GPU gets reset · bdfa7542
      Ville Syrjälä 提交于
      During a GPU reset we need to get pending page flip cleared out
      since the ring contents are gone and flip will never complete
      on its own. This used to work until the mmio vs. CS flip race
      detection came about. That piece of code is looking for a
      specific surface address in the SURFLIVE register, but as
      a flip to that address may never happen the check may never
      pass. So we should just skip the SURFLIVE and flip counter
      checks when the GPU gets reset.
      
      intel_display_handle_reset() tries to effectively complete
      the flip anyway by calling .update_primary_plane(). But that
      may not satisfy the conditions of the mmio vs. CS race
      detection since there's no guarantee that a modeset didn't
      sneak in between the GPU reset and intel_display_handle_reset().
      Such a modeset will not wait for pending flips due to the ongoing GPU
      reset, and then the primary plane updates performed by
      intel_display_handle_reset() will already use the new surface
      address, and thus the surface address the flip is waiting for
      might never appear in SURFLIVE. The result is that the flip
      will never complete and attempts to perform further page flips
      will fail with -EBUSY.
      
      During the GPU reset intel_crtc_has_pending_flip() will return
      false regardless, so the deadlock with a modeset vs. the error
      work acquiring crtc->mutex was avoided. And the reset_counter
      check in intel_crtc_has_pending_flip() actually made this bug
      even less severe since it allowed normal modesets to go through
      even though there's a pending flip.
      
      This is a regression introduced by me here:
       commit 75f7f3ec
       Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
       Date:   Tue Apr 15 21:41:34 2014 +0300
      
          drm/i915: Fix mmio vs. CS flip race on ILK+
      
      Testcase: igt/kms_flip/flip-vs-panning-vs-hang
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      bdfa7542
  3. 17 11月, 2014 2 次提交
  4. 11 11月, 2014 1 次提交
    • C
      drm/i915: Fix obj->map_and_fenceable across tiling changes · e9d784d5
      Chris Wilson 提交于
      As obj->map_and_fenceable computation has changed to only be set when
      the object is bound inside the global GTT (and is suitable aligned to a
      fence region) we need to accommodate those changes when the tiling is
      adjusted. The easiest solution is to unbind from the global GTT if we
      are currently fenceable, but will not be after the tiling change.
      
      The bug has been exposed by
      
      commit f8fcadba218fe6d23b2e353fea1cf0a4be4c9454
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Fri Oct 31 13:53:52 2014 +0000
      
          drm/i915: Only mark as map-and-fenceable when bound into the GGTT
      
      which tried to fix an oversight from
      
      commit e6a84468
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Mon Aug 11 12:00:12 2014 +0200
      
          drm/i915: Force CPU relocations if not GTT mapped
      
      which changed the handling of obj->map_and_fenceable.
      
      Note that the alignment check is a vestige from our attempts to reduce
      the alignment requirements of tiled but unfenced buffers on
      gen2/3. Also, that was when unbinding from the GTT meant UC writes and
      clflushing, so we went to great pains to avoid such.
      
      That leaves the actual bug of setting map_and_fenceable to true if we're
      not bound to ggtt, which violates the change introduced in the above
      patch. Unbinding in that case really looks like the simplest and safest
      option, we have to do it anyway.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85896
      Testcase: igt/gem_concurrent_blit/gttX*
      Tested-by: huax.lu@intel.com
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Tested-by: NValtteri Rantala <valtteri.rantala@intel.com>
      [Jani: amend commit message per input from Daniel and bisect result from
      Valtteri]
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      e9d784d5
  5. 07 11月, 2014 3 次提交
  6. 30 10月, 2014 1 次提交
  7. 29 10月, 2014 1 次提交
  8. 27 10月, 2014 3 次提交
    • V
      drm/i915: Fix GMBUSFREQ on vlv/chv · 6be1e3d3
      Ville Syrjälä 提交于
      vlv_cdclk_freq is in kHz but we need MHz for the GMBUSFREQ divider.
      
      This is a regression from:
      commit f8bf63fd
      Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Date:   Fri Jun 13 13:37:54 2014 +0300
      
          drm/i915: Kill duplicated cdclk readout code from i2c
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      6be1e3d3
    • V
      drm/i915: Ignore long hpds on eDP ports · 7a7f84cc
      Ville Syrjälä 提交于
      Turning vdd on/off can generate a long hpd pulse on eDP ports. In order
      to handle hpd we would need to turn on vdd to perform aux transfers.
      This would lead to an endless cycle of
      "vdd off -> long hpd -> vdd on -> detect -> vdd off -> ..."
      
      So ignore long hpd pulses on eDP ports. eDP panels should be physically
      tied to the machine anyway so they should not actually disappear and
      thus don't need long hpd handling. Short hpds are still needed for link
      re-train and whatnot so we can't just turn off the hpd interrupt
      entirely for eDP ports. Perhaps we could turn it off whenever the panel
      is disabled, but just ignoring the long hpd seems sufficient.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NDave Airlie <airlied@redhat.com>
      Reviewed-by: NTodd Previte <tprevite@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      7a7f84cc
    • V
      drm/i915: Do a dummy DPCD read before the actual read · f6a19066
      Ville Syrjälä 提交于
      Sometimes we seem to get utter garbage from DPCD reads. The resulting
      buffer is filled with the same byte, and the operation completed without
      errors. My HP ZR24w monitor seems particularly susceptible to this
      problem once it's gone into a sleep mode.
      
      The issue seems to happen only for the first AUX message that wakes the
      sink up. But as the first AUX read we often do is the DPCD receiver
      cap it does wreak a bit of havoc with subsequent link training etc. when
      the receiver cap bw/lane/etc. information is garbage.
      
      A sufficient workaround seems to be to perform a single byte dummy read
      before reading the actual data. I suppose that just wakes up the sink
      sufficiently and we can just throw away the returned data in case it's
      crap. DP_DPCD_REV seems like a sufficiently safe location to read here.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NTodd Previte <tprevite@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      f6a19066
  9. 16 10月, 2014 2 次提交
  10. 08 10月, 2014 1 次提交
  11. 06 10月, 2014 2 次提交
  12. 01 10月, 2014 1 次提交
    • C
      drm/i915: Enable pixel replicated modes on BDW and HSW. · ebb69c95
      Clint Taylor 提交于
      Haswell and later silicon has added a new pixel replication register
      to the pipe timings for each transcoder. Now in addition to the
      DPLL_A_MD register for the pixel clock double, we also need to write
      to the TRANS_MULT_n (0x6002c) register to double the pixel data. Writing
      to the DPLL only double the pixel clock.
      
      ver2: Macro name change from MULTIPLY to PIPE_MULTI. (Daniel)
      ver3: Do not set pixel multiplier if transcoder is eDP (Ville)
      ver4: Macro name change to PIPE_MULT and default else pixel_multiplier
      
      Cc: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Signed-off-by: NClint Taylor <clinton.a.taylor@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      [danvet: Appease checkpatch and move one hunk back into the right
      place that git am misplace!?]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ebb69c95
  13. 30 9月, 2014 1 次提交
  14. 29 9月, 2014 5 次提交
    • V
      drm/i915: Don't spam dmesg with rps messages on vlv/chv · 67956867
      Ville Syrjälä 提交于
      If the GPU frequency isn't going to change don't spam dmesg with
      debug messages about it.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      67956867
    • C
      drm/i915: Flush the PTEs after updating them before suspend · 91e56499
      Chris Wilson 提交于
      As we use WC updates of the PTE, we are responsible for notifying the
      hardware when to flush its TLBs. Do so after we zap all the PTEs before
      suspend (and the BIOS tries to read our GTT).
      
      Fixes a regression from
      
      commit 828c7908
      Author: Ben Widawsky <benjamin.widawsky@intel.com>
      Date:   Wed Oct 16 09:21:30 2013 -0700
      
          drm/i915: Disable GGTT PTEs on GEN6+ suspend
      
      that survived and continue to cause harm even after
      
      commit e568af1c
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Wed Mar 26 20:08:20 2014 +0100
      
          drm/i915: Undo gtt scratch pte unmapping again
      
      v2: Trivial rebase.
      v3: Fixes requires pointer dances.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82340
      Tested-by: ming.yao@intel.com
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Todd Previte <tprevite@gmail.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      91e56499
    • T
      drm/i915: Do not leak pages when freeing userptr objects · c479f438
      Tvrtko Ursulin 提交于
      sg_alloc_table_from_pages() can build us a table with coalesced ranges which
      means we need to iterate over pages and not sg table entries when releasing
      page references.
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: "Barbalho, Rafael" <rafael.barbalho@intel.com>
      Tested-by: NRafael Barbalho <rafael.barbalho@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      [danvet: Remove unused local variable sg.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      c479f438
    • C
      drm/i915: Do not store the error pointer for a failed userptr registration · e9681366
      Chris Wilson 提交于
      If we fail to create our mmu notification, we report the error back and
      currently store the error inside the i915_mm_struct. This not only causes
      subsequent registerations of the same mm to fail (an issue if the first
      was interrupted by a signal and needed to be restarted) but also causes
      us to eventually try and free the error pointer.
      
      [   73.419599] BUG: unable to handle kernel NULL pointer dereference at 000000000000004c
      [   73.419831] IP: [<ffffffff8114af33>] mmu_notifier_unregister+0x23/0x130
      [   73.420065] PGD 8650c067 PUD 870bb067 PMD 0
      [   73.420319] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
      [   73.420580] CPU: 0 PID: 42 Comm: kworker/0:1 Tainted: G        W      3.17.0-rc6+ #1561
      [   73.420837] Hardware name: Intel Corporation SandyBridge Platform/LosLunas CRB, BIOS ASNBCPT1.86C.0075.P00.1106281639 06/28/2011
      [   73.421405] Workqueue: events __i915_mm_struct_free__worker
      [   73.421724] task: ffff880088a81220 ti: ffff880088168000 task.ti: ffff880088168000
      [   73.422051] RIP: 0010:[<ffffffff8114af33>]  [<ffffffff8114af33>] mmu_notifier_unregister+0x23/0x130
      [   73.422410] RSP: 0018:ffff88008816bd50  EFLAGS: 00010286
      [   73.422765] RAX: 0000000000000003 RBX: ffff880086485400 RCX: 0000000000000000
      [   73.423137] RDX: ffff88016d80ee90 RSI: ffff880086485400 RDI: 0000000000000044
      [   73.423513] RBP: ffff88008816bd70 R08: 0000000000000001 R09: 0000000000000000
      [   73.423895] R10: 0000000000000320 R11: 0000000000000001 R12: 0000000000000044
      [   73.424282] R13: ffff880166e5f008 R14: ffff88016d815200 R15: ffff880166e5f040
      [   73.424682] FS:  0000000000000000(0000) GS:ffff88016d800000(0000) knlGS:0000000000000000
      [   73.425099] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   73.425537] CR2: 000000000000004c CR3: 0000000087f5f000 CR4: 00000000000407f0
      [   73.426157] Stack:
      [   73.426597]  ffff880088a81248 ffff880166e5f038 fffffffffffffffc ffff880166e5f008
      [   73.427096]  ffff88008816bd98 ffffffff814a75f2 ffff880166e5f038 ffff8800880f8a28
      [   73.427603]  ffff88016d812ac0 ffff88008816be00 ffffffff8106321a ffffffff810631af
      [   73.428119] Call Trace:
      [   73.428606]  [<ffffffff814a75f2>] __i915_mm_struct_free__worker+0x42/0x80
      [   73.429116]  [<ffffffff8106321a>] process_one_work+0x1ba/0x610
      [   73.429632]  [<ffffffff810631af>] ? process_one_work+0x14f/0x610
      [   73.430153]  [<ffffffff810636db>] worker_thread+0x6b/0x4a0
      [   73.430671]  [<ffffffff8108d67d>] ? trace_hardirqs_on+0xd/0x10
      [   73.431501]  [<ffffffff81063670>] ? process_one_work+0x610/0x610
      [   73.432030]  [<ffffffff8106a206>] kthread+0xf6/0x110
      [   73.432561]  [<ffffffff8106a110>] ? __kthread_parkme+0x80/0x80
      [   73.433100]  [<ffffffff8169c22c>] ret_from_fork+0x7c/0xb0
      [   73.433644]  [<ffffffff8106a110>] ? __kthread_parkme+0x80/0x80
      [   73.434194] Code: 0f 1f 84 00 00 00 00 00 66 66 66 66 90 8b 46 4c 85 c0 0f 8e 10 01 00 00 55 48 89 e5 41 55 41 54 53 48 89 f3 49 89 fc 48 83 ec 08 <48> 83 7f 08 00 0f 84 b1 00 00 00 48 c7 c7 40 e6 ac 82 e8 26 65
      [   73.435942] RIP  [<ffffffff8114af33>] mmu_notifier_unregister+0x23/0x130
      [   73.437017]  RSP <ffff88008816bd50>
      [   73.437704] CR2: 000000000000004c
      
      Fixes regression from commit ad46cb53
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Thu Aug 7 14:20:40 2014 +0100
      
          drm/i915: Prevent recursive deadlock on releasing a busy userptr
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84207
      Testcase: igt/gem_render_copy_redux
      Testcase: igt/gem_userptr_blits/create-destroy-sync
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Jacek Danecki <jacek.danecki@intel.com>
      Cc: "Gong, Zhipeng" <zhipeng.gong@intel.com>
      Cc: Jacek Danecki <jacek.danecki@intel.com>
      Cc: "Ursulin, Tvrtko" <tvrtko.ursulin@intel.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      e9681366
    • D
      Revert "drm/i915/bdw: BDW Software Turbo" · 7526ed79
      Daniel Vetter 提交于
      This reverts commit c76bb61a.
      
      It's apparently too broken so that Rodrigo submitted a patch to add a
      config option for it. Given that the design is also ... suboptimal and
      that I've only merged this to get lead engineers and managers off my
      back for one second let's just revert this.
      
      /me puts on combat gear again
      
      It was worth a shot ...
      
      References: http://mid.mail-archive.com/1411686380-1953-1-git-send-email-rodrigo.vivi@intel.com
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Daisy Sun <daisy.sun@intel.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      7526ed79
  15. 24 9月, 2014 2 次提交
  16. 23 9月, 2014 2 次提交
    • J
      drm/i915/hdmi: fix hdmi audio state readout · c84db770
      Jani Nikula 提交于
      Check the correct bit for audio. Seems like a copy-paste error from the
      start:
      
      commit 9ed109a7
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Apr 24 23:54:52 2014 +0200
      
          drm/i915: Track has_audio in the pipe config
      Reported-by: NMartin Andersen <martin.x.andersen@gmail.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82756
      Cc: stable@vger.kernel.org # 3.16+
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      c84db770
    • B
      drm/i915: Don't leak command parser tables on suspend/resume · 22cb99af
      Brad Volkin 提交于
      Ring init and cleanup are not balanced because we re-init the rings on
      resume without having cleaned them up on suspend. This leads to the
      driver leaking the parser's hash tables with a kmemleak signature such
      as this:
      
      unreferenced object 0xffff880405960980 (size 32):
        comm "systemd-udevd", pid 516, jiffies 4294896961 (age 10202.044s)
        hex dump (first 32 bytes):
          d0 85 46 c0 ff ff ff ff 00 00 00 00 00 00 00 00  ..F.............
          98 60 28 04 04 88 ff ff 00 00 00 00 00 00 00 00  .`(.............
        backtrace:
          [<ffffffff81816f9e>] kmemleak_alloc+0x4e/0xb0
          [<ffffffff811fa678>] kmem_cache_alloc_trace+0x168/0x2f0
          [<ffffffffc03e20a5>] i915_cmd_parser_init_ring+0x2a5/0x3e0 [i915]
          [<ffffffffc04088a2>] intel_init_ring_buffer+0x202/0x470 [i915]
          [<ffffffffc040c998>] intel_init_vebox_ring_buffer+0x1e8/0x2b0 [i915]
          [<ffffffffc03eff59>] i915_gem_init_hw+0x2f9/0x3a0 [i915]
          [<ffffffffc03f0057>] i915_gem_init+0x57/0x1d0 [i915]
          [<ffffffffc045e26a>] i915_driver_load+0xc0a/0x10e0 [i915]
          [<ffffffffc02e0d5d>] drm_dev_register+0xad/0x100 [drm]
          [<ffffffffc02e3b9f>] drm_get_pci_dev+0x8f/0x200 [drm]
          [<ffffffffc03c934b>] i915_pci_probe+0x3b/0x60 [i915]
          [<ffffffff81436725>] local_pci_probe+0x45/0xa0
          [<ffffffff81437a69>] pci_device_probe+0xd9/0x130
          [<ffffffff81524f4d>] driver_probe_device+0x12d/0x3e0
          [<ffffffff815252d3>] __driver_attach+0x93/0xa0
          [<ffffffff81522e1b>] bus_for_each_dev+0x6b/0xb0
      
      This patch extends the current convention of checking whether a
      resource is already allocated before allocating it during ring init.
      Longer term it might make sense to only init the rings once.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83794Tested-by: NKari Suvanto <kari.tj.suvanto@gmail.com>
      Signed-off-by: NBrad Volkin <bradley.d.volkin@intel.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      22cb99af
  17. 19 9月, 2014 11 次提交