summaryrefslogtreecommitdiff
path: root/tests/kms_universal_plane.c
diff options
context:
space:
mode:
authorMatt Roper <matthew.d.roper@intel.com>2015-07-01 15:45:21 -0700
committerMatt Roper <matthew.d.roper@intel.com>2015-07-08 13:54:12 -0700
commitb81f7db593a74daeb8c8e4216743fa985a7c03de (patch)
tree9b6e5c57ef95ad5d6945cf813e951708b039dee4 /tests/kms_universal_plane.c
parent8ad1e4077879a111f341dbfd2e0fee84efc9f57e (diff)
kms_universal_plane.c: Update sanity checks for gen9
SKL and BXT have some new plane capabilities that previous generations didn't have; we need to update some of our universal plane tests to expect success rather than failure when running on these platforms. Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Diffstat (limited to 'tests/kms_universal_plane.c')
-rw-r--r--tests/kms_universal_plane.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index e6927171..635cc792 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -29,10 +29,12 @@
#include "drmtest.h"
#include "igt_debugfs.h"
#include "igt_kms.h"
+#include "intel_chipset.h"
typedef struct {
int drm_fd;
igt_display_t display;
+ int gen;
} data_t;
typedef struct {
@@ -355,6 +357,7 @@ sanity_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
igt_plane_t *primary;
drmModeModeInfo *mode;
int i;
+ int expect;
igt_skip_on(pipe >= data->display.n_pipes);
@@ -371,18 +374,21 @@ sanity_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
/*
* Try to use universal plane API to set primary plane that
- * doesn't cover CRTC (should fail).
+ * doesn't cover CRTC (should fail on pre-gen9 and succeed on
+ * gen9+).
*/
igt_plane_set_fb(primary, &test.undersized_fb);
- igt_assert(igt_display_try_commit2(&data->display, COMMIT_UNIVERSAL) == -EINVAL);
+ expect = (data->gen < 9) ? -EINVAL : 0;
+ igt_assert(igt_display_try_commit2(&data->display, COMMIT_UNIVERSAL) == expect);
/* Same as above, but different plane positioning. */
igt_plane_set_position(primary, 100, 100);
- igt_assert(igt_display_try_commit2(&data->display, COMMIT_UNIVERSAL) == -EINVAL);
+ igt_assert(igt_display_try_commit2(&data->display, COMMIT_UNIVERSAL) == expect);
igt_plane_set_position(primary, 0, 0);
- /* Try to use universal plane API to scale down (should fail) */
+ /* Try to use universal plane API to scale down (should fail on pre-gen9) */
+ expect = (data->gen < 9) ? -ERANGE : 0;
igt_assert(drmModeSetPlane(data->drm_fd, primary->drm_plane->plane_id,
output->config.crtc->crtc_id,
test.oversized_fb.fb_id, 0,
@@ -391,9 +397,9 @@ sanity_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
mode->vdisplay + 100,
IGT_FIXED(0,0), IGT_FIXED(0,0),
IGT_FIXED(mode->hdisplay,0),
- IGT_FIXED(mode->vdisplay,0)) == -ERANGE);
+ IGT_FIXED(mode->vdisplay,0)) == expect);
- /* Try to use universal plane API to scale up (should fail) */
+ /* Try to use universal plane API to scale up (should fail on pre-gen9) */
igt_assert(drmModeSetPlane(data->drm_fd, primary->drm_plane->plane_id,
output->config.crtc->crtc_id,
test.oversized_fb.fb_id, 0,
@@ -402,7 +408,7 @@ sanity_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
mode->vdisplay,
IGT_FIXED(0,0), IGT_FIXED(0,0),
IGT_FIXED(mode->hdisplay - 100,0),
- IGT_FIXED(mode->vdisplay - 100,0)) == -ERANGE);
+ IGT_FIXED(mode->vdisplay - 100,0)) == expect);
/* Find other crtcs and try to program our primary plane on them */
for (i = 0; i < test.moderes->count_crtcs; i++)
@@ -667,6 +673,7 @@ igt_main
igt_fixture {
data.drm_fd = drm_open_any_master();
+ data.gen = intel_gen(intel_get_drm_devid(data.drm_fd));
kmstest_set_vt_graphics_mode();