1. 18 8月, 2014 2 次提交
    • I
      drm/i915: make sure VDD is turned off during system suspend · 07f9cd0b
      Imre Deak 提交于
      Atm we may leave eDP VDD enabled during system suspend after the CRTCs
      are disabled through an HPD->DPCD read event. So disable VDD during
      suspend at a point when no HPDs can occur.
      
      Note that runtime suspend doesn't have the same problem, since there the
      RPM ref held by VDD provides already the needed serialization.
      
      v2:
      - add note to commit message about the runtime suspend path (Ville)
      - use edp_panel_vdd_off_sync(), so we can keep the WARN in
        edp_panel_vdd_off() (Ville)
      v3:
      - rebased on -fixes (for_each_intel_encoder()->list_for_each_entry())
        (Imre)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v2)
      Cc: stable@vger.kernel.org (3.16+)
      [Jani: fix sparse warning reported by Fengguang Wu]
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      07f9cd0b
    • I
      drm/i915: cancel hotplug and dig_port work during suspend and unload · 1d0d343a
      Imre Deak 提交于
      Make sure these work handlers don't run after we system suspend or
      unload the driver. Note that we don't cancel the handlers during runtime
      suspend. That could lead to a lockup, since we take a runtime PM ref
      from the handlers themselves. Fortunaltely canceling there is not needed
      since the RPM ref itself provides for the needed serialization.
      
      v2:
      - fix the order of canceling dig_port_work wrt. hotplug_work (Ville)
      - zero out {long,short}_hpd_port_mask and hpd_event_bits for speed
        (Ville)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: stable@vger.kernel.org (3.16+)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      1d0d343a
  2. 08 8月, 2014 1 次提交
    • R
      Revert "drm/i915: Enable semaphores on BDW" · be71eabe
      Rodrigo Vivi 提交于
      This reverts commit 521e62e4.
      
      Although POST_SYNC brought a bit of stability to Semaphores on BDW
      it didn't solved all issues and some hungs can still occour when
      semaphores are enabled on BDW. Also some sloweness can be found on some
      igt tests, althoguth it apparently doesn't affect real workloads.
      
      Besides that, no real performance gain was found on our tests with different
      and even multiple workloads.
      
      Let's disable it again for now. At least until we are sure it is safe
      to re-enable it.
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      be71eabe
  3. 24 7月, 2014 1 次提交
  4. 23 7月, 2014 2 次提交
  5. 22 7月, 2014 1 次提交
    • D
      drm/i915: add DP 1.2 MST support (v0.7) · 0e32b39c
      Dave Airlie 提交于
      This adds DP 1.2 MST support on Haswell systems.
      
      Notes:
      a) this reworks irq handling for DP MST ports, so that we can
      avoid the mode config locking in the current hpd handlers, as
      we need to process up/down msgs at a better time.
      
      Changes since v0.1:
      use PORT_PCH_HOTPLUG to detect short vs long pulses
      add a workqueue to deal with digital events as they can get blocked on the
      main workqueue beyong mode_config mutex
      fix a bunch of modeset checker warnings
      acks irqs in the driver
      cleanup the MST encoders
      
      Changes since v0.2:
      check irq status again in work handler
      move around bring up and tear down to fix DPMS on/off
      use path properties.
      
      Changes since v0.3:
      updates for mst apis
      more state checker fixes
      irq handling improvements
      fbcon handling support
      improved reference counting of link - fixes redocking.
      
      Changes since v0.4:
      handle gpu reset hpd reinit without oopsing
      check link status on HPD irqs
      fix suspend/resume
      
      Changes since v0.5:
      use proper functions to get max link/lane counts
      fix another checker backtrace - due to connectors disappearing.
      set output type in more places fro, unknown->displayport
      don't talk to devices if no HPD asserted
      check mst on short irqs only
      check link status properly
      rebase onto prepping irq changes.
      drop unsued force_act
      
      Changes since v0.6:
      cleanup unused struct entry.
      
      [airlied: fix some sparse warnings].
      Reviewed-by: NTodd Previte <tprevite@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0e32b39c
  6. 08 7月, 2014 3 次提交
    • I
      drm/i915: make system freeze support depend on CONFIG_ACPI_SLEEP · 95fa2eee
      Imre Deak 提交于
      To achieve further power savings during system freeze (aka connected
      standby, or s0ix) we have to send a PCI_D1 opregion notification. As
      the information about the state we're entering (system freeze,
      suspend to ram or suspend to disk) is only available through the ACPI
      subsystem, make this support depend on the relevant kconfig option.
      Things will still work if this option isn't set, albeit with less than
      optimial power saving.
      
      This also fixes a compile breakage when the option is not set introduced
      in
      
      commit e5747e3a
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Thu Jun 12 08:35:47 2014 -0700
      
          drm/i915: send proper opregion notifications on suspend/resume
      Reported-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      95fa2eee
    • D
      drm/fb-helper: Fix hpd vs. initial config races · 50c3dc97
      Daniel Vetter 提交于
      Some drivers need to be able to have a perfect race-free fbcon setup.
      Current drivers only enable hotplug processing after the call to
      drm_fb_helper_initial_config which leaves a tiny but important race.
      
      This race is especially noticable on embedded platforms where the
      driver itself enables the voltage for the hdmi output, since only then
      will monitors (after a bit of delay, as usual) respond by asserting
      the hpd pin.
      
      Most of the infrastructure is already there with the split-out
      drm_fb_helper_init. And drm_fb_helper_initial_config already has all
      the required locking to handle concurrent hpd events since
      
      commit 53f1904b
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Mar 20 14:26:35 2014 +0100
      
          drm/fb-helper: improve drm_fb_helper_initial_config locking
      
      The only missing bit is making drm_fb_helper_hotplug_event save
      against concurrent calls of drm_fb_helper_initial_config. The only
      unprotected bit is the check for fb_helper->fb.
      
      With that drivers can first initialize the fb helper, then enabel
      hotplug processing and then set up the initial config all in a
      completely race-free manner. Update kerneldoc and convert i915 as a
      proof of concept.
      
      Feature requested by Thierry since his tegra driver atm reliably boots
      slowly enough to misses the hotplug event for an external hdmi screen,
      but also reliably boots to quickly for the hpd pin to be asserted when
      the fb helper calls into the hdmi ->detect function.
      
      Cc: Thierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      50c3dc97
    • R
      drm/i915: Enable semaphores on BDW · 521e62e4
      Rodrigo Vivi 提交于
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      521e62e4
  7. 01 7月, 2014 1 次提交
    • P
      drm/i915: flush delayed_resume_work when suspending · 84a2ab8e
      Paulo Zanoni 提交于
      It is possible that, by the time we run i915_drm_freeze(),
      delayed_resume_work was already queued but did not run yet. If it
      still didn't run after intel_runtime_pm_disable_interrupts(), by the
      time it runs it will try to change the interrupt registers with the
      interrupts already disabled, which will trigger a WARN. We can
      reliably reproduce this with the pm_rpm system-suspend test case.
      
      In order to avoid the problem, we have to flush the work before
      disabling the interrupts. We could also cancel the work instead of
      flushing it, but that would require us to put a runtime PM reference -
      and any other resource we may need in the future - in case the work
      was already queued, so I believe flushing the work is more
      future-proof, although less efficient. But I can also change this part
      if someone requests.
      
      Another thing I tried was to move the intel_suspend_gt_powersave()
      call to before intel_runtime_pm_disable_interrupts(), but since that
      function needs to be called after the interrupts are already disabled,
      due to dev_priv->rps.work, this strategy didn't work.
      
      Testcase: igt/pm_rpm/system-suspend
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80517Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      84a2ab8e
  8. 20 6月, 2014 2 次提交
  9. 13 6月, 2014 3 次提交
  10. 12 6月, 2014 2 次提交
  11. 11 6月, 2014 1 次提交
  12. 05 6月, 2014 3 次提交
    • R
      drm/i915: BDW: Adding missing cursor offsets. · 15d24aa5
      Rodrigo Vivi 提交于
      BDW uses IVB cursor offsets.
      
      Whithout this patch it is not possible to use multiple outputs with cursor
      on BDW.
      The cursor gets completely crazy because update position uses the wrong
      cursor register for the second pipe.
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79621Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      15d24aa5
    • J
      drm/i915: tell the user if both KMS and UMS are disabled · c9cd7b65
      Jani Nikula 提交于
      If both KMS is disabled (by i915.modeset=0 or nomodeset parameters) and
      UMS is disabled (by CONFIG_DRM_I915_UMS=n, the default), the user might
      not be aware his setup is not supported. Inform the users (and, by
      extension, the poor i915 developers having to read their dmesgs in bug
      reports) why their graphics experience might be lacking.
      
      A similar message was added on the UMS path in
      commit e147accb
      Author: Jani Nikula <jani.nikula@intel.com>
      Date:   Thu Oct 10 15:25:37 2013 +0300
      
          drm/i915: tell the user KMS is required for gen6+
      
      but it won't be reached if CONFIG_DRM_I915_UMS=n since
      commit b30324ad
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Wed Nov 13 22:11:25 2013 +0100
      
          drm/i915: Deprecated UMS support
      
      v2: Use DRM_DEBUG_DRIVER.
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c9cd7b65
    • D
      drm/i915: Improve irq handling after gpu resets · 78ad455f
      Daniel Vetter 提交于
      Currently we do a full re-init of all interrupts after a gpu hang.
      Which is pretty bad since we don't restore the interrupts we've
      enabled at runtime correctly. Even with that addressed it's rather
      horribly race.
      
      But on g4x and later we only reset the gt and not the entire gpu.
      Which means we only need to reset the GT interrupt bits. Which has the
      nice benefit that vblank waits, pipe CRC interrupts and everything
      else display related just keeps on working.
      
      The downside is that gt interrupt handling (i.e. ring->get/put_irq) is
      still racy. But as long as the gpu hang reliably wakes all waters and
      we have a short time where the refcount drops to 0 we'll recover. So
      not that bad really.
      
      v2: Ville noticed that GTIMR and PMIMR don't get cleared, only the
      subordinate per-ring registers. So let's rip out all the interrupt dancing.
      The FIXME comment is still required though since the ring irq handling
      happens at the per-ring interrupt mask registers, too.
      
      Testcase: igt/kms_flip/vblank-vs-hang
      Testcase: igt/kms_pipe_crc_basic/hang-*
      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>
      78ad455f
  13. 04 6月, 2014 1 次提交
    • D
      drm: Split connection_mutex out of mode_config.mutex (v3) · 6e9f798d
      Daniel Vetter 提交于
      After the split-out of crtc locks from the big mode_config.mutex
      there's still two major areas it protects:
      - Various connector probe states, like connector->status, EDID
        properties, probed mode lists and similar information.
      - The links from connector->encoder and encoder->crtc and other
        modeset-relevant connector state (e.g. properties which control the
        panel fitter).
      
      The later is used by modeset operations. But they don't really care
      about the former since it's allowed to e.g. enable a disconnected VGA
      output or with a mode not in the probed list.
      
      Thus far this hasn't been a problem, but for the atomic modeset
      conversion Rob Clark needs to convert all modeset relevant locks into
      w/w locks. This is required because the order of acquisition is
      determined by how userspace supplies the atomic modeset data. This has
      run into troubles in the detect path since the i915 load detect code
      needs _both_ protections offered by the mode_config.mutex: It updates
      probe state and it needs to change the modeset configuration to enable
      the temporary load detect pipe.
      
      The big deal here is that for the probe/detect users of this lock a
      plain mutex fits best, but for atomic modesets we really want a w/w
      mutex. To fix this lets split out a new connection_mutex lock for the
      modeset relevant parts.
      
      For simplicity I've decided to only add one additional lock for all
      connector/encoder links and modeset configuration states. We have
      piles of different modeset objects in addition to those (like bridges
      or panels), so adding per-object locks would be much more effort.
      
      Also, we're guaranteed (at least for now) to do a full modeset if we
      need to acquire this lock. Which means that fine-grained locking is
      fairly irrelevant compared to the amount of time the full modeset will
      take.
      
      I've done a full audit, and there's just a few things that justify
      special focus:
      - Locking in drm_sysfs.c is almost completely absent. We should
        sprinkle mode_config.connection_mutex over this file a bit, but
        since it already lacks mode_config.mutex this patch wont make the
        situation any worse. This is material for a follow-up patch.
      
      - omap has a omap_framebuffer_flush function which walks the
        connector->encoder->crtc links and is called from many contexts.
        Some look like they don't acquire mode_config.mutex, so this is
        already racy. Again fixing this is material for a separate patch.
      
      - The radeon hot_plug function to retrain DP links looks at
        connector->dpms. Currently this happens without any locking, so is
        already racy. I think radeon_hotplug_work_func should gain
        mutex_lock/unlock calls for the mode_config.connection_mutex.
      
      - Same applies to i915's intel_dp_hot_plug. But again, this is already
        racy.
      
      - i915 load_detect code needs to acquire this lock. Which means the
        w/w dance due to Rob's work will be nicely contained to _just_ this
        function.
      
      I've added fixme comments everywhere where it looks suspicious but in
      the sysfs code. After a quick irc discussion with Dave Airlie it
      sounds like the lack of locking in there is due to sysfs cleanup fun
      at module unload.
      
      v1: original (only compile tested)
      
      v2: missing mutex_init(), etc (from Rob Clark)
      
      v3: i915 needs more care in the conversion:
      - Protect the edp pp logic with the connection_mutex.
      - Use connection_mutex in the backlight code due to
        get_pipe_from_connector.
      - Use drm_modeset_lock_all in suspend/resume paths.
      - Update lock checks in the overlay code.
      
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      6e9f798d
  14. 23 5月, 2014 2 次提交
    • I
      drm/i915: disable GT power saving early during system suspend · fe5b1886
      Imre Deak 提交于
      Atm, we disable GT power saving during the end of the suspend sequence
      in i915_save_state(). Doing the disabling at that point seems arbitrary.
      One reason to disable it early though is to have a quiescent HW state
      before we do anything else (for example save registers). So move the
      disabling earlier, which also takes care canceling of the deferred RPS
      enabling work done by intel_disable_gt_powersave().
      
      Note that after the move we'll call intel_disable_gt_powersave() only
      in case modeset is enabled, but that's anyway the only case where we
      have it enabled in the first place.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NRobert Beckett <robert.beckett@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fe5b1886
    • I
      drm/i915: remove user GTT mappings early during runtime suspend · d6102977
      Imre Deak 提交于
      Currently user space can access GEM buffers mapped to GTT through
      existing mappings concurrently while the platform specific suspend
      handlers are running. Since these handlers may change the HW state in a
      way that would break such accesses, remove the mappings before calling
      the handlers. Spotted by Ville.
      
      Also Chris pointed out that the lists that i915_gem_release_all_mmaps()
      walks through need dev->struct_mutex, so take this lock. There is a
      potential deadlock against a concurrent RPM resume, resolve this by
      aborting and rescheduling the suspend (Daniel).
      
      v2:
      - take struct_mutex around i915_gem_release_all_mmaps() (Chris, Daniel)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NRobert Beckett <robert.beckett@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d6102977
  15. 22 5月, 2014 1 次提交
  16. 21 5月, 2014 1 次提交
  17. 20 5月, 2014 3 次提交
  18. 14 5月, 2014 1 次提交
  19. 13 5月, 2014 1 次提交
  20. 07 5月, 2014 2 次提交
    • I
      drm/i915: vlv: add runtime PM support · ddeea5b0
      Imre Deak 提交于
      Add runtime PM support for VLV, but leave it disabled. The next patch
      enables it.
      
      The suspend/resume sequence used is based on [1] and [2]. In practice we
      depend on the GT RC6 mechanism to save the HW context depending on the
      render and media power wells. By the time we run the runtime suspend
      callback the display side is also off and the HW context for that is
      managed by the display power domain framework.
      
      Besides the above there are Gunit registers that depend on a system-wide
      power well. This power well goes off once the device enters any of the
      S0i[R123] states. To handle this scenario, save/restore these Gunit
      registers. Note that this is not the complete register set dictated by
      [2], to remove some overhead, registers that are known not to be used are
      ignored. Also some registers are fully setup by initialization functions
      called during resume, these are not saved either. The list of registers
      can be further reduced, see the TODO note in the code.
      
      [1] VLV_gfx_clocking_PM_reset_y12w21d3 / "Driver D3 entry/exit"
      [2] VLV2_S0IXRegs
      
      v2:
      - unchanged
      v3:
      - fix s/GEN6_PMIIR/GEN6_PMIMR/ typo when saving/restoring registers
        (Ville)
      v4:
      - rebased on the previous patch fixing GEN register prefixes
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      [ rebased (according to v4) ]
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ddeea5b0
    • I
      drm/i915: propagate the error code from runtime PM callbacks · 0ab9cfeb
      Imre Deak 提交于
      Atm, none of the RPM callbacks can fail, but the next patch adding
      RPM support for VLV changes this, so prepare for it.
      
      In case one of these callbacks return error RPM will get permanently
      disabled until the error is explicitly cleared. In the future we could
      add support for re-enabling it, for example after resetting the HW, but
      for now - hopefully - we can live with the simpler solution.
      
      v2:
      - propagate the error from the resume callbacks too (Paulo)
      v3:
      - fix rebase fail typo around IS_GEN6() check in intel_runtime_suspend()
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0ab9cfeb
  21. 05 5月, 2014 6 次提交