drm/nouveau: always queue flips relative to kernel channel activity
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
07ad6ca0d3
commit
eae389f9b1
1 changed files with 8 additions and 9 deletions
|
@ -591,7 +591,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
|
||||||
struct nouveau_bo *old_bo = nouveau_framebuffer(crtc->fb)->nvbo;
|
struct nouveau_bo *old_bo = nouveau_framebuffer(crtc->fb)->nvbo;
|
||||||
struct nouveau_bo *new_bo = nouveau_framebuffer(fb)->nvbo;
|
struct nouveau_bo *new_bo = nouveau_framebuffer(fb)->nvbo;
|
||||||
struct nouveau_page_flip_state *s;
|
struct nouveau_page_flip_state *s;
|
||||||
struct nouveau_channel *chan = NULL;
|
struct nouveau_channel *chan = drm->channel;
|
||||||
struct nouveau_fence *fence;
|
struct nouveau_fence *fence;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -602,14 +602,13 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
|
||||||
if (!s)
|
if (!s)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* Choose the channel the flip will be handled in */
|
/* synchronise rendering channel with the kernel's channel */
|
||||||
spin_lock(&old_bo->bo.bdev->fence_lock);
|
spin_lock(&new_bo->bo.bdev->fence_lock);
|
||||||
fence = new_bo->bo.sync_obj;
|
fence = nouveau_fence_ref(new_bo->bo.sync_obj);
|
||||||
if (fence)
|
spin_unlock(&new_bo->bo.bdev->fence_lock);
|
||||||
chan = fence->channel;
|
ret = nouveau_fence_sync(fence, chan);
|
||||||
if (!chan)
|
if (ret)
|
||||||
chan = drm->channel;
|
return ret;
|
||||||
spin_unlock(&old_bo->bo.bdev->fence_lock);
|
|
||||||
|
|
||||||
if (new_bo != old_bo) {
|
if (new_bo != old_bo) {
|
||||||
ret = nouveau_bo_pin(new_bo, TTM_PL_FLAG_VRAM);
|
ret = nouveau_bo_pin(new_bo, TTM_PL_FLAG_VRAM);
|
||||||
|
|
Loading…
Add table
Reference in a new issue