summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-01-10 23:39:03 +1000
committerDave Airlie <airlied@redhat.com>2017-01-10 23:39:03 +1000
commit0e9fc702c667d67ce5f67678525afe81095a2f5f (patch)
tree01e0d5edd1f8d06ab1b62d27228f440d04828766
parent2630c5cc41f9ed7f1dddb796a97b9d5df8fe6fa7 (diff)
nouveau: wrap the output poll execution and wakeup gpudrm-next-wip-fix-runtime-race
This wraps the output poll and fixes a problem where pm resume would try and take the mode config mutex but the output poll thread would already have taken it. I found this while looking for another bug, I've no idea yet if this fixes that problem. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nv50_display.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index cb85cb72dc1c..75502cd64ab7 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -4323,10 +4323,26 @@ nv50_disp_atomic_state_alloc(struct drm_device *dev)
return &atom->state;
}
+static bool
+nv50_disp_output_poll_execute(struct drm_device *dev)
+{
+ int ret;
+ bool repoll;
+ ret = pm_runtime_get_sync(dev->dev);
+ if (ret < 0 && ret != -EACCES)
+ return true;
+
+ repoll = drm_kms_helper_poll_outputs(dev);
+ pm_runtime_mark_last_busy(dev->dev);
+ pm_runtime_put_autosuspend(dev->dev);
+ return repoll;
+}
+
static const struct drm_mode_config_funcs
nv50_disp_func = {
.fb_create = nouveau_user_framebuffer_create,
.output_poll_changed = nouveau_fbcon_output_poll_changed,
+ .output_poll_execute = nv50_disp_output_poll_execute,
.atomic_check = nv50_disp_atomic_check,
.atomic_commit = nv50_disp_atomic_commit,
.atomic_state_alloc = nv50_disp_atomic_state_alloc,