mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 17:01:14 +00:00
21950ee7cc
Looking forward, we need to break the struct_mutex dependency on i915_gem_active. In the meantime, external use of i915_gem_active is quite beguiling, little do new users suspect that it implies a barrier as each request it tracks must be ordered wrt the previous one. As one of many, it can be used to track activity across multiple timelines, a shared fence, which fits our unordered request submission much better. We need to steer external users away from the singular, exclusive fence imposed by i915_gem_active to i915_active instead. As part of that process, we move i915_gem_active out of i915_request.c into i915_active.c to start separating the two concepts, and rename it to i915_active_request (both to tie it to the concept of tracking just one request, and to give it a longer, less appealing name). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190205130005.2807-5-chris@chris-wilson.co.uk
36 lines
714 B
C
36 lines
714 B
C
/*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* Copyright © 2019 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _I915_ACTIVE_TYPES_H_
|
|
#define _I915_ACTIVE_TYPES_H_
|
|
|
|
#include <linux/rbtree.h>
|
|
#include <linux/rcupdate.h>
|
|
|
|
struct drm_i915_private;
|
|
struct i915_active_request;
|
|
struct i915_request;
|
|
|
|
typedef void (*i915_active_retire_fn)(struct i915_active_request *,
|
|
struct i915_request *);
|
|
|
|
struct i915_active_request {
|
|
struct i915_request __rcu *request;
|
|
struct list_head link;
|
|
i915_active_retire_fn retire;
|
|
};
|
|
|
|
struct i915_active {
|
|
struct drm_i915_private *i915;
|
|
|
|
struct rb_root tree;
|
|
struct i915_active_request last;
|
|
unsigned int count;
|
|
|
|
void (*retire)(struct i915_active *ref);
|
|
};
|
|
|
|
#endif /* _I915_ACTIVE_TYPES_H_ */
|