1. 11 7月, 2013 7 次提交
    • D
      drm/i915: queue work outside spinlock in hsw_pm_irq_handler · 2adbee62
      Daniel Vetter 提交于
      And kill the comment about it. Queueing work is a barrier type event,
      no amount of locking will help in ordering things (as long as we queue
      the work after having updated all relevant data structures). Also, the
      queue_work works itself as a sufficient memory barrier.
      
      Again on the surface this is just a tiny micro-optimization to reduce
      the hold-time of dev_priv->irq_lock. But the better reason is that it
      reduces superficial locking and so makes it clearer what we actually
      need for correctness.
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2adbee62
    • D
      drm/i915: streamline hsw_pm_irq_handler · 41a05a3a
      Daniel Vetter 提交于
      The if (pm_iir & ~GEN6_PM_RPS_EVENTS) check was redunandant. Otoh
      adding a check for rps events allows us to avoid the spinlock grabbing
      for VECS interrupts.
      
      v2: Drop misplaced hunk which now moved to the right patch.
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      41a05a3a
    • D
      drm/i915: irq handlers don't need interrupt-safe spinlocks · d0ecd7e2
      Daniel Vetter 提交于
      Since we only have one interrupt handler and interrupt handlers are
      non-reentrant.
      
      To drive the point really home give them all an _irq_handler suffix.
      
      This is a tiny micro-optimization but even more important it makes it
      clearer what locking we actually need. And in case someone screws this
      up: lockdep will catch hardirq vs. other context deadlocks.
      
      v2: Fix up compile fail.
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d0ecd7e2
    • D
      drm/i915: kill lpt pch transcoder->crtc mapping code for fifo underruns · de28075d
      Daniel Vetter 提交于
      It's racy: There's no guarantee that we won't walk this code (due to a
      pch fifo underrun interrupt) while someone is changing the pointers
      around.
      
      The only reason we do this is to use the righ crtc for the pch fifo
      underrun accounting. But we never expose this to userspace, so
      essentially no one really cares if we use the "wrong" crtc.
      
      So let's just rip it out.
      
      With this patch fifo underrun code will always use crtc A for tracking
      underruns on the (only) pch transcoder on LPT.
      
      v2: Add a big comment explaining what's going on. Requested by Paulo.
      
      v3: Fixup spelling in comment as spotted by Paulo.
      
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      de28075d
    • D
      drm/i915: improve GEN7_ERR_INT clearing for fifo underrun reporting · 7336df65
      Daniel Vetter 提交于
      Same treatment as for SERR_INT: If we clear only the bit for the pipe
      we're enabling (but unconditionally) then we can always check for
      possible underruns after having disabled the interrupt. That way pipe
      underruns won't be lost, but at worst only get reported in a delayed
      fashion.
      
      v2: The same logic bug as in the SERR handling change also existed
      here. The same bugfix of only reporting missed underruns when the
      error interrupt was masked applies, too.
      
      v3: Do the same fixes as for the SERR handling that Paulo suggested in
      his review:
      - s/%i/%c/ fix in the debug output
      - move the DE_ERR_INT_IVB read into the respective if block
      
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Fix up the checkpatch bikeshed Paulo noticed.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7336df65
    • D
      drm/i915: improve SERR_INT clearing for fifo underrun reporting · 1dd246fb
      Daniel Vetter 提交于
      The current code won't report any fifo underruns on cpt if just one
      pipe has fifo underrun reporting disabled. We can't enable the
      interrupts, but we can still check the per-transcoder bits and so
      report the underrun delayed if:
      - We always clear the transcoder's bit (and none of the other bits)
        when enabling.
      - We check the transcoder's bit after disabling (to avoid racing with
        the interrupt handler).
      
      v2: I've forgotten to actually remove the old SERR_INT clearing.
      
      v3: Use transcoder_name as suggested by Paulo Zanoni. Paulo also
      noticed a logic bug: When an underrun interrupt fires we report it
      both in the interrupt handler and when checking for underruns when
      disabling it in cpt_set_fifo_underrun_reporting. But that second check
      is only required if the interrupt is disabled and we're switching of
      underrun reporting (e.g. because we're disabling the crtc). Hence
      check for that condition.
      
      At first I wanted to rework the code to pass that bit of information
      from the uppper functions down to cpt_set_fifo_underrun_reporting. But
      that turned out too messy. Hence the quick&dirty check whether the
      south error interrupt source is masked off or not.
      
      v4: Streamline the control flow a bit.
      
      v5: s/pipe/pch transcoder/ in the dmesg output, suggested by Paulo.
      
      v6: Review from Paulo:
      - Reorder the was_enabled assignment to only read the register when we
        need it. Also add a comment that we need to do that before updating
        the register.
      - s/%i/%c/ fix for the debug output.
      - Fix the checkpath complaint in the SERR_INT_TRANS_FIFO_UNDERRUN
        #define.
      
      v7: Hopefully put that elusive SERR hunk back into this patch, spotted
      by Paulo.
      
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1dd246fb
    • D
      drm/i915: extract ibx_display_interrupt_update · fee884ed
      Daniel Vetter 提交于
      This way all changes to SDEIMR all go through the same function, with
      the exception of the (single-threaded) setup/teardown code.
      
      For paranoia again add an assert_spin_locked.
      
      v2: For even more paranoia also sprinkle a spinlock assert over
      cpt_can_enable_serr_int since we need to have that one there, too.
      
      v3: Fix the logic of interrupt enabling, add enable/disable macros for
      the simple cases in the fifo code and add a comment. All requested by
      Paulo.
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fee884ed
  2. 09 7月, 2013 1 次提交
    • B
      drm/i915: Getter/setter for object attributes · f343c5f6
      Ben Widawsky 提交于
      Soon we want to gut a lot of our existing assumptions how many address
      spaces an object can live in, and in doing so, embed the drm_mm_node in
      the object (and later the VMA).
      
      It's possible in the future we'll want to add more getter/setter
      methods, but for now this is enough to enable the VMAs.
      
      v2: Reworked commit message (Ben)
      Added comments to the main functions (Ben)
      sed -i "s/i915_gem_obj_set_color/i915_gem_obj_ggtt_set_color/" drivers/gpu/drm/i915/*.[ch]
      sed -i "s/i915_gem_obj_bound/i915_gem_obj_ggtt_bound/" drivers/gpu/drm/i915/*.[ch]
      sed -i "s/i915_gem_obj_size/i915_gem_obj_ggtt_size/" drivers/gpu/drm/i915/*.[ch]
      sed -i "s/i915_gem_obj_offset/i915_gem_obj_ggtt_offset/" drivers/gpu/drm/i915/*.[ch]
      (Daniel)
      
      v3: Rebased on new reserve_node patch
      Changed DRM_DEBUG_KMS to actually work (will need fixing later)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f343c5f6
  3. 06 7月, 2013 1 次提交
  4. 02 7月, 2013 1 次提交
  5. 01 7月, 2013 13 次提交
  6. 18 6月, 2013 1 次提交
  7. 13 6月, 2013 1 次提交
  8. 11 6月, 2013 3 次提交
  9. 06 6月, 2013 1 次提交
  10. 03 6月, 2013 3 次提交
  11. 01 6月, 2013 8 次提交
    • B
      drm/i915: Enable vebox interrupts · 12638c57
      Ben Widawsky 提交于
      Similar to a patch originally written by:
      
      v2: Reversed the meanings of masked and enabled (Haihao)
      Made non-destructive writes in case enable/disabler rps runs first
      (Haihao)
      
      v3: Reword error message (Damien)
      Modify postinstall to do the right thing based on previous fixup. (Ben)
      
      CC: Xiang, Haihao <haihao.xiang@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      12638c57
    • B
      drm/i915: consolidate interrupt naming scheme · cc609d5d
      Ben Widawsky 提交于
      The motivation here is we're going to add some new interrupt definitions
      and handling outside of the GT interrupts which is all we've managed so
      far (with some RPS exceptions). By consolidating the names in the future
      we can make thing a bit cleaner as we don't need to define register
      names twice, and we can leverage pretty decent overlap in HW registers
      since ILK.
      
      To explain briefly what is in the comments: there are two sets of
      interrupt masking/enabling registers. At least so far, the definitions
      of the two sets overlap. The old code setup distinct names for
      interrupts in each set, ie. one for global, and one for ring. This made
      things confusing when using the wrong defines in the wrong places.
      
      rebase: Modified VLV bits
      
      v2: Renamed GT_RENDER_MASTER to GT_RENDER_CS_MASTER (Damien)
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cc609d5d
    • B
      drm/i915: make PM interrupt writes non-destructive · 4848405c
      Ben Widawsky 提交于
      PM interrupts have an expanded role on HSW. It helps route the EBOX
      interrupts. This patch is necessary to make the existing code which
      touches the mask, and enable registers more friendly to other code paths
      that also will need these registers.
      
      To be more explicit:
      At preinstall all interrupts are masked and disabled. This implies that
      preinstall should always happen before any enabling/disabling of RPS or
      other interrupts.
      
      The PMIMR is touched by the workqueue, so enable/disable touch IER and
      IIR. Similarly, the code currently expects IMR has no use outside of the
      RPS related interrupts so they unconditionally set 0, or ~0. We could
      use IER in the workqueue, and IMR elsewhere, but since the workqueue
      use-case is more transient the existing usage makes sense.
      
      Disable RPS events:
      IER := IER & ~GEN6_PM_RPS_EVENTS // Disable RPS related interrupts
      IIR := GEN6_PM_RPS_EVENTS // Disable any outstanding interrupts
      
      Enable RPS events:
      IER := IER | GEN6_PM_RPS_EVENTS // Enable the RPS related interrupts
      IIR := GEN6_PM_RPS_EVENTS // Make sure there were no leftover events
      (really shouldn't happen)
      
      v2: Shouldn't destroy PMIIR or PMIMR VEBOX interrupt state in
      enable/disable rps functions (Haihao)
      
      v3: Bug found by Chris where we were clearing the wrong bits at rps
      disable.
          expanded commit message
      
      v4: v3 was based off the wrong branch
      
      v5: Added the setting of PMIMR because of previous patch update
      
      CC: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4848405c
    • B
      drm/i915: Add PM regs to pre/post install · eda63ffb
      Ben Widawsky 提交于
      At the moment, these values are wiped out anyway by the rps
      enable/disable. That will be changed in the next patch though.
      
      v2: Add post install setup to address issue found by Damien in the next
      patch.
      replaced
      WARN_ON(dev_priv->rps.pm_iir != 0);
      with rps.pm_iir = 0;
      
      With the v2 of this patch and the deferred pm enabling (which changed
      since the original patches) we're now able to get PM interrupts before
      we've brought up enabled rps. At this point in boot, we don't want to do
      anything about it, so we simply ignore it. Since writing the original
      assertion, the code has changed quite a bit, and I believe removing this
      assertion is perfectly safe.
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      [danvet: I don't agree with the justification to drop the WARN and
      added a FIXME to that effect.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      eda63ffb
    • B
      drm/i915: Create an ivybridge_irq_preinstall · 7d99163d
      Ben Widawsky 提交于
      Just duplicates ironlake_irq_preinstall for now.
      
      v2: Add new PCH_NOP check (Damien)
      Add SDEIMR comment (Damien)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      [danvet: Update now outdated comment.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7d99163d
    • B
      drm/i915: Create a more generic pm handler for hsw+ · baf02a1f
      Ben Widawsky 提交于
      HSW has some special requirements for the VEBOX. Splitting out the
      interrupt handler will make the code a bit nicer and less error prone
      when we begin to handle those.
      
      The slight functional change in this patch (queueing work while holding
      the spinlock) is intentional as it makes a subsequent patch a bit nicer.
      The change should also only effect HSW platforms.
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      baf02a1f
    • D
      drm/i915: fix pch_nop support · 692a04cf
      Daniel Vetter 提交于
      This was accidentally broken in the south error interrupt handling
      work:
      
      commit 8664281b
      Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Date:   Fri Apr 12 17:57:57 2013 -0300
      
          drm/i915: report Gen5+ CPU and PCH FIFO underruns
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      692a04cf
    • D
      drm/i915: fixup i915_pipe_enabled check in i915_irq.c · a01025af
      Daniel Vetter 提交于
      Well, as well as we can without completely revamping the drm vblank
      code. The issue are that
      - The vblank code needs to work on both ums and kms.
      - It deals always deals with pipes.
      - It doesn't take any of the kms locks.
      
      The last part is not really fixable without revamping the drm vblank
      code, since the drm core <-> driver interactions is a veritable pile
      of spaghettis. But the other pieces can be fixed by switching on the
      MODESET driver flag and either checking the hw state directly (ums
      case) or just querying our sw tracking (with broken locking, but
      that's not worse than what we've had).
      
      Note that this essentially reverts
      
      commit 702e7a56
      Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Date:   Tue Oct 23 18:29:59 2012 -0200
      
          drm/i915: convert PIPECONF to use transcoder instead of pipe
      
      for the ums case, which will fix a NULL deref (since we really don't
      have any crtcs set up).
      
      But the real reason to do this is to drop our reliance on the
      cpu_transcoder: By only checking intel_crtc->active we don't need to
      make sure that the pipe_config (or at least the cpu_transcoder)
      contain safe values even when the pipe is off.
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Damien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a01025af