From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: IGT development <igt-dev@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Subject: [igt-dev] [PATCH i-g-t 4/5] lib/kms: Drop igt_display_init
Date: Fri, 2 Nov 2018 10:57:25 +0100 [thread overview]
Message-ID: <20181102095726.9052-4-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20181102095726.9052-1-daniel.vetter@ffwll.ch>
If you need the high-level functions, then you probably need a
full display. Unexport the non-requiring version, and adjust the
documentation. This also gives us proper docs for the recently
added igt_display_require.
v2: Rebase, kms_content_protection is new.
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
lib/igt_kms.c | 14 +++++---------
lib/igt_kms.h | 1 -
tests/kms_content_protection.c | 3 ++-
3 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d806ccc1e0b9..7214101e2696 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1861,16 +1861,17 @@ static void igt_fill_plane_format_mod(igt_display_t *display, igt_plane_t *plane
static void igt_fill_display_format_mod(igt_display_t *display);
/**
- * igt_display_init:
+ * igt_display_require:
* @display: a pointer to an #igt_display_t structure
* @drm_fd: a drm file descriptor
*
* Initialize @display and allocate the various resources required. Use
* #igt_display_fini to release the resources when they are no longer required.
*
- * Returns: true if the display has outputs and pipes available, false otherwise
+ * This function automatically skips if the kernel driver doesn't support any
+ * CRTC or outputs.
*/
-bool igt_display_init(igt_display_t *display, int drm_fd)
+void igt_display_require(igt_display_t *display, int drm_fd)
{
drmModeRes *resources;
drmModePlaneRes *plane_resources;
@@ -2034,12 +2035,7 @@ bool igt_display_init(igt_display_t *display, int drm_fd)
out:
LOG_UNINDENT(display);
- return display->n_pipes && display->n_outputs;
-}
-
-void igt_display_require(igt_display_t *display, int drm_fd)
-{
- igt_require(igt_display_init(display, drm_fd));
+ igt_require(display->n_pipes && display->n_outputs);
}
/**
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index e6aff339af60..09395360007f 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -382,7 +382,6 @@ struct igt_display {
int format_mod_count;
};
-bool igt_display_init(igt_display_t *display, int drm_fd);
void igt_display_require(igt_display_t *display, int drm_fd);
void igt_display_fini(igt_display_t *display);
void igt_display_reset(igt_display_t *display);
diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 801eff66c272..4818e021f9c5 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -26,6 +26,7 @@
#include <fcntl.h>
#include "igt.h"
#include "igt_sysfs.h"
+#include "igt_kms.h"
IGT_TEST_DESCRIPTION("Test content protection (HDCP)");
@@ -290,7 +291,7 @@ igt_main
data.drm_fd = drm_open_driver(DRIVER_ANY);
- igt_display_init(&data.display, data.drm_fd);
+ igt_display_require(&data.display, data.drm_fd);
}
igt_subtest("legacy")
--
2.19.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-11-02 9:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-02 9:57 [igt-dev] [PATCH i-g-t 1/5] tests/sw_sync: use igt_fork_helper Daniel Vetter
2018-11-02 9:57 ` [igt-dev] [PATCH i-g-t 2/5] tests/debugfs: use igt_display_require Daniel Vetter
2018-11-02 11:16 ` Chris Wilson
2018-11-06 17:18 ` Antonio Argenziano
2018-11-06 22:05 ` Daniel Vetter
2018-11-06 22:09 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2018-11-02 9:57 ` [igt-dev] [PATCH i-g-t 3/5] tests: Use igt_display_require Daniel Vetter
2018-11-06 22:09 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2018-11-02 9:57 ` Daniel Vetter [this message]
2018-11-02 9:57 ` [igt-dev] [PATCH i-g-t 5/5] lib/kms: warn if we commit without outputs Daniel Vetter
2018-11-02 12:11 ` Maarten Lankhorst
2018-11-20 10:21 ` Daniel Vetter
2018-11-20 11:09 ` Maarten Lankhorst
2018-11-21 12:23 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2018-11-02 10:36 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] tests/sw_sync: use igt_fork_helper Patchwork
2018-11-02 12:07 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-11-02 12:26 ` [igt-dev] [PATCH i-g-t 1/5] " Robert Foss
2018-11-07 19:41 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] tests/sw_sync: use igt_fork_helper (rev3) Patchwork
2018-11-08 7:23 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-11-21 15:01 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/5] tests/sw_sync: use igt_fork_helper (rev4) 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=20181102095726.9052-4-daniel.vetter@ffwll.ch \
--to=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=igt-dev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox