1. 28 Mar, 2013 1 commit
  2. 27 Mar, 2013 5 commits
    • Daniel Vetter's avatar
      drm/i915: add pipe_config->limited_color_range · 50f3b016
      Daniel Vetter authored
      
      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: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      50f3b016
    • Daniel Vetter's avatar
      drm/i915: add pipe_config->has_pch_encoder · 5bfe2ac0
      Daniel Vetter authored
      
      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: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      5bfe2ac0
    • Daniel Vetter's avatar
      drm/i915: add pipe_config->pixel_multiplier · 6cc5f341
      Daniel Vetter authored
      
      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: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      6cc5f341
    • Daniel Vetter's avatar
      drm/i915: add pipe_config->timings_set · 7ae89233
      Daniel Vetter authored
      
      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: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      7ae89233
    • Daniel Vetter's avatar
      drm/i915: introduce struct intel_crtc_config · b8cecdf5
      Daniel Vetter authored
      
      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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      b8cecdf5
  3. 26 Mar, 2013 2 commits
  4. 23 Mar, 2013 1 commit
  5. 21 Feb, 2013 1 commit
  6. 20 Feb, 2013 3 commits
  7. 19 Feb, 2013 2 commits
  8. 13 Feb, 2013 1 commit
  9. 31 Jan, 2013 1 commit
  10. 27 Jan, 2013 1 commit
  11. 26 Jan, 2013 1 commit
    • Paulo Zanoni's avatar
      drm/i915: fix intel_init_power_wells · fa42e23c
      Paulo Zanoni authored
      
      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: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      fa42e23c
  12. 22 Jan, 2013 1 commit
  13. 20 Jan, 2013 3 commits
    • Ville Syrjälä's avatar
      drm/i915: Provide the quantization range in the AVI infoframe · abedc077
      Ville Syrjälä authored
      
      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: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      abedc077
    • Ville Syrjälä's avatar
      drm/i915: Add "Automatic" mode for the "Broadcast RGB" property · 55bc60db
      Ville Syrjälä authored
      
      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: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      55bc60db
    • Ville Syrjälä's avatar
      drm/i915: Fix RGB color range property for PCH platforms · 3685a8f3
      Ville Syrjälä authored
      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=46800
      
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      3685a8f3
  14. 20 Dec, 2012 1 commit
  15. 14 Dec, 2012 1 commit
  16. 11 Dec, 2012 1 commit
    • Daniel Vetter's avatar
      drm/i915: Fixup hpd irq register setup ordering · 20afbda2
      Daniel Vetter authored
      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=54943
      
      Reported-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v3)
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      20afbda2
  17. 08 Dec, 2012 1 commit
  18. 06 Dec, 2012 1 commit
    • Chris Wilson's avatar
      drm/i915: Close race between processing unpin task and queueing the flip · e7d841ca
      Chris Wilson authored
      
      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: default avatarChris 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: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      e7d841ca
  19. 29 Nov, 2012 2 commits
    • Daniel Vetter's avatar
      drm/i915: move is_dual_link_lvds to intel_lvds.c · 1974cad0
      Daniel Vetter authored
      
      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: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      1974cad0
    • Daniel Vetter's avatar
      drm/i915: add encoder->pre_pll_enable callback · dafd226c
      Daniel Vetter authored
      
      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: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      dafd226c
  20. 21 Nov, 2012 1 commit
  21. 11 Nov, 2012 6 commits
  22. 26 Oct, 2012 3 commits