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
Kirill Smelkov
linux
Commits
d6c56613
Commit
d6c56613
authored
May 25, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch compat_drm_mode_addfb2() to drm_ioctl_kernel()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
d5288c88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
28 deletions
+10
-28
drivers/gpu/drm/drm_ioc32.c
drivers/gpu/drm/drm_ioc32.c
+10
-28
No files found.
drivers/gpu/drm/drm_ioc32.c
View file @
d6c56613
...
...
@@ -34,6 +34,7 @@
#include <drm/drmP.h>
#include "drm_legacy.h"
#include "drm_internal.h"
#include "drm_crtc_internal.h"
#define DRM_IOCTL_VERSION32 DRM_IOWR(0x00, drm_version32_t)
#define DRM_IOCTL_GET_UNIQUE32 DRM_IOWR(0x01, drm_unique32_t)
...
...
@@ -877,42 +878,23 @@ static int compat_drm_mode_addfb2(struct file *file, unsigned int cmd,
unsigned
long
arg
)
{
struct
drm_mode_fb_cmd232
__user
*
argp
=
(
void
__user
*
)
arg
;
struct
drm_mode_fb_cmd232
req32
;
struct
drm_mode_fb_cmd2
__user
*
req64
;
int
i
;
struct
drm_mode_fb_cmd2
__user
req64
;
int
err
;
if
(
copy_from_user
(
&
req32
,
argp
,
sizeof
(
req32
)))
if
(
copy_from_user
(
&
req64
,
argp
,
offsetof
(
drm_mode_fb_cmd232_t
,
modifier
)))
return
-
EFAULT
;
req64
=
compat_alloc_user_space
(
sizeof
(
*
req64
));
if
(
!
access_ok
(
VERIFY_WRITE
,
req64
,
sizeof
(
*
req64
))
||
__put_user
(
req32
.
width
,
&
req64
->
width
)
||
__put_user
(
req32
.
height
,
&
req64
->
height
)
||
__put_user
(
req32
.
pixel_format
,
&
req64
->
pixel_format
)
||
__put_user
(
req32
.
flags
,
&
req64
->
flags
))
if
(
copy_from_user
(
&
req64
.
modifier
,
&
argp
->
modifier
,
sizeof
(
req64
.
modifier
)))
return
-
EFAULT
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
if
(
__put_user
(
req32
.
handles
[
i
],
&
req64
->
handles
[
i
]))
return
-
EFAULT
;
if
(
__put_user
(
req32
.
pitches
[
i
],
&
req64
->
pitches
[
i
]))
return
-
EFAULT
;
if
(
__put_user
(
req32
.
offsets
[
i
],
&
req64
->
offsets
[
i
]))
return
-
EFAULT
;
if
(
__put_user
(
req32
.
modifier
[
i
],
&
req64
->
modifier
[
i
]))
return
-
EFAULT
;
}
err
=
drm_ioctl
(
file
,
DRM_IOCTL_MODE_ADDFB2
,
(
unsigned
long
)
req64
);
err
=
drm_ioctl_kernel
(
file
,
drm_mode_addfb2
,
&
req64
,
DRM_CONTROL_ALLOW
|
DRM_UNLOCKED
);
if
(
err
)
return
err
;
if
(
__get_user
(
req32
.
fb_id
,
&
req64
->
fb_id
))
return
-
EFAULT
;
if
(
copy_to_user
(
argp
,
&
req32
,
sizeof
(
req32
)))
if
(
put_user
(
req64
.
fb_id
,
&
argp
->
fb_id
))
return
-
EFAULT
;
return
0
;
...
...
@@ -956,7 +938,7 @@ static struct {
#endif
DRM_IOCTL32_DEF
(
DRM_IOCTL_WAIT_VBLANK
,
compat_drm_wait_vblank
),
#if defined(CONFIG_X86) || defined(CONFIG_IA64)
[
DRM_IOCTL_NR
(
DRM_IOCTL_MODE_ADDFB232
)].
fn
=
compat_drm_mode_addfb2
,
DRM_IOCTL32_DEF
(
DRM_IOCTL_MODE_ADDFB2
,
compat_drm_mode_addfb2
)
,
#endif
};
...
...
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