[igt-dev] [PATCH i-g-t] tests/kms_panel_fitting: Finally fix panel fitter legacy test.
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Fri Aug 24 15:00:06 UTC 2018
Use atomic commit to update planes. This is required for gen9
when 2 outputs share the same pipe, because otherwise the
sprite plane on pipe C might not have disabled the second time
the code loops.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106606
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
tests/kms_panel_fitting.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index 7df8104ed00a..967e9a485ccc 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -47,7 +47,7 @@ static void cleanup_crtc(data_t *data)
}
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)
+ igt_plane_t *plane, drmModeModeInfo *mode)
{
igt_display_t *display = &data->display;
@@ -65,11 +65,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
&data->fb1);
/*
- * We always set the primary plane to actually enable the pipe as
- * there's no way (that works) to light up a pipe with only a sprite
- * plane enabled at the moment.
+ * Legacy modeset has no way to light up a pipe with only a sprite
+ * plane enabled.
*/
- if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
+ if (!display->is_atomic && plane->type != DRM_PLANE_TYPE_PRIMARY) {
igt_plane_t *primary;
primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
@@ -77,7 +76,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
}
igt_plane_set_fb(plane, &data->fb1);
- igt_display_commit2(display, s);
+ igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
}
static void test_panel_fitting(data_t *d)
@@ -110,18 +109,18 @@ static void test_panel_fitting(data_t *d)
mode->hdisplay = 640;
mode->vdisplay = 480;
d->plane1 = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
- prepare_crtc(d, output, pipe, d->plane1, mode, COMMIT_LEGACY);
+ prepare_crtc(d, output, pipe, d->plane1, mode);
/* disable panel fitting */
- prepare_crtc(d, output, pipe, d->plane1, &native_mode, COMMIT_LEGACY);
+ prepare_crtc(d, output, pipe, d->plane1, &native_mode);
/* enable panel fitting */
mode->hdisplay = 800;
mode->vdisplay = 600;
- prepare_crtc(d, output, pipe, d->plane1, mode, COMMIT_LEGACY);
+ prepare_crtc(d, output, pipe, d->plane1, mode);
/* disable panel fitting */
- prepare_crtc(d, output, pipe, d->plane1, &native_mode, COMMIT_LEGACY);
+ prepare_crtc(d, output, pipe, d->plane1, &native_mode);
/* Set up fb2->plane2 mapping. */
d->plane2 = igt_output_get_plane_type(output, DRM_PLANE_TYPE_OVERLAY);
@@ -132,7 +131,7 @@ static void test_panel_fitting(data_t *d)
igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d->fb2.height-200);
igt_plane_set_position(d->plane2, 100, 100);
igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200);
- igt_display_commit2(display, COMMIT_UNIVERSAL);
+ igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
/*
* most of gen7 and all of gen8 doesn't support scaling at all.
@@ -151,7 +150,7 @@ static void test_panel_fitting(data_t *d)
/* enable panel fitting along with sprite scaling */
mode->hdisplay = 1024;
mode->vdisplay = 768;
- prepare_crtc(d, output, pipe, d->plane1, mode, COMMIT_LEGACY);
+ prepare_crtc(d, output, pipe, d->plane1, mode);
valid_tests++;
}
--
2.18.0
More information about the igt-dev
mailing list