]> Git Repo - J-linux.git/commitdiff
Merge tag 'topic/drmp-cleanup-2019-01-02' of git://anongit.freedesktop.org/drm/drm...
authorMaxime Ripard <[email protected]>
Mon, 7 Jan 2019 15:43:24 +0000 (16:43 +0100)
committerMaxime Ripard <[email protected]>
Mon, 7 Jan 2019 15:43:24 +0000 (16:43 +0100)
Make some drm headers self-contained with includes and forward declarations

Signed-off-by: Maxime Ripard <[email protected]>
# gpg: Signature made Wed 02 Jan 2019 10:47:51 AM CET
# gpg:                using RSA key 1565A65B77B0632E1124E59CD398079D26ABEE6F
# gpg: Can't check signature: No public key
From: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1  2 
include/drm/drm_syncobj.h

index 7c6ed845c70dc8824d8394138f603154f2dc6e12,ef57215126328ba619c6d83a0ca4cc08eb057b44..0311c9fdbd2f2107ba39cf40dd64a0f97641b416
  #ifndef __DRM_SYNCOBJ_H__
  #define __DRM_SYNCOBJ_H__
  
- #include "linux/dma-fence.h"
+ #include <linux/dma-fence.h>
+ struct drm_file;
  
 -struct drm_syncobj_cb;
 -
 -enum drm_syncobj_type {
 -      DRM_SYNCOBJ_TYPE_BINARY,
 -      DRM_SYNCOBJ_TYPE_TIMELINE
 -};
 -
  /**
   * struct drm_syncobj - sync object.
   *
 - * This structure defines a generic sync object which is timeline based.
 + * This structure defines a generic sync object which wraps a &dma_fence.
   */
  struct drm_syncobj {
        /**
         */
        struct kref refcount;
        /**
 -       * @type: indicate syncobj type
 -       */
 -      enum drm_syncobj_type type;
 -      /**
 -       * @wq: wait signal operation work queue
 -       */
 -      wait_queue_head_t       wq;
 -      /**
 -       * @timeline_context: fence context used by timeline
 +       * @fence:
 +       * NULL or a pointer to the fence bound to this object.
 +       *
 +       * This field should not be used directly. Use drm_syncobj_fence_get()
 +       * and drm_syncobj_replace_fence() instead.
         */
 -      u64 timeline_context;
 +      struct dma_fence __rcu *fence;
        /**
 -       * @timeline: syncobj timeline value, which indicates point is signaled.
 +       * @cb_list: List of callbacks to call when the &fence gets replaced.
         */
 -      u64 timeline;
 -      /**
 -       * @signal_point: which indicates the latest signaler point.
 -       */
 -      u64 signal_point;
 -      /**
 -       * @signal_pt_list: signaler point list.
 -       */
 -      struct list_head signal_pt_list;
 -
 -      /**
 -         * @cb_list: List of callbacks to call when the &fence gets replaced.
 -         */
        struct list_head cb_list;
        /**
 -       * @pt_lock: Protects pt list.
 -       */
 -      spinlock_t pt_lock;
 -      /**
 -       * @cb_mutex: Protects syncobj cb list.
 +       * @lock: Protects &cb_list and write-locks &fence.
         */
 -      struct mutex cb_mutex;
 +      spinlock_t lock;
        /**
         * @file: A file backing for this syncobj.
         */
        struct file *file;
  };
  
 -typedef void (*drm_syncobj_func_t)(struct drm_syncobj *syncobj,
 -                                 struct drm_syncobj_cb *cb);
 -
 -/**
 - * struct drm_syncobj_cb - callback for drm_syncobj_add_callback
 - * @node: used by drm_syncob_add_callback to append this struct to
 - *       &drm_syncobj.cb_list
 - * @func: drm_syncobj_func_t to call
 - *
 - * This struct will be initialized by drm_syncobj_add_callback, additional
 - * data can be passed along by embedding drm_syncobj_cb in another struct.
 - * The callback will get called the next time drm_syncobj_replace_fence is
 - * called.
 - */
 -struct drm_syncobj_cb {
 -      struct list_head node;
 -      drm_syncobj_func_t func;
 -};
 -
  void drm_syncobj_free(struct kref *kref);
  
  /**
@@@ -85,32 -134,9 +87,32 @@@ drm_syncobj_put(struct drm_syncobj *obj
        kref_put(&obj->refcount, drm_syncobj_free);
  }
  
 +/**
 + * drm_syncobj_fence_get - get a reference to a fence in a sync object
 + * @syncobj: sync object.
 + *
 + * This acquires additional reference to &drm_syncobj.fence contained in @obj,
 + * if not NULL. It is illegal to call this without already holding a reference.
 + * No locks required.
 + *
 + * Returns:
 + * Either the fence of @obj or NULL if there's none.
 + */
 +static inline struct dma_fence *
 +drm_syncobj_fence_get(struct drm_syncobj *syncobj)
 +{
 +      struct dma_fence *fence;
 +
 +      rcu_read_lock();
 +      fence = dma_fence_get_rcu_safe(&syncobj->fence);
 +      rcu_read_unlock();
 +
 +      return fence;
 +}
 +
  struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
                                     u32 handle);
 -void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, u64 point,
 +void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
                               struct dma_fence *fence);
  int drm_syncobj_find_fence(struct drm_file *file_private,
                           u32 handle, u64 point, u64 flags,
@@@ -121,5 -147,7 +123,5 @@@ int drm_syncobj_create(struct drm_synco
  int drm_syncobj_get_handle(struct drm_file *file_private,
                           struct drm_syncobj *syncobj, u32 *handle);
  int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd);
 -int drm_syncobj_search_fence(struct drm_syncobj *syncobj, u64 point, u64 flags,
 -                           struct dma_fence **fence);
  
  #endif
This page took 0.061794 seconds and 4 git commands to generate.