1. 30 4月, 2013 2 次提交
    • D
      drm/i915: implement fdi auto-dithering · e29c22c0
      Daniel Vetter 提交于
      So on a bunch of setups we only have 2 fdi lanes available, e.g. hsw
      VGA or 3 pipes on ivb. And seemingly a lot of modes don't quite fit
      into this, among them the default 1080p mode.
      
      The solution is to dither down the pipe a bit so that everything fits,
      which this patch implements.
      
      But ports compute their state under the assumption that the bpp they
      pick will be the one selected, e.g. the display port bw computations
      won't work otherwise. Now we could adjust our code to again up-dither
      to the computed DP link parameters, but that's pointless.
      
      So instead when the pipe needs to adjust parameters we need to retry
      the pipe_config computation at the encoder stage. Furthermore we need
      to inform encoders that they should not increase bandwidth
      requirements if possible. This is required for the hdmi code, which
      prefers the pipe to up-dither to either of the two possible hdmi bpc
      values.
      
      LVDS has a similar requirement, although that's probably only
      theoretical in nature: It's unlikely that we'll ever see an 8bpc
      high-res lvds panel (which is required to hit the 2 fdi lane limit).
      
      eDP is the only thing which could increase the pipe_bpp setting again,
      even when in the retry-loop. This could hit the WARN. Two reasons for
      not bothering:
      - On many eDP panels we'll get a black screen if the bpp settings
        don't match vbt. So failing the modeset is the right thing to do.
        But since that also means it's the only way to light up the panel,
        it should work. So we shouldn't be able to hit this WARN.
      - There are still opens around the eDP panel handling, and maybe we
        need additional tricks. Before that happens it's imo no use trying
        to be too clever.
      Worst case we just need to kill that WARN or maybe fail the compute
      config stage if the eDP connector can't get the bpp setting it wants.
      And since this can only happen with an fdi link in between and so for
      pch eDP panels it's rather unlikely to blow up, if ever.
      
      v2: Rebased on top of a bikeshed from Paulo.
      
      v3: Improve commit message around eDP handling with the stuff
      things with Imre.
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e29c22c0
    • D
      drm/i915: fixup 12bpc hdmi dotclock handling · 325b9d04
      Daniel Vetter 提交于
      We need to multiply the hdmi port dotclock by 1.5x since it's not
      really a dotclock, but the 10/8 encoding bitclock divided by 10.
      
      Also add correct limit checks for the dotclock and reject modes which
      don't fit. HDMI 1.4 would allow more, but our hw doesn't support that
      unfortunately :(
      
      Somehow I suspect 12bpc hdmi output never really worked - we really
      need an i-g-t testcase to check all the different pixel modes and
      outputs.
      
      v2: Fixup the adjusted port clock handling - we need to make sure that
      the fdi link code still gets the real pixelclock.
      
      v3: g4x/vlv don't support 12bpc hdmi output so drop the bogus comment.
      Acked-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      [danvet: Switch dotclock limit check to <= as suggested by Ville.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      325b9d04
  2. 19 4月, 2013 1 次提交
    • J
      drm/i915: update VLV PLL and DPIO code v11 · 89b667f8
      Jesse Barnes 提交于
      In Valleyview voltage swing, pre-emphasis and lane control registers can
      be programmed only through the h/w side band fabric.  Update
      vlv_update_pll, i9xx_crtc_enable, and intel_enable_pll with the
      appropriate programming.
      
      We need to make sure that the tx lane reset occurs in both the full mode
      set and DPMS paths, so factor things out to allow that.
      
      v2: use different DPIO_DIVISOR values for VGA and DisplayPort
      v3: Fix update pll logic to use same DPIO_DIVISOR & DPIO_REFSFR values
              for all display interfaces
      v4: collapse with various updates
      v5: squash with crtc enable/pll enable bits
      v6: split out DP code (jbarnes)
          put phyready check under IS_VALLEYVIEW (jbarnes)
          remove unneeded check in 9xx pll div update (Jani)
          wrap VLV pll update call in IS_VALLEYVIEW (Jani)
          move port enable back to end of crtc enable (jbarnes)
          put phyready check under IS_VALLEYVIEW (jbarnes)
      v7: fix up conflicts against latest drm-intel-next-queued
      v8: use DPIO reg names, fix pipes (Jani)
          from mPhy_registers_VLV2_ww20p5 doc
      v9: update to latest info from driver enabling notes doc
          driver_vbios_notes_9
      v10: fixup a bit of pipe/port confusion to allow eDP and HDMI to work
           simultaneously (Jesse)
      v11: use pll/port callbacks for DPIO port activity (Daniel)
           use separate VLV CRTC enable function (Daniel)
           move around port ready checks (Jesse)
      Signed-off-by: NPallavi G <pallavi.g@intel.com>
      Signed-off-by: NVijay Purushothaman <vijay.a.purushothaman@intel.com>
      Signed-off-by: NGajanan Bhat <gajanan.bhat@intel.com>
      Signed-off-by: NBen Widawsky <benjamin.widawsky@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: Drop pfit changes and add a little comment explaining that
      vlv has a different enable sequence and so needs it's own crtc_enable
      callback. Also apply a fixup patch from Wu Fengguang to shut up some
      compiler warnings.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      89b667f8
  3. 18 4月, 2013 2 次提交
    • D
      drm/i915: move cpu_transcoder to the pipe configuration · 3b117c8f
      Daniel Vetter 提交于
      For a bunch of reason we need to more accurately track this:
      - hw pipe state readout for Haswell needs the cpu transcoder.
      - We need to know the right cpu transcoder in a bunch of places in
        ->disable and other modeset callbacks.
      
      In the future we need to add hw state readout&check support, too. But
      to avoid ugly merge conflicts do the rote sed job now without any
      functional changes.
      
      v2: Preserve the cpu_transcoder value when overwriting crtc->config.
      Reported by Paulo.
      
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
      [danvet: Removed rough whitespace that Chris spotted.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3b117c8f
    • E
      drm/i915: (re)init HPD interrupt storm statistics · 821450c6
      Egbert Eich 提交于
      When an encoder is shared on several connectors there is only
      one hotplug line, thus this line needs to be shared among these
      connectors.
      If HPD detect only works reliably on a subset of those connectors,
      we want to poll the others. Thus we need to make sure that storm
      detection doesn't mess up the settings for those connectors.
      Therefore we store the settings in the intel_connector struct and
      restore them from there.
      If nothing is set but the encoder has a hpd_pin set we assume this
      connector is hotplug capable.
      On init/reset we make sure the polled state of the connectors
      is (re)set to the default value, the HPD interrupts are marked
      enabled.
      Signed-off-by: NEgbert Eich <eich@suse.de>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      821450c6
  4. 06 4月, 2013 1 次提交
  5. 28 3月, 2013 5 次提交
    • 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->limited_color_range · 50f3b016
      Daniel Vetter 提交于
      Now that we have a useful struct for this, let's use it. Some neat
      pointer-chasing required, but it's all there already.
      
      v2: Rebased on top of the added Haswell limited color range support.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      50f3b016
    • 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
    • E
      DRM/i915: Get rid if the 'hotplug_supported_mask' in struct drm_i915_private. · 4f770a5b
      Egbert Eich 提交于
      Now since we have replaced the bits to show interest in hotplug IRQs
      we can go and nuke the 'hotplug_supported_mask'.
      Signed-off-by: NEgbert Eich <eich@suse.de>
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4f770a5b
  6. 27 3月, 2013 1 次提交
  7. 23 3月, 2013 1 次提交
  8. 05 3月, 2013 2 次提交
  9. 04 3月, 2013 1 次提交
  10. 22 2月, 2013 2 次提交
  11. 20 2月, 2013 2 次提交
  12. 15 2月, 2013 1 次提交
  13. 14 2月, 2013 1 次提交
  14. 25 1月, 2013 1 次提交
  15. 20 1月, 2013 3 次提交
    • V
      drm/i915: Provide the quantization range in the AVI infoframe · abedc077
      Ville Syrjälä 提交于
      The AVI infoframe is able to inform the display whether the source is
      sending full or limited range RGB data.
      
      As per CEA-861 [1] we must first check whether the display reports the
      quantization range as selectable, and if so we can set the approriate
      bits in the AVI inforframe.
      
      [1] CEA-861-E - 6.4 Format of Version 2 AVI InfoFrame
      
      v2: Give the Q bits better names, add spec chapter information
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      abedc077
    • V
      drm/i915: Add "Automatic" mode for the "Broadcast RGB" property · 55bc60db
      Ville Syrjälä 提交于
      Add a new "Automatic" mode to the "Broadcast RGB" range property.
      When selected the driver automagically selects between full range and
      limited range output.
      
      Based on CEA-861 [1] guidelines, limited range output is selected if the
      mode is a CEA mode, except 640x480. Otherwise full range output is used.
      Additionally DVI monitors should most likely default to full range
      always.
      
      As per DP1.2a [2] DisplayPort should always use full range for 18bpp, and
      otherwise will follow CEA-861 rules.
      
      NOTE: The default value for the property will now be "Automatic"
      so some people may be affected in case they're relying on the
      current full range default.
      
      [1] CEA-861-E - 5.1 Default Encoding Parameters
      [2] VESA DisplayPort Ver.1.2a - 5.1.1.1 Video Colorimetry
      
      v2: Use has_hdmi_sink to check if a HDMI monitor is present
      v3: Add information about relevant spec chapters
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      55bc60db
    • V
      drm/i915: Fix RGB color range property for PCH platforms · 3685a8f3
      Ville Syrjälä 提交于
      The RGB color range select bit on the DP/SDVO/HDMI registers
      disappeared when PCH was introduced, and instead a new PIPECONF bit
      was added that performs the same function.
      
      Add a new INTEL_MODE_LIMITED_COLOR_RANGE private mode flag, and set
      it in the encoder mode_fixup if limited color range is requested.
      Set the the PIPECONF bit 13 based on the flag.
      
      Experimentation showed that simply toggling the bit while the pipe is
      active doesn't work. We need to restart the pipe, which luckily already
      happens.
      
      The DP/SDVO/HDMI bit 8 is marked MBZ in the docs, so avoid setting it,
      although it doesn't seem to do any harm in practice.
      
      TODO:
      - the PIPECONF bit too seems to have disappeared from HSW. Need a
        volunteer to test if it's just a documentation issue or if it's really
        gone. If the bit is gone and no easy replacement is found, then I suppose
        we may need to use the pipe CSC unit to perform the range compression.
      
      v2: Use mode private_flags instead of intel_encoder virtual functions
      v3: Moved the intel_dp color_range handling after bpc check to help
          later patches
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46800Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3685a8f3
  16. 21 12月, 2012 1 次提交
  17. 14 12月, 2012 1 次提交
  18. 29 11月, 2012 2 次提交
  19. 22 11月, 2012 1 次提交
  20. 12 11月, 2012 7 次提交
  21. 10 10月, 2012 1 次提交
    • P
      drm/i915: completely rewrite the Haswell PLL handling code · 6441ab5f
      Paulo Zanoni 提交于
      Problems with the previous code:
        - HDMI just uses WRPLL1 for everything, so dual head cases might not
          work sometimes.
        - At encoder->mode_set we just write the PLL register without doing
          any kind of check (e.g., check if the PLL is already being used).
        - There is no way to fail and return error codes at
          encoder->mode_set.
        - We write to PORT_CLK_SEL at mode_set and we never disable it.
        - Machines hang due to wrong clock enable/disable sequence.
      
      So here we rewrite the code, making it a little more like the
      pre-Haswell PLL mode set code:
        - Check PLL availability at ironlake_crtc_mode_set.
        - Try to use both WRPLLs.
        - Check if PLLs are used before actually trying to use them, and
          properly fail with error messages.
        - Enable/disable PORT_CLK_SEL at the right place.
        - Add some WARNs to check for bugs.
      
      The next improvement will be to try to reuse PLLs if the timings
      match, but this is content for another patch and it's already
      documented with a TODO comment.
      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>
      6441ab5f
  22. 03 10月, 2012 1 次提交