All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 2/2] nouveau: wrap the output poll execution and wakeup gpu
Date: Tue, 10 Jan 2017 12:12:32 +1000	[thread overview]
Message-ID: <20170110021232.15389-3-airlied@gmail.com> (raw)
In-Reply-To: <20170110021232.15389-1-airlied@gmail.com>

From: Dave Airlie <airlied@redhat.com>

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>
---
 drivers/gpu/drm/nouveau/nv50_display.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index cb85cb7..75502cd 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,
-- 
2.9.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-01-10  2:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10  2:12 [rfc] fix output poll execute lockdep Dave Airlie
2017-01-10  2:12 ` [PATCH 1/2] drm: allow drivers to wrap output poll execution Dave Airlie
2017-01-10  2:12 ` Dave Airlie [this message]
2017-01-10  9:49 ` [rfc] fix output poll execute lockdep Daniel Vetter
2017-01-10 11:46   ` Dave Airlie
2017-01-10 12:34     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170110021232.15389-3-airlied@gmail.com \
    --to=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.