1. 10 Jun, 2013 10 commits
    • Daniel Vetter's avatar
      drm/i915: hw state readout for shared pch plls · c0d43d62
      Daniel Vetter authored
      Well, the first step of a long road at least, it only reads out
      the pipe -> shared dpll association thus far. Other state which needs
      to follow:
      
      - hw state of the dpll (on/off + dpll registers). Currently we just
        read that out from the hw state, but that doesn't work too well when
        the dpll is in use, but not yet fully enabled. We get away since
        most likely it already has been enabled and so the correct state is
        left behind in the registers. But that doesn't hold for atomic
        modesets when we want to enable all pipes at once.
      
      - Refcount reconstruction for each dpll.
      
      - Cross-checking of all the above. For that we need to keep the dpll
        register state both in the pipe and in the shared_dpll struct, so
        that we can check that every pipe is still connected to a correctly
        configured dpll.
      
      Note that since the refcount resconstruction isn't done yet this will
      spill a few WARNs at boot-up while trying to disable pch plls which
      have bogus refcounts. But since there's still a pile of refactoring to
      do I'd like to lock down the state handling as soon as possible hence
      decided against reordering the patches to quiet these WARNs - after
      all the issues they're complaining about have existed since forever,
      as Jesse can testify by having pch pll states blow up consistently in
      his fastboot patches ...
      
      v2: We need to preserve the old shared_dpll since currently the
      shared dpll refcount dropping/getting is done in ->mode_set. With
      the usual pipe_config infrastructure the old dpll id is already lost
      at that point, hence preserve it in the new config.
      
      v3: Rebase on top of the ips patch from Paulo.
      
      v4: We need to unconditionally take over the shared_dpll id from the
      old pipe config when e.g. doing a direct pch port -> cpu edp
      transition.
      
      v5: Move the saving of the old shared_dpll id to an ealier patch.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      c0d43d62
    • Daniel Vetter's avatar
      drm/i915: refactor PCH_DPLL_SEL #defines · 11887397
      Daniel Vetter authored
      The bits are evenly space, so we can cut down on two big switch
      blocks. This also greatly simplifies the hw state readout which
      follows in the next patch.
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      11887397
    • Daniel Vetter's avatar
      drm/i915: move shared_dpll into the pipe config · a43f6e0f
      Daniel Vetter authored
      With the big sed-job prep work done this is now really simple. With
      the exception that we only assign the right shared dpll id in the
      ->mode_set callback but also depend upon the old one still being
      around.
      
      Until that mess is fixed up we need to jump through a few hoops to
      keep the old value save.
      
      v2: Kill the funny whitespace spotted by Chris.
      
      v3: Move the shared_dpll pipe config fixup into this patch as noticed
      by Ville. Also unconditionally set the shared_dpll with the current
      one, since otherwise we won't handle direct pch port -> cpu edp
      transitions correctly.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      a43f6e0f
    • Daniel Vetter's avatar
      drm/i915: switch crtc->shared_dpll from a pointer to an enum · e2b78267
      Daniel Vetter authored
      Dealing with discrete enum values is simpler for hw state readout and
      pipe config computations than pointers - having neat names instead of
      chasing pointers should look better in the code.
      
      This isn't a that good reason for pch plls, but on haswell we actually
      have 3 different types of plls: WRPLL, SPLL and the DP clocks. Having
      explicit names should help there.
      
      Since this also adds the intel_crtc_to_shared_dpll helper to further
      abstract away the crtc -> dpll relationship this will also help to
      make the next patch simpler, which moves the shared dpll into the pipe
      configuration.
      
      Also note that for uniformity we have two special dpll ids: NONE for
      pipes which need a shared pll but don't have one (yet) and private for
      when there's a non-shared pll (e.g. per-pipe or per-port pll).
      
      I've thought whether we should also add a 2nd enum for the type of the
      pll we want (for really generic pll selection code) but thrown that
      idea out again - likely there's too much platform craziness going on
      to be able to share the pll selection logic much.
      
      Since this touched all the shared_pll functions a bit I've also done
      an s/intel_crtc/crtc/ replacement on a few of them.
      
      v2: Kill DPLL_ID_NONE. It's probably better to call it DPLL_ID_INVALID and use
      it to check that the compute config stage assigns a dpll to every pipe.
      But since that code isn't ready yet until we move the dpll selection out
      of the ->mode_set callback, there's no use for it.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      e2b78267
    • Daniel Vetter's avatar
      drm/i915: s/pch_pll/shared_dpll/ · e72f9fbf
      Daniel Vetter authored
      For fastboot we need some support to read out the sharing state of
      plls, at least for platforms where they can be shared (or freely
      assigned at least). Now for ivb we already have pretty extensive
      infrastructure for tracking pch plls, and it took us an aweful lot of
      tries to get that remotely right. Note that hsw could also share plls,
      but even now they're already freely assignable. So we need this on
      more than just ivb.
      
      So on top of the usual fastboot fun pll sharing seems to be an
      additional step up in fragility. Hence a common infrastructure for all
      shared/freely assignable display plls seems to be in order.
      
      The plan is to have a bit of dpll hw state readout code, which can be
      used individually, but also to fill in the pipe config. The hw state
      cross check code will then use that information to make sure that
      after every modeset every pipe still is connected to a pll which still
      has the correct configuration - a lot of the pch pll sharing bugs
      where due to incorrect sharing.
      
      We start this endeavour with a simple s/pch_pll/shared_dpll/ rename
      job.
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      e72f9fbf
    • Daniel Vetter's avatar
      drm/i915: lock down pch pll accouting some more · f4a091c7
      Daniel Vetter authored
      Before I start to make a complete mess out of this, crank up
      the paranoia level a bit.
      
      v2: Kill the has_pch_encoder check in put_shared_dpll - it's invalid
      as spotted by Ville since we currently only put the dpll when we
      already have the new pipe config. So a direct pch port -> cpu edp
      transition will hit this.
      
      v3: Now that I've lifted my blinders add the WARN_ON Ville requested.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      f4a091c7
    • Daniel Vetter's avatar
      drm/i915: conditionally disable pch resources in ilk_crtc_disable · d925c59a
      Daniel Vetter authored
      Simlar to how disable already works on haswell. This is possible
      since we now carefully track the pch state in the pipe config.
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      d925c59a
    • Daniel Vetter's avatar
      drm/i915: fix up pch pll handling in ->mode_set · cdbd2316
      Daniel Vetter authored
      We ->mode_set is called we can't just blindly reuse an existing pll
      since that might be shared with a different, still active pch output.
      
      v2: Only update the pll settings when the pch pll is know to be
      unused, otherwise we can wreak havoc with a running pipe. Which in the
      case of DP will likely result in a black screen due to loss of link
      lock.
      
      v3: Tighten up the asserts a bit more, especially make sure that the
      pch pll is still enabled when we try to disable it. This would have
      caught the bug fixed in this patch.
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      cdbd2316
    • Damien Lespiau's avatar
      drm/i915: Use FBINFO_STATE defines instead of 0 and 1 · b6f3eff7
      Damien Lespiau authored
      This makes, arguably, the condition on state easier to read.
      Suggested-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      b6f3eff7
    • Chris Wilson's avatar
      drm/i915: Remove dead code from SDVO initialisation · e596a02c
      Chris Wilson authored
      The hotplug_mask is no longer used as the hpd interrupt setup is now
      handled in the core.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      e596a02c
  2. 07 Jun, 2013 8 commits
  3. 06 Jun, 2013 19 commits
  4. 05 Jun, 2013 3 commits
    • Daniel Vetter's avatar
      drm/i915: set default value for config->pixel_multiplier · ef1b460d
      Daniel Vetter authored
      This way we can simplify the code quite a bit.
      
      Also add a WARN in the sdvo code to complain about a bogus value
      and kill the readout code in intel_ddi.c that Jesse sneaked in.
      HW state readout for the pixel multiplier will work a bit differently
      in the end.
      
      v2: Rebase on top of the fdi pixel mutliplier handling fix.
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      ef1b460d
    • Jani Nikula's avatar
      drm/i915: distinguish between error messages in DIDL initialization · c2a2a1a7
      Jani Nikula authored
      Two exactly same error messages on different error paths makes debugging
      difficult. Clarify the messages and distinguish them from each other.
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      c2a2a1a7
    • Daniel Vetter's avatar
      drm/i915: consolidate and tighten encoder cloning checks · accfc0c5
      Daniel Vetter authored
      Only lvds/tv did actually check for cloning or not, but many more
      places should.
      
      Notices because my ivb tried to enable both cpu edp and vga on the
      first crtc - the resulting confusion between has_pch_encoder,
      has_dp_encoder but not actually being a pch dp encoder resulting in
      hilarity (hitting a BUG).
      
      We _really_ need an igt to random-walk our modeset space more
      exhaustively.
      
      The bug seems to have been exposed due to a race in the hw load
      detection support for VGA: Right after a hotplug VGA was still
      detected as connected, but obviously reading the EDID wasn't possible
      any more. Hence why restarting X a bit later fixed things. Due to the
      1024x756 fallback resolution suddenly more outputs had the same
      resolution.
      
      On top of that SNA was confused with the possible_clones mask, trying
      to clone outputs which cannot be cloned. That bug is now fixed with
      
      commit fc1e0702b25e647cb423851fb7228989fec28bd6
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Wed May 29 11:25:28 2013 +0100
      
          sna: fixup up possible_clones kms->X impedance mismatch
      
      v2: Kill intel_encoder_check_is_cloned, spotted by Paulo.
      
      v3: Drop the now unused pipe param.
      
      v4: Kill the stray printk Chris spotted.
      
      v5: Elaborate on how the bug in userspace happened and why it was racy
      to reproduce.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      accfc0c5