1. 09 2月, 2019 2 次提交
  2. 08 2月, 2019 18 次提交
  3. 07 2月, 2019 5 次提交
    • J
      drm/i915: Handle vm_mmap error during I915_GEM_MMAP ioctl with WC set · ebfb6977
      Joonas Lahtinen 提交于
      Add err goto label and use it when VMA can't be established or changes
      underneath.
      
      v2:
      - Dropping Fixes: as it's indeed impossible to race an object to the
        error address. (Chris)
      v3:
      - Use IS_ERR_VALUE (Chris)
      Reported-by: NAdam Zabrocki <adamza@microsoft.com>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Adam Zabrocki <adamza@microsoft.com>
      Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> #v2
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190207085454.10598-2-joonas.lahtinen@linux.intel.com
      ebfb6977
    • J
      drm/i915: Prevent a race during I915_GEM_MMAP ioctl with WC set · 5c4604e7
      Joonas Lahtinen 提交于
      Make sure the underlying VMA in the process address space is the
      same as it was during vm_mmap to avoid applying WC to wrong VMA.
      
      A more long-term solution would be to have vm_mmap_locked variant
      in linux/mmap.h for when caller wants to hold mmap_sem for an
      extended duration.
      
      v2:
      - Refactor the compare function
      
      Fixes: 1816f923 ("drm/i915: Support creation of unbound wc user mappings for objects")
      Reported-by: NAdam Zabrocki <adamza@microsoft.com>
      Suggested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.0+
      Cc: Akash Goel <akash.goel@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Adam Zabrocki <adamza@microsoft.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> #v1
      Link: https://patchwork.freedesktop.org/patch/msgid/20190207085454.10598-1-joonas.lahtinen@linux.intel.com
      5c4604e7
    • L
      drm/i915: Don't send hotplug in intel_dp_check_mst_status() · 6cbb55c0
      Lyude Paul 提交于
      This hotplug also isn't needed: drm_dp_mst_topology_mgr_set_mst()
      already sends a hotplug on its own from drm_dp_destroy_connector_work()
      after destroying connectors in the MST topology.
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129191001.442-4-lyude@redhat.com
      6cbb55c0
    • L
      drm/i915: Don't send MST hotplugs during resume · 6be1cf96
      Lyude Paul 提交于
      We have a bad habit of calling drm_fb_helper_hotplug_event() far more
      then we actually need to. MST appears to be one of these cases, where we
      call drm_fb_helper_hotplug_event() if we fail to resume a connected MST
      topology in intel_dp_mst_resume(). We don't actually need to do this at
      all though since hotplug events are already sent from
      drm_dp_connector_destroy_work() every time connectors are unregistered
      from userspace's PoV. Additionally, extra calls to
      drm_fb_helper_hotplug_event() also just mean more of a chance of doing a
      connector probe somewhere we shouldn't.
      
      So, don't send any hotplug events during resume if the MST topology
      fails to come up. Just rely on the DP MST helpers to send them for us.
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129191001.442-3-lyude@redhat.com
      6be1cf96
    • L
      drm/i915: Block fbdev HPD processing during suspend · fe5ec656
      Lyude Paul 提交于
      When resuming, we check whether or not any previously connected
      MST topologies are still present and if so, attempt to resume them. If
      this fails, we disable said MST topologies and fire off a hotplug event
      so that userspace knows to reprobe.
      
      However, sending a hotplug event involves calling
      drm_fb_helper_hotplug_event(), which in turn results in fbcon doing a
      connector reprobe in the caller's thread - something we can't do at the
      point in which i915 calls drm_dp_mst_topology_mgr_resume() since
      hotplugging hasn't been fully initialized yet.
      
      This currently causes some rather subtle but fatal issues. For example,
      on my T480s the laptop dock connected to it usually disappears during a
      suspend cycle, and comes back up a short while after the system has been
      resumed. This guarantees pretty much every suspend and resume cycle,
      drm_dp_mst_topology_mgr_set_mst(mgr, false); will be caused and in turn,
      a connector hotplug will occur. Now it's Rute Goldberg time: when the
      connector hotplug occurs, i915 reprobes /all/ of the connectors,
      including eDP. However, eDP probing requires that we power on the panel
      VDD which in turn, grabs a wakeref to the appropriate power domain on
      the GPU (on my T480s, this is the PORT_DDI_A_IO domain). This is where
      things start breaking, since this all happens before
      intel_power_domains_enable() is called we end up leaking the wakeref
      that was acquired and never releasing it later. Come next suspend/resume
      cycle, this causes us to fail to shut down the GPU properly, which
      causes it not to resume properly and die a horrible complicated death.
      
      (as a note: this only happens when there's both an eDP panel and MST
      topology connected which is removed mid-suspend. One or the other seems
      to always be OK).
      
      We could try to fix the VDD wakeref leak, but this doesn't seem like
      it's worth it at all since we aren't able to handle hotplug detection
      while resuming anyway. So, let's go with a more robust solution inspired
      by nouveau: block fbdev from handling hotplug events until we resume
      fbdev. This allows us to still send sysfs hotplug events to be handled
      later by user space while we're resuming, while also preventing us from
      actually processing any hotplug events we receive until it's safe.
      
      This fixes the wakeref leak observed on the T480s and as such, also
      fixes suspend/resume with MST topologies connected on this machine.
      
      Changes since v2:
      * Don't call drm_fb_helper_hotplug_event() under lock, do it after lock
        (Chris Wilson)
      * Don't call drm_fb_helper_hotplug_event() in
        intel_fbdev_output_poll_changed() under lock (Chris Wilson)
      * Always set ifbdev->hpd_waiting (Chris Wilson)
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Fixes: 0e32b39c ("drm/i915: add DP 1.2 MST support (v0.7)")
      Cc: Todd Previte <tprevite@gmail.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: intel-gfx@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v3.17+
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129191001.442-2-lyude@redhat.com
      fe5ec656
  4. 06 2月, 2019 15 次提交