Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
012c6741
Commit
012c6741
authored
May 24, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch compat_drm_version() to drm_ioctl_kernel()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
ff22ff9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
27 deletions
+18
-27
drivers/gpu/drm/drm_internal.h
drivers/gpu/drm/drm_internal.h
+1
-0
drivers/gpu/drm/drm_ioc32.c
drivers/gpu/drm/drm_ioc32.c
+16
-26
drivers/gpu/drm/drm_ioctl.c
drivers/gpu/drm/drm_ioctl.c
+1
-1
No files found.
drivers/gpu/drm/drm_internal.h
View file @
012c6741
...
@@ -143,3 +143,4 @@ static inline int drm_debugfs_crtc_crc_add(struct drm_crtc *crtc)
...
@@ -143,3 +143,4 @@ static inline int drm_debugfs_crtc_crc_add(struct drm_crtc *crtc)
return
0
;
return
0
;
}
}
#endif
#endif
drm_ioctl_t
drm_version
;
drivers/gpu/drm/drm_ioc32.c
View file @
012c6741
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include <drm/drmP.h>
#include <drm/drmP.h>
#include "drm_legacy.h"
#include "drm_legacy.h"
#include "drm_internal.h"
#define DRM_IOCTL_VERSION32 DRM_IOWR(0x00, drm_version32_t)
#define DRM_IOCTL_VERSION32 DRM_IOWR(0x00, drm_version32_t)
#define DRM_IOCTL_GET_UNIQUE32 DRM_IOWR(0x01, drm_unique32_t)
#define DRM_IOCTL_GET_UNIQUE32 DRM_IOWR(0x01, drm_unique32_t)
...
@@ -88,39 +89,28 @@ static int compat_drm_version(struct file *file, unsigned int cmd,
...
@@ -88,39 +89,28 @@ static int compat_drm_version(struct file *file, unsigned int cmd,
unsigned
long
arg
)
unsigned
long
arg
)
{
{
drm_version32_t
v32
;
drm_version32_t
v32
;
struct
drm_version
__user
*
version
;
struct
drm_version
v
;
int
err
;
int
err
;
if
(
copy_from_user
(
&
v32
,
(
void
__user
*
)
arg
,
sizeof
(
v32
)))
if
(
copy_from_user
(
&
v32
,
(
void
__user
*
)
arg
,
sizeof
(
v32
)))
return
-
EFAULT
;
return
-
EFAULT
;
version
=
compat_alloc_user_space
(
sizeof
(
*
version
));
v
=
(
struct
drm_version
)
{
if
(
!
version
)
.
name_len
=
v32
.
name_len
,
return
-
EFAULT
;
.
name
=
compat_ptr
(
v32
.
name
),
if
(
__put_user
(
v32
.
name_len
,
&
version
->
name_len
)
.
date_len
=
v32
.
date_len
,
||
__put_user
((
void
__user
*
)(
unsigned
long
)
v32
.
name
,
.
date
=
compat_ptr
(
v32
.
date
),
&
version
->
name
)
.
desc_len
=
v32
.
desc_len
,
||
__put_user
(
v32
.
date_len
,
&
version
->
date_len
)
.
desc
=
compat_ptr
(
v32
.
desc
),
||
__put_user
((
void
__user
*
)(
unsigned
long
)
v32
.
date
,
};
&
version
->
date
)
err
=
drm_ioctl_kernel
(
file
,
drm_version
,
&
v
,
||
__put_user
(
v32
.
desc_len
,
&
version
->
desc_len
)
DRM_UNLOCKED
|
DRM_RENDER_ALLOW
|
DRM_CONTROL_ALLOW
);
||
__put_user
((
void
__user
*
)(
unsigned
long
)
v32
.
desc
,
&
version
->
desc
))
return
-
EFAULT
;
err
=
drm_ioctl
(
file
,
DRM_IOCTL_VERSION
,
(
unsigned
long
)
version
);
if
(
err
)
if
(
err
)
return
err
;
return
err
;
if
(
__get_user
(
v32
.
version_major
,
&
version
->
version_major
)
v32
.
version_major
=
v
.
version_major
;
||
__get_user
(
v32
.
version_minor
,
&
version
->
version_minor
)
v32
.
version_minor
=
v
.
version_minor
;
||
__get_user
(
v32
.
version_patchlevel
,
&
version
->
version_patchlevel
)
v32
.
version_patchlevel
=
v
.
version_patchlevel
;
||
__get_user
(
v32
.
name_len
,
&
version
->
name_len
)
||
__get_user
(
v32
.
date_len
,
&
version
->
date_len
)
||
__get_user
(
v32
.
desc_len
,
&
version
->
desc_len
))
return
-
EFAULT
;
if
(
copy_to_user
((
void
__user
*
)
arg
,
&
v32
,
sizeof
(
v32
)))
if
(
copy_to_user
((
void
__user
*
)
arg
,
&
v32
,
sizeof
(
v32
)))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
...
@@ -1081,7 +1071,7 @@ static struct {
...
@@ -1081,7 +1071,7 @@ static struct {
char
*
name
;
char
*
name
;
}
drm_compat_ioctls
[]
=
{
}
drm_compat_ioctls
[]
=
{
#define DRM_IOCTL32_DEF(n, f) [DRM_IOCTL_NR(n##32)] = {.fn = f, .name = #n}
#define DRM_IOCTL32_DEF(n, f) [DRM_IOCTL_NR(n##32)] = {.fn = f, .name = #n}
[
DRM_IOCTL_NR
(
DRM_IOCTL_VERSION32
)].
fn
=
compat_drm_version
,
DRM_IOCTL32_DEF
(
DRM_IOCTL_VERSION
,
compat_drm_version
)
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_UNIQUE32
)].
fn
=
compat_drm_getunique
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_UNIQUE32
)].
fn
=
compat_drm_getunique
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_MAP32
)].
fn
=
compat_drm_getmap
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_MAP32
)].
fn
=
compat_drm_getmap
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_CLIENT32
)].
fn
=
compat_drm_getclient
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_GET_CLIENT32
)].
fn
=
compat_drm_getclient
,
...
...
drivers/gpu/drm/drm_ioctl.c
View file @
012c6741
...
@@ -461,7 +461,7 @@ static int drm_copy_field(char __user *buf, size_t *buf_len, const char *value)
...
@@ -461,7 +461,7 @@ static int drm_copy_field(char __user *buf, size_t *buf_len, const char *value)
*
*
* Fills in the version information in \p arg.
* Fills in the version information in \p arg.
*/
*/
static
int
drm_version
(
struct
drm_device
*
dev
,
void
*
data
,
int
drm_version
(
struct
drm_device
*
dev
,
void
*
data
,
struct
drm_file
*
file_priv
)
struct
drm_file
*
file_priv
)
{
{
struct
drm_version
*
version
=
data
;
struct
drm_version
*
version
=
data
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment