1. 13 11月, 2019 2 次提交
  2. 12 10月, 2019 1 次提交
  3. 16 9月, 2019 10 次提交
  4. 06 9月, 2019 3 次提交
    • 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
    • X
      drm/i915: Don't deballoon unused ggtt drm_mm_node in linux guest · c7615333
      Xiong Zhang 提交于
      commit 0a3dfbb5cd9033752639ef33e319c2f2863c713a upstream.
      
      The following call trace may exist in linux guest dmesg when guest i915
      driver is unloaded.
      [   90.776610] [drm:vgt_deballoon_space.isra.0 [i915]] deballoon space: range [0x0 - 0x0] 0 KiB.
      [   90.776621] BUG: unable to handle kernel NULL pointer dereference at 00000000000000c0
      [   90.776691] IP: drm_mm_remove_node+0x4d/0x320 [drm]
      [   90.776718] PGD 800000012c7d0067 P4D 800000012c7d0067 PUD 138e4c067 PMD 0
      [   90.777091] task: ffff9adab60f2f00 task.stack: ffffaf39c0fe0000
      [   90.777142] RIP: 0010:drm_mm_remove_node+0x4d/0x320 [drm]
      [   90.777573] Call Trace:
      [   90.777653]  intel_vgt_deballoon+0x4c/0x60 [i915]
      [   90.777729]  i915_ggtt_cleanup_hw+0x121/0x190 [i915]
      [   90.777792]  i915_driver_unload+0x145/0x180 [i915]
      [   90.777856]  i915_pci_remove+0x15/0x20 [i915]
      [   90.777890]  pci_device_remove+0x3b/0xc0
      [   90.777916]  device_release_driver_internal+0x157/0x220
      [   90.777945]  driver_detach+0x39/0x70
      [   90.777967]  bus_remove_driver+0x51/0xd0
      [   90.777990]  pci_unregister_driver+0x23/0x90
      [   90.778019]  SyS_delete_module+0x1da/0x240
      [   90.778045]  entry_SYSCALL_64_fastpath+0x24/0x87
      [   90.778072] RIP: 0033:0x7f34312af067
      [   90.778092] RSP: 002b:00007ffdea3da0d8 EFLAGS: 00000206
      [   90.778297] RIP: drm_mm_remove_node+0x4d/0x320 [drm] RSP: ffffaf39c0fe3dc0
      [   90.778344] ---[ end trace f4b1bc8305fc59dd ]---
      
      Four drm_mm_node are used to reserve guest ggtt space, but some of them
      may be skipped and not initialised due to space constraints in
      intel_vgt_balloon(). If drm_mm_remove_node() is called with
      uninitialized drm_mm_node, the above call trace occurs.
      
      This patch check drm_mm_node's validity before calling
      drm_mm_remove_node().
      
      Fixes: ff8f7975("drm/i915: return the correct usable aperture size under gvt environment")
      Cc: stable@vger.kernel.org
      Signed-off-by: NXiong Zhang <xiong.y.zhang@intel.com>
      Acked-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/1566279978-9659-1-git-send-email-xiong.y.zhang@intel.com
      (cherry picked from commit 4776f3529d6b1e47f02904ad1d264d25ea22b27b)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c7615333
    • L
      drm/i915: fix broadwell EU computation · a3eb2eba
      Lionel Landwerlin 提交于
      [ Upstream commit 63ac3328f0d1d37f286e397b14d9596ed09d7ca5 ]
      
      subslice_mask is an array indexed by slice, not subslice.
      Signed-off-by: NLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Fixes: 8cc76693 ("drm/i915: store all subslice masks")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108712Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181112123931.2815-1-lionel.g.landwerlin@intel.comSigned-off-by: NSasha Levin <sashal@kernel.org>
      a3eb2eba
  5. 16 8月, 2019 1 次提交
  6. 07 8月, 2019 1 次提交
  7. 10 7月, 2019 1 次提交
  8. 19 6月, 2019 1 次提交
    • V
      drm/i915/sdvo: Implement proper HDMI audio support for SDVO · b08ec06c
      Ville Syrjälä 提交于
      commit d74408f528261f900dddb9778f61b5c5a7a6249c upstream.
      
      Our SDVO audio support is pretty bogus. We can't push audio over the
      SDVO bus, so trying to enable audio in the SDVO control register doesn't
      do anything. In fact it looks like the SDVO encoder will always mix in
      the audio coming over HDA, and there's no (at least documented) way to
      disable that from our side. So HDMI audio does work currently on gen4
      but only by luck really. On gen3 it got broken by the referenced commit.
      And what has always been missing on every platform is the ELD.
      
      To pass the ELD to the audio driver we need to write it to magic buffer
      in the SDVO encoder hardware which then gets pulled out via HDA in the
      other end. Ie. pretty much the same thing we had for native HDMI before
      we started to just pass the ELD between the drivers. This sort of
      explains why we even have that silly hardware buffer with native HDMI.
      
      $ cat /proc/asound/card0/eld#1.0
      -monitor_present		0
      -eld_valid		0
      +monitor_present		1
      +eld_valid		1
      +monitor_name		LG TV
      +connection_type		HDMI
      +...
      
      This also fixes our state readout since we can now query the SDVO
      encoder about the state of the "ELD valid" and "presence detect"
      bits. As mentioned those don't actually control whether audio
      gets sent over the HDMI cable, but it's the best we can do. And with
      the state checker appeased we can re-enable HDMI audio for gen3.
      
      Cc: stable@vger.kernel.org
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: zardam@gmail.com
      Tested-by: zardam@gmail.com
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108976
      Fixes: de44e256 ("drm/i915/sdvo: Shut up state checker with hdmi cards on gen3")
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190409144054.24561-3-ville.syrjala@linux.intel.comReviewed-by: NImre Deak <imre.deak@intel.com>
      (cherry picked from commit dc49a56bd43bb04982e64b44436831da801d0237)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b08ec06c
  9. 11 6月, 2019 3 次提交
  10. 02 5月, 2019 1 次提交
  11. 17 4月, 2019 2 次提交
  12. 03 4月, 2019 1 次提交
  13. 24 3月, 2019 1 次提交
  14. 27 2月, 2019 1 次提交
  15. 20 2月, 2019 2 次提交
    • J
      drm/i915: Prevent a race during I915_GEM_MMAP ioctl with WC set · 6a204bd5
      Joonas Lahtinen 提交于
      commit 2e7bd10e05afb866b5fb13eda25095c35d7a27cc upstream.
      
      Make sure the underlying VMA in the process address space is the
      same as it was during vm_mmap to avoid applying WC to wrong VMA.
      
      A more long-term solution would be to have vm_mmap_locked variant
      in linux/mmap.h for when caller wants to hold mmap_sem for an
      extended duration.
      
      v2:
      - Refactor the compare function
      
      Fixes: 1816f923 ("drm/i915: Support creation of unbound wc user mappings for objects")
      Reported-by: NAdam Zabrocki <adamza@microsoft.com>
      Suggested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.0+
      Cc: Akash Goel <akash.goel@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Adam Zabrocki <adamza@microsoft.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> #v1
      Link: https://patchwork.freedesktop.org/patch/msgid/20190207085454.10598-1-joonas.lahtinen@linux.intel.com
      (cherry picked from commit 5c4604e757ba9b193b09768d75a7d2105a5b883f)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6a204bd5
    • L
      drm/i915: Block fbdev HPD processing during suspend · 4631e0b4
      Lyude Paul 提交于
      commit e8a8fedd57fdcebf0e4f24ef0fc7e29323df8e66 upstream.
      
      When resuming, we check whether or not any previously connected
      MST topologies are still present and if so, attempt to resume them. If
      this fails, we disable said MST topologies and fire off a hotplug event
      so that userspace knows to reprobe.
      
      However, sending a hotplug event involves calling
      drm_fb_helper_hotplug_event(), which in turn results in fbcon doing a
      connector reprobe in the caller's thread - something we can't do at the
      point in which i915 calls drm_dp_mst_topology_mgr_resume() since
      hotplugging hasn't been fully initialized yet.
      
      This currently causes some rather subtle but fatal issues. For example,
      on my T480s the laptop dock connected to it usually disappears during a
      suspend cycle, and comes back up a short while after the system has been
      resumed. This guarantees pretty much every suspend and resume cycle,
      drm_dp_mst_topology_mgr_set_mst(mgr, false); will be caused and in turn,
      a connector hotplug will occur. Now it's Rute Goldberg time: when the
      connector hotplug occurs, i915 reprobes /all/ of the connectors,
      including eDP. However, eDP probing requires that we power on the panel
      VDD which in turn, grabs a wakeref to the appropriate power domain on
      the GPU (on my T480s, this is the PORT_DDI_A_IO domain). This is where
      things start breaking, since this all happens before
      intel_power_domains_enable() is called we end up leaking the wakeref
      that was acquired and never releasing it later. Come next suspend/resume
      cycle, this causes us to fail to shut down the GPU properly, which
      causes it not to resume properly and die a horrible complicated death.
      
      (as a note: this only happens when there's both an eDP panel and MST
      topology connected which is removed mid-suspend. One or the other seems
      to always be OK).
      
      We could try to fix the VDD wakeref leak, but this doesn't seem like
      it's worth it at all since we aren't able to handle hotplug detection
      while resuming anyway. So, let's go with a more robust solution inspired
      by nouveau: block fbdev from handling hotplug events until we resume
      fbdev. This allows us to still send sysfs hotplug events to be handled
      later by user space while we're resuming, while also preventing us from
      actually processing any hotplug events we receive until it's safe.
      
      This fixes the wakeref leak observed on the T480s and as such, also
      fixes suspend/resume with MST topologies connected on this machine.
      
      Changes since v2:
      * Don't call drm_fb_helper_hotplug_event() under lock, do it after lock
        (Chris Wilson)
      * Don't call drm_fb_helper_hotplug_event() in
        intel_fbdev_output_poll_changed() under lock (Chris Wilson)
      * Always set ifbdev->hpd_waiting (Chris Wilson)
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Fixes: 0e32b39c ("drm/i915: add DP 1.2 MST support (v0.7)")
      Cc: Todd Previte <tprevite@gmail.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: intel-gfx@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v3.17+
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190129191001.442-2-lyude@redhat.com
      (cherry picked from commit fe5ec65668cdaa4348631d8ce1766eed43b33c10)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4631e0b4
  16. 15 2月, 2019 1 次提交
  17. 23 1月, 2019 1 次提交
    • Z
      drm/i915/gvt: Fix mmap range check · ac8b9e8e
      Zhenyu Wang 提交于
      commit 51b00d8509dc69c98740da2ad07308b630d3eb7d upstream.
      
      This is to fix missed mmap range check on vGPU bar2 region
      and only allow to map vGPU allocated GMADDR range, which means
      user space should support sparse mmap to get proper offset for
      mmap vGPU aperture. And this takes care of actual pgoff in mmap
      request as original code always does from beginning of vGPU
      aperture.
      
      Fixes: 659643f7 ("drm/i915/gvt/kvmgt: add vfio/mdev support to KVMGT")
      Cc: "Monroy, Rodrigo Axel" <rodrigo.axel.monroy@intel.com>
      Cc: "Orrala Contreras, Alfredo" <alfredo.orrala.contreras@intel.com>
      Cc: stable@vger.kernel.org # v4.10+
      Reviewed-by: NHang Yuan <hang.yuan@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ac8b9e8e
  18. 17 1月, 2019 1 次提交
  19. 20 12月, 2018 2 次提交
  20. 13 12月, 2018 1 次提交
  21. 01 12月, 2018 1 次提交
    • V
      drm/i915: Disable LP3 watermarks on all SNB machines · 382debd2
      Ville Syrjälä 提交于
      commit 21556350ade3cb5d7afecc8b3544e56431d21695 upstream.
      
      I have a Thinkpad X220 Tablet in my hands that is losing vblank
      interrupts whenever LP3 watermarks are used.
      
      If I nudge the latency value written to the WM3 register just
      by one in either direction the problem disappears. That to me
      suggests that the punit will not enter the corrsponding
      powersave mode (MPLL shutdown IIRC) unless the latency value
      in the register matches exactly what we read from SSKPD. Ie.
      it's not really a latency value but rather just a cookie
      by which the punit can identify the desired power saving state.
      On HSW/BDW this was changed such that we actually just write
      the WM level number into those bits, which makes much more
      sense given the observed behaviour.
      
      We could try to handle this by disallowing LP3 watermarks
      only when vblank interrupts are enabled but we'd first have
      to prove that only vblank interrupts are affected, which
      seems unlikely. Also we can't grab the wm mutex from the
      vblank enable/disable hooks because those are called with
      various spinlocks held. Thus we'd have to redesigne the
      watermark locking. So to play it safe and keep the code
      simple we simply disable LP3 watermarks on all SNB machines.
      
      To do that we simply zero out the latency values for
      watermark level 3, and we adjust the watermark computation
      to check for that. The behaviour now matches that of the
      g4x/vlv/skl wm code in the presence of a zeroed latency
      value.
      
      v2: s/USHRT_MAX/U32_MAX/ for consistency with the types (Chris)
      
      Cc: stable@vger.kernel.org
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101269
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103713Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181114173440.6730-1-ville.syrjala@linux.intel.com
      (cherry picked from commit 03981c6ebec4fc7056b9b45f847393aeac90d060)
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      382debd2
  22. 27 11月, 2018 1 次提交
  23. 21 11月, 2018 1 次提交
    • V
      drm/i915: Fix hpd handling for pins with two encoders · 32bd1336
      Ville Syrjälä 提交于
      commit 44a7276b30c3c15f2b7790a5729640597fb6a1df upstream.
      
      In my haste to remove irq_port[] I accidentally changed the
      way we deal with hpd pins that are shared by multiple encoders
      (DP and HDMI for pre-DDI platforms). Previously we would only
      handle such pins via ->hpd_pulse(), but now we queue up the
      hotplug work for the HDMI encoder directly. Worse yet, we now
      count each hpd twice and this increment the hpd storm count
      twice as fast. This can lead to spurious storms being detected.
      
      Go back to the old way of doing things, ie. delegate to
      ->hpd_pulse() for any pin which has an encoder with that hook
      implemented. I don't really like the idea of adding irq_port[]
      back so let's loop through the encoders first to check if we
      have an encoder with ->hpd_pulse() for the pin, and then go
      through all the pins and decided on the correct course of action
      based on the earlier findings.
      
      I have occasionally toyed with the idea of unifying the pre-DDI
      HDMI and DP encoders into a single encoder as well. Besides the
      hotplug processing it would have the other benefit of preventing
      userspace from trying to enable both encoders at the same time.
      That is simply illegal as they share the same clock/data pins.
      We have some testcases that will attempt that and thus fail on
      many older machines. But for now let's stick to fixing just the
      hotplug code.
      
      Cc: stable@vger.kernel.org # 4.19+
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Fixes: b6ca3eee ("drm/i915: Nuke dev_priv->irq_port[]")
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181108200424.28371-1-ville.syrjala@linux.intel.comReviewed-by: NLyude Paul <lyude@redhat.com>
      (cherry picked from commit 5a3aeca97af1b6b3498d59a7fd4e8bb95814c108)
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      32bd1336