1. 14 2月, 2014 1 次提交
    • I
      drm/i915: add unregister callback to connector · 4932e2c3
      Imre Deak 提交于
      Since
      
      commit d9255d57
      Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Date:   Thu Sep 26 20:05:59 2013 -0300
      
      it became clear that we need to separate the unload sequence into two
      parts:
      
      1. remove all interfaces through which new operations on some object
         (crtc, encoder, connector) can be started and make sure all pending
         operations are completed
      2. do the actual tear down of the internal representation of the above
         objects
      
      The above commit achieved this separation for connectors by splitting
      out the sysfs removal part from the connector's destroy callback and
      doing this removal before calling drm_mode_config_cleanup() which does
      the actual tear-down of all the drm objects.
      
      Since we'll have to customize the interface removal part for different
      types of connectors in the upcoming patches, add a new unregister
      callback and move the interface removal part to it.
      
      No functional change.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NAntti Koskipää <antti.koskipaa@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4932e2c3
  2. 28 11月, 2013 1 次提交
  3. 04 11月, 2013 1 次提交
  4. 01 10月, 2013 3 次提交
    • P
      drm/i915: destroy connector sysfs files earlier · d9255d57
      Paulo Zanoni 提交于
      For some reason, every single time I try to run module_reload
      something tries to read the connector sysfs files. This happens
      after we destroy the encoders and before we destroy the connectors, so
      when the sysfs read triggers the connector detect() function,
      intel_conector->encoder points to memory that was already freed.
      
      The bad backtrace is just:
          [<ffffffff8163ca9a>] dump_stack+0x54/0x74
          [<ffffffffa00c2c8e>] intel_dp_detect+0x1e/0x4b0 [i915]
          [<ffffffffa001913d>] status_show+0x3d/0x80 [drm]
          [<ffffffff813d5340>] dev_attr_show+0x20/0x60
          [<ffffffff81221f50>] ? sysfs_read_file+0x80/0x1b0
          [<ffffffff81221f79>] sysfs_read_file+0xa9/0x1b0
          [<ffffffff811aaf1e>] vfs_read+0x9e/0x170
          [<ffffffff811aba4c>] SyS_read+0x4c/0xa0
          [<ffffffff8164e392>] system_call_fastpath+0x16/0x1b
      
      But if you add tons of memory checking debug options to your Kernel
      you'll also see:
       - general protection fault: 0000
       - BUG kmalloc-4096 (Tainted: G      D W   ): Poison overwritten
       - INFO: Allocated in intel_ddi_init+0x65/0x270 [i915]
       - INFO: Freed in intel_dp_encoder_destroy+0x69/0xb0 [i915]
      Among a bunch of other error messages.
      
      So this commit just destroys the sysfs files before both the encoder
      and connectors are freed.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d9255d57
    • D
      drm/i915: Use crtc_clock with the adjusted mode · 241bfc38
      Damien Lespiau 提交于
      struct drm_mode_display now has a separate crtc_ version of the clock to
      be used when we're talking about the timings given to the harwadre (was
      far as the mode is concerned).
      
      This commit is really the result of a git grep adjusted_mode.*clock and
      replacing those by adjusted_mode.crtc_clock. No functional change.
      
      v2: Rebased on drm-intel-queued-next
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Acked-by: NDave Airlie <airlied@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      241bfc38
    • D
      drm/i915: use pointer = k[cmz...]alloc(sizeof(*pointer), ...) pattern · b14c5679
      Daniel Vetter 提交于
      Done while reviewing all our allocations for fubar. Also a few errant
      cases of lacking () for the sizeof operator - just a bit of OCD.
      
      I've left out all the conversions that also should use kcalloc from
      this patch  (it's only 2).
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b14c5679
  5. 17 9月, 2013 1 次提交
    • V
      drm/i915: Fix port_clock and adjusted_mode.clock readout all over · 18442d08
      Ville Syrjälä 提交于
      Now that adjusted_mode.clock no longer contains the pixel_multiplier, we
      can kill the get_clock() callback and instead do the clock readout
      in get_pipe_config().
      
      Also i9xx_crtc_clock_get() can now extract the frequency of the PCH
      DPLL, so use it to populate port_clock accurately for PCH encoders.
      For DP in port A the encoder is still responsible for filling in
      port_clock. The FDI adjusted_mode.clock extraction is kept in place
      for some extra sanity checking, but we no longer need to pretend it's
      also the port_clock.
      
      In the encoder get_config() functions fill out adjusted_mode.clock
      based on port_clock and other details such as the DP M/N values,
      HDMI 12bpc and SDVO pixel_multiplier. For PCH encoders we will then
      do an extra sanity check to make sure the dotclock we derived from
      the FDI configuratiuon matches the one we derive from port_clock.
      
      DVO doesn't exist on PCH platforms, so it doesn't need to anything
      but assign adjusted_mode.clock=port_clock. And DDI is HSW only, so
      none of the changes apply there.
      
      v2: Use hdmi_reg color format to detect 12bpc HDMI case
      v3: Set adjusted_mode.clock for LVDS too
      v4: Rename ironlake_crtc_clock_get to ironlake_pch_clock_get,
          eliminate the useless link_freq variable.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      18442d08
  6. 12 9月, 2013 1 次提交
  7. 06 9月, 2013 1 次提交
  8. 05 8月, 2013 3 次提交
  9. 24 7月, 2013 1 次提交
  10. 09 7月, 2013 1 次提交
  11. 01 6月, 2013 1 次提交
  12. 21 5月, 2013 2 次提交
  13. 19 4月, 2013 1 次提交
  14. 14 2月, 2013 1 次提交
  15. 03 10月, 2012 2 次提交
  16. 06 9月, 2012 7 次提交
    • 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: 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: check connector hw/sw state · 0a91ca29
      Daniel Vetter 提交于
      Atm we can only check the connector state after a dpms call - while
      doing modeset with the copy&pasted crtc helper code things are too
      ill-defined for proper checking. But the idea is very much to call
      this check from the modeset code, too.
      
      v2: Fix dpms check and don't presume that if the hw isn't on that it
      must not be linked up with an encoder (it could simply be switched off
      with the dpms state).
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0a91ca29
    • D
      drm/i915/dvo: implement get_hw_state · 732ce74f
      Daniel Vetter 提交于
      Similar to the sdvo code we poke the dvo encoder whether the output is
      active. Safe that dvo encoders are not standardized, so this requires
      a new callback into the dvo chip driver.
      
      Hence implement that for all 6 dvo drivers.
      
      v2: With the newly added ns2501 we now have 6 dvo drivers instead of
      just 5 ...
      Acked-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      732ce74f
    • D
      drm/i915: rip out encoder->prepare/commit · c9deac97
      Daniel Vetter 提交于
      With the new infrastructure we're doing this when enabling/disabling
      the entire display pipe.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c9deac97
    • D
      drm/i915: convert dpms functions of dvo/sdvo/crt · b2cabb0e
      Daniel Vetter 提交于
      Yeah, big patch but I couldn't come up with a neat idea of how to
      split it up further, that wouldn't break dpms on cloned configs
      somehow. But the changes in dvo/sdvo/crt are all pretty much
      orthonogal, so it's not too bad a patch.
      
      These are the only encoders that support cloning, which requires a few
      special changes compared to the previous patches.
      - Compute the desired state of the display pipe by walking all
        connected encoders and checking whether any has active connectors.
        To make this clearer, drop the old mode parameter to the crtc dpms
        function and rename it to intel_crtc_update_dpms.
      - There's the curious case of intel_crtc->dpms_mode. With the previous
        patches to remove the overlay pipe A code and to rework the load
        detect pipe code, the big users are gone. We still keep it to avoid
        enabling the pipe twice, but we duplicate this logic with
        crtc->active, too. Still, leave this for now and just push a fake
        dpms mode into it that reflects the state of the display pipe.
      
      Changes in the encoder dpms functions:
      - We clamp the dpms state to the supported range right away. This is
        escpecially important for the VGA outputs, where only older hw
        supports the intermediate states. This (and the crt->adpa_reg patch)
        allows us to unify the crt dpms code again between all variants
        (gmch, vlv and pch).
      - We only enable/disable the output for dvo/sdvo and leave the encoder
        running. The encoder will be disabled/enabled when we switch the
        state of the entire output pipeline (which will happen right away
        for non-cloned setups). This way the duplication is reduced and
        strange interaction when disabling output ports at the wrong time
        avoided.
      
      The dpms code for all three types of connectors contains a bit of
      duplicated logic, but I think keeping these special cases separate is
      simpler: CRT is the only one that hanldes intermediate dpms state
      (which requires extra logic to enable/disable things in the right
      order), and introducing some abstraction just to share the code
      between dvo and sdvo smells like overkill. We can do that once someone
      bothers to implement cloning for the more modern outputs. But I doubt
      that this will ever happen.
      
      v2: s/crtc/crt/_set_dpms, noticed by Paulo Zanoni.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b2cabb0e
    • D
      drm/i915/dvo: convert to encoder disable/enable · 19c63fa8
      Daniel Vetter 提交于
      Similar to the sdvo conversion.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      19c63fa8
  17. 17 8月, 2012 1 次提交
    • D
      drm/i915: simplify dvo dpms interface · fac3274c
      Daniel Vetter 提交于
      All dvo drivers only support 2 dpms states, and our dvo driver
      even switches of the dvo port for anything else than DPMS_ON. Hence
      ditch this complexity and simply use bool enable.
      
      While reading through this code I've noticed that the mode_set
      function of ch7017 is a bit peculiar - it disable the lvds again, even
      though the crtc helper code should have done that ... This might be to
      work around an issue at driver load, we pretty much ignore the hw
      state when taking over.
      
      v2: Also do the conversion for the new ns2501 driver.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fac3274c
  18. 26 7月, 2012 2 次提交
    • T
      drm/i915: Support for ns2501-DVO · 7434a255
      Thomas Richter 提交于
      This patch adds support for the ns2501 DVO, found in some older Fujitsu/Siemens Labtops.
      It is in the state of "works for me".
      Includes now proper DPMS support. Includes switching between resolutions -
      from 640x480 to 1024x768.
      Currently assumes that the native display resolution is 1024x768.
      
      The ns2501 seems to be rather critical - if the output PLL is not
      running, the chip doesn't seem to be clocked and then doesn't react
      on i2c messages. Thus, a quick'n-dirty trick ensures that the DVO
      is active before submitting any i2c messages to it. This is
      probably to be reviewed.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=17902Signed-off-by: NThomas Richter <thor@math.tu-berlin.de>
      [danvet: fixup whitespace fail.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7434a255
    • 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
  19. 20 7月, 2012 1 次提交
  20. 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
  21. 11 2月, 2012 1 次提交
    • D
      drm/i915: fixup interlaced vertical timings confusion, part 1 · ca9bfa7e
      Daniel Vetter 提交于
      We have a pretty decent confusion about vertical timings of interlaced
      modes. Peter Ross has written a patch that makes interlace modes work
      on a lot more platforms/output combinations by doubling the vertical
      timings.
      
      The issue with that patch is that core drm _does_ support specifying
      whether we want these vertical timings in fields or frames, we just
      haven't managed to consistently use this facility. The relavant
      function is drm_mode_set_crtcinfo, which fills in the crtc timing
      information.
      
      The first thing to note is that the drm core keeps interlaced modes in
      frames, but displays modelines in fields. So when the crtc modeset
      helper copies over the mode into adjusted_mode it will already contain
      vertical timings in half-frames. The result is that the fixup code in
      intel_crtc_mode_fixup doesn't actually do anything (in most cases at
      least).
      
      Now gen3+ natively supports interlaced modes and wants the vertical
      timings in frames. Which is what sdvo already fixes up, at least under
      some conditions.
      
      There are a few other place that demand vertical timings in fields
      but never actually deal with interlaced modes, so use frame timings
      for consistency, too. These are:
      - lvds panel,
      - dvo encoders - dvo is the only way gen2 could support interlaced
        mode, but currently we don't support any encoders that do.
      - tv out - despite that the tv dac sends out an interlaced signal it
        expects a progressive mode pipe configuration.
      All these encoders enforce progressive modes by resetting
      interlace_allowed.
      
      Hence we always want crtc vertical timings in frames. Enforce this in
      our crtc mode_fixup function and rip out any redudant timing
      computations from the encoders' mode_fixup function.
      
      v2-4: Adjust the vertical timings a bit.
      
      v5: Split out the 'subtract-one for interlaced' fixes.
      
      v6: Clarify issues around tv-out and gen2.
      Reviewed-by: NEugeni Dodonov <eugeni.dodonov@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Tested-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Tested-by: NChristopher Egert <cme3000@gmail.com>
      Tested-by: NAlfonso Fiore <alfonso.fiore@gmail.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ca9bfa7e
  22. 08 2月, 2011 1 次提交
  23. 29 9月, 2010 1 次提交
  24. 21 9月, 2010 1 次提交
  25. 18 9月, 2010 1 次提交
    • C
      drm/i915: use GMBUS to manage i2c links · f899fc64
      Chris Wilson 提交于
      Use the GMBUS interface rather than direct bit banging to grab the EDID
      over DDC (and for other forms of auxiliary communication with external
      display controllers). The hope is that this method will be much faster
      and more reliable than bit banging for fetching EDIDs from buggy monitors
      or through switches, though we still preserve the bit banging as a
      fallback in case GMBUS fails.
      
      Based on an original patch by Jesse Barnes.
      
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      f899fc64
  26. 15 9月, 2010 2 次提交