1. 11 9月, 2020 1 次提交
    • D
      drm/vgem: Use devm_drm_dev_alloc · bcc0ef7f
      Daniel Vetter 提交于
      This means we also need to slightly restructure the exit code, so that
      final cleanup of the drm_device is triggered by unregistering the
      platform device. Note that devres is both clean up when the driver is
      unbound (not the case for vgem, we don't bind), and also when unregistering
      the device (very much the case for vgem). Therefore we can rely on devres
      even though vgem isn't a proper platform device driver.
      
      This also somewhat untangles the load code, since the drm and platform device
      setup are no longer interleaved, but two distinct steps.
      
      v2: use devres_open/release_group so we can use devm without real
      hacks in the driver core or having to create an entire fake bus for
      testing drivers. Might want to extract this into helpers eventually,
      maybe as a mock_drm_dev_alloc or test_drm_dev_alloc.
      
      v3: Fix error code handling (Melissa)
      
      Cc: Melissa Wen <melissa.srw@gmail.com>
      Reviewed-by: NMelissa Wen <melissa.srw@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Emil Velikov <emil.velikov@collabora.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Rob Clark <robdclark@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200909120745.716178-1-daniel.vetter@ffwll.ch
      bcc0ef7f
  2. 09 9月, 2020 1 次提交
  3. 10 8月, 2020 1 次提交
  4. 09 7月, 2020 1 次提交
  5. 20 5月, 2020 1 次提交
  6. 26 3月, 2020 2 次提交
  7. 07 2月, 2020 1 次提交
    • D
      drm/vgem: Close use-after-free race in vgem_gem_create · 4b848f20
      Daniel Vetter 提交于
      There's two references floating around here (for the object reference,
      not the handle_count reference, that's a different thing):
      
      - The temporary reference held by vgem_gem_create, acquired by
        creating the object and released by calling
        drm_gem_object_put_unlocked.
      
      - The reference held by the object handle, created by
        drm_gem_handle_create. This one generally outlives the function,
        except if a 2nd thread races with a GEM_CLOSE ioctl call.
      
      So usually everything is correct, except in that race case, where the
      access to gem_object->size could be looking at freed data already.
      Which again isn't a real problem (userspace shot its feet off already
      with the race, we could return garbage), but maybe someone can exploit
      this as an information leak.
      
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Hillf Danton <hdanton@sina.com>
      Reported-by: syzbot+0dc4444774d419e916c8@syzkaller.appspotmail.com
      Cc: stable@vger.kernel.org
      Cc: Emil Velikov <emil.velikov@collabora.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Rob Clark <robdclark@chromium.org>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200202132133.1891846-1-daniel.vetter@ffwll.ch
      4b848f20
  8. 07 8月, 2019 2 次提交
  9. 02 8月, 2019 1 次提交
  10. 01 8月, 2019 1 次提交
  11. 17 7月, 2019 1 次提交
  12. 13 7月, 2019 1 次提交
  13. 26 6月, 2019 1 次提交
  14. 22 6月, 2019 1 次提交
  15. 21 6月, 2019 1 次提交
    • D
      drm/prime: Actually remove DRIVER_PRIME everywhere · 0424fdaf
      Daniel Vetter 提交于
      Split out to make the functional changes stick out more.
      
      All places where DRIVER_PRIME was used have been removed in previous
      patches already.
      
      v2: amdgpu gained DRIVER_SYNCOBJ_TIMELINE.
      
      v3: amdgpu lost DRIVER_SYNCOBJ_TIMELINE.
      
      v4: Don't add a space in i915_drv.c (Sam)
      
      v5: Add note that previous patches removed all the DRIVER_PRIME users
      already (Emil).
      
      v6: Fixupe ingenic (new driver) while applying.
      
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Reviewed-by: NEmil Velikov <emil.velikov@collabora.com>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: etnaviv@lists.freedesktop.org
      Cc: freedreno@lists.freedesktop.org
      Cc: intel-gfx@lists.freedesktop.org
      Cc: lima@lists.freedesktop.org
      Cc: linux-amlogic@lists.infradead.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-arm-msm@vger.kernel.org
      Cc: linux-aspeed@lists.ozlabs.org
      Cc: linux-renesas-soc@vger.kernel.org
      Cc: linux-rockchip@lists.infradead.org
      Cc: linux-samsung-soc@vger.kernel.org
      Cc: linux-stm32@st-md-mailman.stormreply.com
      Cc: linux-tegra@vger.kernel.org
      Cc: nouveau@lists.freedesktop.org
      Cc: NXP Linux Team <linux-imx@nxp.com>
      Cc: spice-devel@lists.freedesktop.org
      Cc: virtualization@lists.linux-foundation.org
      Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
      Cc: xen-devel@lists.xenproject.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20190617153924.414-1-daniel.vetter@ffwll.ch
      0424fdaf
  16. 18 3月, 2019 1 次提交
  17. 05 11月, 2018 2 次提交
  18. 25 10月, 2018 1 次提交
  19. 09 8月, 2018 1 次提交
  20. 03 7月, 2018 1 次提交
  21. 24 5月, 2018 1 次提交
  22. 11 8月, 2017 1 次提交
  23. 18 7月, 2017 1 次提交
  24. 23 6月, 2017 1 次提交
    • C
      drm/vgem: Pin our pages for dmabuf exports · 71bb23c7
      Chris Wilson 提交于
      When the caller maps their dmabuf and we return an sg_table, the caller
      doesn't expect the pages beneath that sg_table to vanish on a whim (i.e.
      under mempressure). The contract is that the pages are pinned for the
      duration of the mapping (from dma_buf_map_attachment() to
      dma_buf_unmap_attachment). To comply, we need to introduce our own
      vgem_object.pages_pin_count and elevate it across the mapping. However,
      the drm_prime interface we use calls drv->prime_pin on dma_buf_attach
      and drv->prime_unpin on dma_buf_detach, which while that does cover the
      mapping is much broader than is desired -- but it will do for now.
      
      v2: also hold the pin across prime_vmap/vunmap
      Reported-by: NTomi Sarvela <tomi.p.sarvela@intel.com>
      Testcase: igt/gem_concurrent_blit/*swap*vgem*
      Fixes: 5ba6c9ff ("drm/vgem: Fix mmaping")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: <stable@vger.kernel.org> # needs a backport
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170622134617.17912-1-chris@chris-wilson.co.uk
      71bb23c7
  25. 22 5月, 2017 1 次提交
  26. 18 5月, 2017 1 次提交
  27. 10 5月, 2017 1 次提交
  28. 08 5月, 2017 2 次提交
  29. 14 3月, 2017 1 次提交
  30. 25 2月, 2017 1 次提交
  31. 20 2月, 2017 1 次提交
  32. 15 12月, 2016 1 次提交
  33. 22 9月, 2016 1 次提交
  34. 18 7月, 2016 1 次提交
    • C
      drm/vgem: Attach sw fences to exported vGEM dma-buf (ioctl) · 40777984
      Chris Wilson 提交于
      vGEM buffers are useful for passing data between software clients and
      hardware renders. By allowing the user to create and attach fences to
      the exported vGEM buffers (on the dma-buf), the user can implement a
      deferred renderer and queue hardware operations like flipping and then
      signal the buffer readiness (i.e. this allows the user to schedule
      operations out-of-order, but have them complete in-order).
      
      This also makes it much easier to write tightly controlled testcases for
      dma-buf fencing and signaling between hardware drivers.
      
      v2: Don't pretend the fences exist in an ordered timeline, but allocate
      a separate fence-context for each fence so that the fences are
      unordered.
      v3: Make the debug output more interesting, and show the signaled status.
      v4: Automatically signal the fence to prevent userspace from
      indefinitely hanging drivers.
      
      Testcase: igt/vgem_basic/dmabuf-fence
      Testcase: igt/vgem_slow/nohang
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Zach Reizner <zachr@google.com>
      Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: NZach Reizner <zachr@google.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1468571471-12610-1-git-send-email-chris@chris-wilson.co.uk
      40777984
  35. 12 7月, 2016 2 次提交