1. 20 6月, 2017 1 次提交
  2. 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
  3. 26 4月, 2017 1 次提交
  4. 23 3月, 2017 1 次提交
  5. 17 3月, 2017 1 次提交
  6. 16 3月, 2017 4 次提交
  7. 15 3月, 2017 1 次提交
  8. 14 3月, 2017 4 次提交
  9. 13 3月, 2017 2 次提交
  10. 12 3月, 2017 2 次提交
  11. 10 3月, 2017 3 次提交
  12. 09 3月, 2017 1 次提交
  13. 04 3月, 2017 1 次提交
  14. 03 3月, 2017 2 次提交
    • C
      drm/i915: Take reference for signaling the request from hardirq · 24754d75
      Chris Wilson 提交于
      Being inside a spinlock signaling that the hardware just completed a
      request doesn't prevent a second thread already spotting that the
      request is complete, freeing it and reallocating it! The code currently
      tries to prevent this using RCU -- but that only prevents the request
      from being freed, it doesn't prevent us from reallocating it - that
      requires us to take a reference.
      
      [  206.922985] BUG: spinlock already unlocked on CPU#4, gem_exec_parall/7796
      [  206.922994]  lock: 0xffff8801c6047120, .magic: dead4ead, .owner: <none>/-1, .owner_cpu: -1
      [  206.923000] CPU: 4 PID: 7796 Comm: gem_exec_parall Not tainted 4.10.0-CI-Patchwork_4008+ #1
      [  206.923006] Hardware name: System manufacturer System Product Name/Z170M-PLUS, BIOS 1805 06/20/2016
      [  206.923012] Call Trace:
      [  206.923014]  <IRQ>
      [  206.923019]  dump_stack+0x67/0x92
      [  206.923023]  spin_dump+0x73/0xc0
      [  206.923027]  do_raw_spin_unlock+0x79/0xb0
      [  206.923031]  _raw_spin_unlock_irqrestore+0x27/0x60
      [  206.923042]  dma_fence_signal+0x160/0x230
      [  206.923060]  notify_ring+0xae/0x2e0 [i915]
      [  206.923073]  ? ibx_hpd_irq_handler+0xc0/0xc0 [i915]
      [  206.923086]  gen8_gt_irq_handler+0x219/0x290 [i915]
      [  206.923100]  gen8_irq_handler+0x8e/0x6b0 [i915]
      [  206.923105]  __handle_irq_event_percpu+0x58/0x370
      [  206.923109]  handle_irq_event_percpu+0x1e/0x50
      [  206.923113]  handle_irq_event+0x34/0x60
      [  206.923117]  handle_edge_irq+0xbe/0x150
      [  206.923122]  handle_irq+0x15/0x20
      [  206.923126]  do_IRQ+0x63/0x130
      [  206.923142]  ? i915_mutex_lock_interruptible+0x39/0x140 [i915]
      [  206.923148]  common_interrupt+0x90/0x90
      [  206.923153] RIP: 0010:osq_lock+0x77/0x110
      [  206.923157] RSP: 0018:ffffc90001cabaa0 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff6e
      [  206.923164] RAX: 0000000000000000 RBX: ffff880236d1abc0 RCX: ffff8801ef642fc0
      [  206.923169] RDX: ffff8801ef6427c0 RSI: ffffffff81c6e7fd RDI: ffffffff81c7c848
      [  206.923175] RBP: ffffc90001cabab8 R08: 00000000692bb19b R09: 08c1493200000000
      [  206.923180] R10: 0000000000000001 R11: 0000000000000001 R12: ffff880236cdabc0
      [  206.923185] R13: ffff8802207f00b0 R14: ffffffffa00b7cd9 R15: ffff8802207f0070
      [  206.923191]  </IRQ>
      [  206.923206]  ? i915_mutex_lock_interruptible+0x39/0x140 [i915]
      [  206.923213]  __mutex_lock+0x649/0x990
      [  206.923217]  ? __mutex_lock+0xb0/0x990
      [  206.923221]  ? _raw_spin_unlock+0x2c/0x50
      [  206.923226]  ? __pm_runtime_resume+0x56/0x80
      [  206.923242]  ? i915_mutex_lock_interruptible+0x39/0x140 [i915]
      [  206.923249]  mutex_lock_interruptible_nested+0x16/0x20
      [  206.923264]  i915_mutex_lock_interruptible+0x39/0x140 [i915]
      [  206.923270]  ? __pm_runtime_resume+0x56/0x80
      [  206.923285]  i915_gem_do_execbuffer.isra.15+0x442/0x1d10 [i915]
      [  206.923291]  ? __lock_acquire+0x449/0x1b50
      [  206.923296]  ? __might_fault+0x3e/0x90
      [  206.923301]  ? __might_fault+0x87/0x90
      [  206.923305]  ? __might_fault+0x3e/0x90
      [  206.923320]  i915_gem_execbuffer2+0xb5/0x220 [i915]
      [  206.923327]  drm_ioctl+0x200/0x450
      [  206.923341]  ? i915_gem_execbuffer+0x330/0x330 [i915]
      [  206.923348]  do_vfs_ioctl+0x90/0x6e0
      [  206.923352]  ? __fget+0x108/0x200
      [  206.923356]  ? expand_files+0x2b0/0x2b0
      [  206.923361]  SyS_ioctl+0x3c/0x70
      [  206.923365]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [  206.923369] RIP: 0033:0x7fdd75fc6357
      [  206.923373] RSP: 002b:00007fdd20e59bf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      [  206.923380] RAX: ffffffffffffffda RBX: ffffffff81481ff3 RCX: 00007fdd75fc6357
      [  206.923385] RDX: 00007fdd20e59c70 RSI: 0000000040406469 RDI: 0000000000000003
      [  206.923390] RBP: ffffc90001cabf88 R08: 0000000000000040 R09: 00000000000003f7
      [  206.923396] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
      [  206.923401] R13: 0000000000000003 R14: 0000000040406469 R15: 0000000001cf9cb0
      [  206.923408]  ? __this_cpu_preempt_check+0x13/0x20
      
      Fixes: 56299fb7 ("drm/i915: Signal first fence from irq handler if complete")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100051Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170303144557.4815-1-chris@chris-wilson.co.ukReviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      24754d75
    • V
      drm/i915: Add plane update/disable tracepoints · 72259536
      Ville Syrjälä 提交于
      Add tracepoints for plane programming. The tracepoints will dump
      the frame and scanline counters, so this can be used to verify eg. that
      the plane gets reprogrammed at the right time with respect to watermark
      programming (if we have appropriate tracepoints for that as well).
      
      v2: Rebase due to legacy cursor changes
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170302171508.1666-16-ville.syrjala@linux.intel.com
      72259536
  15. 02 3月, 2017 1 次提交
  16. 28 2月, 2017 2 次提交
    • C
      drm/i915: Delay disabling the user interrupt for breadcrumbs · 67b807a8
      Chris Wilson 提交于
      A significant cost in setting up a wait is the overhead of enabling the
      interrupt. As we disable the interrupt whenever the queue of waiters is
      empty, if we are frequently waiting on alternating batches, we end up
      re-enabling the interrupt on a frequent basis. We do want to disable the
      interrupt during normal operations as under high load it may add several
      thousand interrupts/s - we have been known in the past to occupy whole
      cores with our interrupt handler after accidentally leaving user
      interrupts enabled. As a compromise, leave the interrupt enabled until
      the next IRQ, or the system is idle. This gives a small window for a
      waiter to keep the interrupt active and not be delayed by having to
      re-enable the interrupt.
      
      v2: Restore hangcheck/missed-irq detection for continuations
      v3: Be more careful restoring the hangcheck timer after reset
      v4: Be more careful restoring the fake irq after reset (if required!)
      v5: Redo changes to intel_engine_wakeup()
      v6: Factor out __intel_engine_wakeup()
      v7: Improve commentary for declaring a missed wakeup
      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>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170227205850.2828-4-chris@chris-wilson.co.uk
      67b807a8
    • C
      drm/i915: Signal first fence from irq handler if complete · 56299fb7
      Chris Wilson 提交于
      As execlists and other non-semaphore multi-engine devices coordinate
      between engines using interrupts, we can shave off a few 10s of
      microsecond of scheduling latency by doing the fence signaling from the
      interrupt as opposed to a RT kthread. (Realistically the delay adds
      about 1% to an individual cross-engine workload.) We only signal the
      first fence in order to limit the amount of work we move into the
      interrupt handler. We also have to remember that our breadcrumbs may be
      unordered with respect to the interrupt and so we still require the
      waiter process to perform some heavyweight coherency fixups, as well as
      traversing the tree of waiters.
      
      v2: No need for early exit in irq handler - it breaks the flow between
      patches and prevents the tracepoint
      v3: Restore rcu hold across irq signaling of request
      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>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170227205850.2828-2-chris@chris-wilson.co.uk
      56299fb7
  17. 21 2月, 2017 1 次提交
  18. 17 2月, 2017 1 次提交
  19. 16 2月, 2017 2 次提交
    • I
      drm/i915/gen9+: Enable hotplug detection early · 2a57d9cc
      Imre Deak 提交于
      For LSPCON resume time initialization we need to sample the
      corresponding pin's HPD level, but this is only available when HPD
      detection is enabled. Currently we enable detection only when enabling
      HPD interrupts which is too late, so bring the enabling of detection
      earlier.
      
      This is needed by the next patch.
      
      Cc: Shashank Sharma <shashank.sharma@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: <stable@vger.kernel.org> # v4.9+
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NShashank Sharma <shashank.sharma@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1485509961-9010-2-git-send-email-imre.deak@intel.com
      (cherry picked from commit 7fff8126)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      2a57d9cc
    • C
      drm/i915: Only enable hotplug interrupts if the display interrupts are enabled · 262fd485
      Chris Wilson 提交于
      In order to prevent accessing the hpd registers outside of the display
      power wells, we should refrain from writing to the registers before the
      display interrupts are enabled.
      
      [    4.740136] WARNING: CPU: 1 PID: 221 at drivers/gpu/drm/i915/intel_uncore.c:795 __unclaimed_reg_debug+0x44/0x50 [i915]
      [    4.740155] Unclaimed read from register 0x1e1110
      [    4.740168] Modules linked in: i915(+) intel_gtt drm_kms_helper prime_numbers
      [    4.740190] CPU: 1 PID: 221 Comm: systemd-udevd Not tainted 4.10.0-rc6+ #384
      [    4.740203] Hardware name:                  /        , BIOS PYBSWCEL.86A.0027.2015.0507.1758 05/07/2015
      [    4.740220] Call Trace:
      [    4.740236]  dump_stack+0x4d/0x6f
      [    4.740251]  __warn+0xc1/0xe0
      [    4.740265]  warn_slowpath_fmt+0x4a/0x50
      [    4.740281]  ? insert_work+0x77/0xc0
      [    4.740355]  ? fwtable_write32+0x90/0x130 [i915]
      [    4.740431]  __unclaimed_reg_debug+0x44/0x50 [i915]
      [    4.740507]  fwtable_read32+0xd8/0x130 [i915]
      [    4.740575]  i915_hpd_irq_setup+0xa5/0x100 [i915]
      [    4.740649]  intel_hpd_init+0x68/0x80 [i915]
      [    4.740716]  i915_driver_load+0xe19/0x1380 [i915]
      [    4.740784]  i915_pci_probe+0x32/0x90 [i915]
      [    4.740799]  pci_device_probe+0x8b/0xf0
      [    4.740815]  driver_probe_device+0x2b6/0x450
      [    4.740828]  __driver_attach+0xda/0xe0
      [    4.740841]  ? driver_probe_device+0x450/0x450
      [    4.740853]  bus_for_each_dev+0x5b/0x90
      [    4.740865]  driver_attach+0x19/0x20
      [    4.740878]  bus_add_driver+0x166/0x260
      [    4.740892]  driver_register+0x5b/0xd0
      [    4.740906]  ? 0xffffffffa0166000
      [    4.740920]  __pci_register_driver+0x47/0x50
      [    4.740985]  i915_init+0x5c/0x5e [i915]
      [    4.740999]  do_one_initcall+0x3e/0x160
      [    4.741015]  ? __vunmap+0x7c/0xc0
      [    4.741029]  ? kmem_cache_alloc+0xcf/0x120
      [    4.741045]  do_init_module+0x55/0x1c4
      [    4.741060]  load_module+0x1f3f/0x25b0
      [    4.741073]  ? __symbol_put+0x40/0x40
      [    4.741086]  ? kernel_read_file+0x100/0x190
      [    4.741100]  SYSC_finit_module+0xbc/0xf0
      [    4.741112]  SyS_finit_module+0x9/0x10
      [    4.741125]  entry_SYSCALL_64_fastpath+0x17/0x98
      [    4.741135] RIP: 0033:0x7f8559a140f9
      [    4.741145] RSP: 002b:00007fff7509a3e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
      [    4.741161] RAX: ffffffffffffffda RBX: 00007f855aba02d1 RCX: 00007f8559a140f9
      [    4.741172] RDX: 0000000000000000 RSI: 000055b6db0914f0 RDI: 0000000000000011
      [    4.741183] RBP: 0000000000020000 R08: 0000000000000000 R09: 000000000000000e
      [    4.741193] R10: 0000000000000011 R11: 0000000000000246 R12: 000055b6db0854d0
      [    4.741204] R13: 000055b6db091150 R14: 0000000000000000 R15: 000055b6db035924
      
      v2: Set dev_priv->display_irqs_enabled to true for all platforms other
      than vlv/chv that manually control the display power domain.
      
      Fixes: 19625e85 ("drm/i915: Enable polling when we don't have hpd")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97798Suggested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Lyude <cpaul@redhat.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Hans de Goede <jwrdegoede@fedoraproject.org>
      Cc: stable@vger.kernel.org
      Link: http://patchwork.freedesktop.org/patch/msgid/20170215131547.5064-1-chris@chris-wilson.co.ukReviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      262fd485
  20. 15 2月, 2017 2 次提交
  21. 11 2月, 2017 1 次提交
    • L
      drm/i915/debugfs: Add i915_hpd_storm_ctl · 317eaa95
      Lyude 提交于
      This adds a file in i915's debugfs directory that allows userspace to
      manually control HPD storm detection. This is mainly for hotplugging
      tests, where we might want to test HPD storm functionality or disable
      storm detection to speed up hotplugging tests without breaking anything.
      
      Changes since v1:
      - Make HPD storm interval configurable
      - Misc code cleanup
      Signed-off-by: NLyude <lyude@redhat.com>
      Acked-by: NJani Nikula <jani.nikula@linux.intel.com>
      Cc: Tomeu Vizoso <tomeu@tomeuvizoso.net>
      317eaa95
  22. 08 2月, 2017 1 次提交
  23. 06 2月, 2017 1 次提交