1. 18 7月, 2013 1 次提交
  2. 01 7月, 2013 4 次提交
  3. 28 6月, 2013 1 次提交
  4. 18 6月, 2013 1 次提交
    • D
      drm/i915: stop killing pfit on i9xx · c9093354
      Daniel Vetter 提交于
      Nowadays (i.e. with Valleyview) we also have edp on non-PCH_SPLIT
      platforms, so just checking for LVDS is not good enough.
      
      Secondly we have full pfit pipe config tracking, so we'll correctly
      disable the pfit as part of the initial modeset.
      
      For fastboot we need a bit of work here to correctly kill unsupported
      configs (if e.g. the pfit is used on anything else than the built-in
      panel). But since that's not yet supported we don't need to worry.
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c9093354
  5. 13 6月, 2013 1 次提交
    • D
      drm/i915: hw state readout and cross-checking for shared dplls · 66e985c0
      Daniel Vetter 提交于
      Just the plumbing, all the modeset and enable code has not yet been
      switched over to use the new state. It seems to be decently broken
      anyway, at least wrt to handling of the special pixel mutliplier
      enabling sequence. Follow-up patches will clean up that mess.
      
      Another missing piece is more careful handling (and fixup) of the fp1
      alternate divisor state. The BIOS most likely doesn't bother to
      program that one to what we expect. So we need to be more careful with
      comparing that state, both for cross checking but also when checking
      for dpll sharing when acquiring shared dpll. Otherwise fastboot will
      deny a few shared dpll configurations which would otherwise work.
      
      v2: We need to memcpy the pipe config dpll hw state into the pll, for
      otherwise the cross-check code will get angry.
      
      v3: Don't forget to read the pch pll state in the crtc get_pipe_config
      function for ibx/ilk platforms.
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      66e985c0
  6. 12 6月, 2013 1 次提交
  7. 11 6月, 2013 3 次提交
    • D
      drm/i915: move shared_dpll into the pipe config · a43f6e0f
      Daniel Vetter 提交于
      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: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a43f6e0f
    • D
      drm/i915: switch crtc->shared_dpll from a pointer to an enum · e2b78267
      Daniel Vetter 提交于
      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: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e2b78267
    • D
      drm/i915: s/pch_pll/shared_dpll/ · e72f9fbf
      Daniel Vetter 提交于
      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: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e72f9fbf
  8. 07 6月, 2013 2 次提交
    • C
      drm/i915: Track when we dirty the scanout with render commands · c65355bb
      Chris Wilson 提交于
      This is required for tracking render damage for use with FBC and will be
      used in subsequent patches.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c65355bb
    • D
      drm/i915: pipe config quirk infrastructure plus sdvo mode.flags fix · bb760063
      Daniel Vetter 提交于
      For various reasons the hw state readout might not be able to
      faithfully match the hw state:
      - broken hw (like the case which motivated this patch here where the
        sdvo encoder does not implemented mandatory functionality
        correctly).
      - platforms which are not supported fully with the pipe config
        infrastructure
      - if our code doesn't support a given hw configuration natively, e.g.
        special restrictions on the per-pipe panel fitters when they're used
        in high-quality scaling modes.
      
      In all these cases both fastboot and the hw state cross checker need
      to be aware of these cases and act accordingly. To be able to do this
      add a new quirk flag to the pipe config structure.
      
      The specific case at hand is an sdvo encoder which doesn't implement
      the get_timings function, so adjusted_mode flags will be wrong. The
      strange thing though is that the encoder _does_ work, even though it
      doesn't implement any of the timings functions (so neither get nor
      set, neither for input nor output timings).
      
      Not that non-compliant sdvo encoder are any surprise at all ...
      
      v2:
      - Don't read random garbage from the dtd if the get_timings call
        failed (suggested by Chris).
      - Still check the interlaced flag, that's read out from someplace
        else. We want maximal paranoia, after all.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bb760063
  9. 06 6月, 2013 2 次提交
  10. 05 6月, 2013 1 次提交
    • D
      drm/i915: consolidate and tighten encoder cloning checks · accfc0c5
      Daniel Vetter 提交于
      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: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      accfc0c5
  11. 04 6月, 2013 1 次提交
    • D
      drm/i915: store adjusted dotclock in adjusted_mode->clock · ff9a6750
      Daniel Vetter 提交于
      ... not the port clock. This allows us to kill the funny semantics
      around pixel_target_clock.
      
      Since the dpll code still needs the real port clock, add a new
      port_clock field to the pipe configuration. Handling the default case
      for that one is a bit tricky, since encoders might not consistently
      overwrite it when retrying the crtc/encoder bw arbitrage step in the
      compute config stage. Hence we need to always clear port_clock and
      update it again if the encoder hasn't put in something more specific.
      This can't be done in one step since the encoder might want to adjust
      the mode first.
      
      I was a bit on the fence whether I should subsume the pixel multiplier
      handling into the port_clock, too. But then I decided against this
      since it's on an abstract level still the dotclock of the adjusted
      mode, and only our hw makes it a bit special due to the separate pixel
      mulitplier setting (which requires that the dpll runs at the
      non-multiplied dotclock).
      
      So after this patch the adjusted_mode accurately describes the mode we
      feed into the port, after the panel fitter and pixel multiplier (or
      line doubling, if we ever bother with that) have done their job.
      Since the fdi link is between the pfit and the pixel multiplier steps
      we need to be careful with calculating the fdi link config.
      
      v2: Fix up ilk cpu pll handling.
      
      v3: Introduce an fdi_dotclock variable in ironlake_fdi_compute_config
      to make it clearer that we transmit the adjusted_mode without the
      pixel multiplier taken into account. The old code multiplied the the
      available link bw with the pixel multiplier, which results in the same
      fdi configuration, but is much more confusing.
      
      v4: Rebase on top of Imre's is_cpu_edp removal.
      
      v5: Rebase on top of Paulo's haswell watermark fixes, which introduce
      a new place which looked at the pixel_clock and so needed conversion.
      
      v6: Split out prep patches as requested by Paulo Zanoni. Also rebase
      on top of the fdi dotclock handling fix in the fdi lanes/bw
      computation code.
      
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v3)
      Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> (v6)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ff9a6750
  12. 01 6月, 2013 3 次提交
  13. 24 5月, 2013 1 次提交
  14. 21 5月, 2013 2 次提交
    • P
      drm/i915: remove intel_update_linetime_watermarks · 1011d8c4
      Paulo Zanoni 提交于
      The spec says the linetime watermarks must be programmed before
      enabling any display low power watermarks, but we're currently
      updating the linetime watermarks after we call intel_update_watermarks
      (and only at crtc_mode_set, not at crtc_{enable,disable}). So IMHO the
      best way guarantee the linetime watermarks will be updated before the
      low power watermarks is inside the update_wm function, because it's
      the function that enables low power watermarks. And since Haswell is
      the only platform that has linetime watermarks, let's completely kill
      the "intel_update_linetime_watermarks" abstraction and just use the
      intel_update_watermarks abstraction by creating haswell_update_wm.
      
      For now haswell_update_wm is still calling sandybridge_update_wm, but
      in the future I plan to implement a function specific to Haswell.
      
      v2: - Rename patch
          - Disable LP watermarks before changing linetime WMs (Chris)
          - Add a comment explaining that this is just temporary code.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1011d8c4
    • J
      drm/i915: add encoder get_config function v5 · 045ac3b5
      Jesse Barnes 提交于
      We can use this for fetching encoder specific pipe_config state, like
      mode flags, adjusted clock, etc.
      
      Just used for mode flags atm, so we can check the pipe config state at
      mode set time.
      
      v2: get_config when checking hw state too
      v3: fix DVO and LVDS mode flags (Ville)
          get SDVO DTD for flag fetch (Ville)
      v4: use input timings (Ville)
          correct command used (Ville)
          remove gen4 check (Ville)
      v5: get DDI flag config too
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v4)
      Tested-by: Paulo Zanoni <przanoni@gmail.com> (the new hsw ddi stuff)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      045ac3b5
  15. 11 5月, 2013 5 次提交
  16. 06 5月, 2013 2 次提交
  17. 04 5月, 2013 1 次提交
    • I
      drm/i915: hsw: fix link training for eDP on port-A · 3ab9c637
      Imre Deak 提交于
      According to BSpec the link training sequence for eDP on HSW port-A
      should be as follows:
      
      1. link training: clock recovery
      2. link training: equalization
      3. link training: set idle transmission mode
      4. display pipe enable
      5. link training: disable (set normal mode)
      
      Contrary to this at the moment we don't do step 3. and we do step 5.
      before step 4. Fix this by setting idle transmission mode for eDP at
      the end of intel_dp_complete_link_train and adding a new
      intel_dp_stop_link_training function to disable link training. With
      these changes we'll end up with the following functions corresponding
      to the above steps:
      
      intel_dp_start_link_train    -> step 1.
      intel_dp_complete_link_train -> step 2., step 3.
      intel_dp_stop_link_train     -> step 5.
      
      For port-A we'll call intel_dp_stop_link_train only after enabling the
      pipe, for everything else we'll call it right after
      intel_dp_complete_link_train to preserve the current behavior.
      
      Tested on HSW/HSW-ULT.
      
      In v2:
      - Due to a HW issue we must set idle transmission mode for port-A too
        before enabling the pipe. Thanks for Arthur Runyan for explaining
        this.
      - Update the patch subject to make it clear that it's an eDP fix, DP is
        not affected.
      
      v3:
      - rename intel_dp_link_train() to intel_dp_set_link_train(), use 'val'
        instead 'l' as var name. (Paulo)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Tested-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3ab9c637
  18. 30 4月, 2013 4 次提交
    • D
      drm/i915: move lvds_border_bits to pipe_config · 68fc8742
      Daniel Vetter 提交于
      pipe_config is the new dev_priv!
      
      More seriously, this is actually better since a pipe_config can be
      thrown away if the modeset compute config stage fails. Whereas any
      state stored in dev_prive needs to be painstakingly restored, since
      otherwise a dpms off/on will wreak massive havoc. Yes, that even
      applies to state only used in ->mode_set callbacks, since we need to
      call those even for dpms on when the Haswell power well cleared
      everything out.
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      68fc8742
    • D
      drm/i915: implement fdi auto-dithering · e29c22c0
      Daniel Vetter 提交于
      So on a bunch of setups we only have 2 fdi lanes available, e.g. hsw
      VGA or 3 pipes on ivb. And seemingly a lot of modes don't quite fit
      into this, among them the default 1080p mode.
      
      The solution is to dither down the pipe a bit so that everything fits,
      which this patch implements.
      
      But ports compute their state under the assumption that the bpp they
      pick will be the one selected, e.g. the display port bw computations
      won't work otherwise. Now we could adjust our code to again up-dither
      to the computed DP link parameters, but that's pointless.
      
      So instead when the pipe needs to adjust parameters we need to retry
      the pipe_config computation at the encoder stage. Furthermore we need
      to inform encoders that they should not increase bandwidth
      requirements if possible. This is required for the hdmi code, which
      prefers the pipe to up-dither to either of the two possible hdmi bpc
      values.
      
      LVDS has a similar requirement, although that's probably only
      theoretical in nature: It's unlikely that we'll ever see an 8bpc
      high-res lvds panel (which is required to hit the 2 fdi lane limit).
      
      eDP is the only thing which could increase the pipe_bpp setting again,
      even when in the retry-loop. This could hit the WARN. Two reasons for
      not bothering:
      - On many eDP panels we'll get a black screen if the bpp settings
        don't match vbt. So failing the modeset is the right thing to do.
        But since that also means it's the only way to light up the panel,
        it should work. So we shouldn't be able to hit this WARN.
      - There are still opens around the eDP panel handling, and maybe we
        need additional tricks. Before that happens it's imo no use trying
        to be too clever.
      Worst case we just need to kill that WARN or maybe fail the compute
      config stage if the eDP connector can't get the bpp setting it wants.
      And since this can only happen with an fdi link in between and so for
      pch eDP panels it's rather unlikely to blow up, if ever.
      
      v2: Rebased on top of a bikeshed from Paulo.
      
      v3: Improve commit message around eDP handling with the stuff
      things with Imre.
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e29c22c0
    • D
      drm/i915: split up fdi_set_m_n into computation and hw setup · ca3a0ff8
      Daniel Vetter 提交于
      And also move the computed m_n values into the pipe_config. This is a
      prep step to move the fdi state computation completely into the
      prepare phase of the modeset sequence. Which will allow us to handle
      fdi link bw constraints in a better way.
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ca3a0ff8
    • D
      drm/i915: move intel_crtc->fdi_lanes to pipe_config · 33d29b14
      Daniel Vetter 提交于
      We need this for two reasons:
      - Correct handling of shared fdi lanes on ivb with fastboot.
      - Handling fdi link bw limits when we only have two fdi lanes by
        dithering down a bit.
      
      Just search&replace in this patch, no functional change at all.
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      33d29b14
  19. 26 4月, 2013 3 次提交
    • J
      drm/i915: move PCH pfit controls into pipe_config · b074cec8
      Jesse Barnes 提交于
      And put the pfit stuff into substructs while we're at it.
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b074cec8
    • J
      drm/i915: factor out GMCH panel fitting code and use for eDP v3 · 2dd24552
      Jesse Barnes 提交于
      This gets the panel fitter working on eDP on VLV, and should also apply
      to eDP panels on G4x chipsets (if we ever detect and mark an all-in-one
      panel as eDP anyway).
      
      A few cleanups are still possible on top of this, for example the LVDS
      border control could be placed in the LVDS encoder structure and updated
      based on the result of the panel fitter calculation.
      
      Multi-pipe fitting isn't handled correctly either if we ever get a config
      that wants to try the panel fitter on more than one output at a time.
      
      v2: use pipe_config for storing pfit values (Daniel)
          add i9xx_pfit_enable function for use by 9xx and VLV (Daniel)
      v3: fixup conflicts and lvds_dither check
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: fix up botched conflict resolution from Jesse:
      - border = LVDS_BORDER_ENABLE was lost for CENTER scaling
      - comment about gen2/3 panel fitter scaling was lost
      - dev_priv->lvds_dither reintroduced.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2dd24552
    • D
      drm/i915: use pipe_config for lvds dithering · d8b32247
      Daniel Vetter 提交于
      Up to now we've relied on the bios to get this right for us. Let's try
      out whether our code has improved a bit, since we should dither
      always when the output bpp doesn't match the plane bpp.
      - gen5+ should be fine, since we only use the bios hint as an upgrade.
      - gen4 changes, since here dithering is still controlled in the lvds
        register.
      - gen2/3 has implicit dithering depeding upon whether you use 2 or 3
        lvds pairs (which makes sense, since it only supports 8bpc pipe
        outpu configurations).
      - hsw doesn't support lvds.
      
      v2: Remove redudant dither setting.
      
      v3: Completly drop reliance on dev_priv->lvds_dither.
      
      v4: Enable dithering on gen2/3 only when we have a 18bpp panel, since
      up-dithering to a 24bpp panel is not supported by the hw. Spotted by
      Ville.
      
      v5: Also only enable lvds port dithering on gen4 for 18bpp modes. In
      practice this only excludes dithering a 10bpc plane down for a 24bpp
      lvds panel. Not something we truly care about. Again noticed by Ville.
      
      v6: Actually git add.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d8b32247
  20. 25 4月, 2013 1 次提交