drm/vmwgfx: Implement dma_fence_ops properly

vmwgfx's fencing predates dma_fence and as a result dma_fence_ops was never
properly implemented, especially with respect to enabling signaling.

Because of this dma_fence callbacks don't work properly. This change
implements enable_signaling properly so that dma_fence callbacks now
work as expected.

It also removes vmwgfx's custom implementation of fence callbacks
and removes vmwgfx's custom dma_fence_ops::wait function which is no
longer necessary now that enable_signaling works.

Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/r/20250530183510.733175-2-ian.forbes@broadcom.com
This commit is contained in:
Ian Forbes
2025-05-30 13:35:09 -05:00
committed by Zack Rusin
parent c82f55f4aa
commit db6a94b263
5 changed files with 97 additions and 500 deletions

View File

@@ -4067,23 +4067,6 @@ static int vmw_execbuf_tie_context(struct vmw_private *dev_priv,
return 0;
}
/*
* DMA fence callback to remove a seqno_waiter
*/
struct seqno_waiter_rm_context {
struct dma_fence_cb base;
struct vmw_private *dev_priv;
};
static void seqno_waiter_rm_cb(struct dma_fence *f, struct dma_fence_cb *cb)
{
struct seqno_waiter_rm_context *ctx =
container_of(cb, struct seqno_waiter_rm_context, base);
vmw_seqno_waiter_remove(ctx->dev_priv);
kfree(ctx);
}
int vmw_execbuf_process(struct drm_file *file_priv,
struct vmw_private *dev_priv,
void __user *user_commands, void *kernel_commands,
@@ -4264,15 +4247,6 @@ int vmw_execbuf_process(struct drm_file *file_priv,
} else {
/* Link the fence with the FD created earlier */
fd_install(out_fence_fd, sync_file->file);
struct seqno_waiter_rm_context *ctx =
kmalloc(sizeof(*ctx), GFP_KERNEL);
ctx->dev_priv = dev_priv;
vmw_seqno_waiter_add(dev_priv);
if (dma_fence_add_callback(&fence->base, &ctx->base,
seqno_waiter_rm_cb) < 0) {
vmw_seqno_waiter_remove(dev_priv);
kfree(ctx);
}
}
}