diff --git a/drivers/gpu/drm/nouveau/nv10_fence.c b/drivers/gpu/drm/nouveau/nv10_fence.c index 7ae7f97..b0d4cc9 100644 --- a/drivers/gpu/drm/nouveau/nv10_fence.c +++ b/drivers/gpu/drm/nouveau/nv10_fence.c @@ -38,6 +38,7 @@ struct nv10_fence_priv { struct nouveau_bo *bo; spinlock_t lock; u32 sequence; + u32 suspend_seq; }; int @@ -162,6 +163,22 @@ nv10_fence_destroy(struct nouveau_drm *drm) kfree(priv); } +bool nv17_fence_suspend(struct nouveau_drm *drm) +{ + struct nv10_fence_priv *priv = drm->fence; + + priv->suspend_seq = nouveau_bo_rd32(priv->bo, 0); + + return true; +} + +void nv17_fence_resume(struct nouveau_drm *drm) +{ + struct nv10_fence_priv *priv = drm->fence; + + nouveau_bo_wr32(priv->bo, 0, priv->suspend_seq); +} + int nv10_fence_create(struct nouveau_drm *drm) { @@ -197,6 +214,9 @@ nv10_fence_create(struct nouveau_drm *drm) if (ret == 0) { nouveau_bo_wr32(priv->bo, 0x000, 0x00000000); priv->base.sync = nv17_fence_sync; + + priv->base.suspend = nv17_fence_suspend; + priv->base.resume = nv17_fence_resume; } }