1. 27 7月, 2017 1 次提交
  2. 21 7月, 2017 1 次提交
  3. 20 7月, 2017 1 次提交
  4. 18 7月, 2017 1 次提交
  5. 28 6月, 2017 1 次提交
    • C
      drm/i915: Avoid keeping waitboost active for signaling threads · 7b92c1bd
      Chris Wilson 提交于
      Once a client has requested a waitboost, we keep that waitboost active
      until all clients are no longer waiting. This is because we don't
      distinguish which waiter deserves the boost. However, with the advent of
      fence signaling, the signaler threads appear as waiters to the RPS
      interrupt handler. So instead of using a single boolean to track when to
      keep the waitboost active, use a counter of all outstanding waitboosted
      requests.
      
      At this point, I have removed all vestiges of the rate limiting on
      clients. Whilst this means that compositors should remain more fluid,
      it also means that boosts are more prevalent. See commit b29c19b6
      ("drm/i915: Boost RPS frequency for CPU stalls") for a longer discussion
      on the pros and cons of both approaches.
      
      A drawback of this implementation is that it requires constant request
      submission to keep the waitboost trimmed (as it is now cancelled when the
      request is completed). This will be fine for a busy system, but near
      idle the boosts may be kept for longer than desired (effectively tens of
      vblanks worstcase) and there is a reliance on rc6 instead.
      
      v2: Remove defunct rps.client_lock
      Reported-by: NMichał Winiarski <michal.winiarski@intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Reviewed-by: NMichał Winiarski <michal.winiarski@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170628123548.9236-1-chris@chris-wilson.co.uk
      7b92c1bd
  6. 23 6月, 2017 1 次提交
    • C
      drm/i915: Break modeset deadlocks on reset · 36703e79
      Chris Wilson 提交于
      Trying to do a modeset from within a reset is fraught with danger. We
      can fall into a cyclic deadlock where the modeset is waiting on a
      previous modeset that is waiting on a request, and since the GPU hung
      that request completion is waiting on the reset. As modesetting doesn't
      allow its locks to be broken and restarted, or for its *own* reset
      mechanism to take over the display, we have to do something very
      evil instead. If we detect that we are stuck waiting to prepare the
      display reset (by using a very simple timeout), resort to cancelling all
      in-flight requests and throwing the user data into /dev/null, which is
      marginally better than the driver locking up and keeping that data to
      itself.
      
      This is not a fix; this is just a workaround that unbreaks machines
      until we can resolve the deadlock in a way that doesn't lose data!
      
      v2: Move the retirement from set-wegded to the i915_reset() error path,
      after which we no longer any delayed worker cleanup for
      i915_handle_error()
      v3: C abuse for syntactic sugar
      v4: Cover all waits with the timeout to catch more driver breakage
      
      References: https://bugs.freedesktop.org/show_bug.cgi?id=99093Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170622105625.16952-1-chris@chris-wilson.co.ukReviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      36703e79
  7. 21 6月, 2017 2 次提交
    • M
      drm/i915: Modify error handler for per engine hang recovery · 142bc7d9
      Michel Thierry 提交于
      This is a preparatory patch which modifies error handler to do per engine
      hang recovery. The actual patch which implements this sequence follows
      later in the series. The aim is to prepare existing recovery function to
      adapt to this new function where applicable (which fails at this point
      because core implementation is lacking) and continue recovery using legacy
      full gpu reset.
      
      A helper function is also added to query the availability of engine
      reset. A subsequent patch will add the capability to query which type
      of reset is present (engine -> full -> no-reset) via the get-param
      ioctl.
      
      It has been decided that the error events that are used to notify user of
      reset will only be sent in case if full chip reset. In case of just
      single (or multiple) engine resets, userspace won't be notified by these
      events.
      
      Note that this implementation of engine reset is for i915 directly
      submitting to the ELSP, where the driver manages the hang detection,
      recovery and resubmission. With GuC submission these tasks are shared
      between driver and firmware; i915 will still responsible for detecting a
      hang, and when it does it will have to request GuC to reset that Engine and
      remind the firmware about the outstanding submissions. This will be
      added in different patch.
      
      v2: rebase, advertise engine reset availability in platform definition,
      add note about GuC submission.
      v3: s/*engine_reset*/*reset_engine*/. (Chris)
      Handle reset as 2 level resets, by first going to engine only and fall
      backing to full/chip reset as needed, i.e. reset_engine will need the
      struct_mutex.
      v4: Pass the engine mask to i915_reset. (Chris)
      v5: Rebase, update selftests.
      v6: Rebase, prepare for mutex-less reset engine.
      v7: Pass reset_engine mask as a function parameter, and iterate over the
      engine mask for reset_engine. (Chris)
      v8: Use i915.reset >=2 in has_reset_engine; remove redundant reset
      logging; add a reset-engine-in-progress flag to prevent concurrent
      resets, and avoid dual purposing of reset-backoff. (Chris)
      v9: Support reset of different engines in parallel (Chris)
      v10: Handle reset-engine flag locking better (Chris)
      v11: Squash in reporting of per-engine-reset availability.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: NIan Lister <ian.lister@intel.com>
      Signed-off-by: NTomas Elf <tomas.elf@intel.com>
      Signed-off-by: NArun Siluvery <arun.siluvery@linux.intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170615201828.23144-4-michel.thierry@intel.comReviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170620095751.13127-5-chris@chris-wilson.co.uk
      142bc7d9
    • C
      drm/i915: Wait for concurrent global resets to complete · d5367307
      Chris Wilson 提交于
      If we enter i915_handle_error() a second time and a global reset is
      already in progress, we can simply wait for completion of the first
      reset. Currently we exit early prior to the actual reset being
      performed -- the worst of both worlds!
      
      v2: Plug into the existing reset_queue, and remember that kselftests is
      playing games with I915_RESET_BACKOFF to prevent hangcheck from screwing
      up.
      v3: Rename to i915_reset_device to fit in better with i915_reset_engine
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170620095751.13127-2-chris@chris-wilson.co.uk
      d5367307
  8. 20 6月, 2017 1 次提交
  9. 03 6月, 2017 1 次提交
  10. 26 5月, 2017 1 次提交
  11. 17 5月, 2017 3 次提交
    • C
      drm/i915: Don't force serialisation on marking up execlists irq posted · 955a4b89
      Chris Wilson 提交于
      Since we coordinate with the execlists tasklet using a locked schedule
      operation that ensures that after we set the engine->irq_posted we
      always have an invocation of the tasklet, we do not need to use a locked
      operation to set the engine->irq_posted itself.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170517121007.27224-12-chris@chris-wilson.co.uk
      955a4b89
    • C
      drm/i915: Stop inlining the execlists IRQ handler · 5d3d69d5
      Chris Wilson 提交于
      As the handler is now quite complex, involving a few atomics, the cost
      of the function preamble is negligible in comparison and so we should
      leave the function out-of-line for better I$.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170517121007.27224-11-chris@chris-wilson.co.uk
      5d3d69d5
    • C
      drm/i915: Don't mark an execlists context-switch when idle · a4b2b015
      Chris Wilson 提交于
      If we *know* that the engine is idle, i.e. we have not more contexts in
      flight, we can skip any spurious CSB idle interrupts. These spurious
      interrupts seem to arrive long after we assert that the engines are
      completely idle, triggering later assertions:
      
      [  178.896646] intel_engine_is_idle(bcs): interrupt not handled, irq_posted=2
      [  178.896655] ------------[ cut here ]------------
      [  178.896658] kernel BUG at drivers/gpu/drm/i915/intel_engine_cs.c:226!
      [  178.896661] invalid opcode: 0000 [#1] SMP
      [  178.896663] Modules linked in: i915(E) x86_pkg_temp_thermal(E) crct10dif_pclmul(E) crc32_pclmul(E) crc32c_intel(E) ghash_clmulni_intel(E) nls_ascii(E) nls_cp437(E) vfat(E) fat(E) intel_gtt(E) i2c_algo_bit(E) drm_kms_helper(E) syscopyarea(E) sysfillrect(E) sysimgblt(E) fb_sys_fops(E) aesni_intel(E) prime_numbers(E) evdev(E) aes_x86_64(E) drm(E) crypto_simd(E) cryptd(E) glue_helper(E) mei_me(E) mei(E) lpc_ich(E) efivars(E) mfd_core(E) battery(E) video(E) acpi_pad(E) button(E) tpm_tis(E) tpm_tis_core(E) tpm(E) autofs4(E) i2c_i801(E) fan(E) thermal(E) i2c_designware_platform(E) i2c_designware_core(E)
      [  178.896694] CPU: 1 PID: 522 Comm: gem_exec_whispe Tainted: G            E   4.11.0-rc5+ #14
      [  178.896702] task: ffff88040aba8d40 task.stack: ffffc900003f0000
      [  178.896722] RIP: 0010:intel_engine_init_global_seqno+0x1db/0x1f0 [i915]
      [  178.896725] RSP: 0018:ffffc900003f3ab0 EFLAGS: 00010246
      [  178.896728] RAX: 0000000000000000 RBX: ffff88040af54000 RCX: 0000000000000000
      [  178.896731] RDX: ffff88041ec933e0 RSI: ffff88041ec8cc48 RDI: ffff88041ec8cc48
      [  178.896734] RBP: ffffc900003f3ac8 R08: 0000000000000000 R09: 000000000000047d
      [  178.896736] R10: 0000000000000040 R11: ffff88040b344f80 R12: 0000000000000000
      [  178.896739] R13: ffff88040bce0000 R14: ffff88040bce52d8 R15: ffff88040bce0000
      [  178.896742] FS:  00007f2cccc2d8c0(0000) GS:ffff88041ec80000(0000) knlGS:0000000000000000
      [  178.896746] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  178.896749] CR2: 00007f41ddd8f000 CR3: 000000040bb03000 CR4: 00000000001406e0
      [  178.896752] Call Trace:
      [  178.896768]  reset_all_global_seqno.part.33+0x4e/0xd0 [i915]
      [  178.896782]  i915_gem_request_alloc+0x304/0x330 [i915]
      [  178.896795]  i915_gem_do_execbuffer+0x8a1/0x17d0 [i915]
      [  178.896799]  ? remove_wait_queue+0x48/0x50
      [  178.896812]  ? i915_wait_request+0x300/0x590 [i915]
      [  178.896816]  ? wake_up_q+0x70/0x70
      [  178.896819]  ? refcount_dec_and_test+0x11/0x20
      [  178.896823]  ? reservation_object_add_excl_fence+0xa5/0x100
      [  178.896835]  i915_gem_execbuffer2+0xab/0x1f0 [i915]
      [  178.896844]  drm_ioctl+0x1e6/0x460 [drm]
      [  178.896858]  ? i915_gem_execbuffer+0x260/0x260 [i915]
      [  178.896862]  ? dput+0xcf/0x250
      [  178.896866]  ? full_proxy_release+0x66/0x80
      [  178.896869]  ? mntput+0x1f/0x30
      [  178.896872]  do_vfs_ioctl+0x8f/0x5b0
      [  178.896875]  ? ____fput+0x9/0x10
      [  178.896878]  ? task_work_run+0x80/0xa0
      [  178.896881]  SyS_ioctl+0x3c/0x70
      [  178.896885]  entry_SYSCALL_64_fastpath+0x17/0x98
      [  178.896888] RIP: 0033:0x7f2ccb455ca7
      [  178.896890] RSP: 002b:00007ffcabec72d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      [  178.896894] RAX: ffffffffffffffda RBX: 000055f897a44b90 RCX: 00007f2ccb455ca7
      [  178.896897] RDX: 00007ffcabec74a0 RSI: 0000000040406469 RDI: 0000000000000003
      [  178.896900] RBP: 00007f2ccb70a440 R08: 00007f2ccb70d0a4 R09: 0000000000000000
      [  178.896903] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
      [  178.896905] R13: 000055f89782d71a R14: 00007ffcabecf838 R15: 0000000000000003
      [  178.896908] Code: 00 31 d2 4c 89 ef 8d 70 48 41 ff 95 f8 06 00 00 e9 68 fe ff ff be 0f 00 00 00 48 c7 c7 48 dc 37 a0 e8 fa 33 d6 e0 e9 0b ff ff ff <0f> 0b 0f 0b 0f 0b 0f 0b 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00
      
      On the other hand, by ignoring the interrupt do we risk running out of
      space in CSB ring? Testing for a few hours suggests not, i.e. that we
      only seem to get the odd delayed CSB idle notification.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170517121007.27224-6-chris@chris-wilson.co.uk
      a4b2b015
  12. 10 5月, 2017 4 次提交
    • D
      drm/vblank: Lock down vblank->hwmode more · 5caa0fea
      Daniel Vetter 提交于
      In the previous patch we've implemented hwmode tracking a la i915 for
      the vblank timestamp calculations. But that was just the basic
      semantics, i915 has some nice sanity checks to make sure we keep
      getting this right. Move them over too.
      
      v2:
      - WARN_ON_ONCE to avoid excessive spam (Ville)
      - Really only WARN on atomic drivers.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
      Acked-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170509140329.24114-5-daniel.vetter@ffwll.ch
      5caa0fea
    • D
      drm/vblank: drop the mode argument from drm_calc_vbltimestamp_from_scanoutpos · 1bf6ad62
      Daniel Vetter 提交于
      If we restrict this helper to only kms drivers (which is the case) we
      can look up the correct mode easily ourselves. But it's a bit tricky:
      
      - All legacy drivers look at crtc->hwmode. But that is updated already
        at the beginning of the modeset helper, which means when we disable
        a pipe. Hence the final timestamps might be a bit off. But since
        this is an existing bug I'm not going to change it, but just try to
        be bug-for-bug compatible with the current code. This only applies
        to radeon&amdgpu.
      
      - i915 tries to get it perfect by updating crtc->hwmode when the pipe
        is off (i.e. vblank->enabled = false).
      
      - All other atomic drivers look at crtc->state->adjusted_mode. Those
        that look at state->requested_mode simply don't adjust their mode,
        so it's the same. That has two problems: Accessing crtc->state from
        interrupt handling code is unsafe, and it's updated before we shut
        down the pipe. For nonblocking modesets it's even worse.
      
      For atomic drivers try to implement what i915 does. To do that we add
      a new hwmode field to the vblank structure, and update it from
      drm_calc_timestamping_constants(). For atomic drivers that's called
      from the right spot by the helper library already, so all fine. But
      for safety let's enforce that.
      
      For legacy driver this function is only called at the end (oh the
      fun), which is broken, so again let's not bother and just stay
      bug-for-bug compatible.
      
      The  benefit is that we can use drm_calc_vbltimestamp_from_scanoutpos
      directly to implement ->get_vblank_timestamp in every driver, deleting
      a lot of code.
      
      v2: Completely new approach, trying to mimick the i915 solution.
      
      v3: Fixup kerneldoc.
      
      v4: Drop the WARN_ON to check that the vblank is off, atomic helpers
      currently unconditionally call this. Recomputing the same stuff should
      be harmless.
      
      v5: Fix typos and move misplaced hunks to the right patches (Neil).
      
      v6: Undo hunk movement (kbuild).
      
      Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: linux-arm-msm@vger.kernel.org
      Cc: freedreno@lists.freedesktop.org
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
      Acked-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170509140329.24114-4-daniel.vetter@ffwll.ch
      1bf6ad62
    • D
      drm/vblank: Switch to bool in_vblank_irq in get_vblank_timestamp · 3fcdcb27
      Daniel Vetter 提交于
      It's overkill to have a flag parameter which is essentially used just
      as a boolean. This takes care of core + adjusting drivers.
      
      Adjusting the scanout position callback is a bit harder, since radeon
      also supplies it's own driver-private flags in there.
      
      v2: Fixup misplaced hunks (Neil).
      
      v3: kbuild says v1 was better ...
      
      Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: linux-arm-msm@vger.kernel.org
      Cc: freedreno@lists.freedesktop.org
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170509140329.24114-2-daniel.vetter@ffwll.ch
      3fcdcb27
    • D
      drm/vblank: Switch drm_driver->get_vblank_timestamp to return a bool · d673c02c
      Daniel Vetter 提交于
      There's really no reason for anything more:
      - Calling this while the crtc vblank stuff isn't set up is a driver
        bug. Those places alrready DRM_ERROR.
      - Calling this when the crtc is off is either a driver bug (calling
        drm_crtc_handle_vblank at the wrong time) or a core bug (for
        anything else). Again, we DRM_ERROR.
      - EINVAL is checked at higher levels already, and if we'd use struct
        drm_crtc * instead of (dev, pipe) it would be real obvious that
        those are again core bugs.
      
      The only valid failure mode is crap hardware that couldn't sample a
      useful timestamp, to ask the core to just grab a not-so-accurate
      timestamp. Bool is perfectly fine for that.
      
      v2: Also fix up the one caller, I lost that in the shuffling (Jani).
      
      v3: Fixup commit message (Neil).
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: linux-arm-msm@vger.kernel.org
      Cc: freedreno@lists.freedesktop.org
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
      Acked-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170509140329.24114-1-daniel.vetter@ffwll.ch
      d673c02c
  13. 03 5月, 2017 1 次提交
    • V
      drm/i915: Stop pretending to mask/unmask LPE audio interrupts · ebf5f921
      Ville Syrjälä 提交于
      vlv_display_irq_postinstall() enables the LPE audio interrupts
      regardless of whether the LPE audio irq chip has masked/unmasked
      them. Also the irqchip masking/unmasking doesn't consider the state
      of the display power well or the device, and hence just leads to
      dmesg spew when it tries to access the hardware while it's powered
      down.
      
      If the current way works, then we don't need to do anything in the
      mask/unmask hooks. If it doesn't work, well, then we'd need to properly
      track whether the irqchip has masked/unmasked the interrupts when
      we enable display interrupts. And the mask/unmask hooks would need
      to check whether display interrupts are even enabled before frobbing
      with he registers.
      
      So let's just assume the current way works and neuter the mask/unmask
      hooks. Also clean up vlv_display_irq_postinstall() a bit and stop
      it from trying to unmask/enable the LPE C interrupt on VLV since it
      doesn't exist.
      
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-4-ville.syrjala@linux.intel.comReviewed-by: NTakashi Iwai <tiwai@suse.de>
      ebf5f921
  14. 02 5月, 2017 1 次提交
  15. 26 4月, 2017 1 次提交
  16. 18 4月, 2017 1 次提交
  17. 23 3月, 2017 1 次提交
  18. 17 3月, 2017 1 次提交
  19. 16 3月, 2017 4 次提交
  20. 15 3月, 2017 1 次提交
  21. 14 3月, 2017 4 次提交
  22. 13 3月, 2017 2 次提交
  23. 12 3月, 2017 2 次提交
  24. 10 3月, 2017 3 次提交