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
314ed736
Commit
314ed736
authored
May 25, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compat_drm: switch sg ioctls
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
e92673ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
+12
-18
drivers/gpu/drm/drm_ioc32.c
drivers/gpu/drm/drm_ioc32.c
+12
-18
No files found.
drivers/gpu/drm/drm_ioc32.c
View file @
314ed736
...
@@ -761,23 +761,19 @@ static int compat_drm_sg_alloc(struct file *file, unsigned int cmd,
...
@@ -761,23 +761,19 @@ static int compat_drm_sg_alloc(struct file *file, unsigned int cmd,
unsigned
long
arg
)
unsigned
long
arg
)
{
{
drm_scatter_gather32_t
__user
*
argp
=
(
void
__user
*
)
arg
;
drm_scatter_gather32_t
__user
*
argp
=
(
void
__user
*
)
arg
;
struct
drm_scatter_gather
__user
*
request
;
struct
drm_scatter_gather
request
;
int
err
;
int
err
;
unsigned
long
x
;
request
=
compat_alloc_user_space
(
sizeof
(
*
request
));
if
(
get_user
(
request
.
size
,
&
argp
->
size
))
if
(
!
request
||
!
access_ok
(
VERIFY_WRITE
,
argp
,
sizeof
(
*
argp
))
||
__get_user
(
x
,
&
argp
->
size
)
||
__put_user
(
x
,
&
request
->
size
))
return
-
EFAULT
;
return
-
EFAULT
;
err
=
drm_ioctl
(
file
,
DRM_IOCTL_SG_ALLOC
,
(
unsigned
long
)
request
);
err
=
drm_ioctl_kernel
(
file
,
drm_legacy_sg_alloc
,
&
request
,
DRM_AUTH
|
DRM_MASTER
|
DRM_ROOT_ONLY
);
if
(
err
)
if
(
err
)
return
err
;
return
err
;
/* XXX not sure about the handle conversion here... */
/* XXX not sure about the handle conversion here... */
if
(
__get_user
(
x
,
&
request
->
handle
)
if
(
put_user
(
request
.
handle
>>
PAGE_SHIFT
,
&
argp
->
handle
))
||
__put_user
(
x
>>
PAGE_SHIFT
,
&
argp
->
handle
))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
...
@@ -787,16 +783,14 @@ static int compat_drm_sg_free(struct file *file, unsigned int cmd,
...
@@ -787,16 +783,14 @@ static int compat_drm_sg_free(struct file *file, unsigned int cmd,
unsigned
long
arg
)
unsigned
long
arg
)
{
{
drm_scatter_gather32_t
__user
*
argp
=
(
void
__user
*
)
arg
;
drm_scatter_gather32_t
__user
*
argp
=
(
void
__user
*
)
arg
;
struct
drm_scatter_gather
__user
*
request
;
struct
drm_scatter_gather
request
;
unsigned
long
x
;
unsigned
long
x
;
request
=
compat_alloc_user_space
(
sizeof
(
*
request
));
if
(
get_user
(
x
,
&
argp
->
handle
))
if
(
!
request
||
!
access_ok
(
VERIFY_WRITE
,
argp
,
sizeof
(
*
argp
))
||
__get_user
(
x
,
&
argp
->
handle
)
||
__put_user
(
x
<<
PAGE_SHIFT
,
&
request
->
handle
))
return
-
EFAULT
;
return
-
EFAULT
;
request
.
handle
=
x
<<
PAGE_SHIFT
;
return
drm_ioctl
(
file
,
DRM_IOCTL_SG_FREE
,
(
unsigned
long
)
request
);
return
drm_ioctl_kernel
(
file
,
drm_legacy_sg_free
,
&
request
,
DRM_AUTH
|
DRM_MASTER
|
DRM_ROOT_ONLY
);
}
}
#if defined(CONFIG_X86) || defined(CONFIG_IA64)
#if defined(CONFIG_X86) || defined(CONFIG_IA64)
...
@@ -972,8 +966,8 @@ static struct {
...
@@ -972,8 +966,8 @@ static struct {
DRM_IOCTL32_DEF
(
DRM_IOCTL_AGP_BIND
,
compat_drm_agp_bind
),
DRM_IOCTL32_DEF
(
DRM_IOCTL_AGP_BIND
,
compat_drm_agp_bind
),
DRM_IOCTL32_DEF
(
DRM_IOCTL_AGP_UNBIND
,
compat_drm_agp_unbind
),
DRM_IOCTL32_DEF
(
DRM_IOCTL_AGP_UNBIND
,
compat_drm_agp_unbind
),
#endif
#endif
[
DRM_IOCTL_NR
(
DRM_IOCTL_SG_ALLOC32
)].
fn
=
compat_drm_sg_alloc
,
DRM_IOCTL32_DEF
(
DRM_IOCTL_SG_ALLOC
,
compat_drm_sg_alloc
)
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_SG_FREE32
)].
fn
=
compat_drm_sg_free
,
DRM_IOCTL32_DEF
(
DRM_IOCTL_SG_FREE
,
compat_drm_sg_free
)
,
#if defined(CONFIG_X86) || defined(CONFIG_IA64)
#if defined(CONFIG_X86) || defined(CONFIG_IA64)
[
DRM_IOCTL_NR
(
DRM_IOCTL_UPDATE_DRAW32
)].
fn
=
compat_drm_update_draw
,
[
DRM_IOCTL_NR
(
DRM_IOCTL_UPDATE_DRAW32
)].
fn
=
compat_drm_update_draw
,
#endif
#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