1. 13 10月, 2017 1 次提交
  2. 29 8月, 2017 3 次提交
    • J
      drm/syncobj: Add a signal ioctl (v3) · ffa9443f
      Jason Ekstrand 提交于
      This IOCTL provides a mechanism for userspace to trigger a sync object
      directly.  There are other ways that userspace can trigger a syncobj
      such as submitting a dummy batch somewhere or hanging on to a triggered
      sync_file and doing an import.  This just provides an easy way to
      manually trigger the sync object without weird hacks.
      
      The motivation for this IOCTL is Vulkan fences.  Vulkan lets you create
      a fence already in the signaled state so that you can wait on it
      immediatly without stalling.  We could also handle this with a new
      create flag to ask the driver to create a syncobj that is already
      signaled but the IOCTL seemed a bit cleaner and more generic.
      
      v2:
       - Take an array of sync objects (Dave Airlie)
      v3:
       - Throw -EINVAL if pad != 0
      Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ffa9443f
    • J
      drm/syncobj: Add a reset ioctl (v3) · aa4035d2
      Jason Ekstrand 提交于
      This just resets the dma_fence to NULL so it looks like it's never been
      signaled.  This will be useful once we add the new wait API for allowing
      wait on "submit and signal" behavior.
      
      v2:
       - Take an array of sync objects (Dave Airlie)
      v3:
       - Throw -EINVAL if pad != 0
      Signed-off-by: NJason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: Christian König <christian.koenig@amd.com> (v1)
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      aa4035d2
    • D
      drm/syncobj: add sync obj wait interface. (v8) · 5e60a10e
      Dave Airlie 提交于
      This interface will allow sync object to be used to back
      Vulkan fences. This API is pretty much the vulkan fence waiting
      API, and I've ported the code from amdgpu.
      
      v2: accept relative timeout, pass remaining time back
      to userspace.
      v3: return to absolute timeouts.
      v4: absolute zero = poll,
          rewrite any/all code to have same operation for arrays
          return -EINVAL for 0 fences.
      v4.1: fixup fences allocation check, use u64_to_user_ptr
      v5: move to sec/nsec, and use timespec64 for calcs.
      v6: use -ETIME and drop the out status flag. (-ETIME
      is suggested by ickle, I can feel a shed painting)
      v7: talked to Daniel/Arnd, use ktime and ns everywhere.
      v8: be more careful in the timeout calculations
          use uint32_t for counter variables so we don't overflow
          graciously handle -ENOINT being returned from dma_fence_wait_timeout
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      Reviewed-by: NJason Ekstrand <jason@jlekstrand.net>
      Acked-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      5e60a10e
  3. 28 6月, 2017 1 次提交
    • D
      drm/vblank: Unexport drm_vblank_cleanup · b4164d66
      Daniel Vetter 提交于
      There's no reason for drivers to call this, and all the ones I've
      removed looked very fishy:
      - Proper quiescenting of the vblank machinery should be done by
        calling drm_crtc_vblank_off(), which is best done by shutting down
        the entire display engine with drm_atomic_helper_shutdown.
      
      - Releasing of allocated memory is done by the core already, it calls
        drm_vblank_cleanup as a fallback.
      
      - drm_vblank_cleanup also has checks for drivers which forget to clean
        up vblank interrupts.
      
      This essentially reverts
      
      commit e77cef9c
      Author: Jerome Glisse <jglisse@redhat.com>
      Date:   Thu Jan 7 15:39:13 2010 +0100
      
          drm: Avoid calling vblank function is vblank wasn't initialized
      
      which was done to fix a bug in radeon code with msi interrupts:
      
      commit 003e69f9
      Author: Jerome Glisse <jglisse@redhat.com>
      Date:   Thu Jan 7 15:39:14 2010 +0100
      
          drm/radeon/kms: Don't try to enable IRQ if we have no handler installed
      
      Afaict from digging around in old code, this was needed to avoid
      blowing up in the ums fallback, and has stopped serving it's purpose
      long ago - if irq init fails, the driver fails to load, and there's
      really no way to blow up anymore.
      
      Long story short, this was most likely a small ums compat/fallback
      hack that became a thing of it's own and got cargo-cult duplicated all
      over the drm codebase for essentially no gain at all.
      
      v2: Mention that for drivers with a ->release callback cleanup is
      handled by drm_dev_fini() (Thierry).
      
      Cc: Thierry Reding <treding@nvidia.com>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170626161949.25629-2-daniel.vetter@ffwll.ch
      b4164d66
  4. 20 6月, 2017 2 次提交
  5. 14 6月, 2017 1 次提交
    • D
      drm: introduce sync objects (v4) · e9083420
      Dave Airlie 提交于
      Sync objects are new toplevel drm object, that contain a
      pointer to a fence. This fence can be updated via command
      submission ioctls via drivers.
      
      There is also a generic wait obj API modelled on the vulkan
      wait API (with code modelled on some amdgpu code).
      
      These objects can be converted to an opaque fd that can be
      passes between processes.
      
      v2: rename reference/unreference to put/get (Chris)
      fix leaked reference (David Zhou)
      drop mutex in favour of cmpxchg (Chris)
      v3: cleanups from danvet, rebase on drm_fops rename
      check fd_flags is 0 in ioctls.
      v4: export find/free, change replace fence to take a
      syncobj. In order to support lookup first, replace
      later semantics which seem in the end to be cleaner.
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      e9083420
  6. 01 6月, 2017 1 次提交
  7. 28 5月, 2017 3 次提交
  8. 24 3月, 2017 1 次提交
  9. 09 3月, 2017 1 次提交
  10. 26 1月, 2017 1 次提交
  11. 18 12月, 2016 1 次提交
  12. 16 11月, 2016 1 次提交
  13. 15 11月, 2016 1 次提交
    • D
      drm: Extract drm_drv.h · 85e634bc
      Daniel Vetter 提交于
      I want to move dumb buffer documentation into the right vfuncs, and
      for that I first need to be able to pull that into kerneldoc without
      having to clean up all of drmP.h. Also, header-splitting is nice.
      
      While at it shuffle all the function declarations for drm_drv.c into
      the right spots, and drop the kerneldoc for drm_minor_acquire/release
      since it's only used internally.
      
      v2: Keep all existing copyright notices (Chris).
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      85e634bc
  14. 17 10月, 2016 1 次提交
    • T
      drm: Add API for capturing frame CRCs · 9edbf1fa
      Tomeu Vizoso 提交于
      Adds files and directories to debugfs for controlling and reading frame
      CRCs, per CRTC:
      
      dri/0/crtc-0/crc
      dri/0/crtc-0/crc/control
      dri/0/crtc-0/crc/data
      
      Drivers can implement the set_crc_source callback() in drm_crtc_funcs to
      start and stop generating frame CRCs and can add entries to the output
      by calling drm_crtc_add_crc_entry.
      
      v2:
          - Lots of good fixes suggested by Thierry.
          - Added documentation.
          - Changed the debugfs layout.
          - Moved to allocate the entries circular queue once when frame
            generation gets enabled for the first time.
      v3:
          - Use the control file just to select the source, and start and stop
            capture when the data file is opened and closed, respectively.
          - Make variable the number of CRC values per entry, per source.
          - Allocate entries queue each time we start capturing as now there
            isn't a fixed number of CRC values per entry.
          - Store the frame counter in the data file as a 8-digit hex number.
          - For sources that cannot provide useful frame numbers, place
            XXXXXXXX in the frame field.
      
      v4:
          - Build only if CONFIG_DEBUG_FS is enabled.
          - Use memdup_user_nul.
          - Consolidate calculation of the size of an entry in a helper.
          - Add 0x prefix to hex numbers in the data file.
          - Remove unnecessary snprintf and strlen usage in read callback.
      
      v5:
          - Made the crcs array in drm_crtc_crc_entry fixed-size
          - Lots of other smaller improvements suggested by Emil Velikov
      
      v7:
          - Move definition of drm_debugfs_crtc_crc_add to drm_internal.h
      
      v8:
          - Call debugfs_remove_recursive when we fail to create the minor
            device
      
      v9:
          - Register the debugfs directory for a crtc from
            drm_crtc_register_all()
      
      v10:
          - Don't let debugfs failures interrupt CRTC registration (Emil
            Velikov)
      
      v11:
          - Remove extra brace that broke compilation. Sorry!
      Signed-off-by: NTomeu Vizoso <tomeu.vizoso@collabora.com>
      Reviewed-by: NEmil Velikov <emil.velikov@collabora.com>
      Acked-by: NBenjamin Gaignard <benjamin.gaignard@linaro.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1475767268-14379-3-git-send-email-tomeu.vizoso@collabora.com
      9edbf1fa
  15. 19 9月, 2016 1 次提交
    • D
      drm: drop obsolete drm_core.h · 82d5e73f
      David Herrmann 提交于
      The drm_core.h header contains a set of constants meant to be used
      throughout DRM. However, as it turns out, they're each used just once and
      don't bring any benefit. They're also grossly mis-named and lack
      name-spacing. This patch inlines them, or moves them into drm_internal.h
      as appropriate:
      
       - CORE_AUTHOR and CORE_DESC are inlined into corresponding MODULE_*()
         macros. It's just confusing having to follow 2 pointers when trying to
         find the definition of these fields. Grep'ping for MODULE_AUTHOR()
         should reveal the full information, if there's no strong reason not to.
      
       - CORE_NAME, CORE_DATE, CORE_MAJOR, CORE_MINOR, and CORE_PATCHLEVEL are
         inlined into the sysfs 'version' attribute. They're stripped
         everywhere else (which is just some printk() statements). CORE_NAME
         just doesn't make *any* sense, as we hard-code it in many places,
         anyway. The other constants are outdated and just serve
         binary-compatibility purposes. Hence, inline them in 'version' sysfs
         attribute (we might even try dropping it..).
      
       - DRM_IF_MAJOR and DRM_IF_MINOR are moved into drm_internal.h as they're
         only used by the global ioctl handlers. Furthermore, versioning
         interfaces breaks backports and as such is deprecated, anyway. We just
         keep them for historic reasons. I doubt anyone will ever modify them
         again.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20160901124837.680-6-dh.herrmann@gmail.com
      82d5e73f
  16. 22 6月, 2016 1 次提交
  17. 16 6月, 2016 5 次提交
  18. 27 4月, 2016 2 次提交
  19. 09 9月, 2015 1 次提交
    • D
      drm: move drm_class into drm_sysfs.c · fcc90213
      David Herrmann 提交于
      Right now, drm_sysfs_create() returns the newly allocated "struct class"
      to the caller (which is drm_core_init()), which then has to set the
      global variable 'drm_class'. During cleanup, though, we call
      drm_sysfs_destroy() which implicitly uses the global 'drm_class'. This is
      confusing, as ownership of the global 'drm_class' is non-obvious.
      
      This patch changes drm_sysfs_create() to drm_sysfs_init() and makes it
      initialize the 'drm_class' object directly, rather than returning it.
      This way, both drm_sysfs_init() and drm_sysfs_destroy() work in a similar
      fashion and manage the global drm class.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fcc90213
  20. 05 5月, 2015 1 次提交
    • D
      drm: simplify authentication management · 32e7b94a
      David Herrmann 提交于
      The magic auth tokens we have are a simple map from cyclic IDs to drm_file
      objects. Remove all the old bulk of code and replace it with a simple,
      direct IDR.
      
      The previous behavior is kept. Especially calling authmagic multiple times
      on the same magic results in EINVAL except on the first call. The only
      difference in behavior is that we never allocate IDs multiple times as
      long as a client has its FD open.
      
      v2:
       - Fix return code of GetMagic()
       - Use non-cyclic IDR allocator
       - fix off-by-one in "magic > INT_MAX" sanity check
      
      v3:
       - drop redundant "magic > INT_MAX" check
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      32e7b94a
  21. 17 12月, 2014 1 次提交
  22. 24 9月, 2014 4 次提交
  23. 12 9月, 2014 4 次提交
  24. 11 6月, 2014 1 次提交