freedreno/drm: fix invalid-cmdstream-size with older kernels
authorRob Clark <robdclark@chromium.org>
Tue, 19 Nov 2019 17:43:22 +0000 (09:43 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Jan 2020 00:09:34 +0000 (00:09 +0000)
commit63af27bc7681c302eaf4527253ca25cc32b400ce
treeab1c3de3277cc559ddc57a47945c844b060f9ad7
parent0c154d9e2db48c5b97ac6f428d3fe9ed5774da30
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 <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2805>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2805>
src/freedreno/drm/msm_ringbuffer.c