Loading...
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
2/*
3 * Copyright (c) 2021-2024 Broadcom. All Rights Reserved. The term
4 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
5 *
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation
8 * files (the "Software"), to deal in the Software without
9 * restriction, including without limitation the rights to use, copy,
10 * modify, merge, publish, distribute, sublicense, and/or sell copies
11 * of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be
15 * included in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 * SOFTWARE.
25 *
26 */
27
28#include "vmwgfx_bo.h"
29#include "vmwgfx_drv.h"
30
31#include "drm/drm_prime.h"
32#include "drm/drm_gem_ttm_helper.h"
33
34#include <linux/debugfs.h>
35
36static void vmw_gem_object_free(struct drm_gem_object *gobj)
37{
38 struct ttm_buffer_object *bo = drm_gem_ttm_of_gem(gobj);
39 if (bo)
40 ttm_bo_put(bo);
41}
42
43static int vmw_gem_object_open(struct drm_gem_object *obj,
44 struct drm_file *file_priv)
45{
46 return 0;
47}
48
49static void vmw_gem_object_close(struct drm_gem_object *obj,
50 struct drm_file *file_priv)
51{
52}
53
54static int vmw_gem_object_pin(struct drm_gem_object *obj)
55{
56 struct vmw_bo *vbo = to_vmw_bo(obj);
57
58 vmw_bo_pin_reserved(vbo, true);
59
60 return 0;
61}
62
63static void vmw_gem_object_unpin(struct drm_gem_object *obj)
64{
65 struct vmw_bo *vbo = to_vmw_bo(obj);
66
67 vmw_bo_pin_reserved(vbo, false);
68}
69
70static struct sg_table *vmw_gem_object_get_sg_table(struct drm_gem_object *obj)
71{
72 struct ttm_buffer_object *bo = drm_gem_ttm_of_gem(obj);
73 struct vmw_ttm_tt *vmw_tt =
74 container_of(bo->ttm, struct vmw_ttm_tt, dma_ttm);
75
76 if (vmw_tt->vsgt.sgt)
77 return vmw_tt->vsgt.sgt;
78
79 return drm_prime_pages_to_sg(obj->dev, vmw_tt->dma_ttm.pages, vmw_tt->dma_ttm.num_pages);
80}
81
82static int vmw_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map)
83{
84 struct ttm_buffer_object *bo = drm_gem_ttm_of_gem(obj);
85 int ret;
86
87 if (obj->import_attach) {
88 ret = dma_buf_vmap(obj->import_attach->dmabuf, map);
89 if (!ret) {
90 if (drm_WARN_ON(obj->dev, map->is_iomem)) {
91 dma_buf_vunmap(obj->import_attach->dmabuf, map);
92 return -EIO;
93 }
94 }
95 } else {
96 ret = ttm_bo_vmap(bo, map);
97 }
98
99 return ret;
100}
101
102static void vmw_gem_vunmap(struct drm_gem_object *obj, struct iosys_map *map)
103{
104 if (obj->import_attach)
105 dma_buf_vunmap(obj->import_attach->dmabuf, map);
106 else
107 drm_gem_ttm_vunmap(obj, map);
108}
109
110static int vmw_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
111{
112 int ret;
113
114 if (obj->import_attach) {
115 /*
116 * Reset both vm_ops and vm_private_data, so we don't end up with
117 * vm_ops pointing to our implementation if the dma-buf backend
118 * doesn't set those fields.
119 */
120 vma->vm_private_data = NULL;
121 vma->vm_ops = NULL;
122
123 ret = dma_buf_mmap(obj->dma_buf, vma, 0);
124
125 /* Drop the reference drm_gem_mmap_obj() acquired.*/
126 if (!ret)
127 drm_gem_object_put(obj);
128
129 return ret;
130 }
131
132 return drm_gem_ttm_mmap(obj, vma);
133}
134
135static const struct vm_operations_struct vmw_vm_ops = {
136 .pfn_mkwrite = vmw_bo_vm_mkwrite,
137 .page_mkwrite = vmw_bo_vm_mkwrite,
138 .fault = vmw_bo_vm_fault,
139 .open = ttm_bo_vm_open,
140 .close = ttm_bo_vm_close,
141};
142
143static const struct drm_gem_object_funcs vmw_gem_object_funcs = {
144 .free = vmw_gem_object_free,
145 .open = vmw_gem_object_open,
146 .close = vmw_gem_object_close,
147 .print_info = drm_gem_ttm_print_info,
148 .pin = vmw_gem_object_pin,
149 .unpin = vmw_gem_object_unpin,
150 .get_sg_table = vmw_gem_object_get_sg_table,
151 .vmap = vmw_gem_vmap,
152 .vunmap = vmw_gem_vunmap,
153 .mmap = vmw_gem_mmap,
154 .vm_ops = &vmw_vm_ops,
155};
156
157int vmw_gem_object_create(struct vmw_private *vmw,
158 struct vmw_bo_params *params,
159 struct vmw_bo **p_vbo)
160{
161 int ret = vmw_bo_create(vmw, params, p_vbo);
162
163 if (ret != 0)
164 goto out_no_bo;
165
166 (*p_vbo)->tbo.base.funcs = &vmw_gem_object_funcs;
167out_no_bo:
168 return ret;
169}
170
171int vmw_gem_object_create_with_handle(struct vmw_private *dev_priv,
172 struct drm_file *filp,
173 uint32_t size,
174 uint32_t *handle,
175 struct vmw_bo **p_vbo)
176{
177 int ret;
178 struct vmw_bo_params params = {
179 .domain = (dev_priv->has_mob) ? VMW_BO_DOMAIN_SYS : VMW_BO_DOMAIN_VRAM,
180 .busy_domain = VMW_BO_DOMAIN_SYS,
181 .bo_type = ttm_bo_type_device,
182 .size = size,
183 .pin = false
184 };
185
186 ret = vmw_gem_object_create(dev_priv, ¶ms, p_vbo);
187 if (ret != 0)
188 goto out_no_bo;
189
190 ret = drm_gem_handle_create(filp, &(*p_vbo)->tbo.base, handle);
191out_no_bo:
192 return ret;
193}
194
195struct drm_gem_object *vmw_prime_import_sg_table(struct drm_device *dev,
196 struct dma_buf_attachment *attach,
197 struct sg_table *table)
198{
199 int ret;
200 struct vmw_private *dev_priv = vmw_priv(dev);
201 struct drm_gem_object *gem = NULL;
202 struct vmw_bo *vbo;
203 struct vmw_bo_params params = {
204 .domain = (dev_priv->has_mob) ? VMW_BO_DOMAIN_SYS : VMW_BO_DOMAIN_VRAM,
205 .busy_domain = VMW_BO_DOMAIN_SYS,
206 .bo_type = ttm_bo_type_sg,
207 .size = attach->dmabuf->size,
208 .pin = false,
209 .keep_resv = true,
210 .resv = attach->dmabuf->resv,
211 .sg = table,
212
213 };
214
215 dma_resv_lock(params.resv, NULL);
216
217 ret = vmw_bo_create(dev_priv, ¶ms, &vbo);
218 if (ret != 0)
219 goto out_no_bo;
220
221 vbo->tbo.base.funcs = &vmw_gem_object_funcs;
222
223 gem = &vbo->tbo.base;
224out_no_bo:
225 dma_resv_unlock(params.resv);
226 return gem;
227}
228
229int vmw_gem_object_create_ioctl(struct drm_device *dev, void *data,
230 struct drm_file *filp)
231{
232 struct vmw_private *dev_priv = vmw_priv(dev);
233 union drm_vmw_alloc_dmabuf_arg *arg =
234 (union drm_vmw_alloc_dmabuf_arg *)data;
235 struct drm_vmw_alloc_dmabuf_req *req = &arg->req;
236 struct drm_vmw_dmabuf_rep *rep = &arg->rep;
237 struct vmw_bo *vbo;
238 uint32_t handle;
239 int ret;
240
241 ret = vmw_gem_object_create_with_handle(dev_priv, filp,
242 req->size, &handle, &vbo);
243 if (ret)
244 goto out_no_bo;
245
246 rep->handle = handle;
247 rep->map_handle = drm_vma_node_offset_addr(&vbo->tbo.base.vma_node);
248 rep->cur_gmr_id = handle;
249 rep->cur_gmr_offset = 0;
250 /* drop reference from allocate - handle holds it now */
251 drm_gem_object_put(&vbo->tbo.base);
252out_no_bo:
253 return ret;
254}
255
256#if defined(CONFIG_DEBUG_FS)
257
258static void vmw_bo_print_info(int id, struct vmw_bo *bo, struct seq_file *m)
259{
260 const char *placement;
261 const char *type;
262
263 switch (bo->tbo.resource->mem_type) {
264 case TTM_PL_SYSTEM:
265 placement = " CPU";
266 break;
267 case VMW_PL_GMR:
268 placement = " GMR";
269 break;
270 case VMW_PL_MOB:
271 placement = " MOB";
272 break;
273 case VMW_PL_SYSTEM:
274 placement = "VCPU";
275 break;
276 case TTM_PL_VRAM:
277 placement = "VRAM";
278 break;
279 default:
280 placement = "None";
281 break;
282 }
283
284 switch (bo->tbo.type) {
285 case ttm_bo_type_device:
286 type = "device";
287 break;
288 case ttm_bo_type_kernel:
289 type = "kernel";
290 break;
291 case ttm_bo_type_sg:
292 type = "sg ";
293 break;
294 default:
295 type = "none ";
296 break;
297 }
298
299 seq_printf(m, "\t\t0x%08x: %12zu bytes %s, type = %s",
300 id, bo->tbo.base.size, placement, type);
301 seq_printf(m, ", priority = %u, pin_count = %u, GEM refs = %d, TTM refs = %d",
302 bo->tbo.priority,
303 bo->tbo.pin_count,
304 kref_read(&bo->tbo.base.refcount),
305 kref_read(&bo->tbo.kref));
306 seq_puts(m, "\n");
307}
308
309static int vmw_debugfs_gem_info_show(struct seq_file *m, void *unused)
310{
311 struct vmw_private *vdev = (struct vmw_private *)m->private;
312 struct drm_device *dev = &vdev->drm;
313 struct drm_file *file;
314 int r;
315
316 r = mutex_lock_interruptible(&dev->filelist_mutex);
317 if (r)
318 return r;
319
320 list_for_each_entry(file, &dev->filelist, lhead) {
321 struct task_struct *task;
322 struct drm_gem_object *gobj;
323 struct pid *pid;
324 int id;
325
326 /*
327 * Although we have a valid reference on file->pid, that does
328 * not guarantee that the task_struct who called get_pid() is
329 * still alive (e.g. get_pid(current) => fork() => exit()).
330 * Therefore, we need to protect this ->comm access using RCU.
331 */
332 rcu_read_lock();
333 pid = rcu_dereference(file->pid);
334 task = pid_task(pid, PIDTYPE_TGID);
335 seq_printf(m, "pid %8d command %s:\n", pid_nr(pid),
336 task ? task->comm : "<unknown>");
337 rcu_read_unlock();
338
339 spin_lock(&file->table_lock);
340 idr_for_each_entry(&file->object_idr, gobj, id) {
341 struct vmw_bo *bo = to_vmw_bo(gobj);
342
343 vmw_bo_print_info(id, bo, m);
344 }
345 spin_unlock(&file->table_lock);
346 }
347
348 mutex_unlock(&dev->filelist_mutex);
349 return 0;
350}
351
352DEFINE_SHOW_ATTRIBUTE(vmw_debugfs_gem_info);
353
354#endif
355
356void vmw_debugfs_gem_init(struct vmw_private *vdev)
357{
358#if defined(CONFIG_DEBUG_FS)
359 struct drm_minor *minor = vdev->drm.primary;
360 struct dentry *root = minor->debugfs_root;
361
362 debugfs_create_file("vmwgfx_gem_info", 0444, root, vdev,
363 &vmw_debugfs_gem_info_fops);
364#endif
365}
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
2/*
3 * Copyright 2021-2023 VMware, Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person
6 * obtaining a copy of this software and associated documentation
7 * files (the "Software"), to deal in the Software without
8 * restriction, including without limitation the rights to use, copy,
9 * modify, merge, publish, distribute, sublicense, and/or sell copies
10 * of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 *
25 */
26
27#include "vmwgfx_bo.h"
28#include "vmwgfx_drv.h"
29
30#include "drm/drm_prime.h"
31#include "drm/drm_gem_ttm_helper.h"
32
33static void vmw_gem_object_free(struct drm_gem_object *gobj)
34{
35 struct ttm_buffer_object *bo = drm_gem_ttm_of_gem(gobj);
36 if (bo)
37 ttm_bo_put(bo);
38}
39
40static int vmw_gem_object_open(struct drm_gem_object *obj,
41 struct drm_file *file_priv)
42{
43 return 0;
44}
45
46static void vmw_gem_object_close(struct drm_gem_object *obj,
47 struct drm_file *file_priv)
48{
49}
50
51static int vmw_gem_pin_private(struct drm_gem_object *obj, bool do_pin)
52{
53 struct ttm_buffer_object *bo = drm_gem_ttm_of_gem(obj);
54 struct vmw_bo *vbo = to_vmw_bo(obj);
55 int ret;
56
57 ret = ttm_bo_reserve(bo, false, false, NULL);
58 if (unlikely(ret != 0))
59 goto err;
60
61 vmw_bo_pin_reserved(vbo, do_pin);
62
63 ttm_bo_unreserve(bo);
64
65err:
66 return ret;
67}
68
69
70static int vmw_gem_object_pin(struct drm_gem_object *obj)
71{
72 return vmw_gem_pin_private(obj, true);
73}
74
75static void vmw_gem_object_unpin(struct drm_gem_object *obj)
76{
77 vmw_gem_pin_private(obj, false);
78}
79
80static struct sg_table *vmw_gem_object_get_sg_table(struct drm_gem_object *obj)
81{
82 struct ttm_buffer_object *bo = drm_gem_ttm_of_gem(obj);
83 struct vmw_ttm_tt *vmw_tt =
84 container_of(bo->ttm, struct vmw_ttm_tt, dma_ttm);
85
86 if (vmw_tt->vsgt.sgt)
87 return vmw_tt->vsgt.sgt;
88
89 return drm_prime_pages_to_sg(obj->dev, vmw_tt->dma_ttm.pages, vmw_tt->dma_ttm.num_pages);
90}
91
92static const struct vm_operations_struct vmw_vm_ops = {
93 .pfn_mkwrite = vmw_bo_vm_mkwrite,
94 .page_mkwrite = vmw_bo_vm_mkwrite,
95 .fault = vmw_bo_vm_fault,
96 .open = ttm_bo_vm_open,
97 .close = ttm_bo_vm_close,
98};
99
100static const struct drm_gem_object_funcs vmw_gem_object_funcs = {
101 .free = vmw_gem_object_free,
102 .open = vmw_gem_object_open,
103 .close = vmw_gem_object_close,
104 .print_info = drm_gem_ttm_print_info,
105 .pin = vmw_gem_object_pin,
106 .unpin = vmw_gem_object_unpin,
107 .get_sg_table = vmw_gem_object_get_sg_table,
108 .vmap = drm_gem_ttm_vmap,
109 .vunmap = drm_gem_ttm_vunmap,
110 .mmap = drm_gem_ttm_mmap,
111 .vm_ops = &vmw_vm_ops,
112};
113
114int vmw_gem_object_create(struct vmw_private *vmw,
115 struct vmw_bo_params *params,
116 struct vmw_bo **p_vbo)
117{
118 int ret = vmw_bo_create(vmw, params, p_vbo);
119
120 if (ret != 0)
121 goto out_no_bo;
122
123 (*p_vbo)->tbo.base.funcs = &vmw_gem_object_funcs;
124out_no_bo:
125 return ret;
126}
127
128int vmw_gem_object_create_with_handle(struct vmw_private *dev_priv,
129 struct drm_file *filp,
130 uint32_t size,
131 uint32_t *handle,
132 struct vmw_bo **p_vbo)
133{
134 int ret;
135 struct vmw_bo_params params = {
136 .domain = (dev_priv->has_mob) ? VMW_BO_DOMAIN_SYS : VMW_BO_DOMAIN_VRAM,
137 .busy_domain = VMW_BO_DOMAIN_SYS,
138 .bo_type = ttm_bo_type_device,
139 .size = size,
140 .pin = false
141 };
142
143 ret = vmw_gem_object_create(dev_priv, ¶ms, p_vbo);
144 if (ret != 0)
145 goto out_no_bo;
146
147 ret = drm_gem_handle_create(filp, &(*p_vbo)->tbo.base, handle);
148out_no_bo:
149 return ret;
150}
151
152struct drm_gem_object *vmw_prime_import_sg_table(struct drm_device *dev,
153 struct dma_buf_attachment *attach,
154 struct sg_table *table)
155{
156 int ret;
157 struct vmw_private *dev_priv = vmw_priv(dev);
158 struct drm_gem_object *gem = NULL;
159 struct vmw_bo *vbo;
160 struct vmw_bo_params params = {
161 .domain = (dev_priv->has_mob) ? VMW_BO_DOMAIN_SYS : VMW_BO_DOMAIN_VRAM,
162 .busy_domain = VMW_BO_DOMAIN_SYS,
163 .bo_type = ttm_bo_type_sg,
164 .size = attach->dmabuf->size,
165 .pin = false,
166 .resv = attach->dmabuf->resv,
167 .sg = table,
168
169 };
170
171 dma_resv_lock(params.resv, NULL);
172
173 ret = vmw_bo_create(dev_priv, ¶ms, &vbo);
174 if (ret != 0)
175 goto out_no_bo;
176
177 vbo->tbo.base.funcs = &vmw_gem_object_funcs;
178
179 gem = &vbo->tbo.base;
180out_no_bo:
181 dma_resv_unlock(params.resv);
182 return gem;
183}
184
185int vmw_gem_object_create_ioctl(struct drm_device *dev, void *data,
186 struct drm_file *filp)
187{
188 struct vmw_private *dev_priv = vmw_priv(dev);
189 union drm_vmw_alloc_dmabuf_arg *arg =
190 (union drm_vmw_alloc_dmabuf_arg *)data;
191 struct drm_vmw_alloc_dmabuf_req *req = &arg->req;
192 struct drm_vmw_dmabuf_rep *rep = &arg->rep;
193 struct vmw_bo *vbo;
194 uint32_t handle;
195 int ret;
196
197 ret = vmw_gem_object_create_with_handle(dev_priv, filp,
198 req->size, &handle, &vbo);
199 if (ret)
200 goto out_no_bo;
201
202 rep->handle = handle;
203 rep->map_handle = drm_vma_node_offset_addr(&vbo->tbo.base.vma_node);
204 rep->cur_gmr_id = handle;
205 rep->cur_gmr_offset = 0;
206 /* drop reference from allocate - handle holds it now */
207 drm_gem_object_put(&vbo->tbo.base);
208out_no_bo:
209 return ret;
210}
211
212#if defined(CONFIG_DEBUG_FS)
213
214static void vmw_bo_print_info(int id, struct vmw_bo *bo, struct seq_file *m)
215{
216 const char *placement;
217 const char *type;
218
219 switch (bo->tbo.resource->mem_type) {
220 case TTM_PL_SYSTEM:
221 placement = " CPU";
222 break;
223 case VMW_PL_GMR:
224 placement = " GMR";
225 break;
226 case VMW_PL_MOB:
227 placement = " MOB";
228 break;
229 case VMW_PL_SYSTEM:
230 placement = "VCPU";
231 break;
232 case TTM_PL_VRAM:
233 placement = "VRAM";
234 break;
235 default:
236 placement = "None";
237 break;
238 }
239
240 switch (bo->tbo.type) {
241 case ttm_bo_type_device:
242 type = "device";
243 break;
244 case ttm_bo_type_kernel:
245 type = "kernel";
246 break;
247 case ttm_bo_type_sg:
248 type = "sg ";
249 break;
250 default:
251 type = "none ";
252 break;
253 }
254
255 seq_printf(m, "\t\t0x%08x: %12zu bytes %s, type = %s",
256 id, bo->tbo.base.size, placement, type);
257 seq_printf(m, ", priority = %u, pin_count = %u, GEM refs = %d, TTM refs = %d",
258 bo->tbo.priority,
259 bo->tbo.pin_count,
260 kref_read(&bo->tbo.base.refcount),
261 kref_read(&bo->tbo.kref));
262 seq_puts(m, "\n");
263}
264
265static int vmw_debugfs_gem_info_show(struct seq_file *m, void *unused)
266{
267 struct vmw_private *vdev = (struct vmw_private *)m->private;
268 struct drm_device *dev = &vdev->drm;
269 struct drm_file *file;
270 int r;
271
272 r = mutex_lock_interruptible(&dev->filelist_mutex);
273 if (r)
274 return r;
275
276 list_for_each_entry(file, &dev->filelist, lhead) {
277 struct task_struct *task;
278 struct drm_gem_object *gobj;
279 struct pid *pid;
280 int id;
281
282 /*
283 * Although we have a valid reference on file->pid, that does
284 * not guarantee that the task_struct who called get_pid() is
285 * still alive (e.g. get_pid(current) => fork() => exit()).
286 * Therefore, we need to protect this ->comm access using RCU.
287 */
288 rcu_read_lock();
289 pid = rcu_dereference(file->pid);
290 task = pid_task(pid, PIDTYPE_TGID);
291 seq_printf(m, "pid %8d command %s:\n", pid_nr(pid),
292 task ? task->comm : "<unknown>");
293 rcu_read_unlock();
294
295 spin_lock(&file->table_lock);
296 idr_for_each_entry(&file->object_idr, gobj, id) {
297 struct vmw_bo *bo = to_vmw_bo(gobj);
298
299 vmw_bo_print_info(id, bo, m);
300 }
301 spin_unlock(&file->table_lock);
302 }
303
304 mutex_unlock(&dev->filelist_mutex);
305 return 0;
306}
307
308DEFINE_SHOW_ATTRIBUTE(vmw_debugfs_gem_info);
309
310#endif
311
312void vmw_debugfs_gem_init(struct vmw_private *vdev)
313{
314#if defined(CONFIG_DEBUG_FS)
315 struct drm_minor *minor = vdev->drm.primary;
316 struct dentry *root = minor->debugfs_root;
317
318 debugfs_create_file("vmwgfx_gem_info", 0444, root, vdev,
319 &vmw_debugfs_gem_info_fops);
320#endif
321}