diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 14:54:14 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 12:40:29 +1000 |
commit | 95cf469cc3b266324cd9129f93a2d44b85ea27ed (patch) | |
tree | ccd0df73aaf149d33517d00acadf62923669ee71 /drivers/gpu/drm/nouveau/nvkm | |
parent | cfdc4c44b4388bb8e697882cddd966333e4ab7b0 (diff) |
drm/nouveau/imem: use object accessor function for suspend/resume
Very much not ideal, but this will be improved later.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/instmem/base.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/base.c index 43a8f4e19eb6..4219eb39cf45 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/base.c @@ -39,7 +39,7 @@ _nvkm_instobj_dtor(struct nvkm_object *object) list_del(&iobj->head); mutex_unlock(&nv_subdev(imem)->mutex); - return nvkm_object_destroy(&iobj->base); + return nvkm_object_destroy(&iobj->object); } int @@ -92,8 +92,10 @@ _nvkm_instmem_fini(struct nvkm_object *object, bool suspend) break; } - for (i = 0; i < iobj->size; i += 4) - iobj->suspend[i / 4] = nv_ro32(iobj, i); + for (i = 0; i < iobj->size; i += 4) { + nvkm_object_rd32(&iobj->object, i, (u32 *) + &iobj->suspend[i/4]); + } } mutex_unlock(&imem->subdev.mutex); if (ret) @@ -117,8 +119,10 @@ _nvkm_instmem_init(struct nvkm_object *object) mutex_lock(&imem->subdev.mutex); list_for_each_entry(iobj, &imem->list, head) { if (iobj->suspend) { - for (i = 0; i < iobj->size; i += 4) - nv_wo32(iobj, i, iobj->suspend[i / 4]); + for (i = 0; i < iobj->size; i += 4) { + nvkm_object_wr32(&iobj->object, i, *(u32 *) + &iobj->suspend[i/4]); + } vfree(iobj->suspend); iobj->suspend = NULL; } |