1. 22 1月, 2014 4 次提交
  2. 21 1月, 2014 29 次提交
  3. 20 1月, 2014 7 次提交
    • 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/radeon: Move the early vblank IRQ fixup to radeon_get_crtc_scanoutpos() · 8072bfa6
      Ville Syrjälä 提交于
      i915 doesn't need this kludge for most platforms. Although we do
      appear to need something similar on certain platforms, but we can
      be more accurate when we apply the adjustment since we know exactly
      why the scanline counter doesn't always quite match the vblank
      status.
      
      Also the current code doesn't handle interlaced modes correctly,
      and we already deal with interlaced modes in i915 code.
      
      So let's just move the current code to radeon_get_crtc_scanoutpos()
      since that's why it was added. For i915 we'll add a more finely
      targeted variant.
      
      v2: Fix vpos vs. *vpos bug (Mario)
      
      Reviewed-by: mario.kleiner.de@gmail.com
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      8072bfa6
    • 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: Fix vblank timestamping constants for interlaced modes · c0ae24c1
      Ville Syrjälä 提交于
      We're currently miscalculating the line and pixel durations for
      interlaced modes. crtc_htotal and crtc_vtotal are the full frame
      timings, and so is crtc_clock, so we can compute the line
      and pixel durations from those w/o any extra adjustments. But
      we actually want framedur_ns to be the field, not frame, duration,
      so we must divide it by two.
      
      This should make the scanout based vblank timestamp corrections
      work correctly with interlaced modes, at least for i915. It all
      depends whether we keep the field or frame timings in the display
      mode crtc_ timings.
      
      v2: Preserve halve->half typo fix that happened in the meantine
      
      Reviewed-by: mario.kleiner.de@gmail.com
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      c0ae24c1
    • 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: Change {pixel,line,frame}dur_ns from s64 to int · 3c184f69
      Ville Syrjälä 提交于
      Using s64 for the timestamping constants is wasteful. Signed 32bit
      integers get us a range of over +-2 seconds. Presuming that no-one
      wants to a vrefresh rate less than 0.5, we can switch to using int
      for the timestamping constants. We save a few bytes in drm_crtc and
      avoid a bunch of 64bit math.
      
      Reviewed-by: mario.kleiner.de@gmail.com
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      3c184f69
    • V
      drm: Use crtc_clock in drm_calc_timestamping_constants() · 77666b72
      Ville Syrjälä 提交于
      drm_calc_timestamping_constants() computes the pixel/line/frame
      durations based on the crtc_ timing values. The corresponding pixel
      clock is in mode->crtc_clock, so we need to use that instead of
      mode->clock.
      
      This should fix drm_calc_timestamping_constants() for frame packing
      stereo modes.
      
      Reviewed-by: mario.kleiner.de@gmail.com
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      77666b72