aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/drm/msm_ringbuffer_sp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/freedreno/drm/msm_ringbuffer_sp.c')
-rw-r--r--src/freedreno/drm/msm_ringbuffer_sp.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/freedreno/drm/msm_ringbuffer_sp.c b/src/freedreno/drm/msm_ringbuffer_sp.c
index d8915707c79..ecb102f2535 100644
--- a/src/freedreno/drm/msm_ringbuffer_sp.c
+++ b/src/freedreno/drm/msm_ringbuffer_sp.c
@@ -152,12 +152,11 @@ append_bo(struct msm_submit_sp *submit, struct fd_bo *bo, uint32_t flags)
msm_bo->idx = idx;
}
- if (flags & FD_RELOC_READ)
- submit->submit_bos[idx].flags |= MSM_SUBMIT_BO_READ;
- if (flags & FD_RELOC_WRITE)
- submit->submit_bos[idx].flags |= MSM_SUBMIT_BO_WRITE;
- if (flags & FD_RELOC_DUMP)
- submit->submit_bos[idx].flags |= MSM_SUBMIT_BO_DUMP;
+ STATIC_ASSERT(FD_RELOC_READ == MSM_SUBMIT_BO_READ);
+ STATIC_ASSERT(FD_RELOC_WRITE == MSM_SUBMIT_BO_WRITE);
+ STATIC_ASSERT(FD_RELOC_DUMP == MSM_SUBMIT_BO_DUMP);
+ submit->submit_bos[idx].flags |=
+ flags & (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE | MSM_SUBMIT_BO_DUMP);
return idx;
}