Skip to content

Commit cd84579

Browse files
committed
Merge branch 'linux-5.1' of git://github.com/skeggsb/linux into drm-fixes
Some minor nouveau dmem and other fixes. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Ben Skeggs <bskeggs@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/CABDvA==kMkD6n-cS9KpQBcTU1E8p7Wc+H1ZuOhSfD7yTFJVvkw@mail.gmail.com
2 parents 8f3b487 + 8385741 commit cd84579

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

drivers/gpu/drm/nouveau/nouveau_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ nouveau_debugfs_pstate_set(struct file *file, const char __user *ubuf,
181181
}
182182

183183
ret = pm_runtime_get_sync(drm->dev);
184-
if (IS_ERR_VALUE(ret) && ret != -EACCES)
184+
if (ret < 0 && ret != -EACCES)
185185
return ret;
186186
ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args));
187187
pm_runtime_put_autosuspend(drm->dev);

drivers/gpu/drm/nouveau/nouveau_dmem.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,10 @@ static void
100100
nouveau_dmem_free(struct hmm_devmem *devmem, struct page *page)
101101
{
102102
struct nouveau_dmem_chunk *chunk;
103-
struct nouveau_drm *drm;
104103
unsigned long idx;
105104

106105
chunk = (void *)hmm_devmem_page_get_drvdata(page);
107106
idx = page_to_pfn(page) - chunk->pfn_first;
108-
drm = chunk->drm;
109107

110108
/*
111109
* FIXME:
@@ -456,11 +454,6 @@ nouveau_dmem_resume(struct nouveau_drm *drm)
456454
/* FIXME handle pin failure */
457455
WARN_ON(ret);
458456
}
459-
list_for_each_entry (chunk, &drm->dmem->chunk_empty, list) {
460-
ret = nouveau_bo_pin(chunk->bo, TTM_PL_FLAG_VRAM, false);
461-
/* FIXME handle pin failure */
462-
WARN_ON(ret);
463-
}
464457
mutex_unlock(&drm->dmem->mutex);
465458
}
466459

@@ -479,9 +472,6 @@ nouveau_dmem_suspend(struct nouveau_drm *drm)
479472
list_for_each_entry (chunk, &drm->dmem->chunk_full, list) {
480473
nouveau_bo_unpin(chunk->bo);
481474
}
482-
list_for_each_entry (chunk, &drm->dmem->chunk_empty, list) {
483-
nouveau_bo_unpin(chunk->bo);
484-
}
485475
mutex_unlock(&drm->dmem->mutex);
486476
}
487477

@@ -623,7 +613,7 @@ nouveau_dmem_init(struct nouveau_drm *drm)
623613
*/
624614
drm->dmem->devmem = hmm_devmem_add(&nouveau_dmem_devmem_ops,
625615
device, size);
626-
if (drm->dmem->devmem == NULL) {
616+
if (IS_ERR(drm->dmem->devmem)) {
627617
kfree(drm->dmem);
628618
drm->dmem = NULL;
629619
return;

0 commit comments

Comments
 (0)