mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-30 10:30:43 +02:00
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>
This commit is contained in:
parent
0c154d9e2d
commit
63af27bc76
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue