From: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
To: <harry.wentland@amd.com>, <dri-devel@lists.freedesktop.org>,
<linux-kernel@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
<maarten.lankhorst@linux.intel.com>
Cc: <amd-gfx@lists.freedesktop.org>, <seanpaul@chromium.org>,
<daniel@ffwll.ch>, Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Subject: [PATCH v2] drm/core: Fail atomic IOCTL with no CRTC state but with signaling.
Date: Tue, 20 Jun 2017 13:57:06 -0400 [thread overview]
Message-ID: <1497981426-27203-1-git-send-email-Andrey.Grodzovsky@amd.com> (raw)
In-Reply-To: <0d603149-3fb0-3d48-89e5-77e3f7686415@amd.com>
Problem : While running IGT kms_atomic_transition test suite i encountered
a hang in drmHandleEvent immediately following an atomic_commit.
After dumping the atomic state I relized that in this case there was
not even one CRTC attached to the state and only disabled
planes. This probably due to a commit which hadn't changed any property
which would require attaching crtc state. This means drmHandleEvent
will never wake up from read since without CRTC in atomic state
the event fd will not be signaled.
Fix: Protect against this issue by failing atomic_commit early in
drm_mode_atomic_commit where such probelm can be identified.
v2:
Fix typos and extra newlines.
Change-Id: I3ee28ffae35fd1e8bfe553146c44da53da02e6f8
Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
---
drivers/gpu/drm/drm_atomic.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index a567310..48145bf 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1933,7 +1933,7 @@ static int prepare_crtc_signaling(struct drm_device *dev,
{
struct drm_crtc *crtc;
struct drm_crtc_state *crtc_state;
- int i, ret;
+ int i, c = 0, ret;
if (arg->flags & DRM_MODE_ATOMIC_TEST_ONLY)
return 0;
@@ -1994,8 +1994,17 @@ static int prepare_crtc_signaling(struct drm_device *dev,
crtc_state->event->base.fence = fence;
}
+
+ c++;
}
+ /*
+ * Having this flag means user mode pends on event which will never
+ * reach due to lack of at least one CRTC for signaling
+ */
+ if (c == 0 && (arg->flags & DRM_MODE_PAGE_FLIP_EVENT))
+ return -EINVAL;
+
return 0;
}
--
2.7.4
next prev parent reply other threads:[~2017-06-20 17:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-09 21:30 [PATCH] " Andrey Grodzovsky
2017-06-12 11:08 ` Maarten Lankhorst
2017-06-12 14:12 ` Andrey Grodzovsky
2017-06-15 20:46 ` Andrey Grodzovsky
2017-06-19 15:35 ` Harry Wentland
2017-06-19 19:24 ` Sean Paul
[not found] ` <f9bdcba7-1549-75ce-c1bf-39525cc3fb47@amd.com>
2017-06-20 9:29 ` [Intel-gfx] " Daniel Vetter
2017-06-20 17:57 ` Andrey Grodzovsky [this message]
2017-06-26 19:44 ` [PATCH v2] " Harry Wentland
2017-06-27 7:37 ` Daniel Vetter
2017-06-27 14:29 ` Maarten Lankhorst
2017-06-27 15:01 ` Daniel Vetter
2017-06-28 10:23 ` Maarten Lankhorst
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=1497981426-27203-1-git-send-email-Andrey.Grodzovsky@amd.com \
--to=andrey.grodzovsky@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=seanpaul@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®