1. 25 1月, 2014 3 次提交
  2. 20 1月, 2014 4 次提交
    • V
      drm/i915: Add a kludge for DSL incrementing too late and ISR not working · 095163ba
      Ville Syrjälä 提交于
      On pre-PCH platforms ISR doesn't seem to be an actual ISR, at least as
      far as display interrupts are concerned. Instead it sort of looks like
      some ISR bits just directly reflect the corresponding bit from PIPESTAT.
      The bit appears in the ISR only if the PIPESTAT interrupt is enabled. So
      in that sense it sort of looks a bit like the south interrupt scheme on
      PCH platforms. So it goes something a bit like this:
      PIPESTAT.status & PIPESTAT.enable -> ISR -> IMR -> IIR -> IER -> actual
      interrupt
      
      In any case that means the intel_pipe_in_vblank_locked() doesn't actually
      work for pre-PCH platforms. As a last resort, add a similar kludge as radeon
      has that fixes things up if we got called from the vblank interrupt,
      but the scanline counter value indicates that we're not quite there yet.
      We know that the scanline counter increments at hsync but is otherwise
      accurate, so we can limit the kludge to the line just prior to vblank
      start, instead of the relative distance that radeon uses.
      
      Reviewed-by: mario.kleiner.de@gmail.com
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      095163ba
    • V
      drm: Pass 'flags' from the caller to .get_scanout_position() · abca9e45
      Ville Syrjälä 提交于
      Preparation for moving the early vblank IRQ logic into
      radeon_get_crtc_scanoutpos().
      
      v2: Fix radeon_drv.c compile warning (Mario)
      
      Reviewed-by: mario.kleiner.de@gmail.com
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      abca9e45
    • V
      drm/i915: Fix scanoutpos calculations for interlaced modes · d31faf65
      Ville Syrjälä 提交于
      The scanline counter counts lines in the current field, not the entire
      frame. But the crtc_ timings are the values for the entire frame. Divide
      the vertical timings by 2 to make them match the scanline counter.
      
      The rounding was carefully chosen to make it do the right thing wrt. the
      observed scanline counter and ISR vblank bit behaviour.
      
      Reviewed-by: mario.kleiner.de@gmail.com
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      d31faf65
    • V
      drm: Pass the display mode to drm_calc_vbltimestamp_from_scanoutpos() · 7da903ef
      Ville Syrjälä 提交于
      Rather than using crtc->hwmode, just pass the relevant mode to
      drm_calc_vbltimestamp_from_scanoutpos(). This removes the last hwmode
      usage from core drm.
      
      Reviewed-by: mario.kleiner.de@gmail.com
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      7da903ef
  3. 11 1月, 2014 5 次提交
  4. 10 1月, 2014 2 次提交
    • D
      drm/i915: Drop I915_ prefix from HAS_FBC · 3a77c4c4
      Daniel Vetter 提交于
      My OCD just couldn't let this slide. Spotted while reviewing Ville's
      patch to only flip planes when we have FBC.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3a77c4c4
    • V
      drm/i915: Don't swap planes on 830M · 38af6096
      Ville Syrjälä 提交于
      Looks like 830M doesn't quite like it when you try to move a plane from
      one pipe to another. It seems that the plane's old pipe has to be active
      even if the plane is already disabled, otherwise the relevant register
      just won't accept new values.
      
      The following commit:
      
       commit 1f1c2e24
       Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
       Date:   Thu Nov 28 17:30:01 2013 +0200
      
          drm/i915: Swap primary planes on gen2 for FBC
      
      caused a regression on 830M. It will attempt to swap the planes when the
      driver is loaded, but at that time only pipe A might be active, so plane
      A gets disabled, but plane B won't get enabled since pipe B is not
      active when we try to move the plane over to pipe A.
      
      There's no reason to swap planes on 830M since it doesn't support
      FBC. Change the logic a bit to limit the plane swapping to platforms
      which actually support FBC. This should avoid getting a black screen on
      830M.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      38af6096
  5. 11 12月, 2013 1 次提交
  6. 04 12月, 2013 1 次提交
  7. 18 11月, 2013 1 次提交
    • D
      drm/i915: dp aux irq support for g4x/vlv · 4aeebd74
      Daniel Vetter 提交于
      Now we have this everywhere. Next up would be to wire up the DP
      hotplug pin to speed up panel power sequencing for eDP panels ...
      
      I've decided to leave the has_aux_irq logic in the code, it should
      come handy for hw bringup.
      
      For testing/fail-safety the dp aux code already has a timeout when
      waiting for interrupts to signal completion and screams rather loud if
      they don't arrive in time. Given that we need a real piece of hw to
      talk to anyway this is probably as good as it gets.
      
      v2: Don't check the dp aux channel bits on i965 machines, they have a
      different meaning there. Yay for reusing bits at will! Spotted by
      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>
      4aeebd74
  8. 12 11月, 2013 1 次提交
  9. 09 11月, 2013 9 次提交
    • D
      drm/i915: Mask the vblank interrupt on bdw by default · 13b3a0a7
      Daniel Vetter 提交于
      Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      13b3a0a7
    • D
      drm/i915: Wire up cpu fifo underrun reporting support for bdw · 38d83c96
      Daniel Vetter 提交于
      HW engineers have listened and given us again a real interrupt with
      masking and status regs. Yay!
      
      For consistency with other platforms call the #define FIFO_UNDERRUN.
      Eventually we also might need to have some enable/disable functions
      for bdw display interrupts, but for now open-coding seems to be good
      enough.
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      38d83c96
    • D
      drm/i915: Optimize gen8_enable|disable_vblank functions · 7167d7c6
      Daniel Vetter 提交于
      Let's cache the IMR value like on other platforms. This is needed to
      implement the underrun reporting since then we'll have two places that
      change the same register at runtime.
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7167d7c6
    • D
      drm/i915: Wire up pipe CRC support for bdw · 0fbe7870
      Daniel Vetter 提交于
      The layout of the CRC registers is the same as on hsw, only the
      interrupt handling has changed a bit. So trivial to wire up, yay!
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0fbe7870
    • D
      drm/i915: Wire up PCH interrupts for bdw · 92d03a80
      Daniel Vetter 提交于
      Gives us hotplug, gmbus, dp aux and south errors (underrun
      reporting!).
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      92d03a80
    • D
      drm/i915: Wire up port A aux channel · 6d766f02
      Daniel Vetter 提交于
      Useful for dp aux to work better. Also stop enabling the port A
      hotplug event - eDP panels are expected to fire that interupt and
      we're not really ready to deal with them. This is consistent with how
      we handle port A on ilk-hsw.
      
      The more important bit is that we must delay the enabling of hotplug
      interrupts until all the encoders are fully set up. But we need irq
      support earlier than that, hence hotplug interrupts can only be
      enabled in the ->hpd_irq_setup callback.
      
      v2: Drop the _HOTPLUG, it isn't (Ville).
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6d766f02
    • D
      drm/i915: Fix up the bdw pipe interrupt enable lists · 30100f2b
      Daniel Vetter 提交于
      - Pipe underrun can't just be enabled, we need some support code like
        on ilk-hsw to make this happen. So drop it for now.
      - CRC error is a special mode of the CRC hardware that we don't use,
        so again drop it. Real CRC support for bdw will be added later.
      - All the other error bits are about faults, so rename the #define and
        adjust the output.
      
      v2: Use pipe_name as pointed out by Ville. Ville's comment was on a
      previous patch, but it was easier to squash in here.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      30100f2b
    • D
      drm/i915: Optimize pipe irq handling on bdw · c42664cc
      Daniel Vetter 提交于
      We have a per-pipe bit in the master irq control register, so use it.
      This allows us to drop the masks for aggregate interrupt bits and be a
      bit more explicit in the code. It also removes one indentation level.
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c42664cc
    • B
      drm/i915/bdw: Implement interrupt changes · abd58f01
      Ben Widawsky 提交于
      The interrupt handling implementation remains the same as previous
      generations with the 4 types of registers, status, identity, mask, and
      enable. However the layout of where the bits go have changed entirely.
      To address these changes, all of the interrupt vfuncs needed special
      gen8 code.
      
      The way it works is there is a top level status register now which
      informs the interrupt service routine which unit caused the interrupt,
      and therefore which interrupt registers to read to process the
      interrupt. For display the division is quite logical, a set of interrupt
      registers for each pipe, and in addition to those, a set each for "misc"
      and port.
      
      For GT the things get a bit hairy, as seen by the code. Each of the GT
      units has it's own bits defined. They all look *very similar* and
      resides in 16 bits of a GT register. As an example, RCS and BCS share
      register 0. To compact the code a bit, at a slight expense to
      complexity, this is exactly how the code works as well. 2 structures are
      added to the ring buffer so that our ring buffer interrupt handling code
      knows which ring shares the interrupt registers, and a shift value (ie.
      the top or bottom 16 bits of the register).
      
      The above allows us to kept the interrupt register caching scheme, the
      per interrupt enables, and the code to mask and unmask interrupts
      relatively clean (again at the cost of some more complexity).
      
      Most of the GT units mentioned above are command streamers, and so the
      symmetry should work quite well for even the yet to be implemented rings
      which Broadwell adds.
      
      v2: Fixes up a couple of bugs, and is more verbose about errors in the
      Broadwell interrupt handler.
      
      v3: fix DE_MISC IER offset
      
      v4: Simplify interrupts:
      I totally misread the docs the first time I implemented interrupts, and
      so this should greatly simplify the mess. Unlike GEN6, we never touch
      the regular mask registers in irq_get/put.
      
      v5: Rebased on to of recent pch hotplug setup changes.
      
      v6: Fixup on top of moving num_pipes to intel_info.
      
      v7: Rebased on top of Egbert Eich's hpd irq handling rework. Also
      wired up ibx_hpd_irq_setup for gen8.
      
      v8: Rebase on top of Jani's asle handling rework.
      
      v9: Rebase on top of Ben's VECS enabling for Haswell, where he
      unfortunately went OCD on the gt irq #defines. Not that they're still
      not yet fully consistent:
      - Used the GT_RENDER_ #defines + bdw shifts.
      - Dropped the shift from the L3_PARITY stuff, seemed clearer.
      - s/irq_refcount/irq_refcount.gt/
      
      v10: Squash in VECS enabling patches and the gen8_gt_irq_handler
      refactoring from Zhao Yakui <yakui.zhao@intel.com>
      
      v11: Rebase on top of the interrupt cleanups in upstream.
      
      v12: Rebase on top of Ben's DPF changes in upstream.
      
      v13: Drop bdw from the HAS_L3_DPF feature flag for now, it's unclear what
      exactly needs to be done. Requested by Ben.
      
      v14: Fix the patch.
      - Drop the mask of reserved bits and assorted logic, it doesn't match
        the spec.
      - Do the posting read inconditionally instead of commenting it out.
      - Add a GEN8_MASTER_IRQ_CONTROL definition and use it.
      - Fix up the GEN8_PIPE interrupt defines and give the GEN8_ prefixes -
        we actually will need to use them.
      - Enclose macros in do {} while (0) (checkpatch).
      - Clear DE_MISC interrupt bits only after having processed them.
      - Fix whitespace fail (checkpatch).
      - Fix overtly long lines where appropriate (checkpatch).
      - Don't use typedef'ed private_t (maintainer-scripts).
      - Align the function parameter list correctly.
      
      Signed-off-by: Ben Widawsky <ben@bwidawsk.net> (v4)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      
      bikeshed
      abd58f01
  10. 08 11月, 2013 2 次提交
  11. 06 11月, 2013 2 次提交
    • J
      drm/i915/vlv: use PIPE_START_VBLANK interrupts on VLV · 7b5562d4
      Jesse Barnes 提交于
      This fixes a mismatch between our vblank enable code and our IRQ
      handler.  Also, since vblank start events come in before page flips
      reliably, it also fixes the kms_flip plain-flip test on my BYT system.
      Spotted-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7b5562d4
    • M
      drm/intel: Push get_scanout_position() timestamping into kms driver. · ad3543ed
      Mario Kleiner 提交于
      Move the ktime_get() clock readouts and potential preempt_disable()
      calls from drm core into kms driver to make it compatible with the
      api changes in the drm core.
      
      The intel-kms driver needs to take the uncore.lock inside
      i915_get_crtc_scanoutpos() and intel_pipe_in_vblank().
      This is incompatible with the preempt_disable() on a
      PREEMPT_RT patched kernel, as regular spin locks must not
      be taken within a preempt_disable'd section. Lock contention
      on the uncore.lock also introduced too much uncertainty in vblank
      timestamps.
      
      Push the ktime_get() timestamping for scanoutpos queries and
      potential preempt_disable_rt() into i915_get_crtc_scanoutpos(),
      so these problems can be avoided:
      
      1. First lock the uncore.lock (might sleep on a PREEMPT_RT kernel).
      2. preempt_disable_rt() (will be added by the rt-linux folks).
      3. ktime_get() a timestamp before scanout pos query.
      4. Do all mmio reads as fast as possible without grabbing any new locks!
      5. ktime_get() a post-query timestamp.
      6. preempt_enable_rt()
      7. Unlock the uncore.lock.
      
      This reduces timestamp uncertainty on a low-end HP Atom Mini netbook
      with Intel GMA-950 nicely:
      
      Before: 3-8 usecs with spikes > 20 usecs, triggering query retries.
      After : Typically 1 usec (98% of all samples), occassionally 2 usecs
              (2% of all samples), with maximum of 3 usecs (a handful).
      
      v2: Fix formatting of new multi-line code comments.
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ad3543ed
  12. 30 10月, 2013 3 次提交
  13. 22 10月, 2013 6 次提交