Lines Matching refs:client

19  * xe_drm_client_alloc() - Allocate drm client
22 * Allocate drm client struct to track client memory against
23 * same till client life. Call this API whenever new client
26 * Return: pointer to client struct or NULL if can't allocate
30 struct xe_drm_client *client;
32 client = kzalloc(sizeof(*client), GFP_KERNEL);
33 if (!client)
36 kref_init(&client->kref);
39 spin_lock_init(&client->bos_lock);
40 INIT_LIST_HEAD(&client->bos_list);
42 return client;
46 * __xe_drm_client_free() - Free client struct
49 * This frees client struct. Call this API when xe device is closed
50 * by drm client.
56 struct xe_drm_client *client =
57 container_of(kref, typeof(*client), kref);
59 kfree(client);
64 * xe_drm_client_add_bo() - Add BO for tracking client mem usage
65 * @client: The drm client ptr
68 * Add all BO created by individual drm client by calling this function.
69 * This helps in tracking client memory usage.
73 void xe_drm_client_add_bo(struct xe_drm_client *client,
76 XE_WARN_ON(bo->client);
79 spin_lock(&client->bos_lock);
80 bo->client = xe_drm_client_get(client);
81 list_add_tail(&bo->client_link, &client->bos_list);
82 spin_unlock(&client->bos_lock);
86 * xe_drm_client_remove_bo() - Remove BO for tracking client mem usage
89 * Remove all BO removed by individual drm client by calling this function.
90 * This helps in tracking client memory usage.
96 struct xe_drm_client *client = bo->client;
98 spin_lock(&client->bos_lock);
100 spin_unlock(&client->bos_lock);
102 xe_drm_client_put(client);
138 struct xe_drm_client *client;
144 client = xef->client;
156 spin_lock(&client->bos_lock);
157 list_for_each_entry(bo, &client->bos_list, client_link) {
163 spin_unlock(&client->bos_lock);