1. 28 6月, 2013 2 次提交
  2. 07 6月, 2013 1 次提交
  3. 04 6月, 2013 2 次提交
    • D
      drm/i915: store adjusted dotclock in adjusted_mode->clock · ff9a6750
      Daniel Vetter 提交于
      ... not the port clock. This allows us to kill the funny semantics
      around pixel_target_clock.
      
      Since the dpll code still needs the real port clock, add a new
      port_clock field to the pipe configuration. Handling the default case
      for that one is a bit tricky, since encoders might not consistently
      overwrite it when retrying the crtc/encoder bw arbitrage step in the
      compute config stage. Hence we need to always clear port_clock and
      update it again if the encoder hasn't put in something more specific.
      This can't be done in one step since the encoder might want to adjust
      the mode first.
      
      I was a bit on the fence whether I should subsume the pixel multiplier
      handling into the port_clock, too. But then I decided against this
      since it's on an abstract level still the dotclock of the adjusted
      mode, and only our hw makes it a bit special due to the separate pixel
      mulitplier setting (which requires that the dpll runs at the
      non-multiplied dotclock).
      
      So after this patch the adjusted_mode accurately describes the mode we
      feed into the port, after the panel fitter and pixel multiplier (or
      line doubling, if we ever bother with that) have done their job.
      Since the fdi link is between the pfit and the pixel multiplier steps
      we need to be careful with calculating the fdi link config.
      
      v2: Fix up ilk cpu pll handling.
      
      v3: Introduce an fdi_dotclock variable in ironlake_fdi_compute_config
      to make it clearer that we transmit the adjusted_mode without the
      pixel multiplier taken into account. The old code multiplied the the
      available link bw with the pixel multiplier, which results in the same
      fdi configuration, but is much more confusing.
      
      v4: Rebase on top of Imre's is_cpu_edp removal.
      
      v5: Rebase on top of Paulo's haswell watermark fixes, which introduce
      a new place which looked at the pixel_clock and so needed conversion.
      
      v6: Split out prep patches as requested by Paulo Zanoni. Also rebase
      on top of the fdi dotclock handling fix in the fdi lanes/bw
      computation code.
      
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v3)
      Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> (v6)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ff9a6750
    • D
      drm/i915: refactor cpu eDP PLL handling a bit · 7c62a164
      Daniel Vetter 提交于
      This prepares a bit for the next big patch, where we switch the
      semantics of the different clocks in the pipe config around.
      
      Since I've broken cpu eDP PLL handling in the first version I've
      figured some refactoring is in order.
      
      Split out on request from Paulo Zanoni.
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7c62a164
  4. 01 6月, 2013 4 次提交
  5. 24 5月, 2013 2 次提交
  6. 23 5月, 2013 1 次提交
  7. 22 5月, 2013 1 次提交
  8. 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
  9. 11 5月, 2013 5 次提交
  10. 04 5月, 2013 2 次提交
    • 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
    • D
      Revert "drm/i915: revert eDP bpp clamping code changes" · 657445fe
      Daniel Vetter 提交于
      This reverts commit 57c21963.
      
      It's an ugly hack for a Haswell SDV platform where the vbt doesn't
      seem to fully agree with the panel. Since it seems to cause issues on
      real eDP platform let's just kill this hack again.
      Reported-and-tested-by: NJosh Boyer <jwboyer@gmail.com>
      References: https://lkml.org/lkml/2013/5/3/467
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      657445fe
  11. 03 5月, 2013 1 次提交
  12. 30 4月, 2013 2 次提交
    • D
      drm/i915: allow high-bpc modes on DP · 52541e30
      Daniel Vetter 提交于
      Totally untested due to lack of screens supporting more than 8bpc. But
      now we should have closed all holes in our bpp handling, so this
      should be safe. The last missing piece was 10bpc support for g4x/vlv,
      since we directly use the pipe bpp to feed the display link (and
      anyway, only the cpt has any means to have a pipe bpp != the display
      link bpp).
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      52541e30
    • D
      drm/i915: force bpp for eDP panels · af13188a
      Daniel Vetter 提交于
      We've had our fair share of woes already which showed that we can't
      rely on the bpc limits in the EDID for eDP panels without risking
      black screens. So now we limit the depth by what the BIOS recommends
      in the VBT:
      
      commit 2f4f649a
      Author: Jani Nikula <jani.nikula@intel.com>
      Date:   Mon Nov 12 14:33:44 2012 +0200
      
          drm/i915: do not ignore eDP bpc settings from vbt
      
      But that's not enough, since at least the panel on my ASUS Zenbook
      Prime here is also unhappy if the bpc is too low. Hence just take the
      firmware value and dither to get what flimsy panels want.
      
      Like before we ensure that we don't change the bpp if the firmware
      doesn't provide a value, see
      
      commit 9a30a61f
      Author: Jani Nikula <jani.nikula@intel.com>
      Date:   Mon Nov 12 14:33:45 2012 +0200
      
          drm/i915: do not default to 18 bpp for eDP if missing from VBT
      
      v2: Apparently there are some horribly broken eDP panels around which
      only work if the DP link is set up as if we want to driver a 24bpp
      mode, but still only work if the data is feed at 18bpp. See
      
      commit 57c21963
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Apr 4 17:19:37 2013 +0200
      
          drm/i915: revert eDP bpp clamping code changes
      
      for the gory details.
      
      Adjust the patch accordingly and update all the relevant comments.
      
      v3: Give up on the cargo-culting v2 attempt and just enfore the edp
      bpp value if it's there. Broken panels be damned!
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Tested-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      af13188a
  13. 26 4月, 2013 3 次提交
    • J
      drm/i915: move PCH pfit controls into pipe_config · b074cec8
      Jesse Barnes 提交于
      And put the pfit stuff into substructs while we're at it.
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b074cec8
    • J
      drm/i915: factor out GMCH panel fitting code and use for eDP v3 · 2dd24552
      Jesse Barnes 提交于
      This gets the panel fitter working on eDP on VLV, and should also apply
      to eDP panels on G4x chipsets (if we ever detect and mark an all-in-one
      panel as eDP anyway).
      
      A few cleanups are still possible on top of this, for example the LVDS
      border control could be placed in the LVDS encoder structure and updated
      based on the result of the panel fitter calculation.
      
      Multi-pipe fitting isn't handled correctly either if we ever get a config
      that wants to try the panel fitter on more than one output at a time.
      
      v2: use pipe_config for storing pfit values (Daniel)
          add i9xx_pfit_enable function for use by 9xx and VLV (Daniel)
      v3: fixup conflicts and lvds_dither check
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: fix up botched conflict resolution from Jesse:
      - border = LVDS_BORDER_ENABLE was lost for CENTER scaling
      - comment about gen2/3 panel fitter scaling was lost
      - dev_priv->lvds_dither reintroduced.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2dd24552
    • D
      drm/i915: move dp clock computations to encoder->compute_config · c6bb3538
      Daniel Vetter 提交于
      With the exception of hsw, which has dedicated DP clocks which run at
      the fixed frequency already, and vlv, which doesn't have optmized
      pre-defined dp clock parameters (yet).
      
      v2: Ville asked me to elaborate a bit more on the longer-term goals
      wrt dpll settings computation:
      
      So ultimately my idea is that in the compute config stage first the crtc
      code puts the default platform pll limits into the pipe_config. Then
      encoders can either overwrite that limit structure with their own special
      stuff (mostly for lvds madness). Or they can pick some or all of the
      parameters (e.g. just the p2 switchover on hdmi, or all the clock
      parameters for dp/sdvo tv).
      
      Once that's done then the generic crtc code can fill out any missing bits
      (using the find_best_pll code) and then try to assign which pll to use (if
      it's a platform with shared plls). In the end the modeset could should
      simply write the computed stuff into registers and never be able to fail.
      
      Of course there's still a lot of data to be moved into pipe_config to make
      this all happen, hence some of the temporary ugliness.
      
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v1)
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c6bb3538
  14. 23 4月, 2013 1 次提交
    • D
      drm/i915: avoid full modeset when changing the color range properties · ae4edb80
      Daniel Vetter 提交于
      Automatic color range selection was added in
      
      commit 55bc60db
      Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Date:   Thu Jan 17 16:31:29 2013 +0200
      
          drm/i915: Add "Automatic" mode for the "Broadcast RGB" property
      
      but that removed the check to avoid a full modeset if the value is
      unchanged. Unfortunately X sets all properties with their current
      value at start-up, resulting in some ugly flickering which shouldn't
      be there.
      
      v2: Change old_range from bool to uint32_t, spotted by Ville.
      
      v3: Actually git add everything ;-)
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ae4edb80
  15. 19 4月, 2013 3 次提交
  16. 18 4月, 2013 3 次提交
  17. 06 4月, 2013 2 次提交
    • D
      drm/i915: revert eDP bpp clamping code changes · 57c21963
      Daniel Vetter 提交于
      The behaviour around handling the eDP bpp value from vbt has been
      slightly changed in
      
      commit 36008365
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Wed Mar 27 00:44:59 2013 +0100
      
          drm/i915: convert DP autodither code to new infrastructure
      
      The old behaviour was that we used the plane's bpp (usually 24bpp) for
      computing the dp link bw, but set up the pipe with the bpp value from
      vbt if available. This takes the vbt bpp override into account even
      for the dp link bw configuration.
      
      On Paulo's hsw machine this resulted in a slower link clock and a
      black screen - but the mode actually /should/ fit even with the lower
      clock. Until we've cleared up simply stay bug-for-bug compatible with
      the old code.
      
      While at it, also restore a debug message lost in:
      
      commit 4e53c2e0
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Wed Mar 27 00:44:58 2013 +0100
      
          drm/i915: precompute pipe bpp before touching the hw
      
      Cc: Paulo Zanoni <przanoni@gmail.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>
      57c21963
    • D
      Revert "drm/i915: fix DP get_hw_state return value" · 2af8898b
      Daniel Vetter 提交于
      This reverts commit deb18211.
      
      It completely breaks the logic, since when we fall through to the end
      of the function we actually _have_ figured out the correct pipe.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2af8898b
  18. 03 4月, 2013 3 次提交
    • D
      drm/i915: remove leaky eDP functions · 947978fa
      Daniel Vetter 提交于
      Jesse Barnes noticed in his review of my DP cleanup series that
      intel_edp_target_clock is now unused. Checking related code I've
      noticed that also intel_edp_link_config is long unused.
      
      Kill them both.
      
      Wrt leaky eDP functions used in the common crtc code, the only thing
      still left is intel_encoder_is_pch_edp. That one is just due to the
      massive confusion between eDP vs. DP and port A vs. port D. Crtc code
      should at most concern itself with the later, never with the former.
      
      But that's material for another patch series.
      
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      947978fa
    • D
      drm/i915: track dp target_clock in pipe_config · df92b1e6
      Daniel Vetter 提交于
      We need it in the fdi m_n computation, which nicely kills almost
      all ugly special cases in there.
      
      It looks like we also need this to handle 12bpc hdmi correctly.
      
      Eventually it might be better to switch things around and put the
      target clock into adjusted_mode->clock and create a new pipe_config
      parameter for the port link clock.
      
      v2: Add a massive comment in the code to explain this mess.
      
      v3: s/dp_target_clock/pixel_target_clock in anticipation of the hdmi
      use-case.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      df92b1e6
    • D
      drm/i915: move dp_m_n computation to dp_encoder->compute_config · 03afc4a2
      Daniel Vetter 提交于
      We need a flag to designate dp encoders and the dp link m_n parameters
      in the pipe config for that. And now that the pipe bpp computations
      have been moved up and stored in the pipe config, too, we can do this
      without losing our sanity.
      
      v2: Rebased on top of Takashi Iwai's fix to (again) fix the target
      clock handling for eDP. Luckily the new code is sane enough and just
      does the right thing!
      
      v3: Move ->has_dp_encoder to this patch (Jesse).
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      03afc4a2