summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-01-15 11:11:39 +0100
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-01-17 10:21:54 +0100
commit1fb3faabbd3dfddcb37c228371fbe71cbc751fd8 (patch)
tree0b319c692f90c7bc117c6c6b951a64e0221a9996 /tests
parentc54ed64e8fcce399a0d70b8084a7e1a6ca986409 (diff)
tests/kms_plane_scaling: Move get_num_scalers to a function, v2.
The number of scalers can depend on the pipe, so require at least 1 scaler before running any subtests. Changes since v1: - More closely match kernel implementation. (Mika) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/kms_plane_scaling.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 7e9a948a..dd87bd09 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -38,8 +38,6 @@ typedef struct {
int image_w;
int image_h;
- int num_scalers;
-
struct igt_fb fb1;
struct igt_fb fb2;
struct igt_fb fb3;
@@ -53,6 +51,18 @@ typedef struct {
igt_plane_t *plane4;
} data_t;
+static int get_num_scalers(uint32_t devid, enum pipe pipe)
+{
+ igt_require(intel_gen(devid) >= 9);
+
+ if (intel_gen(devid) >= 10)
+ return 2;
+ else if (pipe != PIPE_C)
+ return 2;
+ else
+ return 1;
+}
+
static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
igt_plane_t *plane, drmModeModeInfo *mode, enum igt_commit_style s)
{
@@ -170,8 +180,6 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
drmModeModeInfo *mode;
int primary_plane_scaling = 0; /* For now */
- igt_require(d->num_scalers > 0);
-
igt_display_reset(display);
igt_output_set_pipe(output, pipe);
mode = igt_output_get_mode(output);
@@ -310,15 +318,17 @@ igt_main
igt_require_pipe_crc(data.drm_fd);
igt_display_init(&data.display, data.drm_fd);
data.devid = intel_get_drm_devid(data.drm_fd);
- data.num_scalers = intel_gen(data.devid) >= 9 ? 2 : 0;
}
for_each_pipe_static(pipe) igt_subtest_group {
igt_output_t *output;
- igt_fixture
+ igt_fixture {
igt_display_require_output_on_pipe(&data.display, pipe);
+ igt_require(get_num_scalers(data.devid, pipe) > 0);
+ }
+
igt_subtest_f("pipe-%s-plane-scaling", kmstest_pipe_name(pipe))
for_each_valid_output_on_pipe(&data.display, pipe, output)
test_plane_scaling_on_pipe(&data, pipe, output);