All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/kms_panel_fitting: Fix plane scaling avoidance on gen7/gen8
@ 2019-08-30 22:30 ` Matt Roper
  0 siblings, 0 replies; 8+ messages in thread
From: Matt Roper @ 2019-08-30 22:30 UTC (permalink / raw)
  To: igt-dev, intel-gfx

Most gen7 and gen8 platforms can't do plane scaling, so we need to
ensure the test doesn't try to do plane scaling on those platforms.  The
legacy non-atomic subtest bakes these platform characteristics into the
test itself since legacy modesetting interfaces don't provide a way to
probe platform capabilities like atomic does.

Maarten previously tried to address this with commit 24c5e0778
("tests/kms_panel_fitting: Do not use scaling on gen7 and gen8, v2."),
but he augmented an existing test for gen9+pipeC which comes too late
since we've already turned on the plane at that point.  We can fix this
by moving the test up higher; not only before we enable panel fitting,
but also before we turn on the sprite.

Note that this still isn't a great subtest since it's very
Intel-specific, despite being part of a generic KMS test that's intended
for all vendors.  A future enhancement might be to try to probe the
platform capabilities with a TEST_ONLY atomic operation before using the
legacy interfaces to actually program them.

While touching the code, I also added some slight restructuring, added
additional comments, and broke up >80 char lines to add clarity to
what's going on.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 tests/kms_panel_fitting.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index 491e429f..a942294b 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -131,11 +131,10 @@ static void test_panel_fitting(data_t *d)
 		igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
 		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);
 
 		/*
-		 * most of gen7 and all of gen8 doesn't support scaling at all.
+		 * Most of gen7 and all of gen8 doesn't support plane scaling
+		 * at all.
 		 *
 		 * gen9 pipe C has only 1 scaler shared with the crtc, which
 		 * means pipe scaling can't work simultaneously with panel
@@ -144,9 +143,24 @@ static void test_panel_fitting(data_t *d)
 		 * Since this is the legacy path, userspace has to know about
 		 * the HW limitations, whereas atomic can ask.
 		 */
-		if (IS_GEN8(devid) || (IS_GEN7(devid) && !IS_IVYBRIDGE(devid)) ||
+		if (IS_GEN8(devid) ||
+		    (IS_GEN7(devid) && !IS_IVYBRIDGE(devid)) ||
 		    (IS_GEN9(devid) && pipe == PIPE_C))
-			igt_plane_set_size(d->plane2, d->fb2.width-200, d->fb2.height-200);
+			/* same as visible area of fb => no scaling */
+			igt_plane_set_size(d->plane2,
+					   d->fb2.width-200,
+					   d->fb2.height-200);
+		else
+			/*
+			 * different than visible area of fb => plane scaling
+			 * active
+			 */
+			igt_plane_set_size(d->plane2,
+					   mode->hdisplay-200,
+					   mode->vdisplay-200);
+
+		/* Plane scaling active (if possible), pfit off */
+		igt_display_commit2(display, COMMIT_UNIVERSAL);
 
 		/* enable panel fitting along with sprite scaling */
 		mode->hdisplay = 1024;
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-09-02 21:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-30 22:30 [PATCH i-g-t] tests/kms_panel_fitting: Fix plane scaling avoidance on gen7/gen8 Matt Roper
2019-08-30 22:30 ` [igt-dev] " Matt Roper
2019-08-30 23:09 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-08-31 23:15 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-09-02 16:51 ` [igt-dev] [PATCH i-g-t] " Ville Syrjälä
2019-09-02 16:51   ` Ville Syrjälä
2019-09-02 21:10   ` Matt Roper
2019-09-02 21:10     ` Matt Roper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.