freedreno: Mark all ringbuffer BOs as to be dumped on crash.
authorEric Anholt <eric@anholt.net>
Fri, 8 May 2020 18:28:14 +0000 (11:28 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 12 May 2020 16:30:57 +0000 (16:30 +0000)
We can avoid passing these flags around in the DRM backends by just
marking ring BOs up front.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4967>

src/freedreno/drm/freedreno_bo.c
src/freedreno/drm/msm_ringbuffer_sp.c

index 794f0bc3b605b86e9ff9b325bf7ad22aec728d66..a4218cd8ffb38957891d7a7524225fc35bb05307 100644 (file)
@@ -132,9 +132,11 @@ fd_bo_new_ring(struct fd_device *dev, uint32_t size)
 {
        uint32_t flags = DRM_FREEDRENO_GEM_GPUREADONLY;
        struct fd_bo *bo = bo_new(dev, size, flags, &dev->ring_cache);
-       if (bo)
+       if (bo) {
                bo->bo_reuse = RING_CACHE;
-       fd_bo_set_name(bo, "cmdstream");
+               bo->flags |= FD_RELOC_DUMP;
+               fd_bo_set_name(bo, "cmdstream");
+       }
        return bo;
 }
 
index ef16ccd18e20fa18fe9f3ff0a89ad19335cffd85..65bfb2bde80a22d71b01c2b804aee0714d4a908a 100644 (file)
@@ -259,7 +259,7 @@ msm_submit_sp_flush(struct fd_submit *submit, int in_fence_fd,
        for (unsigned i = 0; i < primary->u.nr_cmds; i++) {
                cmds[i].type = MSM_SUBMIT_CMD_BUF;
                cmds[i].submit_idx = msm_submit_append_bo(msm_submit,
-                               primary->u.cmds[i].ring_bo, FD_RELOC_DUMP);
+                               primary->u.cmds[i].ring_bo, 0);
                cmds[i].submit_offset = primary->offset;
                cmds[i].size = primary->u.cmds[i].size;
                cmds[i].pad = 0;
@@ -453,7 +453,6 @@ msm_ringbuffer_sp_emit_reloc_ring(struct fd_ringbuffer *ring,
 
        msm_ringbuffer_sp_emit_reloc(ring, &(struct fd_reloc){
                .bo     = bo,
-               .flags  = FD_RELOC_DUMP,
                .offset = msm_target->offset,
        });