From: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
To: Petri Latvala <petri.latvala@intel.com>,
Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: [igt-dev] [RFC i-g-t] lib/igt_kms: Set capabilities before get resource
Date: Wed, 6 Mar 2019 19:49:38 -0300 [thread overview]
Message-ID: <20190306224938.opisj72oa2kxxrwi@smtp.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2852 bytes --]
Hi, I was working on adding the writeback support to VKMS; as a result,
I was using the Liviu’s patchset to validate my implementation [1].
However, I consistently failed to pass the requirements in
igt_display_require(); more specifically, I couldn't pass this test:
igt_skip("No KMS driver or no outputs, pipes: %d, outputs: %d\n",
display->n_pipes, display->n_outputs);
Next, I made a simple code that does the following three steps:
1. Open the device
2. Collect the resource information with drmModeGetResources()
3. Set writeback capability via drmSetClientCap()
4. Print the total of connectors
I noticed that I could not get any connector as well; after some time
debugging the issue and thanks to Anholt’s help in the dri-channel I
learned that I had to use drmSetClientCap() before
drmModeGetResources(). After move all drmSetClientCap() above
drmModeGetResources(), my simple coded displayed the connector
information. I did the same thing within igt_display_require(), and this
test started to pass for me (I did it, in the Liviu’s patch).
In this sense, I checked the igt_display_require() code in the master
branch; and again, I noticed that capabilities are set after getting the
resource information. Is that correct? Is it ok to call
drmModeGetResources() before drmSetClientCap() in this case?
P.s.: I sent it as a RFC because I’m not 100% sure about the change and
the impacts on the tests. If it make sense, I can make a real patch.
1. https://patchwork.freedesktop.org/series/39229/
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
lib/igt_kms.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 7ebab4ca..2de9ac41 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1886,6 +1886,10 @@ void igt_display_require(igt_display_t *display, int drm_fd)
display->drm_fd = drm_fd;
+ drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
+ if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
+ display->is_atomic = 1;
+
resources = drmModeGetResources(display->drm_fd);
if (!resources)
goto out;
@@ -1898,10 +1902,6 @@ void igt_display_require(igt_display_t *display, int drm_fd)
display->pipes = calloc(sizeof(igt_pipe_t), display->n_pipes);
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.21.0
--
Rodrigo Siqueira
https://siqueira.tech
Graduate Student
Department of Computer Science
University of São Paulo
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 153 bytes --]
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2019-03-06 22:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-06 22:49 Rodrigo Siqueira [this message]
2019-03-06 23:26 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_kms: Set capabilities before get resource 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=20190306224938.opisj72oa2kxxrwi@smtp.gmail.com \
--to=rodrigosiqueiramelo@gmail.com \
--cc=arkadiusz.hiler@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=petri.latvala@intel.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