Commit cd845791 authored by Dave Airlie's avatar Dave Airlie

Merge branch 'linux-5.1' of git://github.com/skeggsb/linux into drm-fixes

Some minor nouveau dmem and other fixes.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Ben Skeggs <bskeggs@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/CABDvA==kMkD6n-cS9KpQBcTU1E8p7Wc+H1ZuOhSfD7yTFJVvkw@mail.gmail.com
parents 8f3b4876 83857418
...@@ -181,7 +181,7 @@ nouveau_debugfs_pstate_set(struct file *file, const char __user *ubuf, ...@@ -181,7 +181,7 @@ nouveau_debugfs_pstate_set(struct file *file, const char __user *ubuf,
} }
ret = pm_runtime_get_sync(drm->dev); ret = pm_runtime_get_sync(drm->dev);
if (IS_ERR_VALUE(ret) && ret != -EACCES) if (ret < 0 && ret != -EACCES)
return ret; return ret;
ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args)); ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args));
pm_runtime_put_autosuspend(drm->dev); pm_runtime_put_autosuspend(drm->dev);
......
...@@ -100,12 +100,10 @@ static void ...@@ -100,12 +100,10 @@ static void
nouveau_dmem_free(struct hmm_devmem *devmem, struct page *page) nouveau_dmem_free(struct hmm_devmem *devmem, struct page *page)
{ {
struct nouveau_dmem_chunk *chunk; struct nouveau_dmem_chunk *chunk;
struct nouveau_drm *drm;
unsigned long idx; unsigned long idx;
chunk = (void *)hmm_devmem_page_get_drvdata(page); chunk = (void *)hmm_devmem_page_get_drvdata(page);
idx = page_to_pfn(page) - chunk->pfn_first; idx = page_to_pfn(page) - chunk->pfn_first;
drm = chunk->drm;
/* /*
* FIXME: * FIXME:
...@@ -456,11 +454,6 @@ nouveau_dmem_resume(struct nouveau_drm *drm) ...@@ -456,11 +454,6 @@ nouveau_dmem_resume(struct nouveau_drm *drm)
/* FIXME handle pin failure */ /* FIXME handle pin failure */
WARN_ON(ret); WARN_ON(ret);
} }
list_for_each_entry (chunk, &drm->dmem->chunk_empty, list) {
ret = nouveau_bo_pin(chunk->bo, TTM_PL_FLAG_VRAM, false);
/* FIXME handle pin failure */
WARN_ON(ret);
}
mutex_unlock(&drm->dmem->mutex); mutex_unlock(&drm->dmem->mutex);
} }
...@@ -479,9 +472,6 @@ nouveau_dmem_suspend(struct nouveau_drm *drm) ...@@ -479,9 +472,6 @@ nouveau_dmem_suspend(struct nouveau_drm *drm)
list_for_each_entry (chunk, &drm->dmem->chunk_full, list) { list_for_each_entry (chunk, &drm->dmem->chunk_full, list) {
nouveau_bo_unpin(chunk->bo); nouveau_bo_unpin(chunk->bo);
} }
list_for_each_entry (chunk, &drm->dmem->chunk_empty, list) {
nouveau_bo_unpin(chunk->bo);
}
mutex_unlock(&drm->dmem->mutex); mutex_unlock(&drm->dmem->mutex);
} }
...@@ -623,7 +613,7 @@ nouveau_dmem_init(struct nouveau_drm *drm) ...@@ -623,7 +613,7 @@ nouveau_dmem_init(struct nouveau_drm *drm)
*/ */
drm->dmem->devmem = hmm_devmem_add(&nouveau_dmem_devmem_ops, drm->dmem->devmem = hmm_devmem_add(&nouveau_dmem_devmem_ops,
device, size); device, size);
if (drm->dmem->devmem == NULL) { if (IS_ERR(drm->dmem->devmem)) {
kfree(drm->dmem); kfree(drm->dmem);
drm->dmem = NULL; drm->dmem = NULL;
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment