Lines Matching +full:resource +full:- +full:files
1 // SPDX-License-Identifier: GPL-2.0 OR MIT
7 * copy of this software and associated documentation files (the
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
32 * struct vmw_user_simple_resource - User-space simple resource struct
34 * @base: The TTM base object implementing user-space visibility.
48 * vmw_simple_resource_init - Initialize a simple resource object.
53 * @res_free: Function pointer to destroy the simple resource.
57 * Negative error value if error, in which case the resource will have been
65 struct vmw_resource *res = &simple->res; in vmw_simple_resource_init()
69 &simple->func->res_func); in vmw_simple_resource_init()
76 ret = simple->func->init(res, data); in vmw_simple_resource_init()
82 simple->res.hw_destroy = simple->func->hw_destroy; in vmw_simple_resource_init()
88 * vmw_simple_resource_free - Free a simple resource object.
90 * @res: The struct vmw_resource member of the simple resource object.
104 * vmw_simple_resource_base_release - TTM object release callback
106 * @p_base: The struct ttm_base_object member of the simple resource object.
117 struct vmw_resource *res = &usimple->simple.res; in vmw_simple_resource_base_release()
124 * vmw_simple_resource_create_ioctl - Helper to set up an ioctl function to
131 * simple resource type.
146 struct ttm_object_file *tfile = vmw_fpriv(file_priv)->tfile; in vmw_simple_resource_create_ioctl()
151 func->size; in vmw_simple_resource_create_ioctl()
155 ret = -ENOMEM; in vmw_simple_resource_create_ioctl()
159 usimple->simple.func = func; in vmw_simple_resource_create_ioctl()
160 res = &usimple->simple.res; in vmw_simple_resource_create_ioctl()
161 usimple->base.shareable = false; in vmw_simple_resource_create_ioctl()
162 usimple->base.tfile = NULL; in vmw_simple_resource_create_ioctl()
165 * From here on, the destructor takes over resource freeing. in vmw_simple_resource_create_ioctl()
167 ret = vmw_simple_resource_init(dev_priv, &usimple->simple, in vmw_simple_resource_create_ioctl()
173 ret = ttm_base_object_init(tfile, &usimple->base, false, in vmw_simple_resource_create_ioctl()
174 func->ttm_res_type, in vmw_simple_resource_create_ioctl()
182 func->set_arg_handle(data, usimple->base.handle); in vmw_simple_resource_create_ioctl()
190 * vmw_simple_resource_lookup - Look up a simple resource from its user-space
194 * @handle: The user-space handle.
195 * @func: The struct vmw_simple_resource_func identifying the simple resource
213 func->res_func.type_name, in vmw_simple_resource_lookup()
215 return ERR_PTR(-ESRCH); in vmw_simple_resource_lookup()
218 if (ttm_base_object_type(base) != func->ttm_res_type) { in vmw_simple_resource_lookup()
221 func->res_func.type_name, in vmw_simple_resource_lookup()
223 return ERR_PTR(-EINVAL); in vmw_simple_resource_lookup()
227 res = vmw_resource_reference(&usimple->simple.res); in vmw_simple_resource_lookup()