1. 01 6月, 2013 1 次提交
    • D
      drm/i915: hw state readout&check support for cpu_transcoder · eccb140b
      Daniel Vetter 提交于
      This allows us to drop a bunch of ugly hacks and finally implement
      what
      
      commit cc464b2a
      Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Date:   Fri Jan 25 16:59:16 2013 -0200
      
          drm/i915: set TRANSCODER_EDP even earlier
      
      tried to achieve, but that was reverted again in
      
      commit bba2181c
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Mar 22 10:53:40 2013 +0100
      
          Revert "drm/i915: set TRANSCODER_EDP even earlier"
      
      Now we should always have a consistent cpu_transcoder in the
      pipe_config.
      
      v2: Fix up the code as spotted by Paulo:
      - read the register for real
      - assign the right pipes
      - break out if the hw state doesn't make sense
      
      v3: Shut up gcc.
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      eccb140b
  2. 21 5月, 2013 2 次提交
    • P
      drm/i915: make intel_ddi_get_cdclk_freq return values in KHz · b2b877ff
      Paulo Zanoni 提交于
      With this, that 338 can finally become the correct 337500.
      
      Due to the change we need to adjust the intel_dp_aux_ch function to
      set the correct value, so adjust the division and also use
      DIV_ROUND_CLOSEST instead of the old "round down" behavior because the
      spec says the value "should be programmed to get as close as possible
      to the ideal rate of 2MHz".
      
      Quoting Paulo's follow-up to a question from Chris Wilson to explain
      what exactly will change:
      
      I use the 337500 value on the next patch, when setting the
      ips_linetime value. The correct frequency is 337500, not 338000.
      
      ips_linetime = DIV_ROUND_CLOSEST(mode->htotal * 1000 * 8,
      intel_ddi_get_cdclk_freq);
      For a mode with htotal of 2640 [0] we'll have: (i) (2640 * 1000 * 8) /
      338000 = 62.48, resulting in 62 and (ii) (2640 * 1000 * 8) / 337500 =
      62.57 resulting in 63.
      
      For the case inside intel_dp.c:
      Previously we were using 338. So with the old formula we were writing
      338/2 = 169 to the register. And 337500 / 169 = 1997.04 (we use 337500
      here because it's the real clock value). With the new value of
      337500/2000 we'll have 168.75, which is 168 on the round-down case and
      169 on the round-closest case. If we write 168 to the register, 337500
      / 168 = 2008.92, and 2008.92 is more distant from 2000 than 1997.04.
      So with this patch we're changing the formula but still writing the
      same correct value to the DP AUX register.
      
      [0]: That's 1920x1080@50Hz on my DP monitor.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Pimp the commit message with Paulo's follow-up.]
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b2b877ff
    • J
      drm/i915: add encoder get_config function v5 · 045ac3b5
      Jesse Barnes 提交于
      We can use this for fetching encoder specific pipe_config state, like
      mode flags, adjusted clock, etc.
      
      Just used for mode flags atm, so we can check the pipe config state at
      mode set time.
      
      v2: get_config when checking hw state too
      v3: fix DVO and LVDS mode flags (Ville)
          get SDVO DTD for flag fetch (Ville)
      v4: use input timings (Ville)
          correct command used (Ville)
          remove gen4 check (Ville)
      v5: get DDI flag config too
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v4)
      Tested-by: Paulo Zanoni <przanoni@gmail.com> (the new hsw ddi stuff)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      045ac3b5
  3. 11 5月, 2013 3 次提交
  4. 06 5月, 2013 1 次提交
  5. 04 5月, 2013 1 次提交
    • I
      drm/i915: hsw: fix link training for eDP on port-A · 3ab9c637
      Imre Deak 提交于
      According to BSpec the link training sequence for eDP on HSW port-A
      should be as follows:
      
      1. link training: clock recovery
      2. link training: equalization
      3. link training: set idle transmission mode
      4. display pipe enable
      5. link training: disable (set normal mode)
      
      Contrary to this at the moment we don't do step 3. and we do step 5.
      before step 4. Fix this by setting idle transmission mode for eDP at
      the end of intel_dp_complete_link_train and adding a new
      intel_dp_stop_link_training function to disable link training. With
      these changes we'll end up with the following functions corresponding
      to the above steps:
      
      intel_dp_start_link_train    -> step 1.
      intel_dp_complete_link_train -> step 2., step 3.
      intel_dp_stop_link_train     -> step 5.
      
      For port-A we'll call intel_dp_stop_link_train only after enabling the
      pipe, for everything else we'll call it right after
      intel_dp_complete_link_train to preserve the current behavior.
      
      Tested on HSW/HSW-ULT.
      
      In v2:
      - Due to a HW issue we must set idle transmission mode for port-A too
        before enabling the pipe. Thanks for Arthur Runyan for explaining
        this.
      - Update the patch subject to make it clear that it's an eDP fix, DP is
        not affected.
      
      v3:
      - rename intel_dp_link_train() to intel_dp_set_link_train(), use 'val'
        instead 'l' as var name. (Paulo)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Tested-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3ab9c637
  6. 03 5月, 2013 1 次提交
  7. 30 4月, 2013 2 次提交
  8. 26 4月, 2013 1 次提交
  9. 19 4月, 2013 1 次提交
  10. 18 4月, 2013 2 次提交
  11. 03 4月, 2013 1 次提交
  12. 28 3月, 2013 3 次提交
    • D
      drm/i915: precompute pipe bpp before touching the hw · 4e53c2e0
      Daniel Vetter 提交于
      The procedure has now 3 steps:
      
      1. Compute the bpp that the plane will output, this is done in
         pipe_config_set_bpp and stored into pipe_config->pipe_bpp. Also,
         this function clamps the pipe_bpp to whatever limit the EDID of any
         connected output specifies.
      2. Adjust the pipe_bpp in the encoder and crtc functions, according to
         whatever constraints there are.
      3. Decide whether to use dither by comparing the stored plane bpp with
         computed pipe_bpp.
      
      There are a few slight functional changes in this patch:
      - LVDS connector are now also going through the EDID clamping. But in
        a 2nd change we now unconditionally force the lvds bpc value - this
        shouldn't matter in reality when the panel setup is consistent, but
        better safe than sorry.
      - HDMI now forces the pipe_bpp to the selected value - I think that's
        what we actually want, since otherwise at least the pixelclock
        computations are wrong (I'm not sure whether the port would accept
        e.g. 10 bpc when in 12bpc mode). Contrary to the old code, we pick
        the next higher bpc value, since otherwise there's no way to make
        use of the 12 bpc mode (since the next patch will remove the 12bpc
        plane format, it doesn't exist).
      
      Both of these changes are due to the removal of the
      
      	pipe_bpp = min(display_bpp, plane_bpp);
      
      statement.
      
      Another slight change is the reworking of the dp bpc code:
      - For the mode_valid callback it's sufficient to only check whether
        the mode would fit at the lowest bpc.
      - The bandwidth computation code is a bit restructured: It now walks
        all available bpp values in an outer loop and the codeblock that
        computes derived values (once a good configuration is found) has been
        moved out of the for loop maze. This is prep work to allow us to
        successively fall back on bpc values, and also correctly support bpc
        values != 8 or 6.
      
      v2: Rebased on top of Paulo Zanoni's little refactoring to use more
      drm dp helper functions.
      
      v3: Rebased on top of Jani's eDP bpp fix and Ville's limited color
      range work.
      
      v4: Remove the INTEL_MODE_DP_FORCE_6BPC #define, no longer needed.
      
      v5: Remove intel_crtc->bpp, too, and fix up the 12bpc check in the
      hdmi code. Also fixup the bpp check in intel_dp.c, it'll get reworked
      in a later patch though again.
      
      v6: Fix spelling in a comment.
      
      v7: Debug output improvements for the bpp computation.
      
      v8: Fixup 6bpc lvds check - dual-link and 8bpc mode are different
      things!
      
      v9: Reinstate the fix to properly ignore the firmware edp bpp ... this
      was lost in a rebase.
      
      v10: Both g4x and vlv lack 12bpc pipes, so don't enforce that we have
      that. Still unsure whether this is the way to go, but at least 6bpc
      for a 8bpc hdmi output seems to work.
      
      v11: And g4x/vlv also lack 12bpc hdmi support, so only support high
      depth on DP. Adjust the code.
      
      v12: Rebased.
      
      v13: Split out the introduction of pipe_config->dither|pipe_bpp, as
      requested from Jesse Barnes.
      
      v14: Split out the special 6BPC handling for DP, as requested by Jesse
      Barnes.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4e53c2e0
    • D
      drm/i915: introduce pipe_config->dither|pipe_bpp · 965e0c48
      Daniel Vetter 提交于
      We want to compute this earlier. To avoid a big complicated patch,
      this patch here just does the big search&replace and still calls the
      old functions at the same places.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      965e0c48
    • D
      drm/i915: add pipe_config->has_pch_encoder · 5bfe2ac0
      Daniel Vetter 提交于
      This is used way too often in the enable/disable paths. And will
      be even more useful in the future.
      
      Note that correct semantics of this change highly depend upon
      correct updating of intel_crtc->config: Like with all other
      modeset state, we need to call ->disable with the old config,
      but ->mode_set and ->enable with the new config.
      
      v2: Do not yet use the flag in the ->disable callbacks - atm we don't
      yet have support for the information stored in the pipe_config in the
      hw state readout code, so this will be wrong at boot-up/resume.
      
      v3: Rebased on top of the hdmi/dp ddi encoder merging.
      
      v4: Fixup stupid rebase error which lead to a NULL vfunc deref.
      
      v5: On haswell the VGA port is on the PCH!
      
      v6: s/IS_HASWELL/HAS_DDI/, spotted by Paulo Zanoni. Also add a missing
      parameter name in a function declaration.
      
      v7: Don't forget to git add ...
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5bfe2ac0
  13. 26 3月, 2013 1 次提交
  14. 23 3月, 2013 2 次提交
  15. 18 3月, 2013 1 次提交
  16. 04 3月, 2013 1 次提交
  17. 20 2月, 2013 3 次提交
  18. 14 2月, 2013 1 次提交
  19. 31 1月, 2013 1 次提交
    • D
      drm/i915: dynamic Haswell display power well support · d6dd9eb1
      Daniel Vetter 提交于
      We can disable (almost) all the display hw if we only use pipe A, with
      the integrated edp transcoder on port A. Because we don't set the cpu
      transcoder that early (yet), we need to help us with a trick to simply
      check for any edp encoders.
      
      v2: Paulo Zanoni pointed out that we also need to configure the eDP
      cpu transcoder correctly.
      
      v3: Made by Paulo Zanoni
        - Rebase patch to be on top of "fix intel_init_power_wells" patch
        - Fix typos
        - Fix a small bug by adding a "connectors_active" check
        - Restore the initial code that unconditionally enables the power
          well when taking over from the BIOS
      
      v4: Made by Paulo Zanoni
        - One more typo spotted by Jani Nikula
      
      v5: Made by Paulo Zanoni
        - Rebase
      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>
      d6dd9eb1
  20. 23 1月, 2013 1 次提交
  21. 10 12月, 2012 1 次提交
  22. 08 12月, 2012 1 次提交
    • P
      drm/i915: fix hsw_fdi_link_train "retry" code · 248138b5
      Paulo Zanoni 提交于
      We were previously doing exactly what the "mode set sequence for CRT"
      document mandates, but whenever we failed to train the link in the
      first tentative, all the other subsequent retries always failed. In
      one of my monitors that has 47 modes, I was usually getting around 3
      failures when running "testdisplay -a".
      
      After this patch, even if we fail in the first tentative, we can
      succeed in the next ones. So now when running "testdisplay -a" I see
      around 3 times the message "FDI link training done on step 1" and no
      failures.
      
      Notice that now the "retry" code looks a lot like the DP retry code.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      248138b5
  23. 04 12月, 2012 1 次提交
    • D
      drm/i915: fixup sparse warnings · 1a240d4d
      Daniel Vetter 提交于
      - __iomem where there is none (I love how we mix these things up).
      - Use gfp_t instead of an other plain type.
      - Unconfuse one place about enum pipe vs enum transcoder - for the pch
        transcoder we actually use the pipe enum. Fixup the other cases
        where we assign the pipe to the cpu transcoder with explicit casts.
      - Declare the mch_lock properly in a header.
      
      There is still a decent mess in intel_bios.c about __iomem, but heck,
      this is x86 and we're allowed to do that.
      
      Makes-sparse-happy: Chris Wilson <chris@chris-wilson.co.uk>
      [danvet: Use a space after the cast consistently and fix up the
      newly-added cast in i915_irq.c to properly use __iomem.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1a240d4d
  24. 29 11月, 2012 3 次提交
  25. 22 11月, 2012 2 次提交
  26. 12 11月, 2012 2 次提交
    • P
      drm/i915: fix Haswell FDI link disable path · 1ad960f2
      Paulo Zanoni 提交于
      This covers the "Disable FDI" section from the CRT mode set sequence.
      This disables the FDI receiver and also the FDI pll.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1ad960f2
    • P
      drm/i915: fix Haswell FDI link training code · 04945641
      Paulo Zanoni 提交于
      This commit makes hsw_fdi_link_train responsible for implementing
      everything described in the "Enable and train FDI" section from the
      Hawell CRT mode set sequence documentation. We completely rewrite
      hsw_fdi_link_train to match the documentation and we also call it in
      the right place.
      
      This patch was initially sent as a series of tiny patches fixing every
      little problem of the function, but since there were too many patches
      fixing the same function it got a little difficult to get the "big
      picture" of how the function would be in the end, so here we amended
      all the patches into a single big patch fixing the whole function.
      
      Problems we fixed:
      
        1 - Train Haswell FDI at the right time.
      
          We need to train the FDI before enabling the pipes and planes, so
          we're moving the call from lpt_pch_enable to haswell_crtc_enable
          directly.
      
          We are also removing ironlake_fdi_pll_enable since the PLL
          enablement on Haswell is completely different and is also done
          during the link training steps.
      
        2 - Use the right FDI_RX_CTL register on Haswell
      
          There is only one PCH transcoder, so it's always _FDI_RXA_CTL.
          Using "pipe" here is wrong.
      
        3 - Don't rely on DDI_BUF_CTL previous values
      
          Just set the bits we want, everything else is zero. Also
          POSTING_READ the register before sleeping.
      
        4 - Program the FDI RX TUSIZE register on hsw_fdi_link_train
      
          According to the mode set sequence documentation, this is the
          right place. According to the FDI_RX_TUSIZE register description,
          this is the value we should set.
      
          Also remove the code that sets this register from the old
          location: lpt_pch_enable.
      
        5 - Properly program FDI_RX_MISC pwrdn lane values on HSW
      
        6 - Wait only 35us for the FDI link training
      
          First we wait 30us for the FDI receiver lane calibration, then we
          wait 5us for the FDI auto training time.
      
        7 - Remove an useless indentation level on hsw_fdi_link_train
      
          We already "break" when the link training succeeds.
      
        8 - Disable FDI_RX_ENABLE, not FDI_RX_PLL_ENABLE
      
          When we fail the training.
      
        9 - Change Haswell FDI link training error messages
      
          We shouldn't call DRM_ERROR when still looping through voltage
          levels since this is expected and not really a failure. So in this
          commit we adjust the error path to only DRM_ERROR when we really
          fail after trying everything.
      
          While at it, replace DRM_DEBUG_DRIVER with DRM_DEBUG_KMS since
          it's what we use everywhere.
      
        10 - Try each voltage twice at hsw_fdi_link_train
      
          Now with Daniel Vetter's suggestion to use "/2" instead of ">>1".
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Applied tiny bikesheds:
      - mention in comment that we test each voltage/emphasis level twice
      - realing arguments of the only untouched reg write, it spilled over
        the 80 char limit ...]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      04945641