1. 13 2月, 2019 1 次提交
  2. 12 2月, 2019 5 次提交
    • V
      drm/i915: Dump skl+ watermark changes · ab98e944
      Ville Syrjälä 提交于
      Currently we're only dumping out the ddb allocation changes, let's do
      the same for the watermarks. This should help with debugging underruns
      and whatnot.
      
      First I tried one line per plane per wm level, but that resulted in
      an obnoxious amount of lines printed. So as a compromise I settled
      on a four line format, each line containing a single watermark related
      value (enable,lines,blocks,min_ddb_alloc) for all 8 levels (+trans wm).
      It still produces quite a lot of output but I can't really see a way
      around that because we simply have a lot of data to dump.
      
      Let's also pimp the ddb debug to print the size of the allocations
      too, not just their bounds. Makes it a bit easier to compare against
      the watermarks.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190208200527.12844-1-ville.syrjala@linux.intel.comReviewed-by: NClint Taylor <Clinton.A.Taylor@intel.com>
      ab98e944
    • C
      drm/i915: Reacquire priolist cache after dropping the engine lock · ed7dc677
      Chris Wilson 提交于
      If we drop the engine lock, we may run execlists_dequeue which may free
      the priolist. Therefore if we ever drop the execution lock on the
      engine, we have to discard our cache and refetch the priolist to ensure
      we do not use a stale pointer.
      
      [  506.418935] [IGT] gem_exec_whisper: starting subtest contexts-priority
      [  593.240825] general protection fault: 0000 [#1] SMP
      [  593.240863] CPU: 1 PID: 494 Comm: gem_exec_whispe Tainted: G     U            5.0.0-rc6+ #100
      [  593.240879] Hardware name:  /NUC6CAYB, BIOS AYAPLCEL.86A.0029.2016.1124.1625 11/24/2016
      [  593.240965] RIP: 0010:__i915_schedule+0x1fe/0x320 [i915]
      [  593.240981] Code: 48 8b 0c 24 48 89 c3 49 8b 45 28 49 8b 75 20 4c 89 3c 24 48 89 46 08 48 89 30 48 8b 43 08 48 89 4b 08 49 89 5d 20 49 89 45 28 <48> 89 08 45 39 a7 b8 03 00 00 7d 44 45 89 a7 b8 03 00 00 49 8b 85
      [  593.240999] RSP: 0018:ffffc90000057a60 EFLAGS: 00010046
      [  593.241013] RAX: 6b6b6b6b6b6b6b6b RBX: ffff8882582d7870 RCX: ffff88826baba6f0
      [  593.241026] RDX: 0000000000000000 RSI: ffff8882582d6e70 RDI: ffff888273482194
      [  593.241049] RBP: ffffc90000057a68 R08: ffff8882582d7680 R09: ffff8882582d7840
      [  593.241068] R10: 0000000000000000 R11: ffffea00095ebe08 R12: 0000000000000728
      [  593.241105] R13: ffff88826baba6d0 R14: ffffc90000057a40 R15: ffff888273482158
      [  593.241120] FS:  00007f4613fb3900(0000) GS:ffff888277a80000(0000) knlGS:0000000000000000
      [  593.241133] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  593.241146] CR2: 00007f57d3c66a84 CR3: 000000026e2b6000 CR4: 00000000001406e0
      [  593.241158] Call Trace:
      [  593.241233]  i915_schedule+0x1f/0x30 [i915]
      [  593.241326]  i915_request_add+0x1a9/0x290 [i915]
      [  593.241393]  i915_gem_do_execbuffer+0x45f/0x1150 [i915]
      [  593.241411]  ? init_object+0x49/0x80
      [  593.241425]  ? ___slab_alloc.constprop.91+0x4b8/0x4e0
      [  593.241491]  ? i915_gem_execbuffer2_ioctl+0x99/0x380 [i915]
      [  593.241563]  ? i915_gem_execbuffer_ioctl+0x270/0x270 [i915]
      [  593.241629]  i915_gem_execbuffer2_ioctl+0x1bb/0x380 [i915]
      [  593.241705]  ? i915_gem_execbuffer_ioctl+0x270/0x270 [i915]
      [  593.241724]  drm_ioctl_kernel+0x81/0xd0
      [  593.241738]  drm_ioctl+0x1a7/0x310
      [  593.241803]  ? i915_gem_execbuffer_ioctl+0x270/0x270 [i915]
      [  593.241819]  ? __update_load_avg_se+0x1c9/0x240
      [  593.241834]  ? pick_next_entity+0x7e/0x120
      [  593.241851]  do_vfs_ioctl+0x88/0x5d0
      [  593.241880]  ksys_ioctl+0x35/0x70
      [  593.241894]  __x64_sys_ioctl+0x11/0x20
      [  593.241907]  do_syscall_64+0x44/0xf0
      [  593.241924]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [  593.241940] RIP: 0033:0x7f4615ffe757
      [  593.241952] Code: 00 00 90 48 8b 05 39 a7 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 09 a7 0c 00 f7 d8 64 89 01 48
      [  593.241970] RSP: 002b:00007ffc1030ddf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      [  593.241984] RAX: ffffffffffffffda RBX: 00007ffc10324420 RCX: 00007f4615ffe757
      [  593.241997] RDX: 00007ffc1030e220 RSI: 0000000040406469 RDI: 0000000000000003
      [  593.242010] RBP: 00007ffc1030e220 R08: 00007f46160c9208 R09: 00007f46160c9240
      [  593.242022] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000040406469
      [  593.242038] R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000
      [  593.242058] Modules linked in: i915 intel_gtt drm_kms_helper prime_numbers
      
      v2: Track the local engine cache and explicitly clear it when switching
      engine locks.
      
      Fixes: a02eb975 ("drm/i915/execlists: Cache the priolist when rescheduling")
      Testcase: igt/gem_exec_whisper/contexts-priority # rare!
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190211204647.26723-1-chris@chris-wilson.co.uk
      ed7dc677
    • C
      drm/i915: Include the current timeline seqno for debugging execlists · ed06fddc
      Chris Wilson 提交于
      While this is mainly only useful for ELSP[0], it is definitely useful to
      know the current timeline seqno wrt to the queued set of requests for
      that port, as this carries additional information above and beyond the
      near-defunct global_seqno and global HWSP.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190211131004.11634-1-chris@chris-wilson.co.uk
      ed06fddc
    • C
      drm/i915: Use synchronize_srcu_expedited() for resets · 7c95c10e
      Chris Wilson 提交于
      We impose upon ourselves a strict timeout for resets (to ensure forward
      progress by use of a failsafe). Prefer to use the expedited
      synchronisation function in this case to reduce the likelihood of a
      spurious delay being treated as a deadlock.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190211135040.1234-2-chris@chris-wilson.co.ukReviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      7c95c10e
    • C
      drm/i915: Pull sync_scru for device reset outside of wedge_mutex · 785fbda5
      Chris Wilson 提交于
      We need to flush our srcu protecting resources about to be clobbered
      by the reset, inside of our timer failsafe but outside of the
      error->wedge_mutex, so that the failsafe can run in case the
      synchronize_srcu() takes too long (hits a shrinker deadlock?).
      
      Fixes: 72eb16df ("drm/i915: Serialise resets with wedging")
      References: https://bugs.freedesktop.org/show_bug.cgi?id=109605Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190211135040.1234-1-chris@chris-wilson.co.ukReviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      785fbda5
  3. 11 2月, 2019 3 次提交
  4. 09 2月, 2019 8 次提交
  5. 08 2月, 2019 18 次提交
  6. 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