1. 06 Sep, 2012 9 commits
    • Daniel Vetter's avatar
      drm/i915/sdvo: convert to encoder disable/enable · ce22c320
      Daniel Vetter authored
      Similar to crt, this doesn't convert the dpms functions.
      Also similar to crt, we don't switch of the display pipe
      for the intermediate modes, only DPMS_OFF is truely off.
      Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      ce22c320
    • Daniel Vetter's avatar
      drm/i915/crt: convert to encoder disable/enable · 2124604b
      Daniel Vetter authored
      CRT is the first output which can be cloned, hence we cannot (yet)
      move the dpms handling over to disable/enable. This requires some more
      smarts in intel_crtc_dpms first to set the display pipe status
      depening upon encoder->connectors_active of all connected encoders.
      
      Because that will happen in a separate step, don't touch the dpms
      functions, yet.
      
      v2: Be careful about clearing the _DISABLE flags for intermediate dpms
      modes - otherwise we might clobber the crt state when another (cloned)
      connector gets enabled.
      Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      2124604b
    • Daniel Vetter's avatar
      drm/i915/dp: convert to encoder disable/enable · e8cb4558
      Daniel Vetter authored
      DP is the first encoder which isn't simple. As
      
      commit d240f20f
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Fri Aug 13 15:43:26 2010 -0700
      
          drm/i915: make sure eDP PLL is enabled at the right time
      
      discovered, we need to enable the eDP PLL for the cpu port _before_ we
      enable the pipes and planes. After a few more commits the current
      solution is to enable the PLL in the dp mode_set function (because
      this is the only encoder callback the crtc helper code calls before it
      calls the crtc's commit function).
      
      Now I suspect that we actually should enable/disable the entire cpu
      eDP port before/after planes, but thanks to how the crtc helper code
      assumes that you can disable an encoder without disabling it's crtc
      right away, this won't work.
      
      The result is that the current prepare/commit hooks don't touch the
      eDP PLL, but instead it get's frobbed in dp_mode_set and in the dp
      dpms function. Hence we need to keep things (at least for now)
      bug-for-bug compatible by using our own special dp dpms function and
      keep everything else more-or-less as-is (just using our own
      infrastrucutre now).
      
      This mess can only be cleaned up once we control the entire modeset
      sequence and can move things around freely.
      
      v2: Squash unsupported dpms modes to OFF at the beginning of the DP
      dpms function.
      
      v3: Need to set the dpms state to off in dp_disable, otherwise this
      breaks the newly added WARNs ...
      
      v4: Rebased against edp panel off sequence changes in 3.6-rc2
      Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      e8cb4558
    • Daniel Vetter's avatar
      drm/i915/lvds: convert to encoder disable/enable · c22834ec
      Daniel Vetter authored
      With the previous patch LVDS is also a simple case. Treat it
      accordingly.
      Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      c22834ec
    • Daniel Vetter's avatar
      drm/i915/tv: convert to encoder enable/disable · 6b5756a0
      Daniel Vetter authored
      Like hdmi tv outputs are simple: They only have 2 states and can't be
      cloned. Hence give it the same treatment.
      Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      6b5756a0
    • Daniel Vetter's avatar
      drm/i915/hdmi: convert to encoder->disable/enable · 5ab432ef
      Daniel Vetter authored
      I've picked hdmi as the first encoder to convert because it's rather
      simple:
      - no cloning possible
      - no differences between prepare/commit and dpms off/on switching.
      
      A few changes are required to do so:
      - Split up the dpms code into an enable/disable function and wire it
        up with the intel encoder.
      - Noop out the existing encoder prepare/commit functions used by the
        crtc helper - our crtc enable/disable code now calls back into the
        encoder enable/disable code at the right spot.
      - Create new helper functions to handle dpms changes.
      - Add intel_encoder->connectors_active to better track dpms state. Atm
        this is unused, but it will be useful to correctly disable the
        entire display pipe for cloned configurations. Also note that for
        now this is only useful in the dpms code - thanks to the crtc
        helper's dpms confusion across a modeset operation we can't (yet)
        rely on this having a sensible value in all circumstances.
      - Rip out the encoder helper dpms callback, if this is still getting
        called somewhere we have a bug. The slight issue with that is that
        the crtc helper abuses dpms off to disable unused functions. Hence
        we also need to implement a default encoder disable function to do
        just that with the new encoder->disable callback.
      - Note that we drop the cpt modeset verification in the commit
        callback, too. The right place to do this would be in the crtc's
        enable function, _after_ all the encoders are set up. But because
        not all encoders are converted yet, we can't do that. Hence disable
        this check temporarily as a minor concession to bisectability.
      
      v2: Squash the dpms mode to only the supported values -
      connector->dpms is for internal tracking only, we can hence avoid
      needless state-changes a bit whithout causing harm.
      
      v3: Apply bikeshed to disable|enable_ddi, suggested by Paulo Zanoni.
      Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      5ab432ef
    • Daniel Vetter's avatar
      drm/i915: add direct encoder disable/enable infrastructure · ef9c3aee
      Daniel Vetter authored
      Just prep work, not yet put to some use.
      
      Note that because we're still using the crtc helper to switch modes
      (and their complicated way to do partial modesets), we need to call
      the encoder's disable function unconditionally.
      
      But once this is cleaned up we shouldn't call the encoder's disable
      function unconditionally any more, because then we know that we'll
      only call it if the encoder is actually enabled. Also note that we
      then need to be careful about which crtc we're filtering the encoder
      list on: We want to filter on the crtc of the _current_ mode, not the
      one we're about to set up.
      
      For the enabling side we need to do the same trick. And again, we
      should be able to simplify this quite a bit when things have settled
      into place.
      
      Also note that this simply does not take cloning into account, so dpms
      needs to be handled specially for the few outputs where we even bother
      with it.
      Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      ef9c3aee
    • Daniel Vetter's avatar
      drm/i915: rip out crtc prepare/commit indirection · eae307a5
      Daniel Vetter authored
      Just impendance matching with the the crtc helper stuff.
      
      ... and somehow the design of this all ended up in this commit here,
      too ;-)
      
      The big plan is that this new set of crtc display_funcs take full
      responsibility of modeset operations for the entire display output
      pipeline (by calling down into object-specific callbacks and
      functions). The platform-specific callbacks simply know best what the
      proper order is.
      
      This has the drawback that we can't do minimal change-overs any more
      if a modeset just disables one encoder in a cloned configuration
      (because we will only expose a disable/enable action that takes
      down/sets up the entire crtc including all encoders). Imo that's the
      only sane way to do it though:
      - The use-case for this is pretty minimal, even when presenting (at
        least sane people) should use a dual-screen output so that you can
        see your notes on your panel. Clone mode is imo BS.
      - With all the clone mode constrains, shared resources, and special
        ordering requirements (which differ even on the same platform
        sometimes for different outputs) there's no way we'd get this right
        for all cases. Especially since this is a under-used feature.
      - And to top it off: On haswell even dp link re-training requires us
        to take down the entire display pipe - otherwise the chip dies.
      
      So the only sane way is to do a full modeset on every crtc where the
      output config changes in any way.
      
      To support global modeset (i.e. set the configuration for all crtcs at
      once) we'd then add one more function to allocate global and shared
      objects in the best ways (e.g. fdi links, pch plls, ...). The crtc
      functions would then simply use the pre-allocated stuff (and shouldn't
      be able to fail, ever). We could even do all the object pinning in
      there (and maybe try to defragment the global gtt if we fail)!
      Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      eae307a5
    • Daniel Vetter's avatar
      drm/i915: add crtc->enable/disable vfuncs insted of dpms · 76e5a89c
      Daniel Vetter authored
      Because that's what we're essentially calling. This is the first step
      in untangling the crtc_helper induced dpms handling mess we have - at
      the crtc level we only have 2 states and the magic is just in
      selecting which one (and atm there isn't even much magic, but on
      recent platforms where not even the crt output has more than 2 states
      we could do better).
      Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      76e5a89c
  2. 17 Aug, 2012 19 commits
  3. 16 Aug, 2012 11 commits
  4. 15 Aug, 2012 1 commit