Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
a446ae2
Breadcrumbs
linux
/
drivers
/
gpu
/
drm
/
i915
/
i915_query.c
Copy path
Blame
Blame
Latest commit
History
History
50 lines (39 loc) · 1.14 KB
Breadcrumbs
linux
/
drivers
/
gpu
/
drm
/
i915
/
i915_query.c
Top
File metadata and controls
Code
Blame
50 lines (39 loc) · 1.14 KB
Raw
/* * SPDX-License-Identifier: MIT * * Copyright © 2018 Intel Corporation */ #include "i915_drv.h" #include "i915_query.h" #include <uapi/drm/i915_drm.h> static int (* const i915_query_funcs[])(struct drm_i915_private *dev_priv, struct drm_i915_query_item *query_item) = { }; int i915_query_ioctl(struct drm_device *dev, void *data, struct drm_file *file) { struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_query *args = data; struct drm_i915_query_item __user *user_item_ptr = u64_to_user_ptr(args->items_ptr); u32 i; if (args->flags != 0) return -EINVAL; for (i = 0; i < args->num_items; i++, user_item_ptr++) { struct drm_i915_query_item item; u64 func_idx; int ret; if (copy_from_user(&item, user_item_ptr, sizeof(item))) return -EFAULT; if (item.query_id == 0) return -EINVAL; func_idx = item.query_id - 1; if (func_idx < ARRAY_SIZE(i915_query_funcs)) ret = i915_query_funcs[func_idx](dev_priv, &item); else ret = -EINVAL; /* Only write the length back to userspace if they differ. */ if (ret != item.length && put_user(ret, &user_item_ptr->length)) return -EFAULT; } return 0; }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
You can’t perform that action at this time.