1. 06 9月, 2012 1 次提交
  2. 26 7月, 2012 2 次提交
    • A
      0274df3e
    • D
      drm/i915: simplify possible_clones computation · 66a9278e
      Daniel Vetter 提交于
      Intel hw only has one MUX for encoders, so outputs are either not
      cloneable or all in the same group of cloneable outputs. This neatly
      simplifies the code and allows us to ditch some ugly if cascades in
      the dp and hdmi init code (well, we need these if cascades for other
      stuff still, but that can be taken care of in follow-up patches).
      
      Note that this changes two things:
      - dvo can now be cloned with sdvo, but dvo is gen2 whereas sdvo is
        gen3+, so no problem. Note that the old code had a bug and didn't
        allow cloning crt with dvo (but only the other way round).
      - sdvo-lvds can now be cloned with sdvo-non-tv. Spec says this won't
        work, but the only reason I've found is that you can't use the
        panel-fitter (used for lvds upscaling) with anything else. But we
        don't use the panel fitter for sdvo-lvds. Imo this part of Bspec is
        a) rather confusing b) mostly as a guideline to implementors (i.e.
        explicitly stating what is already implicit from the spec, without
        always going into the details of why). So I think we can ignore this
        - worst case we'll get a bug report from a user with with sdvo-lvds
        and sdvo-tmds and have to add that special case back in.
      
      Because sdvo lvds is a bit special explain in comments why sdvo LVDS
      outputs can be cloned, but native LVDS and eDP can't be cloned - we
      use the panel fitter for the later, but not for sdvo.
      
      Note that this also uncoditionally initializes the panel_vdd work used
      by eDP. Trying to be clever doesn't buy us anything (but strange bugs)
      and this way we can kill the is_edp check.
      
      v2: Incorporate review from Paulo
      - Add in a missing space.
      - Pimp comment message to address his concerns.
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      66a9278e
  3. 20 7月, 2012 1 次提交
  4. 31 5月, 2012 1 次提交
  5. 24 5月, 2012 1 次提交
  6. 22 5月, 2012 3 次提交
  7. 20 5月, 2012 1 次提交
    • D
      drm/i915: fixup infoframe support for sdvo · 81014b9d
      Daniel Vetter 提交于
      At least the worst offenders:
      - SDVO specifies that the encoder should compute the ecc. Testing also
        shows that we must not send the ecc field, so copy the dip_infoframe
        struct to a temporay place and avoid the ecc field. This way the avi
        infoframe is exactly 17 bytes long, which agrees with what the spec
        mandates as a minimal storage capacity (with the ecc field it would
        be 18 bytes).
      - Only 17 when sending the avi infoframe. The SDVO spec explicitly
        says that sending more data than what the device announces results
        in undefined behaviour.
      - Add __attribute__((packed)) to the avi and spd infoframes, for
        otherwise they're wrongly aligned. Noticed because the avi infoframe
        ended up being 18 bytes large instead of 17. We haven't noticed this
        yet because we don't use the uint16_t fields yet (which are the only
        ones that would be wrongly aligned).
      
      This regression has been introduce by
      
      3c17fe4b is the first bad commit
      commit 3c17fe4b
      Author: David Härdeman <david@hardeman.nu>
      Date:   Fri Sep 24 21:44:32 2010 +0200
      
          i915: enable AVI infoframe for intel_hdmi.c [v4]
      
      Patch tested on my g33 with a sdvo hdmi adaptor.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=25732
      Tested-by: Peter Ross <pross@xvid.org> (G35 SDVO-HDMI)
      Reviewed-by: NEugeni Dodonov <eugeni.dodonov@intel.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      81014b9d
  8. 07 5月, 2012 1 次提交
  9. 04 5月, 2012 2 次提交
    • D
      drm/i915: use mode values consistently when converting to sdvo dtd · c6ebd4c0
      Daniel Vetter 提交于
      The drm_mode->dtd conversion used the crtc timings, whereas the
      dtd->drm_mod did not set these. Use the standard mode information, not
      the crtc timings, in both cases to make these two functions proper
      inverses of each another.
      
      Note that this also kills the risk that we handle interlaced timings
      inconsistently because the drm core uses half-frames for crtc timings,
      whereas we need full frames. But interlaced support is pretty decently
      broken anyway for sdvo encoders, so no big deal.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c6ebd4c0
    • D
      drm/i915: rip out unnecessary calls to drm_mode_set_crtcinfo · f7bacf19
      Daniel Vetter 提交于
      Our handling of the crtc timing computation has been nicely
      cargo-culted with calls to drm_mode_set_crtcinfo sprinkled all over
      the place. But with
      
      commit f9bef081
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Sun Apr 15 19:53:19 2012 +0200
      
          drm/i915: don't clobber the special upscaling lvds timings
      
      and
      
      commit ca9bfa7e
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Sat Jan 28 14:49:20 2012 +0100
      
          drm/i915: fixup interlaced vertical timings confusion, part 1
      
      we now only set the crtc timing fields in the encoder->mode_fixup
      (lvds only) and in crtc->mode_fixup (for everyone else). And since
      
      commit 75c13993
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Sat Jan 28 23:48:46 2012 +0100
      
          drm/i915: fixup overlay checks for interlaced modes
      
      the only places we actually need the crtc timings is in the mode_set
      function.
      
      I guess the idea of the drm core is that every time it creates a drm
      mode, it also sets the timings. But afaics it never uses them, safe
      for the precise vblank timestamp code (but that can only run on active
      modes, i.e.  after our mode_fixup functions have been called). The
      problem is that drm core always sets CRTC_INTERLACE_HALVE_V, so the
      timings are pretty much bogus for us anyway (at least with interlaced
      support).
      
      So I guess it's the drivers job that every active modes needs to have
      crtc timings that suits it, and with these patches we should have
      that. drm core doesn't seem to care about modes that just get passed
      around. Hence we can now safely rip out all the remaining calls to
      set_crtcinfo left in the driver and clean up this confusion.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f7bacf19
  10. 27 4月, 2012 1 次提交
    • D
      drm/i915: handle input/output sdvo timings separately in mode_set · 6651819b
      Daniel Vetter 提交于
      We seem to have a decent confusion between the output timings and the
      input timings of the sdvo encoder. If I understand the code correctly,
      we use the original mode unchanged for the output timings, safe for
      the lvds case. And we should use the adjusted mode for input timings.
      
      Clarify the situation by adding an explicit output_dtd to the sdvo
      mode_set function and streamline the code-flow by moving the input and
      output mode setting in the sdvo encode together.
      
      Furthermore testing showed that the sdvo input timing needs the
      unadjusted dotclock, the sdvo chip will automatically compute the
      required pixel multiplier to get a dotclock above 100 MHz.
      
      Fix this up when converting a drm mode to an sdvo dtd.
      
      This regression was introduced in
      
      commit c74696b9
      Author: Pavel Roskin <proski@gnu.org>
      Date:   Thu Sep 2 14:46:34 2010 -0400
      
          i915: revert some checks added by commit 32aad86f
      
      particularly the following hunk:
      
      diff --git a/drivers/gpu/drm/i915/intel_sdvo.c
      b/drivers/gpu/drm/i915/intel_sdvo.c
      index 093e914..62d22ae 100644
      --- a/drivers/gpu/drm/i915/intel_sdvo.c
      +++ b/drivers/gpu/drm/i915/intel_sdvo.c
      @@ -1122,11 +1123,9 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
      
           /* We have tried to get input timing in mode_fixup, and filled into
              adjusted_mode */
      -    if (intel_sdvo->is_tv || intel_sdvo->is_lvds) {
      -        intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
      +    intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
      +    if (intel_sdvo->is_tv || intel_sdvo->is_lvds)
               input_dtd.part2.sdvo_flags = intel_sdvo->sdvo_flags;
      -    } else
      -        intel_sdvo_get_dtd_from_mode(&input_dtd, mode);
      
           /* If it's a TV, we already set the output timing in mode_fixup.
            * Otherwise, the output timing is equal to the input timing.
      
      Due to questions raised in review, below a more elaborate analysis of
      the bug at hand:
      
      Sdvo seems to have two timings, one is the output timing which will be
      sent over whatever is connected on the other side of the sdvo chip (panel,
      hdmi screen, tv), the other is the input timing which will be generated by
      the gmch pipe. It looks like sdvo is expected to scale between the two.
      
      To make things slightly more complicated, we have a bunch of special
      cases:
      - For lvds panel we always use a fixed output timing, namely
        intel_sdvo->sdvo_lvds_fixed_mode, hence that special case.
      - Sdvo has an interface to generate a preferred input timing for a given
        output timing. This is the confusing thing that I've tried to clear up
        with the follow-on patches.
      - A special requirement is that the input pixel clock needs to be between
        100MHz and 200MHz (likely to keep it within the electromechanical design
        range of PCIe), 270MHz on later gen4+. Lower pixel clocks are
        doubled/quadrupled.
      
      The thing this patch tries to fix is that the pipe needs to be
      explicitly instructed to double/quadruple the pixels and needs the
      correspondingly higher pixel clock, whereas the sdvo adaptor seems to
      do that itself and needs the unadjusted pixel clock. For the sdvo
      encode side we already set the pixel mutliplier with a different
      command (0x21).
      
      This patch tries to fix this mess by:
      - Keeping the output mode timing in the unadjusted plain mode, safe
        for the lvds case.
      - Storing the input timing in the adjusted_mode with the adjusted
        pixel clock. This way we don't need to frob around with the core
        crtc mode set code.
      - Fixing up the pixelclock when constructing the sdvo dtd timing
        struct. This is why the first hunk of the patch is an integral part
        of the series.
      - Dropping the is_tv special case because input_dtd is equivalent to
        adjusted_mode after these changes. Follow-up patches clear this up
        further (by simply ripping out intel_sdvo->input_dtd because it's
        not needed).
      
      v2: Extend commit message with an in-depth bug analysis.
      Reported-and-Tested-by: NBernard Blackham <b-linuxgit@largestprime.net>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48157Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Cc: stable@kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6651819b
  11. 18 4月, 2012 2 次提交
  12. 10 4月, 2012 1 次提交
  13. 28 3月, 2012 1 次提交
    • D
      drm/i915/intel_i2c: refactor using intel_gmbus_get_adapter · 3bd7d909
      Daniel Kurtz 提交于
      Instead of letting other modules directly access the ->gmbus array,
      introduce intel_gmbus_get_adapter() for looking up an i2c_adapter
      for a given gmbus port identifier.  This will enable later refactoring
      of the gmbus port list.
      
      Note: Before requesting an adapter for a given gmbus port number, the
      driver must first check its validity using i2c_intel_gmbus_is_port_valid().
      If this check fails, a call to intel_gmbus_get_adapter() will WARN_ON and
      return NULL.  This is relevant for parts of the driver that read a port
      from VBIOS, which might be improperly initialized and contain an invalid
      port.  In these cases, the driver must fall back to using a safer default
      port.
      Signed-off-by: NDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3bd7d909
  14. 24 3月, 2012 1 次提交
  15. 28 2月, 2012 1 次提交
  16. 11 2月, 2012 2 次提交
  17. 09 2月, 2012 1 次提交
  18. 07 1月, 2012 1 次提交
  19. 17 12月, 2011 2 次提交
  20. 01 11月, 2011 1 次提交
  21. 21 10月, 2011 5 次提交
  22. 22 9月, 2011 1 次提交
  23. 20 9月, 2011 1 次提交
  24. 05 6月, 2011 1 次提交
  25. 18 5月, 2011 1 次提交
    • C
      drm/i915/sdvo: Reorder i2c initialisation before ddc proxy · 56184e3d
      Chris Wilson 提交于
      The ddc proxy depends upon the underlying i2c bus being selected. Under
      certain configurations, the i2c-adapter functionality is queried during
      initialisation and so may trigger an OOPS during boot. Hence, we need to
      reorder the initialisation of the ddc proxy until after we hook up the i2c
      adapter for the SDVO device.
      
      The condition under which it fails is when the i2c_add_adapter calls
      into i2c_detect which will attempt to probe all valid addresses on the
      adapter iff there is a pre-existing i2c_driver with the same class as
      the freshly added i2c_adapter.
      
      So it appears to depend upon having compiled in (or loaded such a
      module before i915.ko) an i2c-driver that likes to futz over the
      i2c_adapters claiming DDC support.
      Reported-by: NMihai Moldovan <ionic@ionic.de>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NKeith Packard <keithp@keithp.com>
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      56184e3d
  26. 23 2月, 2011 1 次提交
  27. 22 2月, 2011 1 次提交
  28. 11 2月, 2011 1 次提交
  29. 10 2月, 2011 1 次提交