1. 26 10月, 2012 7 次提交
    • P
      drm/i915: convert DDI_FUNC_CTL to transcoder · ad80a810
      Paulo Zanoni 提交于
      Because there's one instance of the register per CPU transcoder and
      not per CPU pipe. This is another register that appeared for the first
      time on Haswell, and even though its Haswell name is
      PIPE_DDI_FUNC_CTL, it will be renamed to TRANS_DDI_FUNC_CTL, so let's
      just use the new naming scheme before it confuses more people.
      
      Notice that there's a big improvement on intel_ddi_get_hw_state due to
      the new TRANSCODER_EDP.
      
      V2: Also rename the register to TRANS_DDI_FUNC_CTL as suggested by
      Damien Lespiau.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ad80a810
    • P
      drm/i915: add TRANSCODER_EDP · a5c961d1
      Paulo Zanoni 提交于
      Before Haswell we used to have the CPU pipes and the PCH transcoders.
      We had the same amount of pipes and transcoders, and there was a 1:1
      mapping between them. After Haswell what we used to call CPU pipe was
      split into CPU pipe and CPU transcoder. So now we have 3 CPU pipes (A,
      B and C), 4 CPU transcoders (A, B, C and EDP) and 1 PCH transcoder
      (only used for VGA).
      
      For all the outputs except for EDP we have an 1:1 mapping on the CPU
      pipes and CPU transcoders, so if you're using CPU pipe A you have to
      use CPU transcoder A. When have an eDP output you have to use
      transcoder EDP and you can attach this CPU transcoder to any of the 3
      CPU pipes. When using VGA you need to select a pair of matching CPU
      pipes/transcoders (A/A, B/B, C/C) and you also need to enable/use the
      PCH transcoder.
      
      For now we're just creating the cpu_transcoder definitions and setting
      cpu_transcoder to TRANSCODER_EDP on DDI eDP code, but none of the
      registers was ported to use transcoder instead of pipe. The goal is to
      keep the code backwards-compatible since on all cases except when
      using eDP we must have pipe == cpu_transcoder.
      
      V2: Comment the haswell_crtc_off chunk, suggested by Damien Lespiau
      and Daniel Vetter.
      
      We currently need the haswell_crtc_off chunk because TRANSCODER_EDP
      can be used by any CRTC, so when you stop using it you have to stop
      saying you're using it, otherwise you may have at some point 2 CRTCs
      claiming they're using TRANSCODER_EDP (a disabled CRTC and an enabled
      one), then the HW state readout code will get completely confused.
      
      In other words:
      
      Imagine the following case:
        xrandr --output eDP1 --auto --crtc 0
        xrandr --output eDP1 --off
        xrandr --output eDP1 --auto --crtc 2
      
      After the last command you could get a "pipe A assertion failure
      (expected off, current on)" because CRTC 0 still claims it's using
      TRANSCODER_EDP, so the HW state readout function will read it
      (through PIPECONF) and expect it to be off, when it's actually on
      because it's being used by CRTC 2.
      
      So when we make "intel_crtc->cpu_transcoder = intel_crtc->pipe" we
      make sure we're pointing to our own original CRTC which is certainly
      not used by any other CRTC.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a5c961d1
    • P
      drm/i915: don't call Haswell PCH code when we can't or don't need · 83616634
      Paulo Zanoni 提交于
      On Ironlake we have one PCH transcoder and FDI per pipe, so we know
      that if ironlake_crtc_driving_pch returns false we can disable the PCH
      transcoder and we also know that when we disable the crtc we can also
      disable the PCH transcoder.
      
      On Haswell there is only 1 PCH transcoder and FDI and they can be used
      by any CRTC. So if for one specific crtc haswell_crtc_driving_pch
      returns false we can't assert anything about the state of the PCH
      transcoder or the FDI link without checking if any other CRTC is using
      the PCH.
      
      So on this commit remove the "assert_fdi_{t,r}x_disabled" form
      haswell_crtc_enable and also only disable FDI and the PCH transcoder
      if the port being disabled was actually a PCH port (we only have one
      port using PCH: the VGA port).
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      83616634
    • P
      drm/i915: simplify intel_crtc_driving_pch · fc316cbe
      Paulo Zanoni 提交于
      By forking Ironlake and Haswell functions. The only callers are
      {ironlake,haswell}_crtc_enable anyway, and this way we won't need to
      add other checks on the Haswell version for the next gens.
      
      V2: Even simpler, as pointed by Jani Nikula.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fc316cbe
    • P
      drm/i915: fix checks inside haswell_crtc_{enable, disable} · 1f544388
      Paulo Zanoni 提交于
      These functions were forked from their Ironlake versions, so now fix
      the gen checks to reflect the fact that they will only run on Haswell.
      
      It is worth noticing that we are not considering IBX/CPT possible on
      Haswell anymore. So far on Haswell enablement we kept trying to still
      consider IBX/CPT as a possibility with a Haswell CPU, but this was
      never tested, I really doubt it will work with the current code and we
      don't really have plans to support it. Future patches will remove the
      IBX/CPT code from other Haswell functions. Notice that we still have a
      WARN on haswell_crtc_mode_set in case we detect non-LPT PCH.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1f544388
    • P
      drm/i915: fix checks inside ironlake_crtc_{enable, disable} · 20474e90
      Paulo Zanoni 提交于
      The last commit forked a Haswell version, so now we remove Haswell
      code from these functions.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      20474e90
    • P
      drm/i915: fork a Haswell version of ironlake_crtc_{enable, disable} · 4f771f10
      Paulo Zanoni 提交于
      The way we enable and disable the PCH on Haswell changed considerably
      since now we have only one PCH transcoder, so we can't keep the same
      asserts and we also can't just unconditionally disable the PCH
      transcoder for non-PCH outputs. So let's fork a Haswell version.
      
      These new functions look exactly the same as the ironlake versions.
      The next patches will introduce the differences.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4f771f10
  2. 24 10月, 2012 1 次提交
  3. 19 10月, 2012 1 次提交
  4. 18 10月, 2012 2 次提交
  5. 12 10月, 2012 2 次提交
    • D
      drm/i915: fixup the plane->pipe fixup code · fa555837
      Daniel Vetter 提交于
      We need to check whether the _other plane is on our pipe, not whether
      our plane is on the other pipe. Otherwise if not both pipes/planes are
      active, we won't properly clean up the mess and set up our desired
      plane->pipe mapping.
      
      v2: Fixup the logic, I've totally fumbled it. Noticed by Chris Wilson.
      
      v3: I've checked Bspec, and the flexible plane->pipe mapping is a
      gen2/3 feature, so test for that instead of PCH_SPLIT
      
      v4: Check whether we indeed have 2 pipes before checking the other
      pipe, to avoid upsetting i845g/i865g. Noticed by Chris Wilson.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51265
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49838Tested-by: NDave Airlie <airlied@gmail.com>
      Tested-by: Chris Wilson <chris@chris-wilson.co.uk> #855gm
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fa555837
    • D
      drm/i915: rip out the pipe A quirk for i855gm · ccd0d36e
      Daniel Vetter 提交于
      This seems to be the root-cause that breaks resume on my i855gm when I
      apply the "drm/i915: fixup the plane->pipe fixup code" patch. And that
      code doesn't even run on my machine, so it's pure timing changes
      causing the regression.
      
      Furthermore resume has been constantly switching between working and
      broken on this machine ever since kms support has been merged,
      seemingly with no related change as a root cause. And always with the
      same symptoms of the backlight lighting up, but the lvds panel only
      displaying black.
      
      Also, of both i855gm variants only one is in the table. And in the
      past we've only ever removed entries from this quirk table because it
      breaks things.
      
      So let's just remove it - in case there's indeed a bios out there
      relying on a running pipe A, we can add back in a more precise quirk
      entry, like all the others (save for i830/i845).
      
      Tested-by: Chris Wilson <chris@chris-wilson.co.uk> #855gm
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ccd0d36e
  6. 11 10月, 2012 1 次提交
  7. 10 10月, 2012 7 次提交
  8. 09 10月, 2012 1 次提交
  9. 04 10月, 2012 1 次提交
  10. 03 10月, 2012 1 次提交
  11. 02 10月, 2012 2 次提交
    • P
      drm/i915: extract intel_set_pipe_timings from crtc_mode_set · b0e77b9c
      Paulo Zanoni 提交于
      Version 2: call intel_set_pipe_timings from both i9xx_crtc_mode_set
      and ironlake_crtc_mode_set, instead of just ironlake, as requested by
      Daniel Vetter.
      
      The problem caused by calling this function from i9xx_crtc_mode_set
      too is that now on i9xx we write to PIPESRC before writing to DSPSIZE
      and DSPPOS. I could not find any evidence in our documentation that
      this won't work, and the docs actually say the pipe registers should
      be set before the plane registers.
      
      Version 3: don't remove pipeconf bits on i9xx_crtc_mode_set.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b0e77b9c
    • C
      drm/i915: Flush the pending flips on the CRTC before modification · 5bb61643
      Chris Wilson 提交于
      This was meant to be the purpose of the
      intel_crtc_wait_for_pending_flips() function which is called whilst
      preparing the CRTC for a modeset or before disabling. However, as Ville
      Syrjala pointed out, we set the pending flip notification on the old
      framebuffer that is no longer attached to the CRTC by the time we come
      to flush the pending operations. Instead, we can simply wait on the
      pending unpin work to be finished on this CRTC, knowning that the
      hardware has therefore finished modifying the registers, before proceeding
      with our direct access.
      
      Fixes i-g-t/flip_test on non-pch platforms. pch platforms simply
      schedule the flip immediately when the pipe is disabled, leading
      to other funny issues.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      [danvet: Added i-g-t note and cc: stable]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5bb61643
  12. 28 9月, 2012 4 次提交
  13. 27 9月, 2012 1 次提交
    • J
      drm/i915: use adjusted_mode instead of mode for checking the 6bpc force flag · 0c96c65b
      Jani Nikula 提交于
      The dithering introduced in
      
      commit 3b5c78a3
      Author: Adam Jackson <ajax@redhat.com>
      Date:   Tue Dec 13 15:41:00 2011 -0800
      
          drm/i915/dp: Dither down to 6bpc if it makes the mode fit
      
      stores the INTEL_MODE_DP_FORCE_6BPC flag in the private_flags of the
      adjusted mode, while i9xx_crtc_mode_set() and ironlake_crtc_mode_set() use
      the original mode, without the flag, so it would never have any
      effect. However, the BPC was clamped by VBT settings, making things work by
      coincidence, until that part was removed in
      
      commit 4344b813
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Aug 10 11:10:20 2012 +0200
      
      Use adjusted_mode instead of mode when checking for
      INTEL_MODE_DP_FORCE_6BPC to make the flag have effect.
      
      v2: Don't forget to fix this in i9xx_crtc_mode_set() also, pointed out by
      Daniel both before and after sending the first patch.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47621
      CC: Adam Jackson <ajax@redhat.com>
      CC: stable@vger.kernel.org
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Reviewed-by: NAdam Jackson <ajax@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0c96c65b
  14. 25 9月, 2012 4 次提交
  15. 20 9月, 2012 5 次提交