1. 08 2月, 2019 1 次提交
  2. 06 2月, 2019 2 次提交
  3. 30 1月, 2019 2 次提交
    • C
      drm/i915: Drop fake breadcrumb irq · 789659f4
      Chris Wilson 提交于
      Missed breadcrumb detection is defunct due to the tight coupling with
      dma_fence signaling and the myriad ways we may signal fences from
      everywhere but from an interrupt, i.e. we frequently signal a fence
      before we even see its interrupt. This means that even if we miss an
      interrupt for a fence, it still is signaled before our breadcrumb
      hangcheck fires, so simplify the breadcrumb hangchecking by moving it
      into the GPU hangcheck and forgo fake interrupts.
      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/20190129205230.19056-3-chris@chris-wilson.co.uk
      789659f4
    • C
      drm/i915: Replace global breadcrumbs with per-context interrupt tracking · 52c0fdb2
      Chris Wilson 提交于
      A few years ago, see commit 688e6c72 ("drm/i915: Slaughter the
      thundering i915_wait_request herd"), the issue of handling multiple
      clients waiting in parallel was brought to our attention. The
      requirement was that every client should be woken immediately upon its
      request being signaled, without incurring any cpu overhead.
      
      To handle certain fragility of our hw meant that we could not do a
      simple check inside the irq handler (some generations required almost
      unbounded delays before we could be sure of seqno coherency) and so
      request completion checking required delegation.
      
      Before commit 688e6c72, the solution was simple. Every client
      waiting on a request would be woken on every interrupt and each would do
      a heavyweight check to see if their request was complete. Commit
      688e6c72 introduced an rbtree so that only the earliest waiter on
      the global timeline would woken, and would wake the next and so on.
      (Along with various complications to handle requests being reordered
      along the global timeline, and also a requirement for kthread to provide
      a delegate for fence signaling that had no process context.)
      
      The global rbtree depends on knowing the execution timeline (and global
      seqno). Without knowing that order, we must instead check all contexts
      queued to the HW to see which may have advanced. We trim that list by
      only checking queued contexts that are being waited on, but still we
      keep a list of all active contexts and their active signalers that we
      inspect from inside the irq handler. By moving the waiters onto the fence
      signal list, we can combine the client wakeup with the dma_fence
      signaling (a dramatic reduction in complexity, but does require the HW
      being coherent, the seqno must be visible from the cpu before the
      interrupt is raised - we keep a timer backup just in case).
      
      Having previously fixed all the issues with irq-seqno serialisation (by
      inserting delays onto the GPU after each request instead of random delays
      on the CPU after each interrupt), we can rely on the seqno state to
      perfom direct wakeups from the interrupt handler. This allows us to
      preserve our single context switch behaviour of the current routine,
      with the only downside that we lose the RT priority sorting of wakeups.
      In general, direct wakeup latency of multiple clients is about the same
      (about 10% better in most cases) with a reduction in total CPU time spent
      in the waiter (about 20-50% depending on gen). Average herd behaviour is
      improved, but at the cost of not delegating wakeups on task_prio.
      
      v2: Capture fence signaling state for error state and add comments to
      warm even the most cold of hearts.
      v3: Check if the request is still active before busywaiting
      v4: Reduce the amount of pointer misdirection with list_for_each_safe
      and using a local i915_request variable inside the loops
      v5: Add a missing pluralisation to a purely informative selftest message.
      
      References: 688e6c72 ("drm/i915: Slaughter the thundering i915_wait_request herd")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129205230.19056-2-chris@chris-wilson.co.uk
      52c0fdb2
  4. 29 1月, 2019 1 次提交
  5. 28 1月, 2019 1 次提交
  6. 25 1月, 2019 1 次提交
  7. 23 1月, 2019 2 次提交
  8. 18 1月, 2019 1 次提交
  9. 17 1月, 2019 2 次提交
  10. 15 1月, 2019 8 次提交
  11. 10 1月, 2019 1 次提交
  12. 08 1月, 2019 1 次提交
  13. 07 1月, 2019 1 次提交
  14. 02 1月, 2019 1 次提交
  15. 28 12月, 2018 2 次提交
  16. 27 12月, 2018 1 次提交
  17. 20 12月, 2018 1 次提交
  18. 17 12月, 2018 1 次提交
    • M
      drm/i915/dsc: Add Per connector debugfs node for DSC support/enable · e845f099
      Manasi Navare 提交于
      DSC can be supported per DP connector. This patch adds a per connector
      debugfs node to expose DSC support capability by the kernel.
      The same node can be used from userspace to force DSC enable.
      
      force_dsc_en written through this debugfs node is used to force
      DSC even for lower resolutions.
      
      Credits to Ville Syrjala for suggesting the proper locks to be used
      and to Lyude Paul for explaining how to use them in this context
      
      v8:
      * Add else if (ret) for drm_modeset_lock (Lyude)
      v7:
      * Get crtc, crtc_state from connector atomic state
      and add proper locks and backoff (Ville, Chris Wilson, Lyude)
      (Suggested-by: Ville Syrjala <ville.syrjala@linux.intel.com>)
      * Use %zu for printing size_t variable (Lyude)
      v6:
      * Read fec_capable only for non edp (Manasi)
      v5:
      * Name it dsc sink support and also add
      fec support in the same node (Ville)
      v4:
      * Add missed connector_status check (Manasi)
      * Create i915_dsc_support node only for Gen >=10 (manasi)
      * Access intel_dp->dsc_dpcd only if its not NULL (Manasi)
      v3:
      * Combine Force_dsc_en with this patch (Ville)
      v2:
      * Use kstrtobool_from_user to avoid explicit error checking (Lyude)
      * Rebase on drm-tip (Manasi)
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Signed-off-by: NManasi Navare <manasi.d.navare@intel.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181206005407.4698-1-manasi.d.navare@intel.com
      e845f099
  19. 13 12月, 2018 2 次提交
  20. 07 12月, 2018 1 次提交
  21. 04 12月, 2018 1 次提交
  22. 29 11月, 2018 1 次提交
    • V
      drm/i915: Move ddb/wm programming into plane update/disable hooks on skl+ · ff43bc37
      Ville Syrjälä 提交于
      On SKL+ the plane WM/BUF_CFG registers are a proper part of each
      plane's register set. That means accessing them will cancel any
      pending plane update, and we would need a PLANE_SURF register write
      to arm the wm/ddb change as well.
      
      To avoid all the problems with that let's just move the wm/ddb
      programming into the plane update/disable hooks. Now all plane
      registers get written in one (hopefully atomic) operation.
      
      To make that feasible we'll move the plane ddb tracking into
      the crtc state. Watermarks were already tracked there.
      
      v2: Rebase due to input CSC
      v3: Split out a bunch of junk (Matt)
      v4: Add skl_wm_add_affected_planes() to deal with
          cursor special case and non-zero wm register reset value
      v5: Drop the unrelated for_each_intel_plane_mask() fix (Matt)
          Remove the redundant ddb memset() (Matt)
      
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #v3
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181127165900.31298-1-ville.syrjala@linux.intel.com
      ff43bc37
  23. 23 11月, 2018 2 次提交
  24. 21 11月, 2018 2 次提交
    • A
    • J
      drm/i915/ilk: Fix warning when reading emon_status with no output · cab870b7
      José Roberto de Souza 提交于
      When there is no output no one will hold a runtime_pm reference
      causing a warning when trying to read emom_status in debugfs.
      
      [22.756480] ------------[ cut here ]------------
      [22.756489] RPM wakelock ref not held during HW access
      [22.756578] WARNING: CPU: 0 PID: 1058 at drivers/gpu/drm/i915/intel_drv.h:2104 gen5_read32+0x16b/0x1a0 [i915]
      [22.756580] Modules linked in: snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic i915 coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core e1000e snd_pcm mei_me prime_numbers mei lpc_ich
      [22.756595] CPU: 0 PID: 1058 Comm: debugfs_test Not tainted 4.20.0-rc1-CI-Trybot_3219+ #1
      [22.756597] Hardware name: Hewlett-Packard HP Compaq 8100 Elite SFF PC/304Ah, BIOS 786H1 v01.13 07/14/2011
      [22.756634] RIP: 0010:gen5_read32+0x16b/0x1a0 [i915]
      [22.756637] Code: a4 ea e0 0f 0b e9 d2 fe ff ff 80 3d a5 71 19 00 00 0f 85 d3 fe ff ff 48 c7 c7 48 d0 2d a0 c6 05 91 71 19 00 01 e8 35 a4 ea e0 <0f> 0b e9 b9 fe ff ff e8 69 c6 f2 e0 85 c0 75 92 48 c7 c2 78 d0 2d
      [22.756639] RSP: 0018:ffffc90000f1fd38 EFLAGS: 00010282
      [22.756642] RAX: 0000000000000000 RBX: ffff8801f7ab0000 RCX: 0000000000000006
      [22.756643] RDX: 0000000000000006 RSI: ffffffff8212886a RDI: ffffffff820d6d57
      [22.756645] RBP: 0000000000011020 R08: 0000000043e3d1a8 R09: 0000000000000000
      [22.756647] R10: ffffc90000f1fd80 R11: 0000000000000000 R12: 0000000000000001
      [22.756649] R13: ffff8801f7ab0068 R14: 0000000000000001 R15: ffff88020d53d188
      [22.756651] FS:  00007f2878849980(0000) GS:ffff880213a00000(0000) knlGS:0000000000000000
      [22.756653] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [22.756655] CR2: 00005638deedf028 CR3: 0000000203292001 CR4: 00000000000206f0
      [22.756657] Call Trace:
      [22.756689]  i915_mch_val+0x1b/0x60 [i915]
      [22.756721]  i915_emon_status+0x45/0xd0 [i915]
      [22.756730]  seq_read+0xdb/0x3c0
      [22.756736]  ? lockdep_hardirqs_off+0x94/0xd0
      [22.756740]  ? __slab_free+0x24e/0x510
      [22.756746]  full_proxy_read+0x52/0x90
      [22.756752]  __vfs_read+0x31/0x170
      [22.756759]  ? do_sys_open+0x13b/0x240
      [22.756763]  ? rcu_read_lock_sched_held+0x6f/0x80
      [22.756766]  vfs_read+0x9e/0x140
      [22.756770]  ksys_read+0x50/0xc0
      [22.756775]  do_syscall_64+0x55/0x190
      [22.756781]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [22.756783] RIP: 0033:0x7f28781dc34e
      [22.756786] Code: 00 00 00 00 48 8b 15 71 8c 20 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff c3 0f 1f 40 00 8b 05 ba d0 20 00 85 c0 75 16 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 5a f3 c3 0f 1f 84 00 00 00 00 00 41 54 55 49
      [22.756787] RSP: 002b:00007ffd33fa0d08 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
      [22.756790] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f28781dc34e
      [22.756792] RDX: 0000000000000200 RSI: 00007ffd33fa0d50 RDI: 0000000000000008
      [22.756794] RBP: 00007ffd33fa0f60 R08: 0000000000000000 R09: 0000000000000020
      [22.756796] R10: 0000000000000000 R11: 0000000000000246 R12: 00005638de45c2c0
      [22.756797] R13: 00007ffd33fa14b0 R14: 0000000000000000 R15: 0000000000000000
      [22.756806] irq event stamp: 47950
      [22.756811] hardirqs last  enabled at (47949): [<ffffffff810fba74>] vprintk_emit+0x124/0x320
      [22.756813] hardirqs last disabled at (47950): [<ffffffff810019b0>] trace_hardirqs_off_thunk+0x1a/0x1c
      [22.756816] softirqs last  enabled at (47518): [<ffffffff81c0033a>] __do_softirq+0x33a/0x4b9
      [22.756820] softirqs last disabled at (47479): [<ffffffff8108df29>] irq_exit+0xa9/0xc0
      [22.756858] WARNING: CPU: 0 PID: 1058 at drivers/gpu/drm/i915/intel_drv.h:2104 gen5_read32+0x16b/0x1a0 [i915]
      [22.756860] ---[ end trace bf56fa7d6a3cbf7a ]
      Signed-off-by: NJosé Roberto de Souza <jose.souza@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181119230101.32460-1-jose.souza@intel.com
      cab870b7
  25. 08 11月, 2018 1 次提交
    • L
      drm/i915: Add short HPD IRQ storm detection for non-MST systems · 9a64c650
      Lyude Paul 提交于
      Unfortunately, it seems that the HPD IRQ storm problem from the early
      days of Intel GPUs was never entirely solved, only mostly. Within the
      last couple of days, I got a bug report from one of our customers who
      had been having issues with their machine suddenly booting up very
      slowly after having updated. The amount of time it took to boot went
      from around 30 seconds, to over 6 minutes consistently.
      
      After some investigation, I discovered that i915 was reporting massive
      amounts of short HPD IRQ spam on this system from the DisplayPort port,
      despite there not being anything actually connected. The symptoms would
      start with one "long" HPD IRQ being detected at boot:
      
      [    1.891398] [drm:intel_get_hpd_pins [i915]] hotplug event received, stat 0x00440000, dig 0x00440000, pins 0x000000a0
      [    1.891436] [drm:intel_hpd_irq_handler [i915]] digital hpd port B - long
      [    1.891472] [drm:intel_hpd_irq_handler [i915]] Received HPD interrupt on PIN 5 - cnt: 0
      [    1.891508] [drm:intel_hpd_irq_handler [i915]] digital hpd port D - long
      [    1.891544] [drm:intel_hpd_irq_handler [i915]] Received HPD interrupt on PIN 7 - cnt: 0
      [    1.891592] [drm:intel_dp_hpd_pulse [i915]] got hpd irq on port B - long
      [    1.891628] [drm:intel_dp_hpd_pulse [i915]] got hpd irq on port D - long
      …
      
      followed by constant short IRQs afterwards:
      
      [    1.895091] [drm:intel_encoder_hotplug [i915]] [CONNECTOR:66:DP-1] status updated from unknown to disconnected
      [    1.895129] [drm:i915_hotplug_work_func [i915]] Connector DP-3 (pin 7) received hotplug event.
      [    1.895165] [drm:intel_dp_detect [i915]] [CONNECTOR:72:DP-3]
      [    1.895275] [drm:intel_get_hpd_pins [i915]] hotplug event received, stat 0x00200000, dig 0x00200000, pins 0x00000080
      [    1.895312] [drm:intel_hpd_irq_handler [i915]] digital hpd port D - short
      [    1.895762] [drm:intel_get_hpd_pins [i915]] hotplug event received, stat 0x00200000, dig 0x00200000, pins 0x00000080
      [    1.895799] [drm:intel_hpd_irq_handler [i915]] digital hpd port D - short
      [    1.896239] [drm:intel_dp_aux_xfer [i915]] dp_aux_ch timeout status 0x71450085
      [    1.896293] [drm:intel_get_hpd_pins [i915]] hotplug event received, stat 0x00200000, dig 0x00200000, pins 0x00000080
      [    1.896330] [drm:intel_hpd_irq_handler [i915]] digital hpd port D - short
      [    1.896781] [drm:intel_get_hpd_pins [i915]] hotplug event received, stat 0x00200000, dig 0x00200000, pins 0x00000080
      [    1.896817] [drm:intel_hpd_irq_handler [i915]] digital hpd port D - short
      [    1.897275] [drm:intel_get_hpd_pins [i915]] hotplug event received, stat 0x00200000, dig 0x00200000, pins 0x00000080
      
      The customer's system in question has a GM45 GPU, which is apparently
      well known for hotplugging storms.
      
      So, workaround this impressively broken hardware by changing the default
      HPD storm threshold from 5 to 50. Then, make long IRQs count for 10, and
      short IRQs count for 1. This makes it so that 5 long IRQs will trigger
      an HPD storm, and on systems with short HPD storm detection 50 short
      IRQs will trigger an HPD storm. 50 short IRQs amounts to 100ms of
      constant pulsing, which seems like a good middleground between being too
      sensitive and not being sensitive enough (which would cause visible
      stutters in userspace every time a storm occurs).
      
      And just to be extra safe: we don't enable this by default on systems
      with MST support. There's too high of a chance of MST support triggering
      storm detection, and systems that are new enough to support MST are a
      lot less likely to have issues with IRQ storms anyway.
      
      As a note: this patch was tested using a ThinkPad T450s and a Chamelium
      to simulate the short IRQ storms.
      
      Changes since v1:
      - Don't use two separate thresholds, just make long IRQs count for 10
        each and short IRQs count for 1. This simplifies the code a bit
        - Ville Syrjälä
      Changes since v2:
      - Document @long_hpd in intel_hpd_irq_storm_detect, no functional
        changes
      Changes since v4:
      - Remove !! in long_hpd assignment - Ville Syrjälä
      - queue_hp = true - Ville Syrjälä
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181106213017.14563-6-lyude@redhat.com
      9a64c650