1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2023 Intel Corporation
6 #ifndef _XE_DRM_CLIENT_H_
7 #define _XE_DRM_CLIENT_H_
9 #include <linux/kref.h>
10 #include <linux/list.h>
11 #include <linux/pid.h>
12 #include <linux/rcupdate.h>
13 #include <linux/sched.h>
14 #include <linux/spinlock.h>
20 struct xe_drm_client {
25 * @bos_lock: lock protecting @bos_list
29 * @bos_list: list of bos created by this client
31 * Protected by @bos_lock.
33 struct list_head bos_list;
37 static inline struct xe_drm_client *
38 xe_drm_client_get(struct xe_drm_client *client)
40 kref_get(&client->kref);
44 void __xe_drm_client_free(struct kref *kref);
46 static inline void xe_drm_client_put(struct xe_drm_client *client)
48 kref_put(&client->kref, __xe_drm_client_free);
51 struct xe_drm_client *xe_drm_client_alloc(void);
52 static inline struct xe_drm_client *
53 xe_drm_client_get(struct xe_drm_client *client);
54 static inline void xe_drm_client_put(struct xe_drm_client *client);
56 void xe_drm_client_fdinfo(struct drm_printer *p, struct drm_file *file);
57 void xe_drm_client_add_bo(struct xe_drm_client *client,
59 void xe_drm_client_remove_bo(struct xe_bo *bo);
61 static inline void xe_drm_client_add_bo(struct xe_drm_client *client,
66 static inline void xe_drm_client_remove_bo(struct xe_bo *bo)