1. 17 7月, 2013 1 次提交
  2. 12 7月, 2013 1 次提交
    • D
      drm/i915: fix up readout of the lvds dither bit on gen2/3 · 06922821
      Daniel Vetter 提交于
      It's in the PFIT_CONTROL register, but very much associated with the
      lvds encoder. So move the readout for it (in the case of an otherwise
      disabled pfit) from the pipe to the lvds encoder's get_config
      function.
      
      Otherwise we get a pipe state mismatch if we use pipe B for a non-lvds
      output and we've left the dither bit enabled behind us. This can
      happen if the BIOS has set the bit (some seem to unconditionally do
      that, even in the complete absence of an lvds port), but not enabled
      pipe B at boot-up. Then we won't clear the pfit control register since
      we can only touch that if the pfit is associated with our pipe in the
      crtc configuration - we could trample over the pfit state of the other
      pipe otherwise since it's shared. Once pipe B is enabled we notice
      that the 6to8 dither bit is set and complain about the mismatch.
      
      Note that testing indicates that we don't actually need to set this
      bit when the pfit is disabled, dithering on 18bpp panels seems to work
      regardless. But ripping that code out is not something for a bugfix
      meant for -rc kernels.
      
      v2: While at it clarify the logic in i9xx_get_pfit_config, spurred by
      comments from Chris on irc.
      
      v3: Use Chris suggestion to make the control flow in
      i9xx_get_pfit_config easier to understand.
      
      v4: Kill the extra line, spotted by Chris.
      Reported-by: NKnut Petersen <Knut_Petersen@t-online.de>
      Cc: Knut Petersen <Knut_Petersen@t-online.de>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      References: http://lists.freedesktop.org/archives/intel-gfx/2013-July/030092.htmlTested-by: NKnut Petersen <Knut_Petersen@t-online.de>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      06922821
  3. 01 7月, 2013 5 次提交
  4. 18 6月, 2013 6 次提交
  5. 13 6月, 2013 7 次提交
  6. 11 6月, 2013 14 次提交
    • V
      drm/i915: Print pretty names for pixel formats · 4ee62c76
      Ville Syrjälä 提交于
      Use drm_get_format_name to print more readable pixel format names
      in debug output.
      
      Also unify the debug messages to say "unsupported pixel format",
      which better describes what is going on.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      4ee62c76
    • D
      drm/i915: drop crtc checking from assert_shared_dpll · e9d6944e
      Daniel Vetter 提交于
      The hw state readout code for the pipe config will now check
      this for us, so rip out this hand-rolled complexity.
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e9d6944e
    • D
      drm/i915: enable/disable hooks for shared dplls · e7b903d2
      Daniel Vetter 提交于
      Looks at first like a bit of overkill, but
      - Haswell actually wants different enable/disable functions for
        different plls.
      - And once we have full dpll hw state tracking we can move the full
        register setup into the ->enable hook.
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e7b903d2
    • D
      drm/i915: scrap register address storage · e9a632a5
      Daniel Vetter 提交于
      Using ids in register macros is much more common in our driver. Also
      this way we can reduce the platform specific stuff a bit.
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e9a632a5
    • D
      drm/i915: metadata for shared dplls · 46edb027
      Daniel Vetter 提交于
      An id to match the idx (useful for register access macros) and a name
      fore neater debug output.
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      46edb027
    • D
      drm/i915: consolidate ->num_shared_dplls assignement · 7c74ade1
      Daniel Vetter 提交于
      In the future this won't be just for pch plls, so move it into the
      shared dpll init code.
      
      v2: Bikeshed the uncessary {} away while applying to appease
      checkpatch.
      
      Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v1)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7c74ade1
    • D
      drm/i915: hw state readout for shared pch plls · c0d43d62
      Daniel Vetter 提交于
      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: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c0d43d62
    • D
      drm/i915: refactor PCH_DPLL_SEL #defines · 11887397
      Daniel Vetter 提交于
      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: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      11887397
    • 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
    • D
      drm/i915: lock down pch pll accouting some more · f4a091c7
      Daniel Vetter 提交于
      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: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f4a091c7
    • D
      drm/i915: conditionally disable pch resources in ilk_crtc_disable · d925c59a
      Daniel Vetter 提交于
      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: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d925c59a
    • D
      drm/i915: fix up pch pll handling in ->mode_set · cdbd2316
      Daniel Vetter 提交于
      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: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cdbd2316
  7. 08 6月, 2013 1 次提交
    • V
      drm/i915: Make g4x_fixup_plane() operational again · 22e407d7
      Ville Syrjälä 提交于
      Don't enable the cursor until g4x_fixup_plane() had a chance to do
      cast its magic spell.
      
      Egbert writes:
      "Today I had the chance to test this. First I tried
       if I can still reproduce the blank with this patch
       added when I disable my voodoo g4x_fixup_plane():
       It turned out it still happens however very rarely
       (like 1 out of 20 tries). When I reenabled my voodoo
       the issue still occurred.
       I had to switch two lines around, ie:
      
               intel_enable_plane(dev_priv, plane, pipe);
               if (IS_G4X(dev))
                       g4x_fixup_plane(dev_priv, pipe);
       +       intel_crtc_update_cursor(crtc, true);
      
       to avoid the blank screen issue - which is it didn't
       happen in ~75 tries."
      
      v2: Add a comment to remind people of the ordering constraints
      Acked-by: NEgbert Eich <eich@suse.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      22e407d7
  8. 07 6月, 2013 3 次提交
  9. 06 6月, 2013 2 次提交
    • D
      drm/i915: hw state readout support for pixel_multiplier · 6c49f241
      Daniel Vetter 提交于
      Incomplete since ilk+ support needs proper pch dpll tracking first.
      SDVO get_config parts based on a patch from Jesse Barnes, but fixed up
      to actually work.
      
      v2: Make sure that we call encoder->get_config _after_ we
      get_pipe_config to be consistent in both setup_hw_state and the
      modeset state checker. Otherwise the clever trick with handling the
      pixel mutliplier on i915G/GM where the encoder overrides the default
      value of 1 from the crtc get_pipe_config function doesn't work.
      Spotted by Imre Deak.
      
      v3: Actually cross-check the pixel mutliplier (but not on pch split
      platforms for now). Now actually also tested on a i915G with a sdvo
      encoder plugged in.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6c49f241
    • V
      drm/i915: Assert dpll running in intel_crtc_load_lut() on pre-PCH platforms · 14420bd0
      Ville Syrjälä 提交于
      Adding more context from Ville's reply to Rodrigo's question why we
      need this:
      
      "The spec says that on some hardware you need to PLL running before you
      can poke at the palette registers. I didn't actually try to anger the
      hardware so I'm not really sure what would happen otherwise, but IIRC
      Jesse said something about a hard system hang..."
      
      And generally documenting such ordering constraints with asserts is
      Just Good.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      [danvet: Spruce up the commit message a lot.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      14420bd0