diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drm_client.h')
| -rw-r--r-- | drivers/gpu/drm/i915/i915_drm_client.h | 62 |
1 files changed, 43 insertions, 19 deletions
diff --git a/drivers/gpu/drm/i915/i915_drm_client.h b/drivers/gpu/drm/i915/i915_drm_client.h index 69496af996d9..2e7a50d16a88 100644 --- a/drivers/gpu/drm/i915/i915_drm_client.h +++ b/drivers/gpu/drm/i915/i915_drm_client.h @@ -9,30 +9,37 @@ #include <linux/kref.h> #include <linux/list.h> #include <linux/spinlock.h> -#include <linux/xarray.h> #include <uapi/drm/i915_drm.h> -#define I915_LAST_UABI_ENGINE_CLASS I915_ENGINE_CLASS_COMPUTE - -struct drm_i915_private; +#include "i915_file_private.h" +#include "gem/i915_gem_object_types.h" +#include "gt/intel_context_types.h" -struct i915_drm_clients { - struct drm_i915_private *i915; +#define I915_LAST_UABI_ENGINE_CLASS I915_ENGINE_CLASS_COMPUTE - struct xarray xarray; - u32 next_id; -}; +struct drm_file; +struct drm_printer; struct i915_drm_client { struct kref kref; - unsigned int id; - spinlock_t ctx_lock; /* For add/remove from ctx_list. */ struct list_head ctx_list; /* List of contexts belonging to client. */ - struct i915_drm_clients *clients; +#ifdef CONFIG_PROC_FS + /** + * @objects_lock: lock protecting @objects_list + */ + spinlock_t objects_lock; + + /** + * @objects_list: list of objects created by this client + * + * Protected by @objects_lock. + */ + struct list_head objects_list; +#endif /** * @past_runtime: Accumulation of pphwsp runtimes from closed contexts. @@ -40,9 +47,6 @@ struct i915_drm_client { atomic64_t past_runtime[I915_LAST_UABI_ENGINE_CLASS + 1]; }; -void i915_drm_clients_init(struct i915_drm_clients *clients, - struct drm_i915_private *i915); - static inline struct i915_drm_client * i915_drm_client_get(struct i915_drm_client *client) { @@ -57,12 +61,32 @@ static inline void i915_drm_client_put(struct i915_drm_client *client) kref_put(&client->kref, __i915_drm_client_free); } -struct i915_drm_client *i915_drm_client_add(struct i915_drm_clients *clients); +struct i915_drm_client *i915_drm_client_alloc(void); + +void i915_drm_client_fdinfo(struct drm_printer *p, struct drm_file *file); #ifdef CONFIG_PROC_FS -void i915_drm_client_fdinfo(struct seq_file *m, struct file *f); -#endif +void i915_drm_client_add_object(struct i915_drm_client *client, + struct drm_i915_gem_object *obj); +void i915_drm_client_remove_object(struct drm_i915_gem_object *obj); +void i915_drm_client_add_context_objects(struct i915_drm_client *client, + struct intel_context *ce); +#else +static inline void i915_drm_client_add_object(struct i915_drm_client *client, + struct drm_i915_gem_object *obj) +{ +} -void i915_drm_clients_fini(struct i915_drm_clients *clients); +static inline void +i915_drm_client_remove_object(struct drm_i915_gem_object *obj) +{ +} + +static inline void +i915_drm_client_add_context_objects(struct i915_drm_client *client, + struct intel_context *ce) +{ +} +#endif #endif /* !__I915_DRM_CLIENT_H__ */ |
