Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
35b62a89
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
35b62a89
编写于
9月 26, 2010
作者:
C
Chris Wilson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/i915: Skip pread/pwrite if size to copy is 0.
Signed-off-by:
N
Chris Wilson
<
chris@chris-wilson.co.uk
>
上级
df6d075a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
7 deletion
+13
-7
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem.c
+13
-7
未找到文件。
drivers/gpu/drm/i915/i915_gem.c
浏览文件 @
35b62a89
...
@@ -576,7 +576,7 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
...
@@ -576,7 +576,7 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
struct
drm_i915_gem_pread
*
args
=
data
;
struct
drm_i915_gem_pread
*
args
=
data
;
struct
drm_gem_object
*
obj
;
struct
drm_gem_object
*
obj
;
struct
drm_i915_gem_object
*
obj_priv
;
struct
drm_i915_gem_object
*
obj_priv
;
int
ret
;
int
ret
=
0
;
obj
=
drm_gem_object_lookup
(
dev
,
file_priv
,
args
->
handle
);
obj
=
drm_gem_object_lookup
(
dev
,
file_priv
,
args
->
handle
);
if
(
obj
==
NULL
)
if
(
obj
==
NULL
)
...
@@ -586,14 +586,17 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
...
@@ -586,14 +586,17 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
/* Bounds check source. */
/* Bounds check source. */
if
(
args
->
offset
>
obj
->
size
||
args
->
size
>
obj
->
size
-
args
->
offset
)
{
if
(
args
->
offset
>
obj
->
size
||
args
->
size
>
obj
->
size
-
args
->
offset
)
{
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
goto
err
;
goto
out
;
}
}
if
(
args
->
size
==
0
)
goto
out
;
if
(
!
access_ok
(
VERIFY_WRITE
,
if
(
!
access_ok
(
VERIFY_WRITE
,
(
char
__user
*
)(
uintptr_t
)
args
->
data_ptr
,
(
char
__user
*
)(
uintptr_t
)
args
->
data_ptr
,
args
->
size
))
{
args
->
size
))
{
ret
=
-
EFAULT
;
ret
=
-
EFAULT
;
goto
err
;
goto
out
;
}
}
if
(
i915_gem_object_needs_bit17_swizzle
(
obj
))
{
if
(
i915_gem_object_needs_bit17_swizzle
(
obj
))
{
...
@@ -605,7 +608,7 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
...
@@ -605,7 +608,7 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
file_priv
);
file_priv
);
}
}
err
:
out
:
drm_gem_object_unreference_unlocked
(
obj
);
drm_gem_object_unreference_unlocked
(
obj
);
return
ret
;
return
ret
;
}
}
...
@@ -1059,14 +1062,17 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
...
@@ -1059,14 +1062,17 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
/* Bounds check destination. */
/* Bounds check destination. */
if
(
args
->
offset
>
obj
->
size
||
args
->
size
>
obj
->
size
-
args
->
offset
)
{
if
(
args
->
offset
>
obj
->
size
||
args
->
size
>
obj
->
size
-
args
->
offset
)
{
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
goto
err
;
goto
out
;
}
}
if
(
args
->
size
==
0
)
goto
out
;
if
(
!
access_ok
(
VERIFY_READ
,
if
(
!
access_ok
(
VERIFY_READ
,
(
char
__user
*
)(
uintptr_t
)
args
->
data_ptr
,
(
char
__user
*
)(
uintptr_t
)
args
->
data_ptr
,
args
->
size
))
{
args
->
size
))
{
ret
=
-
EFAULT
;
ret
=
-
EFAULT
;
goto
err
;
goto
out
;
}
}
/* We can only do the GTT pwrite on untiled buffers, as otherwise
/* We can only do the GTT pwrite on untiled buffers, as otherwise
...
@@ -1100,7 +1106,7 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
...
@@ -1100,7 +1106,7 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
DRM_INFO
(
"pwrite failed %d
\n
"
,
ret
);
DRM_INFO
(
"pwrite failed %d
\n
"
,
ret
);
#endif
#endif
err
:
out
:
drm_gem_object_unreference_unlocked
(
obj
);
drm_gem_object_unreference_unlocked
(
obj
);
return
ret
;
return
ret
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录