summaryrefslogtreecommitdiff
path: root/tests/kms_plane_scaling.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-01-30 16:11:08 +0100
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-02-05 13:41:23 +0100
commit48d9da5636d54d37261b3fd2fa25aec70746b999 (patch)
treef43da35f4244ea3b90bb34c110d31ea4707164a5 /tests/kms_plane_scaling.c
parent51a1f428ac88c8fd685ba43334e9ac6f10f5b45f (diff)
tests/kms_plane_scaling: Test all pixel formats in pipe-*-scaler-with-rotation
This will allow us to test NV12 as well, when available. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'tests/kms_plane_scaling.c')
-rw-r--r--tests/kms_plane_scaling.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index d32f3441..18a42035 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -164,25 +164,13 @@ static const igt_rotation_t rotations[] = {
IGT_ROTATION_270,
};
-static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,
- igt_output_t *output)
+static bool can_rotate(unsigned format)
{
- igt_display_t *display = &d->display;
- igt_plane_t *plane;
-
- igt_output_set_pipe(output, pipe);
- for_each_plane_on_pipe(display, pipe, plane) {
- if (plane->type == DRM_PLANE_TYPE_CURSOR)
- continue;
+ if (format == DRM_FORMAT_C8 ||
+ format == DRM_FORMAT_RGB565)
+ return false;
- for (int i = 0; i < ARRAY_SIZE(rotations); i++) {
- igt_rotation_t rot = rotations[i];
-
- check_scaling_pipe_plane_rot(d, plane, DRM_FORMAT_XRGB8888,
- LOCAL_I915_FORMAT_MOD_Y_TILED,
- pipe, output, rot);
- }
- }
+ return true;
}
static bool can_draw(uint32_t drm_format)
@@ -199,6 +187,30 @@ static bool can_draw(uint32_t drm_format)
return false;
}
+static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,
+ igt_output_t *output)
+{
+ igt_display_t *display = &d->display;
+ igt_plane_t *plane;
+
+ igt_output_set_pipe(output, pipe);
+ for_each_plane_on_pipe(display, pipe, plane) {
+ if (plane->type == DRM_PLANE_TYPE_CURSOR)
+ continue;
+
+ for (int i = 0; i < ARRAY_SIZE(rotations); i++) {
+ igt_rotation_t rot = rotations[i];
+ for (int j = 0; j < plane->drm_plane->count_formats; j++) {
+ unsigned format = plane->drm_plane->formats[j];
+ if (can_draw(format) && can_rotate(format))
+ check_scaling_pipe_plane_rot(d, plane, format,
+ LOCAL_I915_FORMAT_MOD_Y_TILED,
+ pipe, output, rot);
+ }
+ }
+ }
+}
+
static const uint64_t tilings[] = {
LOCAL_DRM_FORMAT_MOD_NONE,
LOCAL_I915_FORMAT_MOD_X_TILED,