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
f0a42bb5
Commit
f0a42bb5
authored
Jun 16, 2016
by
Rob Clark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/msm: submit support for in-fences
Signed-off-by:
Rob Clark
<
robdclark@gmail.com
>
parent
d9c181e2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
5 deletions
+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
No files found.
drivers/gpu/drm/msm/Kconfig
View file @
f0a42bb5
...
...
@@ -11,6 +11,7 @@ config DRM_MSM
select TMPFS
select QCOM_SCM
select SND_SOC_HDMI_CODEC if SND_SOC
select SYNC_FILE
default y
help
DRM/KMS driver for MSM/snapdragon.
...
...
drivers/gpu/drm/msm/msm_gem_submit.c
View file @
f0a42bb5
...
...
@@ -15,6 +15,8 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/sync_file.h>
#include "msm_drv.h"
#include "msm_gpu.h"
#include "msm_gem.h"
...
...
@@ -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_gem_submit
*
submit
;
struct
msm_gpu
*
gpu
=
priv
->
gpu
;
struct
fence
*
in_fence
=
NULL
;
unsigned
i
;
int
ret
;
...
...
@@ -394,9 +397,32 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
if
(
ret
)
goto
out
;
if
(
args
->
flags
&
MSM_SUBMIT_FENCE_FD_IN
)
{
in_fence
=
sync_file_get_fence
(
args
->
fence_fd
);
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
);
if
(
ret
)
...
...
@@ -467,6 +493,8 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
args
->
fence
=
submit
->
fence
->
seqno
;
out:
if
(
in_fence
)
fence_put
(
in_fence
);
submit_cleanup
(
submit
);
if
(
ret
)
msm_gem_submit_free
(
submit
);
...
...
include/uapi/drm/msm_drm.h
View file @
f0a42bb5
...
...
@@ -185,8 +185,12 @@ struct drm_msm_gem_submit_bo {
};
/* Valid submit ioctl flags: */
/* to start, nothing.. */
#define MSM_SUBMIT_FLAGS 0
#define MSM_SUBMIT_NO_IMPLICIT 0x80000000
/* disable implicit sync */
#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
* one or more cmdstream buffers. This allows for conditional execution
...
...
@@ -199,6 +203,7 @@ struct drm_msm_gem_submit {
__u32
nr_cmds
;
/* in, number of submit_cmd's */
__u64
__user
bos
;
/* in, ptr to array of submit_bo'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
...
...
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