From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: igt-dev@lists.freedesktop.org
Cc: eben@raspberrypi.org, Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [igt-dev] [PATCH i-g-t] lib/igt_kms: Set writeback connector capacity to fix VC4 testing
Date: Wed, 14 Nov 2018 16:31:49 +0100 [thread overview]
Message-ID: <20181114153149.14912-1-paul.kocialkowski@bootlin.com> (raw)
Support for writeback connectors was recently introduced in DRM, with
an implementation in the VC4 DRM driver. This unfortunately broke IGT
testing for the driver due to always-failing atomic commits.
After boot up, the writeback connector is attached to a CRTC, with a
virtual encoder and a plane (that takes the same framebuffer as the
primary plane).
Because IGT configures all the available planes, this plane is no
longer associated with the writeback CRTC. The connector remains
associated with the CRTC as the core does not automatically clean it up.
IGT is not aware of the writeback connector (hidden by default), so it
does not detach the CRTC. As a result, the atomic commit fails because
the CRTC is moving to a disabled state with a connector still attached.
Fix this issue by setting the writeback connector cap before getting
DRM resources so that the connector can be discovered and the CRTC
can be detached by IGT. Since it requires atomic support, make it
conditional and move the atomic capability before getting DRM resources.
The associated cap definitions are also updated to include the required
writeback one.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
include/drm-uapi/drm.h | 16 ++++++++++++++++
lib/igt_kms.c | 8 ++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/include/drm-uapi/drm.h b/include/drm-uapi/drm.h
index f0bd91de..85c685a2 100644
--- a/include/drm-uapi/drm.h
+++ b/include/drm-uapi/drm.h
@@ -674,6 +674,22 @@ struct drm_get_cap {
*/
#define DRM_CLIENT_CAP_ATOMIC 3
+/**
+ * DRM_CLIENT_CAP_ASPECT_RATIO
+ *
+ * If set to 1, the DRM core will provide aspect ratio information in modes.
+ */
+#define DRM_CLIENT_CAP_ASPECT_RATIO 4
+
+/**
+ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS
+ *
+ * If set to 1, the DRM core will expose special connectors to be used for
+ * writing back to memory the scene setup in the commit. Depends on client
+ * also supporting DRM_CLIENT_CAP_ATOMIC
+ */
+#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
+
/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
struct drm_set_client_cap {
__u64 capability;
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d806ccc1..4f356b8b 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1882,6 +1882,12 @@ bool igt_display_init(igt_display_t *display, int drm_fd)
display->drm_fd = drm_fd;
+ if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0) {
+ display->is_atomic = 1;
+
+ drmSetClientCap(drm_fd, DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1);
+ }
+
resources = drmModeGetResources(display->drm_fd);
if (!resources)
goto out;
@@ -1895,8 +1901,6 @@ bool igt_display_init(igt_display_t *display, int drm_fd)
igt_assert_f(display->pipes, "Failed to allocate memory for %d pipes\n", display->n_pipes);
drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
- if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
- display->is_atomic = 1;
plane_resources = drmModeGetPlaneResources(display->drm_fd);
igt_assert(plane_resources);
--
2.19.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2018-11-14 15:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-14 15:31 Paul Kocialkowski [this message]
2018-11-14 15:50 ` [igt-dev] [PATCH i-g-t] lib/igt_kms: Set writeback connector capacity to fix VC4 testing Boris Brezillon
2018-11-15 16:36 ` Paul Kocialkowski
2018-11-14 16:42 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-11-15 3:07 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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=20181114153149.14912-1-paul.kocialkowski@bootlin.com \
--to=paul.kocialkowski@bootlin.com \
--cc=eben@raspberrypi.org \
--cc=igt-dev@lists.freedesktop.org \
--cc=thomas.petazzoni@bootlin.com \
/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