diff options
author | Rob Clark <[email protected]> | 2020-01-31 13:01:52 -0800 |
---|---|---|
committer | Rob Clark <[email protected]> | 2020-01-31 13:01:52 -0800 |
commit | d326d30efefd132255826ff33a9a4c51c216fe39 (patch) | |
tree | 2d468c87da33d4996794af073704792fbbd7cbc1 | |
parent | f93dfb509cbf9474befae9919dd8c135bbd67093 (diff) |
freedreno/drm: readonly cmdstream
Noticed that we weren't consistently making cmdstream buffers
gpu-readonly. Fix that and drop the need to pass flags to
fd_bo_new_ring().
Signed-off-by: Rob Clark <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3663>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3663>
-rw-r--r-- | src/freedreno/drm/freedreno_bo.c | 3 | ||||
-rw-r--r-- | src/freedreno/drm/freedreno_priv.h | 3 | ||||
-rw-r--r-- | src/freedreno/drm/msm_ringbuffer.c | 9 | ||||
-rw-r--r-- | src/freedreno/drm/msm_ringbuffer_sp.c | 12 |
4 files changed, 11 insertions, 16 deletions
diff --git a/src/freedreno/drm/freedreno_bo.c b/src/freedreno/drm/freedreno_bo.c index 7449160f137..6d51023acac 100644 --- a/src/freedreno/drm/freedreno_bo.c +++ b/src/freedreno/drm/freedreno_bo.c @@ -125,8 +125,9 @@ _fd_bo_set_name(struct fd_bo *bo, const char *fmt, va_list ap) * to re-use cmdstream bo's for cmdstream and not unrelated purposes. */ struct fd_bo * -fd_bo_new_ring(struct fd_device *dev, uint32_t size, uint32_t flags) +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) bo->bo_reuse = RING_CACHE; diff --git a/src/freedreno/drm/freedreno_priv.h b/src/freedreno/drm/freedreno_priv.h index 349a2296472..36cb8fb6044 100644 --- a/src/freedreno/drm/freedreno_priv.h +++ b/src/freedreno/drm/freedreno_priv.h @@ -178,8 +178,7 @@ struct fd_bo { time_t free_time; /* time when added to bucket-list */ }; -struct fd_bo *fd_bo_new_ring(struct fd_device *dev, - uint32_t size, uint32_t flags); +struct fd_bo *fd_bo_new_ring(struct fd_device *dev, uint32_t size); #define enable_debug 0 /* TODO make dynamic */ diff --git a/src/freedreno/drm/msm_ringbuffer.c b/src/freedreno/drm/msm_ringbuffer.c index 3ce36ad142a..5e033b3d6ac 100644 --- a/src/freedreno/drm/msm_ringbuffer.c +++ b/src/freedreno/drm/msm_ringbuffer.c @@ -218,8 +218,7 @@ msm_submit_suballoc_ring_bo(struct fd_submit *submit, if (!suballoc_bo) { // TODO possibly larger size for streaming bo? - msm_ring->ring_bo = fd_bo_new_ring( - submit->pipe->dev, 0x8000, 0); + msm_ring->ring_bo = fd_bo_new_ring(submit->pipe->dev, 0x8000); msm_ring->offset = 0; } else { msm_ring->ring_bo = fd_bo_ref(suballoc_bo); @@ -257,7 +256,7 @@ msm_submit_new_ringbuffer(struct fd_submit *submit, uint32_t size, size = INIT_SIZE; msm_ring->offset = 0; - msm_ring->ring_bo = fd_bo_new_ring(submit->pipe->dev, size, 0); + msm_ring->ring_bo = fd_bo_new_ring(submit->pipe->dev, size); } if (!msm_ringbuffer_init(msm_ring, size, flags)) @@ -503,7 +502,7 @@ msm_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t size) finalize_current_cmd(ring); fd_bo_del(msm_ring->ring_bo); - msm_ring->ring_bo = fd_bo_new_ring(pipe->dev, size, 0); + msm_ring->ring_bo = fd_bo_new_ring(pipe->dev, size); msm_ring->cmd = cmd_new(msm_ring->ring_bo); ring->start = fd_bo_map(msm_ring->ring_bo); @@ -711,7 +710,7 @@ msm_ringbuffer_new_object(struct fd_pipe *pipe, uint32_t size) msm_ring->u.pipe = pipe; msm_ring->offset = 0; - msm_ring->ring_bo = fd_bo_new_ring(pipe->dev, size, 0); + msm_ring->ring_bo = fd_bo_new_ring(pipe->dev, size); msm_ring->base.refcnt = 1; msm_ring->u.reloc_bos = NULL; diff --git a/src/freedreno/drm/msm_ringbuffer_sp.c b/src/freedreno/drm/msm_ringbuffer_sp.c index 41732858580..d8915707c79 100644 --- a/src/freedreno/drm/msm_ringbuffer_sp.c +++ b/src/freedreno/drm/msm_ringbuffer_sp.c @@ -187,8 +187,7 @@ msm_submit_suballoc_ring_bo(struct fd_submit *submit, if (!suballoc_bo) { // TODO possibly larger size for streaming bo? - msm_ring->ring_bo = fd_bo_new_ring(submit->pipe->dev, - 0x8000, DRM_FREEDRENO_GEM_GPUREADONLY); + msm_ring->ring_bo = fd_bo_new_ring(submit->pipe->dev, 0x8000); msm_ring->offset = 0; } else { msm_ring->ring_bo = fd_bo_ref(suballoc_bo); @@ -226,8 +225,7 @@ msm_submit_sp_new_ringbuffer(struct fd_submit *submit, uint32_t size, size = INIT_SIZE; msm_ring->offset = 0; - msm_ring->ring_bo = fd_bo_new_ring(submit->pipe->dev, size, - DRM_FREEDRENO_GEM_GPUREADONLY); + msm_ring->ring_bo = fd_bo_new_ring(submit->pipe->dev, size); } if (!msm_ringbuffer_sp_init(msm_ring, size, flags)) @@ -388,8 +386,7 @@ msm_ringbuffer_sp_grow(struct fd_ringbuffer *ring, uint32_t size) finalize_current_cmd(ring); fd_bo_del(msm_ring->ring_bo); - msm_ring->ring_bo = fd_bo_new_ring(pipe->dev, size, - DRM_FREEDRENO_GEM_GPUREADONLY); + msm_ring->ring_bo = fd_bo_new_ring(pipe->dev, size); ring->start = fd_bo_map(msm_ring->ring_bo); ring->end = &(ring->start[size/4]); @@ -568,8 +565,7 @@ msm_ringbuffer_sp_new_object(struct fd_pipe *pipe, uint32_t size) msm_ring->u.pipe = pipe; msm_ring->offset = 0; - msm_ring->ring_bo = fd_bo_new_ring(pipe->dev, size, - DRM_FREEDRENO_GEM_GPUREADONLY); + msm_ring->ring_bo = fd_bo_new_ring(pipe->dev, size); msm_ring->base.refcnt = 1; return msm_ringbuffer_sp_init(msm_ring, size, _FD_RINGBUFFER_OBJECT); |