diff options
author | Christian König <christian.koenig@amd.com> | 2021-09-13 14:08:13 +0200 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2021-10-29 10:17:06 +0200 |
commit | bdf6aa22204e1250e217e79e77db38753a6731de (patch) | |
tree | 65b9008bb1591d324cb0bf3f3bdd261f78e66ccc | |
parent | 74c1bda2f3fa79a93e1c910008649b49b02dc09d (diff) | |
download | linux-bdf6aa22204e1250e217e79e77db38753a6731de.tar.gz linux-bdf6aa22204e1250e217e79e77db38753a6731de.tar.bz2 linux-bdf6aa22204e1250e217e79e77db38753a6731de.zip |
drm/nouveau: use the new interator in nv50_wndw_prepare_fb
Makes the handling a bit more complex, but avoids the use of
dma_resv_get_excl_unlocked().
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20211005113742.1101-27-christian.koenig@amd.com
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/wndw.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c index 8d048bacd6f0..30712a681e2a 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c @@ -539,6 +539,8 @@ 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); @@ -561,7 +563,13 @@ nv50_wndw_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state) asyw->image.handle[0] = ctxdma->object.handle; } - asyw->state.fence = dma_resv_get_excl_unlocked(nvbo->bo.base.resv); + 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); asyw->image.offset[0] = nvbo->offset; if (wndw->func->prepare) { |