1. 13 11月, 2019 2 次提交
  2. 06 9月, 2019 1 次提交
    • L
      drm/i915: Call dma_set_max_seg_size() in i915_driver_hw_probe() · 68b58d39
      Lyude Paul 提交于
      commit 32f0a982650b123bdab36865617d3e03ebcacf3b upstream.
      
      Currently, we don't call dma_set_max_seg_size() for i915 because we
      intentionally do not limit the segment length that the device supports.
      However, this results in a warning being emitted if we try to map
      anything larger than SZ_64K on a kernel with CONFIG_DMA_API_DEBUG_SG
      enabled:
      
      [    7.751926] DMA-API: i915 0000:00:02.0: mapping sg segment longer
      than device claims to support [len=98304] [max=65536]
      [    7.751934] WARNING: CPU: 5 PID: 474 at kernel/dma/debug.c:1220
      debug_dma_map_sg+0x20f/0x340
      
      This was originally brought up on
      https://bugs.freedesktop.org/show_bug.cgi?id=108517 , and the consensus
      there was it wasn't really useful to set a limit (and that dma-debug
      isn't really all that useful for i915 in the first place). Unfortunately
      though, CONFIG_DMA_API_DEBUG_SG is enabled in the debug configs for
      various distro kernels. Since a WARN_ON() will disable automatic problem
      reporting (and cause any CI with said option enabled to start
      complaining), we really should just fix the problem.
      
      Note that as me and Chris Wilson discussed, the other solution for this
      would be to make DMA-API not make such assumptions when a driver hasn't
      explicitly set a maximum segment size. But, taking a look at the commit
      which originally introduced this behavior, commit 78c47830
      ("dma-debug: check scatterlist segments"), there is an explicit mention
      of this assumption and how it applies to devices with no segment size:
      
      	Conversely, devices which are less limited than the rather
      	conservative defaults, or indeed have no limitations at all
      	(e.g. GPUs with their own internal MMU), should be encouraged to
      	set appropriate dma_parms, as they may get more efficient DMA
      	mapping performance out of it.
      
      So unless there's any concerns (I'm open to discussion!), let's just
      follow suite and call dma_set_max_seg_size() with UINT_MAX as our limit
      to silence any warnings.
      
      Changes since v3:
      * Drop patch for enabling CONFIG_DMA_API_DEBUG_SG in CI. It looks like
        just turning it on causes the kernel to spit out bogus WARN_ONs()
        during some igt tests which would otherwise require teaching igt to
        disable the various DMA-API debugging options causing this. This is
        too much work to be worth it, since DMA-API debugging is useless for
        us. So, we'll just settle with this single patch to squelch WARN_ONs()
        during driver load for users that have CONFIG_DMA_API_DEBUG_SG turned
        on for some reason.
      * Move dma_set_max_seg_size() call into i915_driver_hw_probe() - Chris
        Wilson
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: <stable@vger.kernel.org> # v4.18+
      Link: https://patchwork.freedesktop.org/patch/msgid/20190823205251.14298-1-lyude@redhat.com
      (cherry picked from commit acd674af95d3f627062007429b9c195c6b32361d)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      68b58d39
  3. 19 7月, 2018 1 次提交
  4. 16 7月, 2018 1 次提交
  5. 13 7月, 2018 1 次提交
  6. 10 7月, 2018 3 次提交
    • C
      drm/i915: Unwind HW init after GVT setup failure · 7ab87ede
      Chris Wilson 提交于
      Following intel_gvt_init() failure, we missed unwinding our setup
      leaving pointers dangling past the module unload. For our example, the
      pm_qos:
      
      [  441.057615] top: 000000006b3baf1c, n: 0000000054d8ef33, p: 0000000097cdf1a2
                     prev: 0000000054d8ef33, n: 0000000097cdf1a2, p: 000000006b3baf1c
                     next: 0000000097cdf1a2, n: 000000006de8fc8b, p: 0000000081087253
      [  441.057627] WARNING: CPU: 4 PID: 9277 at lib/plist.c:42 plist_check_prev_next+0x2d/0x40
      [  441.057628] Modules linked in: i915(+) vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core e1000e snd_pcm mei_me mei prime_numbers [last unloaded: i915]
      [  441.057652] CPU: 4 PID: 9277 Comm: drv_selftest Tainted: G     U            4.18.0-rc4-CI-CI_DRM_4464+ #1
      [  441.057653] Hardware name: System manufacturer System Product Name/Z170 PRO GAMING, BIOS 3402 04/26/2017
      [  441.057656] RIP: 0010:plist_check_prev_next+0x2d/0x40
      [  441.057657] Code: 08 48 39 f0 74 2b 49 89 f0 48 8b 4f 08 50 ff 32 52 48 89 fe 41 ff 70 08 48 8b 17 48 c7 c7 d8 ae 14 82 4d 8b 08 e8 63 0e 76 ff <0f> 0b 48 83 c4 20 c3 48 39 10 75 d0 f3 c3 0f 1f 44 00 00 41 54 55
      [  441.057717] RSP: 0018:ffffc900003a3a68 EFLAGS: 00010082
      [  441.057720] RAX: 0000000000000000 RBX: ffff8802193978c0 RCX: 0000000000000002
      [  441.057721] RDX: 0000000080000002 RSI: ffffffff820c65a4 RDI: 00000000ffffffff
      [  441.057722] RBP: ffff8802193978c0 R08: 0000000000000000 R09: 0000000000000001
      [  441.057724] R10: ffffc900003a3a70 R11: 0000000000000000 R12: ffffffff82243de0
      [  441.057725] R13: ffffffff82243de0 R14: ffff88021a6c78c0 R15: 0000000077359400
      [  441.057726] FS:  00007fc23a4a9980(0000) GS:ffff880236d00000(0000) knlGS:0000000000000000
      [  441.057728] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  441.057729] CR2: 0000563e4503d038 CR3: 0000000138f86005 CR4: 00000000003606e0
      [  441.057730] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  441.057731] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  441.057732] Call Trace:
      [  441.057736]  plist_check_list+0x2e/0x40
      [  441.057738]  plist_add+0x23/0x130
      [  441.057743]  pm_qos_update_target+0x1bd/0x2f0
      [  441.057771]  i915_driver_load+0xec4/0x1060 [i915]
      [  441.057775]  ? trace_hardirqs_on_caller+0xe0/0x1b0
      [  441.057800]  i915_pci_probe+0x29/0x90 [i915]
      [  441.057804]  pci_device_probe+0xa1/0x130
      [  441.057807]  driver_probe_device+0x306/0x480
      [  441.057810]  __driver_attach+0xdb/0x100
      [  441.057812]  ? driver_probe_device+0x480/0x480
      [  441.057813]  ? driver_probe_device+0x480/0x480
      [  441.057816]  bus_for_each_dev+0x74/0xc0
      [  441.057819]  bus_add_driver+0x15f/0x250
      [  441.057821]  ? 0xffffffffa0696000
      [  441.057823]  driver_register+0x56/0xe0
      [  441.057825]  ? 0xffffffffa0696000
      [  441.057827]  do_one_initcall+0x58/0x370
      [  441.057830]  ? do_init_module+0x1d/0x1ea
      [  441.057832]  ? rcu_read_lock_sched_held+0x6f/0x80
      [  441.057834]  ? kmem_cache_alloc_trace+0x282/0x2e0
      [  441.057838]  do_init_module+0x56/0x1ea
      [  441.057841]  load_module+0x2435/0x2b20
      [  441.057852]  ? __se_sys_finit_module+0xd3/0xf0
      [  441.057854]  __se_sys_finit_module+0xd3/0xf0
      [  441.057861]  do_syscall_64+0x55/0x190
      [  441.057863]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [  441.057865] RIP: 0033:0x7fc239d75839
      [  441.057866] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f f6 2c 00 f7 d8 64 89 01 48
      [  441.057927] RSP: 002b:00007fffb7825d38 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
      [  441.057930] RAX: ffffffffffffffda RBX: 0000563e45035dd0 RCX: 00007fc239d75839
      [  441.057931] RDX: 0000000000000000 RSI: 0000563e4502f8a0 RDI: 0000000000000004
      [  441.057932] RBP: 0000563e4502f8a0 R08: 0000000000000004 R09: 0000000000000000
      [  441.057933] R10: 00007fffb7825ea0 R11: 0000000000000246 R12: 0000000000000000
      [  441.057934] R13: 0000563e4502f690 R14: 0000000000000000 R15: 000000000000003f
      [  441.057940] irq event stamp: 231338
      [  441.057943] hardirqs last  enabled at (231337): [<ffffffff8193e3fc>] _raw_spin_unlock_irqrestore+0x4c/0x60
      [  441.057944] hardirqs last disabled at (231338): [<ffffffff8193e26d>] _raw_spin_lock_irqsave+0xd/0x50
      [  441.057947] softirqs last  enabled at (231024): [<ffffffff81c0034f>] __do_softirq+0x34f/0x505
      [  441.057949] softirqs last disabled at (231005): [<ffffffff8108c7b9>] irq_exit+0xa9/0xc0
      [  441.057951] WARNING: CPU: 4 PID: 9277 at lib/plist.c:42 plist_check_prev_next+0x2d/0x40
      
      v2: Add a load failure point to intel_gvt_init() so that we always
      exercise this path in future.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107129Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Reviewed-by: NMichał Winiarski <michal.winiarski@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180710143821.1889-1-chris@chris-wilson.co.uk
      7ab87ede
    • C
      drm/i915: Cleanup modesetting on load-error path · 73bad7ca
      Chris Wilson 提交于
      After handling a critical failure initialising GEM we need to unwind the
      modesetting setup.
      
      Testcase: igt/drv_module_reload/basic-reload-inject
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180710094421.16223-2-chris@chris-wilson.co.ukReviewed-by: NMatthew Auld <matthew.auld@intel.com>
      73bad7ca
    • C
      drm/i915: Remove function details from device error messages · 8cff1f4a
      Chris Wilson 提交于
      Error messages are intended to be addressed to the user; be clear,
      succinct, instructive and unambiguous. Adding the function name to
      that message does not add any information the user requires and in
      the process makes the message less clear.
      
      E.g.
      
      [  245.539711] i915 0000:00:02.0: [drm:i915_gem_init [i915]] Failed to initialize GPU, declaring it wedged!
      
      becomes
      
      [  245.539711] i915 0000:00:02.0: Failed to initialize GPU, declaring it wedged!
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180709134858.12446-1-chris@chris-wilson.co.uk
      8cff1f4a
  7. 21 6月, 2018 1 次提交
  8. 18 6月, 2018 1 次提交
    • C
      drm/i915: Fix fallout of fake reset along resume · 4fdd5b4e
      Chris Wilson 提交于
      commit b2209e62 ("drm/i915/execlists: Reset the CSB head tracking on
      reset/sanitization") and commit 1288786b ("drm/i915: Move GEM sanitize
      from resume_early to resume") show the conflicting requirements on the
      code. We must reset the GPU before trashing live state on a fast resume
      (hibernation debug, or error paths), but we must only reset our state
      tracking iff the GPU is reset (or power cycled). This is tricky if we
      are disabling GPU reset to simulate broken hardware; we reset our state
      tracking but the GPU is left intact and recovers from its stale state.
      
      v2: Again without the assertion for forcewake, no longer required since
      commit b3ee09a4 ("drm/i915/ringbuffer: Fix context restore upon reset")
      as the contexts are reset from the CS ensuring everything is powered up.
      
      Fixes: b2209e62 ("drm/i915/execlists: Reset the CSB head tracking on reset/sanitization")
      Fixes: 1288786b ("drm/i915: Move GEM sanitize from resume_early to resume")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180616202534.18767-1-chris@chris-wilson.co.uk
      4fdd5b4e
  9. 14 6月, 2018 1 次提交
  10. 11 6月, 2018 4 次提交
  11. 07 6月, 2018 1 次提交
  12. 04 6月, 2018 1 次提交
  13. 02 6月, 2018 1 次提交
  14. 01 6月, 2018 1 次提交
  15. 25 5月, 2018 1 次提交
  16. 08 5月, 2018 1 次提交
  17. 03 5月, 2018 2 次提交
  18. 18 4月, 2018 1 次提交
  19. 15 4月, 2018 1 次提交
  20. 07 4月, 2018 2 次提交
    • C
      drm/i915: Pass the set of guilty engines to i915_reset() · d0667e9c
      Chris Wilson 提交于
      Currently, we rely on inspecting the hangcheck state from within the
      i915_reset() routines to determine which engines were guilty of the
      hang. This is problematic for cases where we want to run
      i915_handle_error() and call i915_reset() independently of hangcheck.
      Instead of relying on the indirect parameter passing, turn it into an
      explicit parameter providing the set of stalled engines which then are
      treated as guilty until proven innocent.
      
      While we are removing the implicit stalled parameter, also make the
      reason into an explicit parameter to i915_reset(). We still need a
      back-channel for i915_handle_error() to hand over the task to the locked
      waiter, but let's keep that its own channel rather than incriminate
      another.
      
      This leaves stalled/seqno as being private to hangcheck, with no more
      nefarious snooping by reset, be it whole-device or per-engine. \o/
      
      The only real issue now is that this makes it crystal clear that we
      don't actually do any testing of hangcheck per se in
      drv_selftest/live_hangcheck, merely of resets!
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Jeff McGee <jeff.mcgee@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180406220354.18911-2-chris@chris-wilson.co.uk
      d0667e9c
    • C
      drm/i915: Treat i915_reset_engine() as guilty until proven innocent · bba0869b
      Chris Wilson 提交于
      If we are resetting just one engine, we know it has stalled. So we can
      pass the stalled parameter directly to i915_gem_reset_engine(), which
      alleviates the necessity to poke at the generic engine->hangcheck.stalled
      magic variable, leaving that under control of hangcheck as its name
      implies. Other than simplifying by removing the indirect parameter along
      this path, this allows us to introduce new reset mechanisms that run
      independently of hangcheck.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Jeff McGee <jeff.mcgee@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180406220354.18911-1-chris@chris-wilson.co.uk
      bba0869b
  21. 06 4月, 2018 1 次提交
  22. 27 3月, 2018 1 次提交
    • I
      drm/i915: Fix hibernation with ACPI S0 target state · 300efa9e
      Imre Deak 提交于
      After
      
      commit dd9f31c7
      Author: Imre Deak <imre.deak@intel.com>
      Date:   Wed Aug 16 17:46:07 2017 +0300
      
          drm/i915/gen9+: Set same power state before hibernation image
          save/restore
      
      during hibernation/suspend the power domain functionality got disabled,
      after which resume could leave it incorrectly disabled if the ACPI
      target state was S0 during suspend and i915 was not loaded by the loader
      kernel.
      
      This was caused by not considering if we resumed from hibernation as the
      condition for power domains reiniting.
      
      Fix this by simply tracking if we suspended power domains during system
      suspend and reinit power domains accordingly during resume. This will
      result in reiniting power domains always when resuming from hibernation,
      regardless of the platform and whether or not i915 is loaded by the
      loader kernel.
      
      The reason we didn't catch this earlier is that the enabled/disabled
      state of power domains during PMSG_FREEZE/PMSG_QUIESCE is platform
      and kernel config dependent: on my SKL the target state is S4
      during PMSG_FREEZE and (with the driver loaded in the loader kernel)
      S0 during PMSG_QUIESCE. On the reporter's machine it's S0 during
      PMSG_FREEZE but (contrary to this) power domains are not initialized
      during PMSG_QUIESCE since i915 is not loaded in the loader kernel, or
      it's loaded but without the DMC firmware being available.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105196
      Reported-and-tested-by: amn-bas@hotmail.com
      Fixes: dd9f31c7 ("drm/i915/gen9+: Set same power state before hibernation image save/restore")
      Cc: amn-bas@hotmail.com
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180322143642.26883-1-imre.deak@intel.com
      (cherry picked from commit 0f90603c)
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      300efa9e
  23. 24 3月, 2018 3 次提交
  24. 21 3月, 2018 1 次提交
  25. 20 3月, 2018 2 次提交
    • C
      drm/i915: Add control flags to i915_handle_error() · ce800754
      Chris Wilson 提交于
      Not all callers want the GPU error to handled in the same way, so expose
      a control parameter. In the first instance, some callers do not want the
      heavyweight error capture so add a bit to request the state to be
      captured and saved.
      
      v2: Pass msg down to i915_reset/i915_reset_engine so that we include the
      reason for the reset in the dev_notice(), superseding the earlier option
      to not print that notice.
      v3: Stash the reason inside the i915->gpu_error to handover to the direct
      reset from the blocking waiter.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Jeff McGee <jeff.mcgee@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180320100449.1360-2-chris@chris-wilson.co.uk
      ce800754
    • O
      drm/i915/icl: Check for fused-off VDBOX and VEBOX instances · 26376a7e
      Oscar Mateo 提交于
      In Gen11, the Video Decode engines (aka VDBOX, aka VCS, aka BSD) and the
      Video Enhancement engines (aka VEBOX, aka VECS) could be fused off. Also,
      each VDBOX and VEBOX has its own power well, which only exist if the
      related engine exists in the HW.
      
      Unfortunately, we have a Catch-22 situation going on: we need the blitter
      forcewake to read the register with the fuse info, but we cannot initialize
      the forcewake domains without knowin about the engines present in the HW.
      We workaround this problem by allowing the initialization of all forcewake
      domains and then pruning the fused off ones, as per the fuse information.
      
      Bspec: 20680
      
      v2: We were shifting incorrectly for vebox disable (Vinay)
      
      v3: Assert mmio is ready and warn if we have attempted to initialize
          forcewake for fused-off engines (Paulo)
      
      v4:
        - Use INTEL_GEN in new code (Tvrtko)
        - Shorter local variable (Tvrtko, Michal)
        - Keep "if (!...) continue" style (Tvrtko)
        - No unnecessary BUG_ON (Tvrtko)
        - WARN_ON and cleanup if wrong mask (Tvrtko, Michal)
        - Use I915_READ_FW (Michal)
        - Use I915_MAX_VCS/VECS macros (Michal)
      
      v5: Rebased by Rodrigo fixing conflicts on top of:
          "drm/i915: Simplify intel_engines_init"
      
      v6: Fix v5. Remove info->num_rings. (by Oscar)
      
      v7: Rebase (Rodrigo).
      
      v8:
        - s/intel_device_info_fused_off_engines/
          intel_device_info_init_mmio (Chris)
        - Make vdbox_disable & vebox_disable local variables (Chris)
      
      v9:
        - Move function declaration to intel_device_info.h (Michal)
        - Missing indent in bit fields definitions (Michal)
        - When RC6 is enabled by BIOS, the fuse register cannot be read until
          the blitter powerwell is awake. Shuffle where the fuse is read, prune
          the forcewake domains after the fact and change the commit message
          accordingly (Vinay, Sagar, Chris).
      
      v10:
        - Improved commit message (Sagar)
        - New line in header file (Sagar)
        - Specify the message in fw_domain_reset applies to ICL+ (Sagar)
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Reviewed-by: NSagar Arun Kamble <sagar.a.kamble@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180316121456.11577-1-mika.kuoppala@linux.intel.com
      [Mika: soothe checkpatch on commit msg]
      Signed-off-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      26376a7e
  26. 19 3月, 2018 1 次提交
  27. 16 3月, 2018 1 次提交
    • C
      drm/i915: Stop engines when declaring the machine wedged · ac697ae8
      Chris Wilson 提交于
      If we fail to reset the GPU, we declare the machine wedged. However, the
      GPU may well still be running in the background with an in-flight
      request. So despite our efforts in cleaning up the request queue and
      faking the breadcrumb in the HWSP, the GPU may eventually write the
      in-flght seqno there breaking all of our assumptions and throwing the
      driver into a deep turmoil, wedging beyond wedged.
      
      To avoid this we ideally want to reset the GPU. Since that has already
      failed, make sure the rings have the stop bit set instead. This is part
      of the normal GPU reset sequence, but that is actually disabled by
      igt/gem_eio to force the wedged state. If we assume the worst, we must
      poke at the bit again before we give up.
      
      v2: Move the intel_gpu_reset() from set-wedged in the reset error path
      into i915_gem_set_wedged() itself. Even if the reset fails (e.g. if it is
      disabled by gem_eio), it still tries to make sure the engines are
      stopped. For i915_gem_set_wedged() callers from outside of i915_reset(),
      this should make sure the GPU is disabled while the driver is marked as
      being wedged.
      
      Testcase: igt/gem_eio
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180315151015.22741-1-chris@chris-wilson.co.uk
      ac697ae8
  28. 14 3月, 2018 1 次提交
    • J
      drm/i915: Implement dynamic GuC WOPCM offset and size calculation · 6b0478fb
      Jackie Li 提交于
      Hardware may have specific restrictions on GuC WOPCM offset and size. On
      Gen9, the value of the GuC WOPCM size register needs to be larger than the
      value of GuC WOPCM offset register + a Gen9 specific offset (144KB) for
      reserved GuC WOPCM. Fail to enforce such a restriction on GuC WOPCM size
      will lead to GuC firmware execution failures. On the other hand, with
      current static GuC WOPCM offset and size values (512KB for both offset and
      size), the GuC WOPCM size verification will fail on Gen9 even if it can be
      fixed by lowering the GuC WOPCM offset by calculating its value based on
      HuC firmware size (which is likely less than 200KB on Gen9), so that we can
      have a GuC WOPCM size value which is large enough to pass the GuC WOPCM
      size check.
      
      This patch updates the reserved GuC WOPCM size for RC6 context on Gen9 to
      24KB to strictly align with the Gen9 GuC WOPCM layout. It also adds support
      to verify the GuC WOPCM size aganist the Gen9 hardware restrictions. To
      meet all above requirements, let's provide dynamic partitioning of the
      WOPCM that will be based on platform specific HuC/GuC firmware sizes.
      
      v2:
       - Removed intel_wopcm_init (Ville/Sagar/Joonas)
       - Renamed and Moved the intel_wopcm_partition into intel_guc (Sagar)
       - Removed unnecessary function calls (Joonas)
       - Init GuC WOPCM partition as soon as firmware fetching is completed
      
      v3:
       - Fixed indentation issues (Chris)
       - Removed layering violation code (Chris/Michal)
       - Created separat files for GuC wopcm code  (Michal)
       - Used inline function to avoid code duplication (Michal)
      
      v4:
       - Preset the GuC WOPCM top during early GuC init (Chris)
       - Fail intel_uc_init_hw() as soon as GuC WOPCM partitioning failed
      
      v5:
       - Moved GuC DMA WOPCM register updating code into intel_wopcm.c
       - Took care of the locking status before writing to GuC DMA
         Write-Once registers. (Joonas)
      
      v6:
       - Made sure the GuC WOPCM size to be multiple of 4K (4K aligned)
      
      v8:
       - Updated comments and fixed naming issues (Sagar/Joonas)
       - Updated commit message to include more description about the hardware
         restriction on GuC WOPCM size (Sagar)
      
      v9:
       - Minor changes variable names and code comments (Sagar)
       - Added detailed GuC WOPCM layout drawing (Sagar/Michal)
       - Refined macro definitions to be reader friendly (Michal)
       - Removed redundent check to valid flag (Michal)
       - Unified first parameter for exported GuC WOPCM functions (Michal)
       - Refined the name and parameter list of hardware restriction checking
         functions (Michal)
      
      v10:
       - Used shorter function name for internal functions (Joonas)
       - Moved init-ealry function into c file (Joonas)
       - Consolidated and removed redundant size checks (Joonas/Michal)
       - Removed unnecessary unlikely() from code which is only called once
         during boot (Joonas)
       - More fixes to kernel-doc format and content (Michal)
       - Avoided the use of PAGE_MASK for 4K pages (Michal)
       - Added error log messages to error paths (Michal)
      
      v11:
       - Replaced intel_guc_wopcm with more generic intel_wopcm and attached
         intel_wopcm to drm_i915_private instead intel_guc (Michal)
       - dynamic calculation of GuC non-wopcm memory start (a.k.a WOPCM Top
         offset from GuC WOPCM base) (Michal)
       - Moved WOPCM marco definitions into .c source file (Michal)
       - Exported WOPCM layout diagram as kernel-doc (Michal)
      
      v12:
       - Updated naming, function kernel-doc to align with new changes (Michal)
      
      v13:
       - Updated the ordering of s-o-b/cc/r-b tags (Sagar)
       - Corrected one tense error in comment (Sagar)
       - Corrected typos and removed spurious comments (Joonas)
      
      Bspec: 12690
      Signed-off-by: NJackie Li <yaodong.li@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
      Cc: Sujaritha Sundaresan <sujaritha.sundaresan@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: John Spotswood <john.a.spotswood@intel.com>
      Cc: Oscar Mateo <oscar.mateo@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com> (v8)
      Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> (v9)
      Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com> (v11)
      Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> (v12)
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1520987574-19351-2-git-send-email-yaodong.li@intel.com
      6b0478fb
  29. 13 3月, 2018 1 次提交