Skip to contentSkip to conversation

tests/kms_panel_fitting: Fix plane scaling avoidance on gen7/gen8

PATCH In review Matt Roper 3 participants 5 messages Aug 30, 2019 – Sep 2, 2019

lore
Share & tools
lore

Matt Roper

author
#0 lore raw

PATCH 1/1 tests/kms_panel_fitting: Fix plane scaling avoidance on gen7/gen8

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 <[email protected]>
---
 tests/kms_panel_fitting.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
tests/kms_panel_fitting.c +19 -5
index 491e429f..a942294b 100644
@@ -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;
Signature · 6 lines
2.20.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for tests/kms_panel_fitting: Fix plane scaling avoidance on gen7/gen8

== Series Details ==

== Series Details ==

Series: tests/kms_panel_fitting: Fix plane scaling avoidance on gen7/gen8
URL : https://patchwork.freedesktop.org/series/66080/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6813 -> IGTPW_3405
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/66080/revisions/1/mbox/

Known issues
------------

Here are the changes found in IGTPW_3405 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_cpu_reloc@basic:
- fi-icl-u3: [PASS][1] -> [DMESG-WARN][2] ([fdo#107724])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/fi-icl-u3/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/fi-icl-u3/igt@[email protected]

* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: [PASS][3] -> [INCOMPLETE][4] ([fdo#107718])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/fi-blb-e6850/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/fi-blb-e6850/igt@[email protected]

* igt@i915_selftest@live_gem_contexts:
- fi-cfl-8700k: [PASS][5] -> [INCOMPLETE][6] ([fdo#111514])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/fi-cfl-8700k/igt@i915_selftest@live_gem_contexts.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/fi-cfl-8700k/igt@i915_selftest@live_gem_contexts.html

#### Possible fixes ####

* igt@gem_mmap_gtt@basic-small-bo-tiledx:
- fi-icl-u3: [DMESG-WARN][7] ([fdo#107724]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/fi-icl-u3/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/fi-icl-u3/igt@[email protected]

* igt@i915_selftest@live_execlists:
- {fi-icl-guc}: [INCOMPLETE][9] ([fdo#107713]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/fi-icl-guc/igt@i915_selftest@live_execlists.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/fi-icl-guc/igt@i915_selftest@live_execlists.html

* igt@i915_selftest@live_workarounds:
- fi-bsw-kefka: [DMESG-WARN][11] ([fdo#111373]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/fi-bsw-kefka/igt@i915_selftest@live_workarounds.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/fi-bsw-kefka/igt@i915_selftest@live_workarounds.html

#### Warnings ####

* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-kbl-guc: [SKIP][13] ([fdo#109271]) -> [FAIL][14] ([fdo#107707])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/fi-kbl-guc/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/fi-kbl-guc/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#107707]: https://bugs.freedesktop.org/show_bug.cgi?id=107707
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111373]: https://bugs.freedesktop.org/show_bug.cgi?id=111373
[fdo#111514]: https://bugs.freedesktop.org/show_bug.cgi?id=111514

Participating hosts (52 -> 45)
------------------------------

Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_5162 -> IGTPW_3405

CI-20190529: 20190529
CI_DRM_6813: 7d8570ed21a0d6fc7083f287fcd39823c361f240 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3405: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/
IGT_5162: e62ea305fdba2a9cd0dadfa527b54529cb0d1438 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for tests/kms_panel_fitting: Fix plane scaling avoidance on gen7/gen8

In reply to Matt Roper
== Series Details ==

== Series Details ==

Series: tests/kms_panel_fitting: Fix plane scaling avoidance on gen7/gen8
URL : https://patchwork.freedesktop.org/series/66080/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6813_full -> IGTPW_3405_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/66080/revisions/1/mbox/

Known issues
------------

Here are the changes found in IGTPW_3405_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_nop@basic-parallel:
- shard-hsw: [PASS][1] -> [INCOMPLETE][2] ([fdo#103540]) +1 similar issue
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-hsw1/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-hsw4/igt@[email protected]

* igt@gem_exec_schedule@preempt-queue-bsd1:
- shard-iclb: [PASS][3] -> [SKIP][4] ([fdo#109276]) +12 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-iclb2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-iclb3/igt@[email protected]

* igt@gem_workarounds@suspend-resume-context:
- shard-apl: [PASS][5] -> [DMESG-WARN][6] ([fdo#108566]) +7 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-apl3/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-apl8/igt@[email protected]

* igt@kms_flip@flip-vs-blocking-wf-vblank:
- shard-apl: [PASS][7] -> [INCOMPLETE][8] ([fdo#103927]) +1 similar issue
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-apl4/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-apl2/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw:
- shard-iclb: [PASS][9] -> [FAIL][10] ([fdo#103167]) +3 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-iclb5/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-iclb2/igt@[email protected]

* igt@kms_plane_lowres@pipe-a-tiling-y:
- shard-iclb: [PASS][11] -> [FAIL][12] ([fdo#103166])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-iclb6/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-iclb8/igt@[email protected]

* igt@kms_psr@psr2_primary_render:
- shard-iclb: [PASS][13] -> [SKIP][14] ([fdo#109441])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-iclb2/igt@kms_psr@psr2_primary_render.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-iclb1/igt@kms_psr@psr2_primary_render.html

* igt@perf_pmu@rc6-runtime-pm-long:
- shard-apl: [PASS][15] -> [FAIL][16] ([fdo#105010])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-apl6/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-apl2/igt@[email protected]
- shard-glk: [PASS][17] -> [FAIL][18] ([fdo#105010])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-glk4/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-glk4/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_balancer@smoke:
- shard-iclb: [SKIP][19] ([fdo#110854]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-iclb5/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-iclb2/igt@[email protected]

* igt@gem_exec_schedule@preempt-other-bsd1:
- shard-iclb: [SKIP][21] ([fdo#109276]) -> [PASS][22] +12 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-iclb7/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-iclb4/igt@[email protected]

* igt@gem_exec_schedule@preempt-other-chain-bsd:
- shard-iclb: [SKIP][23] ([fdo#111325]) -> [PASS][24] +5 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-iclb4/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-iclb8/igt@[email protected]

* igt@gem_mmap_gtt@medium-copy-xy:
- shard-apl: [INCOMPLETE][25] ([fdo#103927]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-apl2/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-apl6/igt@[email protected]

* igt@i915_suspend@fence-restore-untiled:
- shard-apl: [DMESG-WARN][27] ([fdo#108566]) -> [PASS][28] +2 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-apl3/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-apl4/igt@[email protected]

* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
- shard-hsw: [FAIL][29] ([fdo#105767]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-hsw4/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-hsw1/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-blt:
- shard-iclb: [FAIL][31] ([fdo#103167]) -> [PASS][32] +1 similar issue
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-iclb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-blt.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-iclb6/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-blt.html

* igt@kms_psr@psr2_primary_blt:
- shard-iclb: [SKIP][33] ([fdo#109441]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-iclb7/igt@kms_psr@psr2_primary_blt.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-iclb2/igt@kms_psr@psr2_primary_blt.html

* igt@kms_setmode@basic:
- shard-hsw: [FAIL][35] ([fdo#99912]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-hsw4/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-hsw6/igt@[email protected]

#### Warnings ####

* igt@gem_ctx_isolation@vcs1-nonpriv:
- shard-iclb: [SKIP][37] ([fdo#109276]) -> [FAIL][38] ([fdo#111329])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-iclb6/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-iclb1/igt@[email protected]

* igt@gem_mocs_settings@mocs-settings-bsd2:
- shard-iclb: [SKIP][39] ([fdo#109276]) -> [FAIL][40] ([fdo#111330])
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6813/shard-iclb7/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/shard-iclb1/igt@[email protected]

[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105010]: https://bugs.freedesktop.org/show_bug.cgi?id=105010
[fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
[fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
[fdo#111329]: https://bugs.freedesktop.org/show_bug.cgi?id=111329
[fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912

Participating hosts (9 -> 6)
------------------------------

Missing (3): pig-skl-6260u shard-skl pig-glk-j5005

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_5162 -> IGTPW_3405
* Piglit: piglit_4509 -> None

CI-20190529: 20190529
CI_DRM_6813: 7d8570ed21a0d6fc7083f287fcd39823c361f240 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3405: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/
IGT_5162: e62ea305fdba2a9cd0dadfa527b54529cb0d1438 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3405/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

Reviewed-by on v1 1/1
#3 lore raw
In reply to Matt Roper
Quoted 19 lines · Matt Roper

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.

Quoted 6 lines

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 <[email protected]>
Quoted 56 lines
---
 tests/kms_panel_fitting.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
tests/kms_panel_fitting.c +19 -5
index 491e429f..a942294b 100644
@@ -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;
Signature · 6 lines
2.20.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
author
#4 lore raw
Quoted 20 lines · Ville Syrjälä
Quoted 19 lines · Matt Roper

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.

Quoted 8 lines
Quoted 6 lines

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 <[email protected]>

Pushed, thanks for the review.

Matt

Quoted 61 lines
Quoted 57 lines
---
 tests/kms_panel_fitting.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
tests/kms_panel_fitting.c +19 -5
index 491e429f..a942294b 100644
@@ -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;
Signature · 6 lines
2.20.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Signature · 2 lines
Ville Syrjälä
Intel
Signature · 9 lines
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev