1. 28 3月, 2013 3 次提交
    • D
      drm/i915: add pipe_config->pixel_multiplier · 6cc5f341
      Daniel Vetter 提交于
      Used by SDVO (and hopefully, eventually HDMI, if we ever get around
      to fixing up the low dotclock CEA modes ...).
      
      This required adding a new encoder->mode_set callback to be able to
      pass around the intel_crtc_config.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6cc5f341
    • D
      drm/i915: add pipe_config->timings_set · 7ae89233
      Daniel Vetter 提交于
      Only used by the lvds encoder. Note that we shouldn't do the same
      simple conversion with the FORCE_6BPC flag, since that's much better
      handled by moving all the pipe_bpc computation around.
      
      This requires that we pass the pipe config around to encoders, so
      that they can set special attributes and set constraints. To do so
      introduce a new ->compute_config encoder callback, which is called in
      stead of the drm crtc helper's ->mode_fixup.
      
      To avoid massive churn all over the codebase we don't want to convert
      all existing ->mode_fixup functions. Instead I've opted to convert
      them on an as-needed basis (mostly to cut down on rebase conflicts and
      to have more freedom to experiment around while developing the
      patches).
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7ae89233
    • D
      drm/i915: introduce struct intel_crtc_config · b8cecdf5
      Daniel Vetter 提交于
      Currently only containing the requested and the adjusted mode. And
      only crtc callbacks are converted somewhat to it, encoders will be
      done on a as-needed basis (simply too much churn in one patch
      otherwise).
      
      Future patches will add tons more useful stuff to this struct,
      starting with the very simple.
      
      v2: Store the pipe_config in the intel_crtc, so that the ->mode-set,
      ->enable and also ->disable have easy access to it.
      
      v3: Store the pipe config in the right crtc ...
      
      v4: Rebased.
      
      v5: Fixup an OOPS when trying to kfree an ERR_PTR.
      
      v6: Used drm_moode_copy and some other small cleanups as suggested
      by Ville Syrjälä.
      
      v7: drm_mode_copy preserves the mode id of the destination, so no need
      to clear it again (Ville).
      
      v8: Break a long line spotted by Paulo.
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b8cecdf5
  2. 27 3月, 2013 2 次提交
  3. 23 3月, 2013 1 次提交
  4. 22 2月, 2013 1 次提交
  5. 20 2月, 2013 5 次提交
  6. 14 2月, 2013 1 次提交
  7. 31 1月, 2013 1 次提交
  8. 28 1月, 2013 1 次提交
  9. 27 1月, 2013 1 次提交
    • P
      drm/i915: fix intel_init_power_wells · fa42e23c
      Paulo Zanoni 提交于
      The current code was wrong in many different ways, so this is a full
      rewrite. We don't have "different power wells for different parts of
      the GPU", we have a single power well, but we have multiple registers
      that can be used to request enabling/disabling the power well. So
      let's be a good citizen and only use the register we're suppose to
      use, except when we're loading the driver, where we clear the request
      made by the BIOS.
      
      If any of the registers is requesting the power well to be enabled, it
      will be enabled. If none of the registers is requesting the power well
      to be enabled, it will be disabled.
      
      For now we're just forcing the power well to be enabled, but in the
      next commits we'll change this.
      
      V2:
        - Remove debug messages that could be misleading due to possible
          race conditions with KVMr, Debug and BIOS.
        - Don't wait on disabling: after a conversaion with a hardware
          engineer we discovered that the "restriction" on bit 31 is just
          for the "enable" case, and we don't even need to wait on the
          "disable" case.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fa42e23c
  10. 23 1月, 2013 1 次提交
  11. 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
  12. 21 12月, 2012 1 次提交
  13. 14 12月, 2012 1 次提交
  14. 12 12月, 2012 1 次提交
    • D
      drm/i915: Fixup hpd irq register setup ordering · 20afbda2
      Daniel Vetter 提交于
      For GMCH platforms we set up the hpd irq registers in the irq
      postinstall hook. But since we only enable the irq sources we actually
      need in PORT_HOTPLUG_EN/STATUS, taking dev_priv->hotplug_supported_mask
      into account, no hpd interrupt sources is enabled since
      
      commit 52d7eced
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Sat Dec 1 21:03:22 2012 +0100
      
          drm/i915: reorder setup sequence to have irqs for output setup
      
      Wrongly set-up interrupts also lead to broken hw-based load-detection
      on at least GM45, resulting in ghost VGA/TV-out outputs.
      
      To fix this, delay the hotplug register setup until after all outputs
      are set up, by moving it into a new dev_priv->display.hpd_irq_callback.
      We might also move the PCH_SPLIT platforms to such a setup eventually.
      
      Another funny part is that we need to delay the fbdev initial config
      probing until after the hpd regs are setup, for otherwise it'll detect
      ghost outputs. But we can only enable the hpd interrupt handling
      itself (and the output polling) _after_ that initial scan, due to
      massive locking brain-damage in the fbdev setup code. Add a big
      comment to explain this cute little dragon lair.
      
      v2: Encapsulate all the fbdev handling by wrapping the move call into
      intel_fbdev_initial_config in intel_fb.c. Requested by Chris Wilson.
      
      v3: Applied bikeshed from Jesse Barnes.
      
      v4: Imre Deak noticed that we also need to call intel_hpd_init after
      the drm_irqinstall calls in the gpu reset and resume paths - otherwise
      hotplug will be broken. Also improve the comment a bit about why
      hpd_init needs to be called before we set up the initial fbdev config.
      
      Bugzilla: Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54943Reported-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v3)
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      20afbda2
  15. 08 12月, 2012 1 次提交
  16. 06 12月, 2012 1 次提交
    • C
      drm/i915: Close race between processing unpin task and queueing the flip · e7d841ca
      Chris Wilson 提交于
      Before queuing the flip but crucially after attaching the unpin-work to
      the crtc, we continue to setup the unpin-work. However, should the
      hardware fire early, we see the connected unpin-work and queue the task.
      The task then promptly runs and unpins the fb before we finish taking
      the required references or even pinning it... Havoc.
      
      To close the race, we use the flip-pending atomic to indicate when the
      flip is finally setup and enqueued. So during the flip-done processing,
      we can check more accurately whether the flip was expected.
      
      v2: Add the appropriate mb() to ensure that the writes to the page-flip
      worker are complete prior to marking it active and emitting the MI_FLIP.
      On the read side, the mb should be enforced by the spinlocks.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      [danvet: Review the barriers a bit, we need a write barrier both
      before and after updating ->pending. Similarly we need a read barrier
      in the interrupt handler both before and after reading ->pending. With
      well-ordered irqs only one barrier in each place should be required,
      but since this patch explicitly sets out to combat spurious interrupts
      with is staged activation of the unpin work we need to go full-bore on
      the barriers, too. Discussed with Chris Wilson on irc and changes
      acked by him.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e7d841ca
  17. 29 11月, 2012 2 次提交
    • D
      drm/i915: move is_dual_link_lvds to intel_lvds.c · 1974cad0
      Daniel Vetter 提交于
      Just a prep patch to make this a property of intel_lvds. Makes more
      sense, removes clutter from intel_display.c and eventually I want to
      move all the encoder special cases wrt clock handling to encoders
      anyway.
      
      v2: Add an intel_ prefixe to is_dual_link_lvds since it's non-static
      now.
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1974cad0
    • D
      drm/i915: add encoder->pre_pll_enable callback · dafd226c
      Daniel Vetter 提交于
      Currently we have two encoder specific bits in the common mode_set
      functions:
      - lvds pin pair enabling
      - dp m/n setting and computation
      
      Now the lvds stuff needs to happen before the pll is enabled. Since
      that is done in the crtc_mode_set functions, we need to add a new
      callback to be able to move them to the encoder code (where they
      belong). The dp m/n stuff is a giant mess anyway (since it also
      confuses itself with the fdi link m/n handling), so that needs to be
      handled separately.
      
      I think that we can move the pll enabling down quite a bit, which
      might allow us to eventually merge encoder->pre_enable with this new
      pre_pll_enable callback. But for now this will allow us to clean
      things up a bit.
      
      Note that vlv doesn't support lvds, hence we don't need to change
      anything in there.
      
      v2: Fixup commit message, both suggested from Paulo Zanoni.
      - dp m/n doesn't need to happen before pll enabling
      - lvds doesn't exist on vlv, hence no changes required in the vlv pll
        function.
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      dafd226c
  18. 22 11月, 2012 1 次提交
  19. 12 11月, 2012 6 次提交
  20. 27 10月, 2012 1 次提交
  21. 26 10月, 2012 5 次提交
    • P
      drm/i915: turn the eDP DDI panel on/off · 82a4d9c0
      Paulo Zanoni 提交于
      It's an important step :)
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      82a4d9c0
    • P
      d6c50ff8
    • P
      drm/i915: set the correct eDP aux channel clock divider on DDI · b8fc2f6a
      Paulo Zanoni 提交于
      The cdclk frequency is not always the same, so the value here should
      be adjusted to match it.
      
      Version 2: call intel_ddi_get_cdclk_freq instead of reading
      CDCLK_FREQ, because the register is just for earlier HW steppings.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b8fc2f6a
    • 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