Message ID | 20211207123411.167006-10-christian.koenig@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [01/24] dma-buf: add dma_resv_replace_fences | expand |
On Tue, Dec 07, 2021 at 01:33:56PM +0100, Christian König wrote: > Instead use the new dma_resv_get_singleton function. > > Signed-off-by: Christian König <christian.koenig@amd.com> > --- > drivers/gpu/drm/radeon/radeon_display.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c > index 573154268d43..a6f875118f01 100644 > --- a/drivers/gpu/drm/radeon/radeon_display.c > +++ b/drivers/gpu/drm/radeon/radeon_display.c > @@ -533,7 +533,12 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, > DRM_ERROR("failed to pin new rbo buffer before flip\n"); > goto cleanup; > } > - work->fence = dma_fence_get(dma_resv_excl_fence(new_rbo->tbo.base.resv)); > + r = dma_resv_get_singleton(new_rbo->tbo.base.resv, false, &work->fence); > + if (r) { > + radeon_bo_unreserve(new_rbo); > + DRM_ERROR("failed to get new rbo buffer fences\n"); > + goto cleanup; > + } Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > radeon_bo_get_tiling_flags(new_rbo, &tiling_flags, NULL); > radeon_bo_unreserve(new_rbo); > > -- > 2.25.1 >
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 573154268d43..a6f875118f01 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -533,7 +533,12 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, DRM_ERROR("failed to pin new rbo buffer before flip\n"); goto cleanup; } - work->fence = dma_fence_get(dma_resv_excl_fence(new_rbo->tbo.base.resv)); + r = dma_resv_get_singleton(new_rbo->tbo.base.resv, false, &work->fence); + if (r) { + radeon_bo_unreserve(new_rbo); + DRM_ERROR("failed to get new rbo buffer fences\n"); + goto cleanup; + } radeon_bo_get_tiling_flags(new_rbo, &tiling_flags, NULL); radeon_bo_unreserve(new_rbo);
Instead use the new dma_resv_get_singleton function. Signed-off-by: Christian König <christian.koenig@amd.com> --- drivers/gpu/drm/radeon/radeon_display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)