Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f0a42bb5
K
Kernel
项目概览
openeuler
/
Kernel
接近 2 年 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f0a42bb5
编写于
6月 16, 2016
作者:
R
Rob Clark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/msm: submit support for in-fences
Signed-off-by:
N
Rob Clark
<
robdclark@gmail.com
>
上级
d9c181e2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
5 deletion
+39
-5
drivers/gpu/drm/msm/Kconfig
drivers/gpu/drm/msm/Kconfig
+1
-0
drivers/gpu/drm/msm/msm_gem_submit.c
drivers/gpu/drm/msm/msm_gem_submit.c
+31
-3
include/uapi/drm/msm_drm.h
include/uapi/drm/msm_drm.h
+7
-2
未找到文件。
drivers/gpu/drm/msm/Kconfig
浏览文件 @
f0a42bb5
...
@@ -11,6 +11,7 @@ config DRM_MSM
...
@@ -11,6 +11,7 @@ config DRM_MSM
select TMPFS
select TMPFS
select QCOM_SCM
select QCOM_SCM
select SND_SOC_HDMI_CODEC if SND_SOC
select SND_SOC_HDMI_CODEC if SND_SOC
select SYNC_FILE
default y
default y
help
help
DRM/KMS driver for MSM/snapdragon.
DRM/KMS driver for MSM/snapdragon.
...
...
drivers/gpu/drm/msm/msm_gem_submit.c
浏览文件 @
f0a42bb5
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#include <linux/sync_file.h>
#include "msm_drv.h"
#include "msm_drv.h"
#include "msm_gpu.h"
#include "msm_gpu.h"
#include "msm_gem.h"
#include "msm_gem.h"
...
@@ -361,6 +363,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
...
@@ -361,6 +363,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
struct
msm_file_private
*
ctx
=
file
->
driver_priv
;
struct
msm_file_private
*
ctx
=
file
->
driver_priv
;
struct
msm_gem_submit
*
submit
;
struct
msm_gem_submit
*
submit
;
struct
msm_gpu
*
gpu
=
priv
->
gpu
;
struct
msm_gpu
*
gpu
=
priv
->
gpu
;
struct
fence
*
in_fence
=
NULL
;
unsigned
i
;
unsigned
i
;
int
ret
;
int
ret
;
...
@@ -394,9 +397,32 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
...
@@ -394,9 +397,32 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
if
(
ret
)
if
(
ret
)
goto
out
;
goto
out
;
ret
=
submit_fence_sync
(
submit
);
if
(
args
->
flags
&
MSM_SUBMIT_FENCE_FD_IN
)
{
if
(
ret
)
in_fence
=
sync_file_get_fence
(
args
->
fence_fd
);
goto
out
;
if
(
!
in_fence
)
{
ret
=
-
EINVAL
;
goto
out
;
}
/* TODO if we get an array-fence due to userspace merging multiple
* fences, we need a way to determine if all the backing fences
* are from our own context..
*/
if
(
in_fence
->
context
!=
gpu
->
fctx
->
context
)
{
ret
=
fence_wait
(
in_fence
,
true
);
if
(
ret
)
goto
out
;
}
}
if
(
!
(
args
->
fence
&
MSM_SUBMIT_NO_IMPLICIT
))
{
ret
=
submit_fence_sync
(
submit
);
if
(
ret
)
goto
out
;
}
ret
=
submit_pin_objects
(
submit
);
ret
=
submit_pin_objects
(
submit
);
if
(
ret
)
if
(
ret
)
...
@@ -467,6 +493,8 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
...
@@ -467,6 +493,8 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
args
->
fence
=
submit
->
fence
->
seqno
;
args
->
fence
=
submit
->
fence
->
seqno
;
out:
out:
if
(
in_fence
)
fence_put
(
in_fence
);
submit_cleanup
(
submit
);
submit_cleanup
(
submit
);
if
(
ret
)
if
(
ret
)
msm_gem_submit_free
(
submit
);
msm_gem_submit_free
(
submit
);
...
...
include/uapi/drm/msm_drm.h
浏览文件 @
f0a42bb5
...
@@ -185,8 +185,12 @@ struct drm_msm_gem_submit_bo {
...
@@ -185,8 +185,12 @@ struct drm_msm_gem_submit_bo {
};
};
/* Valid submit ioctl flags: */
/* Valid submit ioctl flags: */
/* to start, nothing.. */
#define MSM_SUBMIT_NO_IMPLICIT 0x80000000
/* disable implicit sync */
#define MSM_SUBMIT_FLAGS 0
#define MSM_SUBMIT_FENCE_FD_IN 0x40000000
/* enable input fence_fd */
#define MSM_SUBMIT_FLAGS ( \
MSM_SUBMIT_NO_IMPLICIT | \
MSM_SUBMIT_FENCE_FD_IN | \
0)
/* Each cmdstream submit consists of a table of buffers involved, and
/* Each cmdstream submit consists of a table of buffers involved, and
* one or more cmdstream buffers. This allows for conditional execution
* one or more cmdstream buffers. This allows for conditional execution
...
@@ -199,6 +203,7 @@ struct drm_msm_gem_submit {
...
@@ -199,6 +203,7 @@ struct drm_msm_gem_submit {
__u32
nr_cmds
;
/* in, number of submit_cmd's */
__u32
nr_cmds
;
/* in, number of submit_cmd's */
__u64
__user
bos
;
/* in, ptr to array of submit_bo's */
__u64
__user
bos
;
/* in, ptr to array of submit_bo's */
__u64
__user
cmds
;
/* in, ptr to array of submit_cmd's */
__u64
__user
cmds
;
/* in, ptr to array of submit_cmd's */
__s32
fence_fd
;
/* in/out fence fd (see MSM_SUBMIT_FENCE_FD_IN) */
};
};
/* The normal way to synchronize with the GPU is just to CPU_PREP on
/* The normal way to synchronize with the GPU is just to CPU_PREP on
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录