diff options
author | Rob Clark <[email protected]> | 2019-11-19 09:43:22 -0800 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-28 00:09:34 +0000 |
commit | 63af27bc7681c302eaf4527253ca25cc32b400ce (patch) | |
tree | ab1c3de3277cc559ddc57a47945c844b060f9ad7 /src | |
parent | 0c154d9e2db48c5b97ac6f428d3fe9ed5774da30 (diff) |
freedreno/drm: fix invalid-cmdstream-size with older kernels
A cmdstream of size zero is invalid. But this can appear in various
places where we emit a pointer to state. This doesn't show up with
newer kernels (newer than v5.0) which use "softpin", but on earlier
kernels can result in:
[drm:msm_ioctl_gem_submit [msm]] *ERROR* invalid cmdstream size: 0
Since the pointer value doesn't matter in these cases, the easy solution
is just to not emit a cmds table entry in this case.
Signed-off-by: Rob Clark <[email protected]>
Reviewed-by: Kristian H. Kristensen <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2805>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2805>
Diffstat (limited to 'src')
-rw-r--r-- | src/freedreno/drm/msm_ringbuffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/freedreno/drm/msm_ringbuffer.c b/src/freedreno/drm/msm_ringbuffer.c index c4b352ee283..3ce36ad142a 100644 --- a/src/freedreno/drm/msm_ringbuffer.c +++ b/src/freedreno/drm/msm_ringbuffer.c @@ -612,6 +612,9 @@ msm_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, .offset = msm_target->offset, }); + if (!size) + return 0; + if ((target->flags & _FD_RINGBUFFER_OBJECT) && !(ring->flags & _FD_RINGBUFFER_OBJECT)) { struct msm_submit *msm_submit = to_msm_submit(msm_ring->u.submit); |