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. 13 2月, 2014 1 次提交
  3. 05 2月, 2014 1 次提交
    • A
      drm/i915: Reorganize display pipe register accesses · a57c774a
      Antti Koskipaa 提交于
      RFCv2: Reorganize array indexing so that full offsets can be used as
      is. It makes grepping for registers in i915_reg.h much easier. Also
      move offset arrays to intel_device_info.
      
      v1: Fixed offsets for VLV, proper eDP handling
      
      v2: Fixed BCLRPAT, PIPESRC, PIPECONF and DSP* macros.
      
      v3: Added EDP pipe comment, removed redundant offset arrays for
          MSA_MISC and DDI_FUNC_CTL.
      
      v4: Rename patch and report object size increase.
      
      v5: Change location of commas, add PIPE_EDP into enum pipe
      
      v6: Insert PIPE_EDP_OFFSET into pipe offset array
      
      v7: Set I915_MAX_PIPES back to 3, change more registers accessors
          to use the new macros, get rid of _PIPE_INC and add dev_priv
          as a parameter where required by the new macros.
      
      Upcoming hardware will not have the various display pipe register
      ranges evenly spaced in memory. Change register address calculations
      into array lookups.
      
      Tested on SNB, VLV, IVB, Gen2 and HSW w/eDP.
      
      I left the UMS cruft untouched.
      
      Size differences:
         text    data     bss     dec     hex filename
       596431    4634      56  601121   92c21 i915.ko (new)
       593199    4634      56  597889   91f81 i915.ko (old)
      Signed-off-by: NAntti Koskipaa <antti.koskipaa@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Tested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a57c774a
  4. 10 12月, 2013 1 次提交
  5. 28 11月, 2013 1 次提交
  6. 11 11月, 2013 1 次提交
  7. 09 11月, 2013 2 次提交
  8. 16 10月, 2013 1 次提交
  9. 01 10月, 2013 4 次提交
  10. 17 9月, 2013 2 次提交
    • V
      drm/i915: Use adjusted_mode in HDMI 12bpc clock check · d68e7c3c
      Ville Syrjälä 提交于
      The pixel clock should come from adjusted_mode not requested_mode.
      In this case the two should be the same as we don't currently
      overwrite the clock in the case of HDMI. But let's make the code
      safe against such things happening in the future.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d68e7c3c
    • 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
  11. 05 9月, 2013 1 次提交
  12. 30 8月, 2013 1 次提交
  13. 22 8月, 2013 1 次提交
  14. 08 8月, 2013 5 次提交
  15. 06 8月, 2013 2 次提交
    • J
      drm/i915: rearrange vlv hdmi enable and pre_enable callbacks · b76cf76b
      Jani Nikula 提交于
      VLV wants encoder enabling before the pipe is up. This is currently
      achieved through calling the ->enable callback early, right after the
      ->pre_enable callback, in valleyview_crtc_enable(). This loses both the
      distinction between ->pre_enable and ->enable on VLV and the possibility
      to use a hook at the end of the modeset sequence.
      
      Rearrange the HDMI callbacks to make it possible to move ->enable call
      later. Basically do everything in ->pre_enable on VLV, and make ->enable
      a NOP.
      
      There should be no functional changes.
      
      v2: Rebase.
      
      v3: Explain why this is needed in the commit message (Chris).
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b76cf76b
    • C
      drm/i915: Acquire dpio_lock for VLV sideband programming in DP/HDMI · 0980a60f
      Chris Wilson 提交于
      Otherwise we get flooded by the kernel warning us that we are doing
      long sequences of IO without serialisation. For example,
      
       WARNING: CPU: 0 PID: 11136 at drivers/gpu/drm/i915/intel_sideband.c:40 vlv_sideband_rw+0x48/0x1ef()
       Modules linked in:
       CPU: 0 PID: 11136 Comm: kworker/u2:0 Tainted: G        W    3.11.0-rc2+ #4
       Call Trace:
        [<c2028564>] ?  warn_slowpath_common+0x63/0x78
        [<c227ad43>] ?  vlv_sideband_rw+0x48/0x1ef
        [<c20285dd>] ?  warn_slowpath_null+0xf/0x13
        [<c227ad43>] ?  vlv_sideband_rw+0x48/0x1ef
        [<c227b060>] ?  vlv_dpio_write+0x1c/0x21
        [<c2262b3b>] ?  intel_dp_set_signal_levels+0x24a/0x385
        [<c2264909>] ?  intel_dp_complete_link_train+0x25/0x1d1
        [<c2264c55>] ?  intel_dp_check_link_status+0xf7/0x106
        [<c2238ced>] ?  i915_hotplug_work_func+0x17b/0x221
        [<c203a204>] ?  process_one_work+0x12e/0x210
        [<c203a5e4>] ?  worker_thread+0x116/0x1ad
        [<c203a4ce>] ?  rescuer_thread+0x1cb/0x1cb
        [<c203d8f5>] ?  kthread+0x67/0x6c
        [<c2457ebb>] ?  ret_from_kernel_thread+0x1b/0x30
        [<c203d88e>] ?  init_completion+0x18/0x18
      
      v2: Retire the locking in vlv_crtc_enable() and do it close to the meat.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      [danvet: Squash in a s/mutex_lock/mutex_unlock/ fixup spotted by the 0
      day kernel build/coccinelle and reported by Dan Carpenter.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0980a60f
  16. 05 8月, 2013 1 次提交
  17. 24 7月, 2013 1 次提交
  18. 23 7月, 2013 1 次提交
    • D
      drm/i915: fix hdmi portclock limits · 7d148ef5
      Daniel Vetter 提交于
      In
      
      commit 325b9d04
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Apr 19 11:24:33 2013 +0200
      
          drm/i915: fixup 12bpc hdmi dotclock handling
      
      I've errornously claimed that we don't yet support the hdmi 1.4
      dotclocks > 225 MHz on Haswell. But a bug report and a closer look at
      the wrpll table showed that we've supported port clocks up to 300MHz.
      
      With the new code to dynamically compute wrpll limits we should have
      no issues going up to the full 340 MHz range of hdmi 1.4, so let's
      just use that to fix this regression. That'll allow 4k over hdmi for
      free!
      
      v2: Drop the random hunk that somehow slipped in.
      
      v3: Cantiga has the original HDMI dotclock limit of 165MHz. And also
      patch up the mode filtering. To do so extract the dotclock limits into
      a little helper function.
      
      v4: Use 300MHz (from Bspec) instead of 340MHz (upper limit for hdmi
      1.3), apparently hw is not required to be able to drive the highest
      dotclocks. Suggested by Damien.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67048
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67030
      Tested-by: Andreas Reis <andreas.reis@gmail.com> (v2)
      Cc: Damien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7d148ef5
  19. 01 7月, 2013 1 次提交
  20. 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
  21. 24 5月, 2013 2 次提交
  22. 21 5月, 2013 1 次提交
    • 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
  23. 30 4月, 2013 2 次提交
    • 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: fixup 12bpc hdmi dotclock handling · 325b9d04
      Daniel Vetter 提交于
      We need to multiply the hdmi port dotclock by 1.5x since it's not
      really a dotclock, but the 10/8 encoding bitclock divided by 10.
      
      Also add correct limit checks for the dotclock and reject modes which
      don't fit. HDMI 1.4 would allow more, but our hw doesn't support that
      unfortunately :(
      
      Somehow I suspect 12bpc hdmi output never really worked - we really
      need an i-g-t testcase to check all the different pixel modes and
      outputs.
      
      v2: Fixup the adjusted port clock handling - we need to make sure that
      the fdi link code still gets the real pixelclock.
      
      v3: g4x/vlv don't support 12bpc hdmi output so drop the bogus comment.
      Acked-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      [danvet: Switch dotclock limit check to <= as suggested by Ville.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      325b9d04
  24. 23 4月, 2013 1 次提交
    • D
      drm/i915: avoid full modeset when changing the color range properties · ae4edb80
      Daniel Vetter 提交于
      Automatic color range selection was added in
      
      commit 55bc60db
      Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Date:   Thu Jan 17 16:31:29 2013 +0200
      
          drm/i915: Add "Automatic" mode for the "Broadcast RGB" property
      
      but that removed the check to avoid a full modeset if the value is
      unchanged. Unfortunately X sets all properties with their current
      value at start-up, resulting in some ugly flickering which shouldn't
      be there.
      
      v2: Change old_range from bool to uint32_t, spotted by Ville.
      
      v3: Actually git add everything ;-)
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Paulo 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>
      ae4edb80
  25. 19 4月, 2013 1 次提交
    • J
      drm/i915: update VLV PLL and DPIO code v11 · 89b667f8
      Jesse Barnes 提交于
      In Valleyview voltage swing, pre-emphasis and lane control registers can
      be programmed only through the h/w side band fabric.  Update
      vlv_update_pll, i9xx_crtc_enable, and intel_enable_pll with the
      appropriate programming.
      
      We need to make sure that the tx lane reset occurs in both the full mode
      set and DPMS paths, so factor things out to allow that.
      
      v2: use different DPIO_DIVISOR values for VGA and DisplayPort
      v3: Fix update pll logic to use same DPIO_DIVISOR & DPIO_REFSFR values
              for all display interfaces
      v4: collapse with various updates
      v5: squash with crtc enable/pll enable bits
      v6: split out DP code (jbarnes)
          put phyready check under IS_VALLEYVIEW (jbarnes)
          remove unneeded check in 9xx pll div update (Jani)
          wrap VLV pll update call in IS_VALLEYVIEW (Jani)
          move port enable back to end of crtc enable (jbarnes)
          put phyready check under IS_VALLEYVIEW (jbarnes)
      v7: fix up conflicts against latest drm-intel-next-queued
      v8: use DPIO reg names, fix pipes (Jani)
          from mPhy_registers_VLV2_ww20p5 doc
      v9: update to latest info from driver enabling notes doc
          driver_vbios_notes_9
      v10: fixup a bit of pipe/port confusion to allow eDP and HDMI to work
           simultaneously (Jesse)
      v11: use pll/port callbacks for DPIO port activity (Daniel)
           use separate VLV CRTC enable function (Daniel)
           move around port ready checks (Jesse)
      Signed-off-by: NPallavi G <pallavi.g@intel.com>
      Signed-off-by: NVijay Purushothaman <vijay.a.purushothaman@intel.com>
      Signed-off-by: NGajanan Bhat <gajanan.bhat@intel.com>
      Signed-off-by: NBen Widawsky <benjamin.widawsky@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: Drop pfit changes and add a little comment explaining that
      vlv has a different enable sequence and so needs it's own crtc_enable
      callback. Also apply a fixup patch from Wu Fengguang to shut up some
      compiler warnings.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      89b667f8
  26. 18 4月, 2013 2 次提交
    • D
      drm/i915: move cpu_transcoder to the pipe configuration · 3b117c8f
      Daniel Vetter 提交于
      For a bunch of reason we need to more accurately track this:
      - hw pipe state readout for Haswell needs the cpu transcoder.
      - We need to know the right cpu transcoder in a bunch of places in
        ->disable and other modeset callbacks.
      
      In the future we need to add hw state readout&check support, too. But
      to avoid ugly merge conflicts do the rote sed job now without any
      functional changes.
      
      v2: Preserve the cpu_transcoder value when overwriting crtc->config.
      Reported by Paulo.
      
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
      [danvet: Removed rough whitespace that Chris spotted.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3b117c8f
    • E
      drm/i915: (re)init HPD interrupt storm statistics · 821450c6
      Egbert Eich 提交于
      When an encoder is shared on several connectors there is only
      one hotplug line, thus this line needs to be shared among these
      connectors.
      If HPD detect only works reliably on a subset of those connectors,
      we want to poll the others. Thus we need to make sure that storm
      detection doesn't mess up the settings for those connectors.
      Therefore we store the settings in the intel_connector struct and
      restore them from there.
      If nothing is set but the encoder has a hpd_pin set we assume this
      connector is hotplug capable.
      On init/reset we make sure the polled state of the connectors
      is (re)set to the default value, the HPD interrupts are marked
      enabled.
      Signed-off-by: NEgbert Eich <eich@suse.de>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      821450c6
  27. 06 4月, 2013 1 次提交