From: Christian König Date: Mon, 8 Nov 2021 11:54:59 +0000 (+0100) Subject: drm/nouveau: support more than one write fence in fenv50_wndw_prepare_fb X-Git-Tag: for-5.19/block-exec-2022-06-02~43^2~21^2~18 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=33f2069fb6a9c2d6509accc39521d3f4d6369576;p=linux-block.git drm/nouveau: support more than one write fence in fenv50_wndw_prepare_fb Use dma_resv_get_singleton() here to eventually get more than one write fence as single fence. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Lyude Paul Cc: nouveau@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-14-christian.koenig@amd.com --- diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c index 0c1a2ea0ed04..e2faf92e4831 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c @@ -536,8 +536,6 @@ nv50_wndw_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state) struct nouveau_bo *nvbo; struct nv50_head_atom *asyh; struct nv50_wndw_ctxdma *ctxdma; - struct dma_resv_iter cursor; - struct dma_fence *fence; int ret; NV_ATOMIC(drm, "%s prepare: %p\n", plane->name, fb); @@ -560,13 +558,11 @@ nv50_wndw_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state) asyw->image.handle[0] = ctxdma->object.handle; } - dma_resv_iter_begin(&cursor, nvbo->bo.base.resv, false); - dma_resv_for_each_fence_unlocked(&cursor, fence) { - /* TODO: We only use the first writer here */ - asyw->state.fence = dma_fence_get(fence); - break; - } - dma_resv_iter_end(&cursor); + ret = dma_resv_get_singleton(nvbo->bo.base.resv, false, + &asyw->state.fence); + if (ret) + return ret; + asyw->image.offset[0] = nvbo->offset; if (wndw->func->prepare) {