1. 21 7月, 2015 2 次提交
  2. 14 7月, 2015 9 次提交
    • M
      drm/i915: Do not call intel_crtc_disable if the crtc is already disabled. · ccfb8b2e
      Maarten Lankhorst 提交于
      When resuming with dpms off, the following warn can happen:
      
      [  118.334082] ------------[ cut here ]------------
      [  118.334105] WARNING: CPU: 2 PID: 2274 at drivers/gpu/drm/i915/intel_display.c:6319 __intel_set_mode+0xae5/0xb90 [i915]()
      [  118.334106] WARN_ON(!crtc->state->enable)
      [  118.334137] Modules linked in: i915
      [  118.334139] CPU: 2 PID: 2274 Comm: kworker/u16:117 Not tainted 4.2.0-rc2-fixes+ #4148
      [  118.334140] Hardware name: LENOVO 2349AV8/2349AV8, BIOS G1ETA5WW (2.65 ) 04/15/2014
      [  118.334144] Workqueue: events_unbound async_run_entry_fn
      [  118.334147]  ffffffffc017eef0 ffff8800ada93998 ffffffff817aa62a 0000000080000001
      [  118.334149]  ffff8800ada939e8 ffff8800ada939d8 ffffffff810807e1 ffff8800ada939c8
      [  118.334151]  ffff8800cea3b3d8 0000000000000000 ffff8800ad86b008 ffff880117705668
      [  118.334151] Call Trace:
      [  118.334155]  [<ffffffff817aa62a>] dump_stack+0x4f/0x7b
      [  118.334157]  [<ffffffff810807e1>] warn_slowpath_common+0x81/0xc0
      [  118.334158]  [<ffffffff81080861>] warn_slowpath_fmt+0x41/0x50
      [  118.334173]  [<ffffffffc0120375>] __intel_set_mode+0xae5/0xb90 [i915]
      [  118.334188]  [<ffffffffc0121312>] ? intel_modeset_compute_config+0x52/0xb40 [i915]
      [  118.334191]  [<ffffffff8144de53>] ? drm_atomic_set_fb_for_plane+0x63/0x80
      [  118.334205]  [<ffffffffc01269d9>] intel_set_mode+0x29/0x60 [i915]
      [  118.334219]  [<ffffffffc012730a>] intel_crtc_restore_mode+0x13a/0x1f0 [i915]
      [  118.334232]  [<ffffffffc0101160>] ? gen6_write16+0x250/0x250 [i915]
      [  118.334246]  [<ffffffffc01283ec>] intel_modeset_setup_hw_state+0x89c/0xcd0 [i915]
      [  118.334248]  [<ffffffff8137d260>] ? pci_pm_thaw+0x90/0x90
      [  118.334255]  [<ffffffffc00ac11b>] i915_drm_resume+0xcb/0x160 [i915]
      [  118.334262]  [<ffffffffc00ac1d2>] i915_pm_resume+0x22/0x30 [i915]
      [  118.334263]  [<ffffffff8137d2c3>] pci_pm_resume+0x63/0xa0
      [  118.334266]  [<ffffffff81467550>] dpm_run_callback+0x70/0x420
      [  118.334267]  [<ffffffff81467cbd>] device_resume+0x9d/0x1c0
      [  118.334269]  [<ffffffff814673d0>] ? initcall_debug_start+0x60/0x60
      [  118.334270]  [<ffffffff81467dfc>] async_resume+0x1c/0x50
      [  118.334271]  [<ffffffff810a6a94>] async_run_entry_fn+0x34/0xd0
      [  118.334273]  [<ffffffff8109d4ad>] process_one_work+0x1dd/0x7e0
      [  118.334275]  [<ffffffff8109d41a>] ? process_one_work+0x14a/0x7e0
      [  118.334276]  [<ffffffff8109daf9>] worker_thread+0x49/0x450
      [  118.334278]  [<ffffffff8109dab0>] ? process_one_work+0x7e0/0x7e0
      [  118.334280]  [<ffffffff810a3cb9>] kthread+0xf9/0x110
      [  118.334282]  [<ffffffff810a3bc0>] ? insert_kthread_work+0x90/0x90
      [  118.334284]  [<ffffffff817b414f>] ret_from_fork+0x3f/0x70
      [  118.334286]  [<ffffffff810a3bc0>] ? insert_kthread_work+0x90/0x90
      [  118.334287] ---[ end trace 01f2cf6371b82d7a ]---
      
      This warn is harmless, and can be fixed by not calling intel_crtc_disable when
      the crtc is already disabled.
      Reported-and-Tested-by: NJörg Otte <jrg.otte@gmail.com>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ccfb8b2e
    • D
      Revert "drm/i915: Declare the swizzling unknown for L-shaped configurations" · d82c0ba6
      Daniel Vetter 提交于
      This reverts commit 19ee835c.
      
      It breaks existing old userspace which doesn't handle UNKNOWN
      swizzling correct. Yes UNKNOWN was a thing back in 2009 and probably
      still is on some other platforms, but it still pretty clearly broke
      the testers machine. If we want this we need to extend the ioctl with
      new paramters that only new userspace looks at.
      
      Cc: Harald Arnesen <harald@skogtun.org>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reported-by: NHarald Arnesen <harald@skogtun.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      d82c0ba6
    • T
      drm/i915: Forward all core DRM ioctls to core compat handling · ac7e7ab1
      Tvrtko Ursulin 提交于
      Previously only core DRM ioctls under the DRM_COMMAND_BASE were being
      forwarded, but the drm.h header suggests (and reality confirms) ones
      after (and including) DRM_COMMAND_END should be forwarded as well.
      
      We need this to correctly forward the compat ioctl for the botched-up
      addfb2.1 extension.
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: stable@vger.kernel.org # 4.1+
      [danvet: Explain why this is suddenly needed and add cc: stable.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ac7e7ab1
    • D
      drm/i915: fix oops in primary_check_plane · bbf47020
      Daniel Vetter 提交于
      On Sun, Jul 12, 2015 at 09:52:51AM -0700, Linus Torvalds wrote:
      > On Sun, Jul 12, 2015 at 1:03 AM, Jörg Otte <jrg.otte@gmail.com> wrote:
      > > BUG: unable to handle kernel NULL pointer dereference at 0000000000000009
      > > IP: [<ffffffffbd3447bb>] 0xffffffffbd3447bb
      >
      > Ugh. Please enable KALLSYMS to get sane symbols.
      >
      > But yes, "crtc_state->base.active" is at offset 9 from "crtc_state",
      > so it's pretty clearly just that change frm
      >
      > -       if (intel_crtc->active) {
      > +       if (crtc_state->base.active) {
      >
      > and "crtc_state" is NULL.
      >
      > And the code very much knows that crtc_state can be NULL, since it's
      > initialized with
      >
      >         crtc_state = state->base.state ?
      >                 intel_atomic_get_crtc_state(state->base.state,
      > intel_crtc) : NULL;
      >
      > Tssk. Daniel? Should I just revert that commit dec4f799
      > ("drm/i915: Use crtc_state->active in primary check_plane func") for
      > now, or is there a better fix? Like just checking crtc_state for NULL?
      
      Indeed embarrassing. I've missed that we still have 1 caller left that's
      using the transitional helpers, and those don't fill out
      plane_state->state backpointers to the global atomic update since there is
      no global atomic update for transitional helpers. Below diff should fix
      this - we need to preferentially check crts_state->active and if that's
      not set intel_crtc->active should yield the right result for the one
      remaining caller (it's in the crtc_disable paths).
      
      This fixes a regression introduced in
      
      commit dec4f799
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Tue Jul 7 11:15:47 2015 +0200
      
          drm/i915: Use crtc_state->active in primary check_plane func
      
      which was quickly reverted in
      
      commit 01e2d062
      Author: Linus Torvalds <torvalds@linux-foundation.org>
      Date:   Sun Jul 12 15:00:20 2015 -0700
      
          Revert "drm/i915: Use crtc_state->active in primary check_plane func"
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Jörg Otte <jrg.otte@gmail.com>
      Reported-and-tested-by: NJörg Otte <jrg.otte@gmail.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      bbf47020
    • I
      drm/i915: remove unused has_dma_mapping flag · 5ec5b516
      Imre Deak 提交于
      After the previous patch this flag will check always clear, as it's
      never set for shmem backed and userptr objects, so we can remove it.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: Yeah this isn't really fixes but it's a nice cleanup to
      clarify the code but not really worth the hassle of backmerging. So
      just add to -fixes, we're still early in -rc.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5ec5b516
    • D
      drm/i915: Fix missing return warning for !CONFIG_DEBUGFS · 101057fa
      Daniel Vetter 提交于
      This broken code was introduced in
      
      commit aa7471d2
      Author: Jani Nikula <jani.nikula@intel.com>
      Date:   Wed Apr 1 11:15:21 2015 +0300
      
          drm/i915: add i915 specific connector debugfs file for DPCD
      
      v2: Drop hunk that accidentally crept in.
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Bob Paauwe <bob.j.paauwe@intel.com>
      Cc: François Valenduc <francoisvalenduc@gmail.com>
      Reported-by: NFrançois Valenduc <francoisvalenduc@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      101057fa
    • I
      drm/i915: avoid leaking DMA mappings · e2273302
      Imre Deak 提交于
      We have 3 types of DMA mappings for GEM objects:
      1. physically contiguous for stolen and for objects needing contiguous
         memory
      2. DMA-buf mappings imported via a DMA-buf attach operation
      3. SG DMA mappings for shmem backed and userptr objects
      
      For 1. and 2. the lifetime of the DMA mapping matches the lifetime of the
      corresponding backing pages and so in practice we create/release the
      mapping in the object's get_pages/put_pages callback.
      
      For 3. the lifetime of the mapping matches that of any existing GPU binding
      of the object, so we'll create the mapping when the object is bound to
      the first vma and release the mapping when the object is unbound from its
      last vma.
      
      Since the object can be bound to multiple vmas, we can end up creating a
      new DMA mapping in the 3. case even if the object already had one. This
      is not allowed by the DMA API and can lead to leaked mapping data and
      IOMMU memory space starvation in certain cases. For example HW IOMMU
      drivers (intel_iommu) allocate a new range from their memory space
      whenever a mapping is created, silently overriding a pre-existing
      mapping.
      
      Fix this by moving the creation/removal of DMA mappings to the object's
      get_pages/put_pages callbacks. These callbacks already check for and do
      an early return in case of any nested calls. This way objects of the 3.
      case also become more like the other object types.
      
      I noticed this issue by enabling DMA debugging, which got disabled after
      a while due to its internal mapping tables getting full. It also reported
      errors in connection to random other drivers that did a DMA mapping for
      an address that was previously mapped by i915 but was never released.
      Besides these diagnostic messages and the memory space starvation
      problem for IOMMUs, I'm not aware of this causing a real issue.
      
      The fix is based on a patch from Chris.
      
      v2:
      - move the DMA mapping create/remove calls to the get_pages/put_pages
        callbacks instead of adding new callbacks for these (Chris)
      v3:
      - also fix the get_page cache logic on the userptr async path (Chris)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e2273302
    • T
      drm/i915: Snapshot seqno of most recently submitted request. · 94f7bbe1
      Tomas Elf 提交于
      The hang checker needs to inspect whether or not the ring request list is empty
      as well as if the given engine has reached or passed the most recently
      submitted request. The problem with this is that the hang checker cannot grab
      the struct_mutex, which is required in order to safely inspect requests since
      requests might be deallocated during inspection. In the past we've had kernel
      panics due to this very unsynchronized access in the hang checker.
      
      One solution to this problem is to not inspect the requests directly since
      we're only interested in the seqno of the most recently submitted request - not
      the request itself. Instead the seqno of the most recently submitted request is
      stored separately, which the hang checker then inspects, circumventing the
      issue of synchronization from the hang checker entirely.
      
      This fixes a regression introduced in
      
      commit 44cdd6d2
      Author: John Harrison <John.C.Harrison@Intel.com>
      Date:   Mon Nov 24 18:49:40 2014 +0000
      
          drm/i915: Convert 'ring_idle()' to use requests not seqnos
      
      v2 (Chris Wilson):
      - Pass current engine seqno to ring_idle() from i915_hangcheck_elapsed() rather
      than compute it over again.
      - Remove extra whitespace.
      
      Issue: VIZ-5998
      Signed-off-by: NTomas Elf <tomas.elf@intel.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: Add regressing commit citation provided by Chris.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      94f7bbe1
    • C
      drm/i915: Store device pointer in contexts for late tracepoint usafe · 9ea4feec
      Chris Wilson 提交于
      [ 1572.417121] BUG: unable to handle kernel NULL pointer dereference at           (null)
      [ 1572.421010] IP: [<ffffffffa00b2514>] ftrace_raw_event_i915_context+0x5d/0x70 [i915]
      [ 1572.424970] PGD 1766a3067 PUD 1767a2067 PMD 0
      [ 1572.428892] Oops: 0000 [#1] SMP
      [ 1572.432787] Modules linked in: ipv6 dm_mod iTCO_wdt iTCO_vendor_support snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_controller snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd soundcore serio_raw pcspkr lpc_ich i2c_i801 mfd_core battery ac acpi_cpufreq i915 button video drm_kms_helper drm
      [ 1572.441720] CPU: 2 PID: 18853 Comm: kworker/u8:0 Not tainted 4.0.0_kcloud_3f0360_20150429+ #588
      [ 1572.446298] Workqueue: i915 i915_gem_retire_work_handler [i915]
      [ 1572.450876] task: ffff880002f428f0 ti: ffff880035724000 task.ti: ffff880035724000
      [ 1572.455557] RIP: 0010:[<ffffffffa00b2514>]  [<ffffffffa00b2514>] ftrace_raw_event_i915_context+0x5d/0x70 [i915]
      [ 1572.460423] RSP: 0018:ffff880035727ce8  EFLAGS: 00010286
      [ 1572.465262] RAX: ffff880073f1643c RBX: ffff880002da9058 RCX: ffff880073e5db40
      [ 1572.470179] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880035727ce8
      [ 1572.475107] RBP: ffff88007bb11a00 R08: 0000000000000000 R09: 0000000000000000
      [ 1572.480034] R10: 0000000000362200 R11: 0000000000000008 R12: 0000000000000000
      [ 1572.484952] R13: ffff880035727d78 R14: ffff880002dc1c98 R15: ffff880002dc1dc8
      [ 1572.489886] FS:  0000000000000000(0000) GS:ffff88017fd00000(0000) knlGS:0000000000000000
      [ 1572.494883] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [ 1572.499859] CR2: 0000000000000000 CR3: 000000017572a000 CR4: 00000000001006e0
      [ 1572.504842] Stack:
      [ 1572.509834]  ffff88017b0090c0 ffff880073f16438 ffff880002da9058 ffff880073f1643c
      [ 1572.514904]  0000000000000246 ffff880100000000 ffff88007bb11a00 ffff880002ddeb10
      [ 1572.519985]  ffff8801759f79c0 ffffffffa0092ff0 0000000000000000 ffff88007bb11a00
      [ 1572.525049] Call Trace:
      [ 1572.530093]  [<ffffffffa0092ff0>] ? i915_gem_context_free+0xa8/0xc1 [i915]
      [ 1572.535227]  [<ffffffffa009b969>] ? i915_gem_request_free+0x4e/0x50 [i915]
      [ 1572.540347]  [<ffffffffa00b5533>] ? intel_execlists_retire_requests+0x14c/0x159 [i915]
      [ 1572.545500]  [<ffffffffa009d9ea>] ? i915_gem_retire_requests+0x9d/0xeb [i915]
      [ 1572.550664]  [<ffffffffa009dd8c>] ? i915_gem_retire_work_handler+0x4c/0x61 [i915]
      [ 1572.555825]  [<ffffffff8104ca7f>] ? process_one_work+0x1b2/0x31d
      [ 1572.560951]  [<ffffffff8104d278>] ? worker_thread+0x24d/0x339
      [ 1572.566033]  [<ffffffff8104d02b>] ? cancel_delayed_work_sync+0xa/0xa
      [ 1572.571140]  [<ffffffff81050b25>] ? kthread+0xce/0xd6
      [ 1572.576191]  [<ffffffff81050a57>] ? kthread_create_on_node+0x162/0x162
      [ 1572.581228]  [<ffffffff8179b3c8>] ? ret_from_fork+0x58/0x90
      [ 1572.586259]  [<ffffffff81050a57>] ? kthread_create_on_node+0x162/0x162
      [ 1572.591318] Code: de 48 89 e7 e8 09 4d 00 e1 48 85 c0 74 27 48 89 68 10 48 8b 55 38 48 89 e7 48 89 50 18 48 8b 55 10 48 8b 12 48 8b 12 48 8b 52 38 <8b> 12 89 50 08 e8 95 4d 00 e1 48 83 c4 30 5b 5d 41 5c c3 41 55
      [ 1572.596981] RIP  [<ffffffffa00b2514>] ftrace_raw_event_i915_context+0x5d/0x70 [i915]
      [ 1572.602464]  RSP <ffff880035727ce8>
      [ 1572.607911] CR2: 0000000000000000
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90112#c23Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9ea4feec
  3. 13 7月, 2015 1 次提交
    • L
      Revert "drm/i915: Use crtc_state->active in primary check_plane func" · 01e2d062
      Linus Torvalds 提交于
      This reverts commit dec4f799.
      
      Jörg Otte reports a NULL pointder dereference due to this commit, as
      'crtc_state' very much can be NULL:
      
              crtc_state = state->base.state ?
                      intel_atomic_get_crtc_state(state->base.state, intel_crtc) : NULL;
      
      So the change to test 'crtc_state->base.active' cannot possibly be
      correct as-is.
      
      There may be some other minimal fix (like just checking crtc_state for
      NULL), but I'm just reverting it now for the rc2 release, and people
      like Daniel Vetter who actually know this code will figure out what the
      right solution is in the longer term.
      Reported-and-bisected-by: NJörg Otte <jrg.otte@gmail.com>
      Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      01e2d062
  4. 09 7月, 2015 2 次提交
  5. 08 7月, 2015 3 次提交
  6. 06 7月, 2015 1 次提交
  7. 30 6月, 2015 1 次提交
  8. 29 6月, 2015 1 次提交
  9. 26 6月, 2015 2 次提交
  10. 22 6月, 2015 1 次提交
  11. 19 6月, 2015 1 次提交
  12. 17 6月, 2015 3 次提交
  13. 15 6月, 2015 6 次提交
  14. 09 6月, 2015 1 次提交
    • J
      drm/i915: Fix DDC probe for passive adapters · 3f5f1554
      Jani Nikula 提交于
      Passive DP->DVI/HDMI dongles on DP++ ports show up to the system as HDMI
      devices, as they do not have a sink device in them to respond to any AUX
      traffic. When probing these dongles over the DDC, sometimes they will
      NAK the first attempt even though the transaction is valid and they
      support the DDC protocol. The retry loop inside of
      drm_do_probe_ddc_edid() would normally catch this case and try the
      transaction again, resulting in success.
      
      That, however, was thwarted by the fix for [1]:
      
      commit 9292f37e
      Author: Eugeni Dodonov <eugeni.dodonov@intel.com>
      Date:   Thu Jan 5 09:34:28 2012 -0200
      
          drm: give up on edid retries when i2c bus is not responding
      
      This added code to exit immediately if the return code from the
      i2c_transfer function was -ENXIO in order to reduce the amount of time
      spent in waiting for unresponsive or disconnected devices. That was
      possible because the underlying i2c bit banging algorithm had retries of
      its own (which, of course, were part of the reason for the bug the
      commit fixes).
      
      Since its introduction in
      
      commit f899fc64
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Tue Jul 20 15:44:45 2010 -0700
      
          drm/i915: use GMBUS to manage i2c links
      
      we've been flipping back and forth enabling the GMBUS transfers, but
      we've settled since then. The GMBUS implementation does not do any
      retries, however, bailing out of the drm_do_probe_ddc_edid() retry loop
      on first encounter of -ENXIO. This, combined with Eugeni's commit, broke
      the retry on -ENXIO.
      
      Retry GMBUS once on -ENXIO on first message to mitigate the issues with
      passive adapters.
      
      This patch is based on the work, and commit message, by Todd Previte
      <tprevite@gmail.com>.
      
      [1] https://bugs.freedesktop.org/show_bug.cgi?id=41059
      
      v2: Don't retry if using bit banging.
      
      v3: Move retry within gmbux_xfer, retry only on first message.
      
      v4: Initialize GMBUS0 on retry (Ville).
      
      v5: Take index reads into account (Ville).
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85924
      Cc: Todd Previte <tprevite@gmail.com>
      Cc: stable@vger.kernel.org
      Tested-by: Oliver Grafe <oliver.grafe@ge.com> (v2)
      Tested-by: NJim Bride <jim.bride@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      3f5f1554
  15. 08 6月, 2015 1 次提交
  16. 05 6月, 2015 1 次提交
  17. 04 6月, 2015 3 次提交
  18. 01 6月, 2015 1 次提交