1. 20 5月, 2014 1 次提交
  2. 17 5月, 2014 1 次提交
  3. 16 5月, 2014 1 次提交
    • B
      drm/i915/bdw: Implement a basic PM interrupt handler · 0961021a
      Ben Widawsky 提交于
      Almost all of it is reusable from the existing code. The primary
      difference is we need to do even less in the interrupt handler, since
      interrupts are not shared in the same way.
      
      The patch is mostly a copy-paste of the existing snb+ code, with updates
      to the relevant parts requiring changes to the interrupt handling. As
      such it /should/ be relatively trivial. It's highly likely that I missed
      some places where I need a gen8 version of the PM interrupts, but it has
      become invisible to me by now.
      
      This patch could probably be split into adding the new functions,
      followed by actually handling the interrupts. Since the code is
      currently disabled (and broken) I think the patch stands better by
      itself.
      
      v2: Move the commit about not touching the ringbuffer interrupt to the
      snb_* function where it belongs (Rodrigo)
      
      v3: Rebased on Paulo's runtime PM changes
      
      v4: Not well validated, but rebase on
      commit 730488b2
      Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Date:   Fri Mar 7 20:12:32 2014 -0300
      
          drm/i915: kill dev_priv->pm.regsave
      
      v5: Rebased on latest code base. (Deepak)
      
      v6: Remove conflict markers, Unnecessary empty line and use right
      IIR interrupt (Ville)
      
      v7: mask modified without rmw (Ville Syrjälä)
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDeepak S <deepak.s@linux.intel.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0961021a
  4. 13 5月, 2014 2 次提交
    • D
      drm/i915: Drop unecessary casts in i915_irq.c · 45a83f84
      Daniel Vetter 提交于
      Inspired by a review bikeshed from Jani.
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      45a83f84
    • V
      drm/i915/chv: Preliminary interrupt support for Cherryview · 43f328d7
      Ville Syrjälä 提交于
      CHV has the Gen8 master interrupt register, as well as Gen8
      GT/PCU interrupt registers.
      
      The display block is based on VLV, with the main difference
      of adding pipe C.
      
      v2: Rewrite the order of operations to make more sense
          Don't bail out if MASTER_CTL register doesn't show an interrupt,
          as display interrupts aren't reported there.
      
      v3: Rebase on top of Egbert Eich's hpd irq handling rework by using
      the relevant port hotplug logic like for vlv.
      
      v4: Rebase on top of Ben's gt irq #define refactoring.
      
      v5: Squash in gen8_gt_irq_handler refactoring from Zhao Yakui
      <yakui.zhao@intel.com>
      
      v6: Adapt to upstream changes, dev_priv->irq_received is gone.
      
      v7: Enable 3 the commented-out 3 pipe support.
      
      v8: Rebase on top of Paulo's irq setup rework, use the renamed macros from
      upstream.
      
      v9: Grab irq_lock around i915_enable_pipestat()
      
      FIXME: There's probably some potential for more shared code between bdw and chv.
      
      Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v2)
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      [danvet: Drop the unnecessary cast Jani spotted.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      43f328d7
  5. 06 5月, 2014 1 次提交
    • V
      drm/i915: Make sprite updates atomic · 8d7849db
      Ville Syrjälä 提交于
      Add a mechanism by which we can evade the leading edge of vblank. This
      guarantees that no two sprite register writes will straddle on either
      side of the vblank start, and that means all the writes will be latched
      together in one atomic operation.
      
      We do the vblank evade by checking the scanline counter, and if it's too
      close to the start of vblank (too close has been hardcoded to 100usec
      for now), we will wait for the vblank start to pass. In order to
      eliminate random delayes from the rest of the system, we operate with
      interrupts disabled, except when waiting for the vblank obviously.
      
      Note that we now go digging through pipe_to_crtc_mapping[] in the
      vblank interrupt handler, which is a bit dangerous since we set up
      interrupts before the crtcs. However in this case since it's the vblank
      interrupt, we don't actually unmask it until some piece of code
      requests it.
      
      v2: preempt_check_resched() calls after local_irq_enable() (Jesse)
          Hook up the vblank irq stuff on BDW as well
      v3: Pass intel_crtc instead of drm_crtc (Daniel)
          Warn if crtc.mutex isn't locked (Daniel)
          Add an explicit compiler barrier and document the barriers (Daniel)
          Note the irq vs. modeset setup madness in the commit message (Daniel)
      v4: Use prepare_to_wait() & co. directly and eliminate vbl_received
      v5: Refactor intel_pipe_handle_vblank() vs. drm_handle_vblank() (Chris)
          Check for min/max scanline <= 0 (Chris)
          Don't call intel_pipe_update_end() if start failed totally (Chris)
          Check that the vblank counters match on both sides of the critical
          section (Chris)
      v6: Fix atomic update for interlaced modes
      v7: Reorder code for better readability (Chris)
      v8: Drop preempt_check_resched(). It's not available to modules
          anymore and isn't even needed unless we ourselves cause
          a wakeup needing reschedule while interrupts are off
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NSourab Gupta <sourabgupta@gmail.com>
      Reviewed-by: NAkash Goel <akash.goels@gmail.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8d7849db
  6. 05 5月, 2014 6 次提交
    • B
      drm/i915: Move semaphore specific ring members to struct · ebc348b2
      Ben Widawsky 提交于
      This will be helpful in abstracting some of the code in preparation for
      gen8 semaphores.
      
      v2: Move mbox stuff to a separate struct
      
      v3: Rebased over VCS2 work
      
      Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v1)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ebc348b2
    • V
      drm/i915: Add intel_get_crtc_scanline() · a225f079
      Ville Syrjälä 提交于
      Add a new function intel_get_crtc_scanline() that returns the current
      scanline counter for the crtc.
      
      v2: Rebase after vblank timestamp changes.
          Use intel_ prefix instead of i915_ as is more customary for
          display related functions.
          Include DRM_SCANOUTPOS_INVBL in the return value even w/o
          adjustments, for a bit of extra consistency.
      v3: Change the implementation to be based on DSL on all gens,
          since that's enough for the needs of atomic updates, and
          it will avoid complicating the scanout position calculations
          for the vblank timestamps
      v4: Don't break scanline wraparound for interlaced modes
      Reviewed-by: NSourab Gupta <sourabgupta@gmail.com>
      Reviewed-by: NAkash Goel <akash.goels@gmail.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a225f079
    • V
      drm/i915: Fix scanout position for real · 78e8fc6b
      Ville Syrjälä 提交于
      Seems I've been a bit dense with regards to the start of vblank
      vs. the scanline counter / pixel counter.
      
      After staring at the pixel counter on gen4 I came to the conclusion
      that the start of vblank interrupt and scanline counter increment
      happen at the same time. The scanline counter increment is documented
      to occur at start of hsync, which means that the start of vblank
      interrupt must also trigger there. Looking at the pixel counter value
      when the scanline wraps from vtotal-1 to 0 confirms that, as the pixel
      counter at that point reads hsync_start. This also clarifies why we see
      need the +1 adjustment to the scaline counter. The counter actually
      starts counting from vtotal-1 on the first active line.
      
      I also confirmed that the frame start interrupt happens ~1 line after
      the start of vblank, but the frame start occurs at hblank_start instead.
      We only use the frame start interrupt on gen2 where the start of vblank
      interrupt isn't available. The only important thing to note here is that
      frame start occurs after vblank start, so we don't have to play any
      additional tricks to fix up the scanline counter.
      
      The other thing to note is the fact that the pixel counter on gen3-4
      starts counting from the start of horizontal active on the first active
      line. That means that when we get the start of vblank interrupt, the
      pixel counter reads (htotal*(vblank_start-1)+hsync_start). Since we
      consider vblank to start at (htotal*vblank_start) we need to add a
      constant (htotal-hsync_start) offset to the pixel counter, or else we
      risk misdetecting whether we're in vblank or not.
      
      I talked a bit with Art Runyan about these topics, and he confirmed my
      findings. And that the same rules should hold for platforms which don't
      have the pixel counter. That's good since without the pixel counter it's
      rather difficult to verify the timings to this accuracy.
      
      So the conclusion is that we can throw away all the ISR tricks I added,
      and just increment the scanline counter by one always.
      Reviewed-by: NSourab Gupta <sourabgupta@gmail.com>
      Reviewed-by: NAkash Goel <akash.goels@gmail.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      78e8fc6b
    • I
      drm/i915: get a runtime PM ref for the deferred GPU reset work · f454c694
      Imre Deak 提交于
      Atm we can end up in the GPU reset deferred work in D3 state if the last
      runtime PM reference is dropped between detecting a hang/scheduling the
      work and executing the work. At least one such case I could trigger is
      the simulated reset via the i915_wedged debugfs entry. Fix this by
      getting an RPM reference around accessing the HW in the reset work.
      
      v2:
      - Instead of getting/putting the RPM reference in the reset work itself,
        get it already before scheduling the work. By this we also prevent
        going to D3 before the work gets to run, in addition to making sure
        that we run the work itself in D0. (Ville, Daniel)
      v3:
      - fix inverted logic fail when putting the RPM ref on behalf of a
        cancelled GPU reset work (Ville)
      v4:
      - Taking the RPM ref in the interrupt handler isn't really needed b/c
        it's already guaranteed that we hold an RPM ref until the end of the
        reset work in all cases we care about. So take the ref in the reset
        work (for cases like i915_wedged_set). (Daniel)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f454c694
    • I
      drm/i915: vlv: clear master interrupt flag when disabling interrupts · 843d0e7d
      Imre Deak 提交于
      Not clearing this flag causes spurious interrupts at least in D3 state,
      so before enabling RPM we need to fix this. We were already setting this
      flag when enabling interrupts, only clearing it was missing.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      843d0e7d
    • Z
  7. 25 4月, 2014 1 次提交
    • D
      drm/i915: Don't WARN nor handle unexpected hpd interrupts on gmch platforms · 3ff04a16
      Daniel Vetter 提交于
      The status bits are unconditionally set, the control bits only enable
      the actual interrupt generation. Which means if we get some random
      other interrupts we'll bogusly complain about them.
      
      So restrict the WARN to platforms with a sane hotplug interrupt
      handling scheme. And even more important also don't attempt to process
      the hpd bit since we've detected a storm already. Instead just clear
      the bit silently.
      
      This WARN has been introduced in
      
      commit b8f102e8
      Author: Egbert Eich <eich@suse.de>
      Date:   Fri Jul 26 14:14:24 2013 +0200
      
          drm/i915: Add messages useful for HPD storm detection debugging (v2)
      
      before that we silently handled the hpd event and so partially
      defeated the storm detection.
      
      v2: Pimp commit message (Jani)
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Egbert Eich <eich@suse.de>
      Cc: bitlord <bitlord0xff@gmail.com>
      Reported-by: Nbitlord <bitlord0xff@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      3ff04a16
  8. 09 4月, 2014 1 次提交
  9. 03 4月, 2014 1 次提交
  10. 02 4月, 2014 24 次提交
  11. 31 3月, 2014 1 次提交