Loosely based on commit f0a42bb5423a ("drm/msm: submit support for in-fences"). Unfortunately, struct drm_etnaviv_gem_submit doesn't have a flags field yet, so we have to extend the structure and trust that drm_ioctl will clear the flags for us if an older userspace only submits part of the struct.
Showing the changes to include/uapi (1 of 6 files). Show all
Unified · Split
| @@ -154,6 +154,10 @@ struct drm_etnaviv_gem_submit_bo { · 153 unmodified lines | |||
| 154 | * one or more cmdstream buffers. This allows for conditional execution | 154 | * one or more cmdstream buffers. This allows for conditional execution |
| 155 | * (context-restore), and IB buffers needed for per tile/bin draw cmds. | 155 | * (context-restore), and IB buffers needed for per tile/bin draw cmds. |
| 156 | */ | 156 | */ |
| 157 | #define ETNA_SUBMIT_NO_IMPLICIT 0x0001 | ||
| 158 | #define ETNA_SUBMIT_FENCE_FD_IN 0x0002 | ||
| 159 | #define ETNA_SUBMIT_FLAGS (ETNA_SUBMIT_NO_IMPLICIT | \ | ||
| 160 | ETNA_SUBMIT_FENCE_FD_IN) | ||
| 157 | #define ETNA_PIPE_3D 0x00 | 161 | #define ETNA_PIPE_3D 0x00 |
| 158 | #define ETNA_PIPE_2D 0x01 | 162 | #define ETNA_PIPE_2D 0x01 |
| 159 | #define ETNA_PIPE_VG 0x02 | 163 | #define ETNA_PIPE_VG 0x02 |
| @@ -167,6 +171,8 @@ struct drm_etnaviv_gem_submit { · 7 unmodified lines | |||
| 167 | __u64 bos; /* in, ptr to array of submit_bo's */ | 171 | __u64 bos; /* in, ptr to array of submit_bo's */ |
| 168 | __u64 relocs; /* in, ptr to array of submit_reloc's */ | 172 | __u64 relocs; /* in, ptr to array of submit_reloc's */ |
| 169 | __u64 stream; /* in, ptr to cmdstream */ | 173 | __u64 stream; /* in, ptr to cmdstream */ |
| 174 | __u32 flags; /* in, mask of ETNA_SUBMIT_x */ | ||
| 175 | __s32 fence_fd; /* in, fence fd (see ETNA_SUBMIT_FENCE_FD_IN) */ | ||
| 170 | }; | 176 | }; |
| 171 | 177 | ||
| 172 | /* The normal way to synchronize with the GPU is just to CPU_PREP on | 178 | /* The normal way to synchronize with the GPU is just to CPU_PREP on |