1. 07 7月, 2014 13 次提交
  2. 04 7月, 2014 2 次提交
  3. 03 7月, 2014 3 次提交
  4. 02 7月, 2014 2 次提交
  5. 01 7月, 2014 2 次提交
    • P
      drm/i915: flush delayed_resume_work when suspending · 84a2ab8e
      Paulo Zanoni 提交于
      It is possible that, by the time we run i915_drm_freeze(),
      delayed_resume_work was already queued but did not run yet. If it
      still didn't run after intel_runtime_pm_disable_interrupts(), by the
      time it runs it will try to change the interrupt registers with the
      interrupts already disabled, which will trigger a WARN. We can
      reliably reproduce this with the pm_rpm system-suspend test case.
      
      In order to avoid the problem, we have to flush the work before
      disabling the interrupts. We could also cancel the work instead of
      flushing it, but that would require us to put a runtime PM reference -
      and any other resource we may need in the future - in case the work
      was already queued, so I believe flushing the work is more
      future-proof, although less efficient. But I can also change this part
      if someone requests.
      
      Another thing I tried was to move the intel_suspend_gt_powersave()
      call to before intel_runtime_pm_disable_interrupts(), but since that
      function needs to be called after the interrupts are already disabled,
      due to dev_priv->rps.work, this strategy didn't work.
      
      Testcase: igt/pm_rpm/system-suspend
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80517Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      84a2ab8e
    • D
      drm/i915: Drop early VLV WA to fix Voltage not getting dropped to Vmin · 5549d25f
      Deepak S 提交于
      Drop WA to fix Voltage not getting dropped to Vmin when Gfx is power
      gated for latest VLV revision.
      
      Workaround fixed in Latest VLV revision. Forcing Gfx clk up not needed,
      and Requesting the min freq should bring bring the voltage Vnn.
      
      v2: Drop WA for Latest VLV revision (Ville)
      Signed-off-by: NDeepak S <deepak.s@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      [Jani: modified code comment, reformatted the commit message a bit.]
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      5549d25f
  6. 30 6月, 2014 1 次提交
  7. 27 6月, 2014 1 次提交
    • V
      drm/i915: Wait for vblank after enabling the primary plane on BDW · 33c3b0d1
      Ville Syrjälä 提交于
      BDW signals the flip done interrupt immediately after the DSPSURF write
      when the plane is disabled. This is true even if we've already armed
      DSPCNTR to enable the plane at the next vblank. This causes major
      problems for our page flip code which relies on the flip done interrupts
      happening at vblank time.
      
      So what happens is that we enable the plane, and immediately allow
      userspace to submit a page flip. If the plane is still in the process
      of being enabled when the page flip is issued, the flip done gets
      signalled immediately. Our DSPSURFLIVE check catches this to prevent
      premature flip completion, but it also means that we don't get a flip
      done interrupt when the plane actually gets enabled, and so the page
      flip is never completed.
      
      Work around this by re-introducing blocking vblank waits on BDW
      whenever we enable the primary plane.
      
      I removed some of the vblank waits here:
       commit 6304cd91
       Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
       Date:   Fri Apr 25 13:30:12 2014 +0300
      
          drm/i915: Drop the excessive vblank waits from modeset codepaths
      
      To avoid these blocking vblank waits we should start using the vblank
      interrupt instead of the flip done interrupt to complete page flips.
      But that's material for another patch.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79354Tested-by: NGuo Jinxian <jinxianx.guo@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      33c3b0d1
  8. 25 6月, 2014 2 次提交
  9. 24 6月, 2014 2 次提交
    • C
      drm/i915: Hold the table lock whilst walking the file's idr and counting the objects in debugfs · 5b5ffff0
      Chris Wilson 提交于
      Fixes an issue whereby we may race with the table updates (before the
      core takes the struct_mutex) and so risk dereferencing a stale pointer in
      the iterator for /debugfs/.../i915_gem_objects. For example,
      
      [ 1524.757545] BUG: unable to handle kernel paging request at f53af748
      [ 1524.757572] IP: [<c1406982>] per_file_stats+0x12/0x100
      [ 1524.757599] *pdpt = 0000000001b13001 *pde = 00000000379fb067 *pte = 80000000353af060
      [ 1524.757621] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
      [ 1524.757637] Modules linked in: ctr ccm arc4 ath9k ath9k_common ath9k_hw ath snd_hda_codec_conexant mac80211 snd_hda_codec_generic snd_hda_intel snd_hda_controller snd_hda_codec bnep snd_hwdep rfcomm snd_pcm gpio_ich dell_wmi sparse_keymap snd_seq_midi hid_multitouch uvcvideo snd_seq_midi_event dell_laptop snd_rawmidi dcdbas snd_seq videobuf2_vmalloc videobuf2_memops videobuf2_core usbhid videodev snd_seq_device coretemp snd_timer hid joydev kvm_intel cfg80211 ath3k kvm btusb bluetooth serio_raw snd microcode soundcore lpc_ich wmi mac_hid parport_pc ppdev lp parport psmouse ahci libahci
      [ 1524.757825] CPU: 3 PID: 1911 Comm: intel-gpu-overl Tainted: G        W  OE 3.15.0-rc3+ #96
      [ 1524.757840] Hardware name: Dell Inc. Inspiron 1090/Inspiron 1090, BIOS A06 08/23/2011
      [ 1524.757855] task: f52f36c0 ti: f4cbc000 task.ti: f4cbc000
      [ 1524.757869] EIP: 0060:[<c1406982>] EFLAGS: 00210202 CPU: 3
      [ 1524.757884] EIP is at per_file_stats+0x12/0x100
      [ 1524.757896] EAX: 0000002d EBX: 00000000 ECX: f4cbdefc EDX: f53af700
      [ 1524.757909] ESI: c1406970 EDI: f53af700 EBP: f4cbde6c ESP: f4cbde5c
      [ 1524.757922]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      [ 1524.757934] CR0: 80050033 CR2: f53af748 CR3: 356af000 CR4: 000007f0
      [ 1524.757945] Stack:
      [ 1524.757957]  f4cbdefc 00000000 c1406970 f53af700 f4cbdea8 c12e5f15 f4cbdefc c1406970
      [ 1524.757993]  0000ffff f4cbde90 0000002d f5dc5cd0 e4e80438 c1181d59 f4cbded8 f4d89900
      [ 1524.758027]  f5631b40 e5131074 c1903f37 f4cbdf28 c14068e6 f52648a0 c1927748 c1903f37
      [ 1524.758062] Call Trace:
      [ 1524.758084]  [<c1406970>] ? i915_gem_object_info+0x510/0x510
      [ 1524.758106]  [<c12e5f15>] idr_for_each+0xa5/0x100
      [ 1524.758126]  [<c1406970>] ? i915_gem_object_info+0x510/0x510
      [ 1524.758148]  [<c1181d59>] ? seq_vprintf+0x29/0x50
      [ 1524.758168]  [<c14068e6>] i915_gem_object_info+0x486/0x510
      [ 1524.758189]  [<c11823a6>] seq_read+0xd6/0x380
      [ 1524.758208]  [<c116d11d>] ? final_putname+0x1d/0x40
      [ 1524.758227]  [<c11822d0>] ? seq_hlist_next_percpu+0x90/0x90
      [ 1524.758246]  [<c1163e52>] vfs_read+0x82/0x150
      [ 1524.758265]  [<c11645d6>] SyS_read+0x46/0x90
      [ 1524.758285]  [<c16b8d8c>] sysenter_do_call+0x12/0x22
      [ 1524.758298] Code: f5 8f 2a 00 83 c4 6c 31 c0 5b 5e 5f 5d c3 8d 74 26 00 8d bc 27 00 00 00 00 55 89 e5 57 56 53 83 ec 04 3e 8d 74 26 00 83 41 04 01 <8b> 42 48 01 41 08 8b 42 4c 89 d7 85 c0 75 07 8b 42 60 85 c0 74
      [ 1524.758461] EIP: [<c1406982>] per_file_stats+0x12/0x100 SS:ESP 0068:f4cbde5c
      [ 1524.758485] CR2: 00000000f53af748
      Reported-by: NSam Jansen <sam.jansen@starleaf.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Sam Jansen <sam.jansen@starleaf.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      5b5ffff0
    • C
      drm/i915: Only mark the ctx as initialised after a SET_CONTEXT operation · 967ab6b1
      Chris Wilson 提交于
      Fallout from
      
      commit 46470fc9
      Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Date:   Wed May 21 19:01:06 2014 +0300
      
          drm/i915: Add null state batch to active list
      
      undid the earlier fix of only marking the ctx as initialised after it is
      saved by the hardware during a SET_CONTEXT operation:
      
      commit ad1d2199
      Author: Ben Widawsky <benjamin.widawsky@intel.com>
      Date:   Sat Dec 28 13:31:49 2013 -0800
      
          drm/i915: set ctx->initialized only after RCS
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Damien Lespiau <damien.lespiau@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      [Jani: add reference to the earlier fix in the commit messsage.]
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      967ab6b1
  10. 23 6月, 2014 2 次提交
  11. 20 6月, 2014 6 次提交
    • D
      drm/i915: Update DRIVER_DATE to 20140620 · 34882298
      Daniel Vetter 提交于
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      34882298
    • K
      drivers/i915: Fix unnoticed failure of init_ring_common() · 9c33baa6
      Konrad Zapalowicz 提交于
      This commit add check for return value of init_ring_common() in the
      init_render_ring(). Now, when failure is detected the error code is
      propagated to the caller instead of being ignored.
      Signed-off-by: NKonrad Zapalowicz <bergo.torino@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9c33baa6
    • D
      drm/i915: Track frontbuffer invalidation/flushing · f99d7069
      Daniel Vetter 提交于
      So these are the guts of the new beast. This tracks when a frontbuffer
      gets invalidated (due to frontbuffer rendering) and hence should be
      constantly scaned out, and when it's flushed again and can be
      compressed/one-shot-upload.
      
      Rules for flushing are simple: The frontbuffer needs one more full
      upload starting from the next vblank. Which means that the flushing
      can _only_ be called once the frontbuffer update has been latched.
      
      But this poses a problem for pageflips: We can't just delay the
      flushing until the pageflip is latched, since that would pose the risk
      that we override frontbuffer rendering that has been scheduled
      in-between the pageflip ioctl and the actual latching.
      
      To handle this track asynchronous invalidations (and also pageflip)
      state per-ring and delay any in-between flushing until the rendering
      has completed. And also cancel any delayed flushing if we get a new
      invalidation request (whether delayed or not).
      
      Also call intel_mark_fb_busy in both cases in all cases to make sure
      that we keep the screen at the highest refresh rate both on flips,
      synchronous plane updates and for frontbuffer rendering.
      
      v2: Lots of improvements
      
      Suggestions from Chris:
      - Move invalidate/flush in flush_*_domain and set_to_*_domain.
      - Drop the flush in busy_ioctl since it's redundant. Was a leftover
        from an earlier concept to track flips/delayed flushes.
      - Don't forget about the initial modeset enable/final disable.
        Suggested by Chris.
      
      Track flips accurately, too. Since flips complete independently of
      rendering we need to track pending flips in a separate mask. Again if
      an invalidate happens we need to cancel the evenutal flush to avoid
      races.
      
      v3:
      Provide correct header declarations for flip functions. Currently not
      needed outside of intel_display.c, but part of the proper interface.
      
      v4: Add proper domain management to fbcon so that the fbcon buffer is
      also tracked correctly.
      
      v5: Fixup locking around the fbcon set_to_gtt_domain call.
      
      v6: More comments from Chris:
      - Split out fbcon changes.
      - Drop superflous checks for potential scanout before calling intel_fb
        functions - we can micro-optimize this later.
      - s/intel_fb_/intel_fb_obj_/ to make it clear that this deals in gem
        object. We already have precedence for fb_obj in the pin_and_fence
        functions.
      
      v7: Clarify the semantics of the flip flush handling by renaming
      things a bit:
      - Don't go through a gem object but take the relevant frontbuffer bits
        directly. These functions center on the plane, the actual object is
        irrelevant - even a flip to the same object as already active should
        cause a flush.
      - Add a new intel_frontbuffer_flip for synchronous plane updates. It
        currently just calls intel_frontbuffer_flush since the implemenation
        differs.
      
      This way we achieve a clear split between one-shot update events on
      one side and frontbuffer rendering with potentially a very long delay
      between the invalidate and flush.
      
      Chris and I also had some discussions about mark_busy and whether it
      is appropriate to call from flush. But mark busy is a state which
      should be derived from the 3 events (invalidate, flush, flip) we now
      have by the users, like psr does by tracking relevant information in
      psr.busy_frontbuffer_bits. DRRS (the only real use of mark_busy for
      frontbuffer) needs to have similar logic. With that the overall
      mark_busy in the core could be removed.
      
      v8: Only when retiring gpu buffers only flush frontbuffer bits we
      actually invalidated in a batch. Just for safety since before any
      additional usage/invalidate we should always retire current rendering.
      Suggested by Chris Wilson.
      
      v9: Actually use intel_frontbuffer_flip in all appropriate places.
      Spotted by Chris.
      
      v10: Address more comments from Chris:
      - Don't call _flip in set_base when the crtc is inactive, avoids redunancy
        in the modeset case with the initial enabling of all planes.
      - Add comments explaining that the initial/final plane enable/disable
        still has work left to do before it's fully generic.
      
      v11: Only invalidate for gtt/cpu access when writing. Spotted by Chris.
      
      v12: s/_flush/_flip/ in intel_overlay.c per Chris' comment.
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      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>
      f99d7069
    • D
      drm/i915: Use new frontbuffer bits to increase pll clock · cc36513c
      Daniel Vetter 提交于
      The downclocking checks a few more things, so not that simple to
      convert. Also, this should get unified with the drrs handling and also
      use the locking of that. Otoh the drrs locking is about as hapzardous
      as no locking, at least on first sight.
      
      For easier conversion ditch the upclocking on unload - we'll turn off
      everything anyway.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cc36513c
    • J
      drm/i915: don't take runtime PM reference around freeze/thaw · 395a5abb
      Jesse Barnes 提交于
      We should be taking the right power well refs these days, so this
      shouldn't be necessary.  It also gets in the way of re-using these
      routines for S0iX states, as those need all the power saving features
      enabled.
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      395a5abb
    • J
      drm/i915: use runtime irq suspend/resume in freeze/thaw · e11aa362
      Jesse Barnes 提交于
      We don't need to uninstall the full handler, simply disabling interrupts
      ought to be enough.
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e11aa362
  12. 19 6月, 2014 4 次提交
    • D
      drm/i915: Properly track domain of the fbcon fb · e991077e
      Daniel Vetter 提交于
      X could end up putting the fbcon fb into other domains, e.g.
      for smooth take-overs. Also we want this for accurate frontbuffer
      tracking: The set_config is an implicit flush and will re-enable
      psr and similar features, so we need to bring the bo back into
      the gtt domain.
      
      v2: Add FIXME comment about fbcon locking fun in atomic context,
      requested by Chris.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e991077e
    • D
      drm/i915: Print obj->frontbuffer_bits in debugfs output · d5a81ef1
      Daniel Vetter 提交于
      Can be useful to figure out imbalances and bugs in the frontbuffer
      tracking.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d5a81ef1
    • D
      drm/i915: Introduce accurate frontbuffer tracking · a071fa00
      Daniel Vetter 提交于
      So from just a quick look we seem to have enough information to
      accurately figure out whether a given gem bo is used as a frontbuffer
      and where exactly: We have obj->pin_count as a first check with no
      false negatives and only negligible false positives. And then we can
      just walk the modeset objects and figure out where exactly a buffer is
      used as scanout.
      
      Except that we can't due to locking order: If we already hold
      dev->struct_mutex we can't acquire any modeset locks, so could
      potential chase freed pointers and other evil stuff.
      
      So we need something else. For that introduce a new set of bits
      obj->frontbuffer_bits to track where a buffer object is used. That we
      can then chase without grabbing any modeset locks.
      
      Of course the consumers of this (DRRS, PSR, FBC, ...) still need to be
      able to do their magic both when called from modeset and from gem
      code. But that can be easily achieved by adding locks for these
      specific subsystems which always nest within either kms or gem
      locking.
      
      This patch just adds the relevant update code to all places.
      
      Note that if we ever support multi-planar scanout targets then we need
      one frontbuffer tracking bit per attachment point that we expose to
      userspace.
      
      v2:
      - Fix more oopsen. Oops.
      - WARN if we leak obj->frontbuffer_bits when freeing a gem buffer. Fix
        the bugs this brought to light.
      - s/update_frontbuffer_bits/update_fb_bits/. More consistent with the
        fb tracking functions (fb for gem object, frontbuffer for raw bits).
        And the function name was way too long.
      
      v3: Size obj->frontbuffer_bits correctly so that all pipes fit in.
      
      v4: Don't update fb bits in set_base on failure. Noticed by Chris.
      
      v5: s/i915_gem_update_fb_bits/i915_gem_track_fb/ Also remove a few
      local enum pipe variables which are now no longer needed to make the
      function arguments no drop over the 80 char limit.
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      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>
      a071fa00
    • D
      drm/i915: Drop schedule_back from psr_exit · 3108e99e
      Daniel Vetter 提交于
      It doesn't make sense to never again schedule the work, since by the
      time we might want to re-enable psr the world might have changed and
      we can do it again.
      
      The only exception is when we shut down the pipe, but that's an
      entirely different thing and needs to be handled in psr_disable.
      
      Note that later patch will again split psr_exit into psr_invalidate
      and psr_flush. But the split is different and this simplification
      helps with the transition.
      
      v2: Improve the commit message a bit.
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3108e99e