1. 29 9月, 2020 1 次提交
  2. 25 9月, 2020 1 次提交
  3. 09 9月, 2020 1 次提交
  4. 20 5月, 2020 1 次提交
  5. 07 2月, 2020 1 次提交
  6. 04 12月, 2019 2 次提交
    • T
      drm/tegra: gem: Remove premature import restrictions · 49f82191
      Thierry Reding 提交于
      All the display related blocks on Tegra require contiguous memory. Using
      the DMA API, there is no knowing at import time which device will end up
      using the buffer, so it's not known whether or not an IOMMU will be used
      to map the buffer.
      
      Move the check for non-contiguous buffers/mappings to the tegra_dc_pin()
      function which is now the earliest point where it is known if a DMA BUF
      can be used by the given device or not.
      
      v2: add check for contiguous buffer/mapping in tegra_dc_pin()
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      49f82191
    • T
      drm/tegra: gem: Properly pin imported buffers · 1f16deac
      Thierry Reding 提交于
      Buffers that are imported from a DMA-BUF don't have pages allocated with
      them. At the same time an SG table for them can't be derived using the
      DMA API helpers because the necessary information doesn't exist. However
      there's already an SG table that was created during import, so this can
      simply be duplicated.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      1f16deac
  7. 26 11月, 2019 2 次提交
  8. 29 10月, 2019 2 次提交
    • T
      gpu: host1x: Support DMA mapping of buffers · af1cbfb9
      Thierry Reding 提交于
      If host1x_bo_pin() returns an SG table, create a DMA mapping for the
      buffer. For buffers that the host1x client has already mapped itself,
      host1x_bo_pin() returns NULL and the existing DMA address is used.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      af1cbfb9
    • T
      gpu: host1x: Overhaul host1x_bo_{pin,unpin}() API · 80327ce3
      Thierry Reding 提交于
      The host1x_bo_pin() and host1x_bo_unpin() APIs are used to pin and unpin
      buffers during host1x job submission. Pinning currently returns the SG
      table and the DMA address (an IOVA if an IOMMU is used or a physical
      address if no IOMMU is used) of the buffer. The DMA address is only used
      for buffers that are relocated, whereas the host1x driver will map
      gather buffers into its own IOVA space so that they can be processed by
      the CDMA engine.
      
      This approach has a couple of issues. On one hand it's not very useful
      to return a DMA address for the buffer if host1x doesn't need it. On the
      other hand, returning the SG table of the buffer is suboptimal because a
      single SG table cannot be shared for multiple mappings, because the DMA
      address is stored within the SG table, and the DMA address may be
      different for different devices.
      
      Subsequent patches will move the host1x driver over to the DMA API which
      doesn't work with a single shared SG table. Fix this by returning a new
      SG table each time a buffer is pinned. This allows the buffer to be
      referenced by multiple jobs for different engines.
      
      Change the prototypes of host1x_bo_pin() and host1x_bo_unpin() to take a
      struct device *, specifying the device for which the buffer should be
      pinned. This is required in order to be able to properly construct the
      SG table. While at it, make host1x_bo_pin() return the SG table because
      that allows us to return an ERR_PTR()-encoded error code if we need to,
      or return NULL to signal that we don't need the SG table to be remapped
      and can simply use the DMA address as-is. At the same time, returning
      the DMA address is made optional because in the example of command
      buffers, host1x doesn't need to know the DMA address since it will have
      to create its own mapping anyway.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      80327ce3
  9. 28 10月, 2019 4 次提交
  10. 15 8月, 2019 1 次提交
  11. 21 6月, 2019 1 次提交
    • D
      drm/prime: Align gem_prime_export with obj_funcs.export · e4fa8457
      Daniel Vetter 提交于
      The idea is that gem_prime_export is deprecated in favor of
      obj_funcs.export. That's much easier to do if both have matching
      function signatures.
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Reviewed-by: NEmil Velikov <emil.velikov@collabora.com>
      Acked-by: NChristian König <christian.koenig@amd.com>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <maxime.ripard@bootlin.com>
      Cc: Sean Paul <sean@poorly.run>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: Zhi Wang <zhi.a.wang@intel.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: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: "Michel Dänzer" <michel.daenzer@amd.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Huang Rui <ray.huang@amd.com>
      Cc: Felix Kuehling <Felix.Kuehling@amd.com>
      Cc: Hawking Zhang <Hawking.Zhang@amd.com>
      Cc: Feifei Xu <Feifei.Xu@amd.com>
      Cc: Jim Qu <Jim.Qu@amd.com>
      Cc: Evan Quan <evan.quan@amd.com>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Thomas Zimmermann <tdz@users.sourceforge.net>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Jilayne Lovejoy <opensource@jilayne.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Mikulas Patocka <mpatocka@redhat.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Junwei Zhang <Jerry.Zhang@amd.com>
      Cc: intel-gvt-dev@lists.freedesktop.org
      Cc: intel-gfx@lists.freedesktop.org
      Cc: amd-gfx@lists.freedesktop.org
      Cc: linux-tegra@vger.kernel.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-10-daniel.vetter@ffwll.ch
      e4fa8457
  12. 19 6月, 2019 1 次提交
  13. 18 4月, 2019 1 次提交
    • D
      drm/tegra: gem: Fix CPU-cache maintenance for BO's allocated using get_pages() · 61b51fb5
      Dmitry Osipenko 提交于
      The allocated pages need to be invalidated in CPU caches. On ARM32 the
      DMA_BIDIRECTIONAL flag only ensures that data is written-back to DRAM and
      the data stays in CPU cache lines. While the DMA_FROM_DEVICE flag ensures
      that the corresponding CPU cache lines are getting invalidated and nothing
      more, that's exactly what is needed for a newly allocated pages.
      
      This fixes randomly failing rendercheck tests on Tegra30 using the
      Opentegra driver for tests that use small-sized pixmaps (10x10 and less,
      i.e. 1-2 memory pages) because apparently CPU reads out stale data from
      caches and/or that data is getting evicted to DRAM at the time of HW job
      execution.
      
      Fixes: bd43c9f0 ("drm/tegra: gem: Map pages via the DMA API")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NDmitry Osipenko <digetx@gmail.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      61b51fb5
  14. 20 6月, 2018 1 次提交
  15. 19 5月, 2018 1 次提交
  16. 17 5月, 2018 1 次提交
    • S
      drm/tegra: Adding new typedef vm_fault_t · cc7add70
      Souptick Joarder 提交于
      Use new return type vm_fault_t for fault handler. For now, this is just
      documenting that the function returns a VM_FAULT value rather than an
      errno. Once all instances are converted, vm_fault_t will become a
      distinct type.
      
      Reference id -> 1c8f4220 ("mm: change return type to vm_fault_t")
      
      Previously vm_insert_page() returns err which driver mapped into
      VM_FAULT_* type. The new function vmf_insert_page() will replace this
      inefficiency by returning VM_FAULT_* type.
      Signed-off-by: NSouptick Joarder <jrdr.linux@gmail.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      cc7add70
  17. 17 3月, 2018 2 次提交
  18. 08 3月, 2018 1 次提交
  19. 21 12月, 2017 1 次提交
  20. 17 8月, 2017 3 次提交
  21. 15 6月, 2017 1 次提交
    • D
      drm/tegra: Check for malformed offsets and sizes in the 'submit' IOCTL · 368f622c
      Dmitry Osipenko 提交于
      If commands buffer claims a number of words that is higher than its BO can
      fit, a kernel OOPS will be fired on the out-of-bounds BO access. This was
      triggered by an opentegra Xorg driver that erroneously pushed too many
      commands to the pushbuf.
      
      The CDMA commands buffer address is 4 bytes aligned, so check its
      alignment.
      
      The maximum number of the CDMA gather fetches is 16383, add a check for
      it.
      
      Add a sanity check for the relocations in a same way.
      
      [   46.829393] Unable to handle kernel paging request at virtual address f09b2000
      ...
      [<c04a3ba4>] (host1x_job_pin) from [<c04dfcd0>] (tegra_drm_submit+0x474/0x510)
      [<c04dfcd0>] (tegra_drm_submit) from [<c04deea0>] (tegra_submit+0x50/0x6c)
      [<c04deea0>] (tegra_submit) from [<c04c07c0>] (drm_ioctl+0x1e4/0x3ec)
      [<c04c07c0>] (drm_ioctl) from [<c02541a0>] (do_vfs_ioctl+0x9c/0x8e4)
      [<c02541a0>] (do_vfs_ioctl) from [<c0254a1c>] (SyS_ioctl+0x34/0x5c)
      [<c0254a1c>] (SyS_ioctl) from [<c0107640>] (ret_fast_syscall+0x0/0x3c)
      Signed-off-by: NDmitry Osipenko <digetx@gmail.com>
      Reviewed-by: NErik Faye-Lund <kusmabite@gmail.com>
      Reviewed-by: NMikko Perttunen <mperttunen@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      368f622c
  22. 20 4月, 2017 1 次提交
  23. 06 4月, 2017 1 次提交
  24. 25 2月, 2017 1 次提交
  25. 03 2月, 2017 1 次提交
    • C
      drm: Improve drm_mm search (and fix topdown allocation) with rbtrees · 4e64e553
      Chris Wilson 提交于
      The drm_mm range manager claimed to support top-down insertion, but it
      was neither searching for the top-most hole that could fit the
      allocation request nor fitting the request to the hole correctly.
      
      In order to search the range efficiently, we create a secondary index
      for the holes using either their size or their address. This index
      allows us to find the smallest hole or the hole at the bottom or top of
      the range efficiently, whilst keeping the hole stack to rapidly service
      evictions.
      
      v2: Search for holes both high and low. Rename flags to mode.
      v3: Discover rb_entry_safe() and use it!
      v4: Kerneldoc for enum drm_mm_insert_mode.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Lucas Stach <l.stach@pengutronix.de>
      Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Sinclair Yeh <syeh@vmware.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: Sinclair Yeh <syeh@vmware.com> # vmwgfx
      Reviewed-by: Lucas Stach <l.stach@pengutronix.de> #etnaviv
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170202210438.28702-1-chris@chris-wilson.co.uk
      4e64e553
  26. 15 12月, 2016 1 次提交
  27. 11 11月, 2016 2 次提交
  28. 07 11月, 2016 1 次提交
  29. 05 10月, 2016 1 次提交
  30. 17 5月, 2016 1 次提交