1. 23 11月, 2012 1 次提交
    • J
      drm/i915: do not default to 18 bpp for eDP if missing from VBT · 9a30a61f
      Jani Nikula 提交于
      commit 500a8cc4
      Author: Zhenyu Wang <zhenyuw@linux.intel.com>
      Date:   Wed Jan 13 11:19:52 2010 +0800
      
          drm/i915: parse eDP panel color depth from VBT block
      
      originally introduced parsing bpp for eDP from VBT, with a default of 18
      bpp if the eDP BIOS data block is not present. Turns out that default seems
      to break the Macbook Pro with retina display, as noted in
      
      commit 4344b813
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Aug 10 11:10:20 2012 +0200
      
          drm/i915: ignore eDP bpc settings from vbt
      
      Since we can't ignore bpc settings from VBT completely after all, get rid
      of the default. Do not clamp eDP to 18 bpp by default if the eDP BDB is
      missing from VBT.
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Tested-by: NHenrik Rydberg <rydberg@euromail.se>
      [danvet: paste in the updated commit message from irc.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9a30a61f
  2. 13 11月, 2012 1 次提交
  3. 16 10月, 2012 1 次提交
  4. 12 10月, 2012 2 次提交
    • D
      drm/i915: fixup the plane->pipe fixup code · fa555837
      Daniel Vetter 提交于
      We need to check whether the _other plane is on our pipe, not whether
      our plane is on the other pipe. Otherwise if not both pipes/planes are
      active, we won't properly clean up the mess and set up our desired
      plane->pipe mapping.
      
      v2: Fixup the logic, I've totally fumbled it. Noticed by Chris Wilson.
      
      v3: I've checked Bspec, and the flexible plane->pipe mapping is a
      gen2/3 feature, so test for that instead of PCH_SPLIT
      
      v4: Check whether we indeed have 2 pipes before checking the other
      pipe, to avoid upsetting i845g/i865g. Noticed by Chris Wilson.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51265
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49838Tested-by: NDave Airlie <airlied@gmail.com>
      Tested-by: Chris Wilson <chris@chris-wilson.co.uk> #855gm
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fa555837
    • D
      drm/i915: rip out the pipe A quirk for i855gm · ccd0d36e
      Daniel Vetter 提交于
      This seems to be the root-cause that breaks resume on my i855gm when I
      apply the "drm/i915: fixup the plane->pipe fixup code" patch. And that
      code doesn't even run on my machine, so it's pure timing changes
      causing the regression.
      
      Furthermore resume has been constantly switching between working and
      broken on this machine ever since kms support has been merged,
      seemingly with no related change as a root cause. And always with the
      same symptoms of the backlight lighting up, but the lvds panel only
      displaying black.
      
      Also, of both i855gm variants only one is in the table. And in the
      past we've only ever removed entries from this quirk table because it
      breaks things.
      
      So let's just remove it - in case there's indeed a bios out there
      relying on a running pipe A, we can add back in a more precise quirk
      entry, like all the others (save for i830/i845).
      
      Tested-by: Chris Wilson <chris@chris-wilson.co.uk> #855gm
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ccd0d36e
  5. 09 10月, 2012 1 次提交
  6. 04 10月, 2012 1 次提交
  7. 03 10月, 2012 1 次提交
  8. 02 10月, 2012 1 次提交
    • C
      drm/i915: Flush the pending flips on the CRTC before modification · 5bb61643
      Chris Wilson 提交于
      This was meant to be the purpose of the
      intel_crtc_wait_for_pending_flips() function which is called whilst
      preparing the CRTC for a modeset or before disabling. However, as Ville
      Syrjala pointed out, we set the pending flip notification on the old
      framebuffer that is no longer attached to the CRTC by the time we come
      to flush the pending operations. Instead, we can simply wait on the
      pending unpin work to be finished on this CRTC, knowning that the
      hardware has therefore finished modifying the registers, before proceeding
      with our direct access.
      
      Fixes i-g-t/flip_test on non-pch platforms. pch platforms simply
      schedule the flip immediately when the pipe is disabled, leading
      to other funny issues.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      [danvet: Added i-g-t note and cc: stable]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5bb61643
  9. 27 9月, 2012 1 次提交
    • J
      drm/i915: use adjusted_mode instead of mode for checking the 6bpc force flag · 0c96c65b
      Jani Nikula 提交于
      The dithering introduced in
      
      commit 3b5c78a3
      Author: Adam Jackson <ajax@redhat.com>
      Date:   Tue Dec 13 15:41:00 2011 -0800
      
          drm/i915/dp: Dither down to 6bpc if it makes the mode fit
      
      stores the INTEL_MODE_DP_FORCE_6BPC flag in the private_flags of the
      adjusted mode, while i9xx_crtc_mode_set() and ironlake_crtc_mode_set() use
      the original mode, without the flag, so it would never have any
      effect. However, the BPC was clamped by VBT settings, making things work by
      coincidence, until that part was removed in
      
      commit 4344b813
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Aug 10 11:10:20 2012 +0200
      
      Use adjusted_mode instead of mode when checking for
      INTEL_MODE_DP_FORCE_6BPC to make the flag have effect.
      
      v2: Don't forget to fix this in i9xx_crtc_mode_set() also, pointed out by
      Daniel both before and after sending the first patch.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47621
      CC: Adam Jackson <ajax@redhat.com>
      CC: stable@vger.kernel.org
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Reviewed-by: NAdam Jackson <ajax@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0c96c65b
  10. 20 9月, 2012 8 次提交
  11. 18 9月, 2012 1 次提交
  12. 17 9月, 2012 1 次提交
  13. 11 9月, 2012 1 次提交
  14. 06 9月, 2012 19 次提交
    • D
      drm/i915: improve modeset state checking after dpms calls · b980514c
      Daniel Vetter 提交于
      Now that we have solid modeset state tracking and checking code in
      place, we can do the Full Monty also after dpms calls.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b980514c
    • D
      drm/i915: add tons of modeset state checks · 8af6cf88
      Daniel Vetter 提交于
      ... let's see whether this catches anything earlier and I can track
      down a few bugs.
      
      v2: Add more checks and also add DRM_DEBUG_KMS output so that it's
      clear which connector/encoder/crtc is being checked atm. Which proved
      rather useful for debugging ...
      
      v3: Add a WARN in the common encoder dpms function, now that also
      modeset changes properly update the dpms state ...
      
      v4: Properly add a short explanation for each WARN, to avoid the need
      to correlate dmesg lines with source lines accurately. Suggested by
      Chris Wilson.
      
      v5: Also dump (expected, found) for state checks (or wherever it's not
      apparent from the test what exactly mismatches with expectations).
      Again suggested by Chris Wilson.
      
      v6: Due to an issue reported by Paulo Zanoni I've noticed that the
      encoder checking is by far not as strict as it could and should be.
      Improve this.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8af6cf88
    • D
      drm/i915: disable all crtcs at suspend time · a261b246
      Daniel Vetter 提交于
      We need this to avoid confusing the hw state readout code with the cpt
      pch plls at resume time: We'd read the new pipe state (which is
      disabled), but still believe that we have a life pll connected to that
      pipe (from before the suspend). Hence properly disable pipes to clear
      out all the residual state.
      
      This has the neat side-effect that we don't enable ports prematurely
      by restoring bogus state from the saved register values.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a261b246
    • D
      drm/i915: push commit_output_state past the crtc/encoder preparing · ea9d758d
      Daniel Vetter 提交于
      With this change we can (finally!) rip out a few of the temporary hacks
      and clean up a few other things:
      - Kill intel_crtc_prepare_encoders, now unused.
      - Kill the hacks in the crtc_disable/enable functions to always call the
        encoder callbacks, we now always call the crtc functions with the right
        encoder -> crtc links.
      - Also push down the crtc->enable, encoder and connector dpms state
        updates. Unfortunately we can't add a WARN in the crtc_disable
        callbacks to ensure that the crtc is always still enabled when
        disabling an output pipe - the crtc sanitizer of the hw readout path
        can hit this when it needs to disable an active pipe without any
        enabled outputs.
      - Only call crtc->disable if the pipe is already enabled - again avoids
        running afoul of the new WARN.
      
      v2: Copy&paste our own version of crtc_in_use, too.
      
      v3: We need to update the dpms an encoder->connectors_active states,
      too.
      
      v4: I've forgotten to kill the unconditional encoder->disable calls in
      the crtc_disable functions.
      
      v5: Rip out leftover debug printk.
      
      v6: Properly clear intel_encoder->connectors_active. This wasn't
      properly cleared when disabling an encoder because it was no longer on
      the new connector list, but the crtc was still enabled (i.e. switching
      the encoder of an active crtc). Reported by Jani Nikula.
      
      v7: Don't clobber the encoder->connectors_active state of untouched
      encoders. Since X likes to first disable all outputs with dpms off
      before setting a new framebuffer, this hit a few warnings. Reported by
      Paulo Zanoni.
      
      v8: Kill the now stale comment warning that intel_crtc->active is not
      always updated at the right times.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ea9d758d
    • D
      drm/i915: switch the load detect code to the staged modeset config · fc303101
      Daniel Vetter 提交于
      Now that set_mode also disables crtcs and expects it's new
      configuration in the staged output links we need to adjust the load
      detect code a bit.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fc303101
    • D
      drm/i915: WARN if the pipe won't turn off · 284637d9
      Daniel Vetter 提交于
      This seems to be the symptom of a few neat bugs, hence be more
      obnoxious when this fails.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      284637d9
    • D
      drm/i915: s/intel_encoder_disable/intel_encoder_noop · 1f703855
      Daniel Vetter 提交于
      Because that's what it is. Unfortunately we can't rip this out because
      the fb helper has an incetious relationship with the crtc helper - it
      likes to call disable_unused_functions, among other things.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1f703855
    • D
      drm/i915: push commit_output_state past crtc disabling · 976f8a20
      Daniel Vetter 提交于
      This requires a few changes
      - We still need a noop function for crtc->disable, becuase the fb
        helper is a bit too intimate with the crtc helper.
      - We need to clear crtc->fb ourselves in intel_crtc_disable now that
        we no longer rely on the helper's disable_unused_functions to do
        that.
      - We need to split out the sare update code, becuase the crtc code
        can't call update_dpms any more, it needs to disable the crtc
        unconditionally. This is because we now keep onto the encoder ->
        crtc mapping of the (still) active output pipe configuration.
      - To check that we really disable a crtc that still has encoders,
        insert a WARN_ON(!enabled) in the crtc disable function.
      - Lastly, we need to walk over all crtcs to update their enabled state
        after having called commit_output_state - for all disabled crtcs the
        crtc helper code has done that for us previously.
      
      v2: Update connector dpms and encoder->connectors_active after
      disabling the crtc, too.
      
      v3: Noop-out intel_encoder_disable. Similarly to the crtc disable
      callback used by the crtc helper code we can't simply remove all these
      encoder callbacks: The fb helper (which we still use) has a rather
      incetious relationship with the crtc helper code ...
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      976f8a20
    • D
      drm/i915: implement new set_mode code flow · 25c5b266
      Daniel Vetter 提交于
      ... using the pipe masks from the previous patch.
      
      Well, not quite:
      - We still need to call the disable_unused_functions helper, until
        we've moved the call to commit_output_state further down and
        adjusted intel_crtc_disable a bit. The next patch will do that.
      - Because we don't support (yet) mode changes on more than one crtc at
        a time, some of the modeset_pipes checks are a bit hackish - but
        that only needs fixing once we incorporate global modeset support.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      25c5b266
    • D
      drm/i915: compute masks of crtcs affected in set_mode · e2e1ed41
      Daniel Vetter 提交于
      This is definetely a bit more generic than currently required, but if
      we keep track of all crtcs that need to be disabled/enable (because
      they loose an encoder or something similar), crtcs that get completely
      disabled and those that we need to do an actual mode change nicely
      prepares us for global modeset operations on multiple crtcs.
      
      The only big thing missing here would be a global resource allocation
      step (for e.g. pch plls), which would equally frob these bitmasks if
      e.g. a crtc only needs a new pll. Or if we need to enable dithering on
      an another pipe due to bandwidth constrains somewhere.
      
      These masks aren't yet put to use in this patch, this will follow in the
      next one.
      
      v2-v5: Fix up the computations for good (hopefully).
      
      v6: Fixup a confusion reported by Damien Lespiau: I've conserved the
      (imo braindead) behaviour of the crtc helper to disable _any_
      disconnected outputs if we do a modeset, even when that newly disabled
      connector isn't connected to the crtc being changed by the modeset.
      
      The effect of that is that we could disable an arbitrary number of
      unrelated crtcs, which I haven't taken into account when writing this
      code. Fix this up.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e2e1ed41
    • D
      drm/i915: use staged outuput config in tv->mode_fixup · 6ed0f796
      Daniel Vetter 提交于
      The "is this encoder cloned" check will be reused by the lvds encoder,
      hence exract it.
      
      v2: Be a bit more careful about that we need to check the new, staged
      ouput configuration in the check_non_cloned helper ...
      
      v3: Kill the double negation with s/!non_cloned/is_cloned/, suggested
      by Jesse Barnes.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6ed0f796
    • D
      drm/i915: extract adjusted mode computation · 7758a113
      Daniel Vetter 提交于
      While at it, adjust a few things:
      - Only assigng the new mode to crtc->mode right before calling the
        mode_set callbacks - none of the previous callbacks depend upon
        this, they all use the mode argument (as they should).
      - Check encoder->new_crtc instead of the current crtc to check whether
        the encoder will be used. This prepares for moving the staged output
        committing further down in the sequence. Follow-on patches will fix
        up individual ->mode_fixup callbacks (only tv and lvds are affected
        though).
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7758a113
    • D
      drm/i915: move output commit and crtc disabling into set_mode · 87f1faa6
      Daniel Vetter 提交于
      It's rather pointless to compute crtc->enabled twice right away ;-)
      
      The only thing we really have to be careful about is that we frob the
      dpms state only after a successful modeset and when we've actually
      haven't just disabled the crtc.
      
      Hooray for convoluted interfaces ...
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      87f1faa6
    • D
      drm/i915: remove crtc disabling special case · ba1c28c9
      Daniel Vetter 提交于
      Originally this has been introduced in
      
      commit 6eebd6bb
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Mon Nov 28 21:10:05 2011 +0000
      
          drm: Fix lack of CRTC disable for drm_crtc_helper_set_config(.fb=NULL)
      
      With the improvements of the output state staging and no longer
      overwriting crtc->fb before the hw state is updated we can now handle
      crtc disabling as part of the normal modeset sequence.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ba1c28c9
    • D
      drm/i915: push crtc->fb update into pipe_set_base · 94352cf9
      Daniel Vetter 提交于
      Passing in the old fb, having overwritten the current fb, leads to
      some neatly convoluted code. It's much simpler if we defer the
      crtc->fb update to the place that updates the hw, in pipe_set_base.
      This way we also don't need to restore anything in case something
      fails - we only update crtc->fb once things have succeeded.
      
      The real reason for this change is that now we keep the old fb
      assigned to crtc->fb, which allows us to finally move the crtc disable
      case into the common low-level set_mode function in the next patch.
      
      Also don't clobber crtc->x and crtc->y, we neatly pass these down the
      callchain already. Unfortunately we can't do the same with crtc->mode,
      because that one is being used in the mode_set callbacks.
      
      v2: Don't restore the drm_crtc object any more on failed modesets,
      since we've lose an fb reference otherwise. Also (and this is the
      reason this has been found), this totally confused the modeset state
      tracking, since it clobbers crtc->enabled. Issue reported by Paulo
      Zanoni.
      
      v3: Rip out the entire crtc saving into struct intel_set_config, not
      just the restoring part.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      94352cf9
    • D
      drm/i915: stage modeset output changes · 9a935856
      Daniel Vetter 提交于
      This is the core of the new modeset logic.
      
      The current code which is based upon the crtc helper code first
      updates all the link of the new display pipeline and then calls the
      lower-level set_mode function to execute the required callbacks to get
      there. The issue with this approach is that for disabling we need to
      know the _current_ display pipe state, not the new one.
      
      Hence we need to stage the new state of the display pipe and only
      update it once we have disabled the current configuration and before we
      start to update the hw registers with the new configuration.
      
      This patch here just prepares the ground by switching the new output
      state computation to these staging pointers. To make it clearer,
      rename the old update_output_state function to stage_output_state.
      
      A few peculiarities:
      - We're also calling the set_mode function at various places to update
        properties. Hence after a successfule modeset we need to stage the
        current configuration (for otherwise we might fall back again). This
        happens automatically because as part of the (successful) modeset we
        need to copy the staged state to the real one. But for the hw
        readout code we need to make sure that this happens, too.
      - Teach the new staged output state computation code the required
        smarts to handle the disabling of outputs. The current code handles
        this in a special case, but to better handle global modeset changes
        covering more than one crtc, we want to do this all in the same
        low-level modeset code.
      - The actual modeset code is still a bit ugly and wants to know the new
        crtc->enabled state a bit early. Follow-on patches will clean that
        up, for now we have to apply the staged output configuration early,
        outside of the set_mode functions.
      - Improve/add comments in stage_output_state.
      
      Essentially all that is left to do now is move the disabling code into
      set_mode and then move the staged state update code also into
      set_mode, at the right place between disabling things and calling the
      mode_set callbacks for the new configuration.
      
      v2: Disabling a crtc works by passing in a NULL mode or fb, userspace
      doesn't hand in the list of connectors. We therefore need to detect
      this case manually and tear down all the output links.
      
      v3: Properly update the output staging pointers after having read out
      the hw state.
      
      v4: Simplify the code, add more DRM_DEBUG_KMS output and check a few
      assumptions with WARN_ON. Essentially all things that I've noticed
      while debugging issues in other places of the code.
      
      v4: Correctly disable the old set of connectors when enabling an
      already enabled crtc on a new set of crtc. Reported by Paulo Zanoni.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9a935856
    • D
      drm/i915: don't save all the encoder/crtc state in set_config · 1aa4b628
      Daniel Vetter 提交于
      We actually only touch the connector -> encoder and encoder -> crtc
      linking. So it's enough to just save/restore that.
      
      While at it, also switch to kcalloc to allocate these arrays (omission
      in the commit message spotted by Jesse Barnes).
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1aa4b628
    • D
      drm/i915: convert pointless error checks in set_config to BUGs · 8d3e375e
      Daniel Vetter 提交于
      Because they all are, the ioctl command never calls us with any of
      these violated. Also drop a equally pointless empty debug message (and
      also in set_cursor, while we're at it).
      
      With all these changes, intel_crtc_set_config is neatly condensed down
      to it's essence, the actual modeset code (or fb update calling code)
      
      v2: The fb helper code is actually stretching ->set_config semantics a bit,
      it calls it with set->mode == NULL but set->fb != NULL.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8d3e375e
    • D
      drm/i915: don't update the fb base if there is no fb · 835c5873
      Daniel Vetter 提交于
      Otherwise we'll set_fb complains pretty loudly if we the crtc is off
      and userspace moves the NULL fb around a bit. Yeah, this actually
      happens in the wild ...
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      835c5873