From 9372f11c81018f77eaf38dd0f60b3fcb6ea067e0 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 3 Dec 2022 08:08:34 -0800 Subject: [PATCH] freedreno/drm: Remove cpu_fini It has been unused since nearly forever. Signed-off-by: Rob Clark Part-of: --- src/freedreno/drm/freedreno_bo.c | 9 --------- src/freedreno/drm/freedreno_drmif.h | 1 - src/freedreno/drm/freedreno_priv.h | 1 - src/freedreno/drm/msm/msm_bo.c | 11 ----------- src/freedreno/drm/virtio/virtio_bo.c | 7 ------- src/gallium/drivers/freedreno/freedreno_context.c | 4 ---- src/gallium/drivers/freedreno/freedreno_query_acc.c | 2 -- src/gallium/drivers/freedreno/freedreno_query_hw.c | 2 -- src/gallium/drivers/freedreno/freedreno_resource.c | 2 -- 9 files changed, 39 deletions(-) diff --git a/src/freedreno/drm/freedreno_bo.c b/src/freedreno/drm/freedreno_bo.c index 80cc93b3b6b..1c126894737 100644 --- a/src/freedreno/drm/freedreno_bo.c +++ b/src/freedreno/drm/freedreno_bo.c @@ -585,15 +585,6 @@ fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op) return bo->funcs->cpu_prep(bo, pipe, op); } -void -fd_bo_cpu_fini(struct fd_bo *bo) -{ -// TODO until we have cached buffers, the kernel side ioctl does nothing, -// so just skip it. When we have cached buffers, we can make the -// ioctl conditional -// bo->funcs->cpu_fini(bo); -} - void fd_bo_add_fence(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t fence) { diff --git a/src/freedreno/drm/freedreno_drmif.h b/src/freedreno/drm/freedreno_drmif.h index a9b271e335b..27af4df54f7 100644 --- a/src/freedreno/drm/freedreno_drmif.h +++ b/src/freedreno/drm/freedreno_drmif.h @@ -290,7 +290,6 @@ void *fd_bo_map(struct fd_bo *bo); void fd_bo_upload(struct fd_bo *bo, void *src, unsigned off, unsigned len); bool fd_bo_prefer_upload(struct fd_bo *bo, unsigned len); int fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op); -void fd_bo_cpu_fini(struct fd_bo *bo); bool fd_bo_is_cached(struct fd_bo *bo); #ifdef __cplusplus diff --git a/src/freedreno/drm/freedreno_priv.h b/src/freedreno/drm/freedreno_priv.h index 2d1434e2a18..c4b8a47cb0e 100644 --- a/src/freedreno/drm/freedreno_priv.h +++ b/src/freedreno/drm/freedreno_priv.h @@ -317,7 +317,6 @@ fd_dev_count_deferred_cmds(struct fd_device *dev) struct fd_bo_funcs { int (*offset)(struct fd_bo *bo, uint64_t *offset); int (*cpu_prep)(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op); - void (*cpu_fini)(struct fd_bo *bo); int (*madvise)(struct fd_bo *bo, int willneed); uint64_t (*iova)(struct fd_bo *bo); void (*set_name)(struct fd_bo *bo, const char *fmt, va_list ap); diff --git a/src/freedreno/drm/msm/msm_bo.c b/src/freedreno/drm/msm/msm_bo.c index 70e7d751b73..57e7ba87b70 100644 --- a/src/freedreno/drm/msm/msm_bo.c +++ b/src/freedreno/drm/msm/msm_bo.c @@ -78,16 +78,6 @@ msm_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op) return drmCommandWrite(bo->dev->fd, DRM_MSM_GEM_CPU_PREP, &req, sizeof(req)); } -static void -msm_bo_cpu_fini(struct fd_bo *bo) -{ - struct drm_msm_gem_cpu_fini req = { - .handle = bo->handle, - }; - - drmCommandWrite(bo->dev->fd, DRM_MSM_GEM_CPU_FINI, &req, sizeof(req)); -} - static int msm_bo_madvise(struct fd_bo *bo, int willneed) { @@ -156,7 +146,6 @@ msm_bo_destroy(struct fd_bo *bo) static const struct fd_bo_funcs funcs = { .offset = msm_bo_offset, .cpu_prep = msm_bo_cpu_prep, - .cpu_fini = msm_bo_cpu_fini, .madvise = msm_bo_madvise, .iova = msm_bo_iova, .set_name = msm_bo_set_name, diff --git a/src/freedreno/drm/virtio/virtio_bo.c b/src/freedreno/drm/virtio/virtio_bo.c index f54b8215a4d..d5d163f7084 100644 --- a/src/freedreno/drm/virtio/virtio_bo.c +++ b/src/freedreno/drm/virtio/virtio_bo.c @@ -138,12 +138,6 @@ out: return ret; } -static void -virtio_bo_cpu_fini(struct fd_bo *bo) -{ - /* no-op */ -} - static int virtio_bo_madvise(struct fd_bo *bo, int willneed) { @@ -288,7 +282,6 @@ virtio_bo_destroy(struct fd_bo *bo) static const struct fd_bo_funcs funcs = { .offset = virtio_bo_offset, .cpu_prep = virtio_bo_cpu_prep, - .cpu_fini = virtio_bo_cpu_fini, .madvise = virtio_bo_madvise, .iova = virtio_bo_iova, .set_name = virtio_bo_set_name, diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c index 6e19e85a87b..b82509bc2ea 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.c +++ b/src/gallium/drivers/freedreno/freedreno_context.c @@ -180,10 +180,6 @@ fd_memory_barrier(struct pipe_context *pctx, unsigned flags) return; fd_context_flush(pctx, NULL, 0); - - /* TODO do we need to check for persistently mapped buffers and - * fd_bo_cpu_prep()?? - */ } static void diff --git a/src/gallium/drivers/freedreno/freedreno_query_acc.c b/src/gallium/drivers/freedreno/freedreno_query_acc.c index de703c57452..4e37cb50d09 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_acc.c +++ b/src/gallium/drivers/freedreno/freedreno_query_acc.c @@ -64,7 +64,6 @@ realloc_query_bo(struct fd_context *ctx, struct fd_acc_query *aq) map = fd_bo_map(rsc->bo); memset(map, 0, aq->size); - fd_bo_cpu_fini(rsc->bo); } static void @@ -193,7 +192,6 @@ fd_acc_get_query_result(struct fd_context *ctx, struct fd_query *q, bool wait, struct fd_acc_query_sample *s = fd_bo_map(rsc->bo); p->result(aq, s, result); - fd_bo_cpu_fini(rsc->bo); return true; } diff --git a/src/gallium/drivers/freedreno/freedreno_query_hw.c b/src/gallium/drivers/freedreno/freedreno_query_hw.c index fbdfa928ce7..3a42d9a479d 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_hw.c +++ b/src/gallium/drivers/freedreno/freedreno_query_hw.c @@ -245,8 +245,6 @@ fd_hw_get_query_result(struct fd_context *ctx, struct fd_query *q, bool wait, p->accumulate_result(ctx, sampptr(period->start, i, ptr), sampptr(period->end, i, ptr), result); } - - fd_bo_cpu_fini(rsc->bo); } return true; diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index ec10b776897..e648fe4c61a 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -725,8 +725,6 @@ fd_resource_transfer_unmap(struct pipe_context *pctx, if (trans->upload_ptr) { fd_bo_upload(rsc->bo, trans->upload_ptr, ptrans->box.x, ptrans->box.width); free(trans->upload_ptr); - } else if (!(ptrans->usage & PIPE_MAP_UNSYNCHRONIZED)) { - fd_bo_cpu_fini(rsc->bo); } util_range_add(&rsc->b.b, &rsc->valid_buffer_range, ptrans->box.x,