1. 13 5月, 2014 1 次提交
    • 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
  2. 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
  3. 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
  4. 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
  5. 09 4月, 2014 1 次提交
  6. 03 4月, 2014 1 次提交
  7. 02 4月, 2014 24 次提交
  8. 31 3月, 2014 2 次提交
  9. 29 3月, 2014 3 次提交
    • C
      drm/i915: Broadwell expands ACTHD to 64bit · 50877445
      Chris Wilson 提交于
      As Broadwell has an increased virtual address size, it requires more
      than 32 bits to store offsets into its address space. This includes the
      debug registers to track the current HEAD of the individual rings, which
      may be anywhere within the per-process address spaces. In order to find
      the full location, we need to read the high bits from a second register.
      We then also need to expand our storage to keep track of the larger
      address.
      
      v2: Carefully read the two registers to catch wraparound between
          the reads.
      v3: Use a WARN_ON rather than loop indefinitely on an unstable
          register read.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Cc: Timo Aaltonen <tjaalton@ubuntu.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: Drop spurious hunk which conflicted.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      50877445
    • D
      drm/i915: Track the enabled PM interrupts in dev_priv. · a6706b45
      Deepak S 提交于
      When we use different rps events for different platforms or due to wa,
      we might end up needing this logic in a lot of places. Instead of
      this let's use a variable in dev_priv to track the enabled PM
      interrupts.
      
      v2: Initialize pm_rps_events in intel_irq_init() (Ville).
      Signed-off-by: NDeepak S <deepak.s@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      [danvet: Frob the commit message a bit since the English was a bit too
      garbled ;-) ]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a6706b45
    • D
      drm/i915: fix up semaphore_waits_for · 88fe429d
      Daniel Vetter 提交于
      There's an entire pile of issues in here:
      
      - Use the main RING_HEAD register, not ACTHD. ACTHD points at the gtt
        offset of the batch buffer when a batch is executed. Semaphores are
        always emitted to the main ring, so we always want to look at that.
      
      - Mask the obtained HEAD pointer with the actual ring size, which is
        much smaller. Together with the above issue this resulted us in
        trying to dereference a pointer way outside of the ring mmio
        mapping. The resulting invalid access in interrupt context
        (hangcheck is executed from timers) lead to a full blown kernel
        panic. The fbcon panic handler then tried to frob our driver harder,
        resulting in a full machine hang at least on my snb here where I've
        stumbled over this.
      
      - Handle ring wrapping correctly and be a bit more explicit about how
        many dwords we're scanning. We probably should also scan more than
        just 4 ...
      
      - Space out some of teh computations for readability.
      
      This reduces hard-hangs on my snb here. Mika and QA both say that it
      doesn't completel remove them, but at least for me it's a clear
      improvement in stability.
      
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      References: https://bugs.freedesktop.org/show_bug.cgi?id=74100Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      88fe429d