summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatt Roper <matthew.d.roper@intel.com>2014-06-30 16:44:24 -0700
committerDamien Lespiau <damien.lespiau@intel.com>2014-07-04 12:04:01 +0100
commit1c25547d48296c3058c9e1cc45b533746144a230 (patch)
treee761c0ccc67312da04b873d60206bd0f0c72dc2c /lib
parent2a3e212acc01742ac0a0f8bcf969e8a1ae2343b1 (diff)
lib/kms: Add igt_display_commit2()
Add a new commit interface, igt_display_commit2(), that allows tests to specify which programming API should be used to perform hardware updates. COMMIT_LEGACY is the only option for now, but universal and atomic interfaces will be added as additional options in the future. igt_display_commit() remains unchanged for existing tests that wish to place the hardware in a specific state, but that don't care which API is used to achieve that state. The legacy API will be used by default for now, but in the future we may decide to make the default API configurable via an environment variable. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_kms.c32
-rw-r--r--lib/igt_kms.h7
2 files changed, 38 insertions, 1 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 3f561e9a..064b741c 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -946,7 +946,21 @@ static int igt_output_commit(igt_output_t *output)
return 0;
}
-int igt_display_commit(igt_display_t *display)
+/**
+ * igt_display_commit2:
+ * @display: DRM device handle
+ * @s: Commit style
+ *
+ * Commits framebuffer and positioning changes to all planes of each display
+ * pipe, using a specific API to perform the programming. This function should
+ * be used to exercise a specific driver programming API; igt_display_commit
+ * should be used instead if the API used is unimportant to the test being run.
+ *
+ * Returns: 0 upon success. This function will never return upon failure
+ * since igt_fail() at lower levels will longjmp out of it.
+ */
+int igt_display_commit2(igt_display_t *display,
+ enum igt_commit_style s)
{
int i;
@@ -971,6 +985,22 @@ int igt_display_commit(igt_display_t *display)
return 0;
}
+/**
+ * igt_display_commit:
+ * @display: DRM device handle
+ * @s: Commit style
+ *
+ * Commits framebuffer and positioning changes to all planes of each display
+ * pipe.
+ *
+ * Returns: 0 upon success. This function will never return upon failure
+ * since igt_fail() at lower levels will longjmp out of it.
+ */
+int igt_display_commit(igt_display_t *display)
+{
+ return igt_display_commit2(display, COMMIT_LEGACY);
+}
+
const char *igt_output_name(igt_output_t *output)
{
return output->name;
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index a9a42368..62dc73c5 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -65,6 +65,12 @@ enum port {
};
#define port_name(p) ((p) + 'A')
+enum igt_commit_style {
+ COMMIT_LEGACY = 0,
+ COMMIT_UNIVERSAL,
+ /* We'll add atomic here eventually. */
+};
+
#include "igt_fb.h"
struct kmstest_connector_config {
@@ -150,6 +156,7 @@ void igt_set_vt_graphics_mode(void);
void igt_display_init(igt_display_t *display, int drm_fd);
void igt_display_fini(igt_display_t *display);
+int igt_display_commit2(igt_display_t *display, enum igt_commit_style s);
int igt_display_commit(igt_display_t *display);
int igt_display_get_n_pipes(igt_display_t *display);