tests/kms_yuv: Add yuv specific tests.
PATCH 1/1 tests/kms_yuv: Add yuv specific tests.
Add tests excercising switching between various scaled/unscaled transitions to and from various nv12 formats, since some of the workarounds mention this may fail.
We also add NV12 specific clipping/scaling tests, to make sure that YUV src coordinates are always programmed as a multiple of 2 correctly, and verify scaling/clipping works with CRC tests.
crop-scale-bug shows a corruption when scaling and cropping at the same time.
The subpixel clip test rotates and clips a rectangle on each side, which should produce the same CRC as when that part of the rectangle is hidden by a cursor and a whole 2x2 pixel is hidden.
--- tests/Makefile.sources | 1 + tests/kms_yuv.c | 845 +++++++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 3 files changed, 847 insertions(+) create mode 100644 tests/kms_yuv.c
tests/Makefile.sources +1 -0
@@ -72,6 +72,7 @@ TESTS_progs = \ kms_universal_plane \ kms_vblank \ kms_vrr \ + kms_yuv \ kms_sequence \ meta_test \ perf \
tests/kms_yuv.c new file +845 -0
845 lines not on this page · raw message
tests/meson.build +1 -0
@@ -60,6 +60,7 @@ test_progs = [ 'kms_universal_plane', 'kms_vblank', 'kms_vrr', + 'kms_yuv', 'meta_test', 'perf', 'pm_backlight',
Signature · 6 lines
2.20.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for tests/kms_yuv: Add yuv specific tests.
== Series Details ==
== Series Details ==
Series: tests/kms_yuv: Add yuv specific tests.
URL : https://patchwork.freedesktop.org/series/56684/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5601 -> IGTPW_2407
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/56684/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2407 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_basic@cs-compute:
- fi-kbl-8809g: NOTRUN -> FAIL [fdo#108094]
* igt@prime_vgem@basic-fence-flip:
- fi-gdg-551: PASS -> FAIL [fdo#103182]
#### Possible fixes ####
* igt@amdgpu/amd_basic@userptr:
- fi-kbl-8809g: DMESG-WARN [fdo#108965] -> PASS
* igt@gem_exec_suspend@basic-s3:
- {fi-icl-u3}: FAIL [fdo#103375] -> PASS
* igt@gem_mmap_gtt@basic-small-bo:
- {fi-icl-u3}: DMESG-WARN [fdo#107724] -> PASS
* igt@i915_module_load@reload:
- fi-blb-e6850: INCOMPLETE [fdo#107718] -> PASS
* igt@i915_selftest@live_workarounds:
- {fi-icl-u2}: INCOMPLETE [fdo#109626] -> PASS
* igt@kms_busy@basic-flip-b:
- fi-gdg-551: FAIL [fdo#103182] -> PASS
* igt@kms_flip@basic-flip-vs-dpms:
- fi-skl-6700hq: DMESG-WARN [fdo#105998] -> PASS
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
- fi-byt-clapper: FAIL [fdo#103191] / [fdo#107362] -> PASS
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-ivb-3520m: FAIL [fdo#103375] -> PASS
#### Warnings ####
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-kbl-7567u: DMESG-WARN [fdo#103558] / [fdo#105079] / [fdo#105602] -> DMESG-FAIL [fdo#105079]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
[fdo#105079]: https://bugs.freedesktop.org/show_bug.cgi?id=105079
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#105998]: https://bugs.freedesktop.org/show_bug.cgi?id=105998
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#108094]: https://bugs.freedesktop.org/show_bug.cgi?id=108094
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622
[fdo#108965]: https://bugs.freedesktop.org/show_bug.cgi?id=108965
[fdo#109226]: https://bugs.freedesktop.org/show_bug.cgi?id=109226
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109626]: https://bugs.freedesktop.org/show_bug.cgi?id=109626
Participating hosts (50 -> 43)
------------------------------
Missing (7): fi-kbl-soraka fi-ilk-m540 fi-bdw-gvtdvm fi-byt-squawks fi-bsw-cyan fi-kbl-7560u fi-bdw-samus
Build changes
-------------
* IGT: IGT_4827 -> IGTPW_2407
CI_DRM_5601: 7977cc73f17770b9b1ed8baff66a8c9fd681d6a8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2407: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2407/
IGT_4827: 395eaffd7e1390c9d6043c2980dc14ce3e08b154 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Testlist changes ==
+++ 480 lines
--- 0 lines
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2407/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_yuv: Add yuv specific tests.
In reply to Maarten Lankhorst via igt-dev== Series Details ==
== Series Details ==
Series: tests/kms_yuv: Add yuv specific tests.
URL : https://patchwork.freedesktop.org/series/56684/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_5601_full -> IGTPW_2407_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_2407_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_2407_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/56684/revisions/1/mbox/
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_2407_full:
### IGT changes ###
#### Possible regressions ####
* igt@kms_vblank@pipe-b-ts-continuation-modeset-rpm:
- shard-apl: PASS -> FAIL +1
- shard-kbl: PASS -> FAIL +1
* {igt@kms_yuv@pipe-a-vyuy-chroma-subpixel-clip} (NEW):
- shard-apl: NOTRUN -> FAIL +11
* {igt@kms_yuv@pipe-a-vyuy-crop-scale-bug} (NEW):
- shard-hsw: NOTRUN -> FAIL +59
* {igt@kms_yuv@pipe-a-yvyu-crop-scale-bug} (NEW):
- shard-snb: NOTRUN -> FAIL +36
* {igt@kms_yuv@pipe-c-uyvy-chroma-subpixel-clip} (NEW):
- shard-kbl: NOTRUN -> FAIL +11
* {igt@kms_yuv@pipe-c-vyuy-chroma-subpixel-clip} (NEW):
- shard-glk: NOTRUN -> FAIL +20
New tests
---------
New tests have been introduced between CI_DRM_5601_full and IGTPW_2407_full:
### New IGT tests (240) ###
* igt@kms_yuv@pipe-a-nv12-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0, 0.48] s
* igt@kms_yuv@pipe-a-nv12-crop-scale-bug:
- Statuses : 2 pass(s) 3 skip(s)
- Exec time: [0.0, 10.80] s
* igt@kms_yuv@pipe-a-nv12-rgb-scaled-switch:
- Statuses : 2 pass(s) 3 skip(s)
- Exec time: [0.0, 4.98] s
* igt@kms_yuv@pipe-a-nv12-rgb-switch:
- Statuses : 2 pass(s) 3 skip(s)
- Exec time: [0.0, 4.99] s
* igt@kms_yuv@pipe-a-nv12-valid-width:
- Statuses : 2 pass(s) 3 skip(s)
- Exec time: [0.0, 7.80] s
* igt@kms_yuv@pipe-a-nv16-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv16-crop-scale-bug:
- Statuses : 4 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv16-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv16-rgb-switch:
- Statuses : 4 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv16-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv21-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv21-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv21-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv21-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv21-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv61-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv61-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv61-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv61-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-nv61-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p010-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p010-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p010-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p010-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p010-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p012-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p012-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p012-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p012-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p012-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p016-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p016-crop-scale-bug:
- Statuses : 4 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p016-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p016-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-p016-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-uyvy-chroma-subpixel-clip:
- Statuses : 5 fail(s)
- Exec time: [0.10, 0.70] s
* igt@kms_yuv@pipe-a-uyvy-crop-scale-bug:
- Statuses : 3 fail(s) 2 pass(s)
- Exec time: [0.09, 8.05] s
* igt@kms_yuv@pipe-a-uyvy-rgb-scaled-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.10, 8.35] s
* igt@kms_yuv@pipe-a-uyvy-rgb-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.18, 8.41] s
* igt@kms_yuv@pipe-a-uyvy-valid-width:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.21, 14.17] s
* igt@kms_yuv@pipe-a-vyuy-chroma-subpixel-clip:
- Statuses : 5 fail(s)
- Exec time: [0.02, 0.28] s
* igt@kms_yuv@pipe-a-vyuy-crop-scale-bug:
- Statuses : 3 fail(s) 2 pass(s)
- Exec time: [0.18, 8.05] s
* igt@kms_yuv@pipe-a-vyuy-rgb-scaled-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.10, 8.36] s
* igt@kms_yuv@pipe-a-vyuy-rgb-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.19, 8.40] s
* igt@kms_yuv@pipe-a-vyuy-valid-width:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.10, 14.17] s
* igt@kms_yuv@pipe-a-xyuv8888-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-xyuv8888-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-xyuv8888-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-xyuv8888-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-xyuv8888-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yuv420-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yuv420-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yuv420-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yuv420-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yuv420-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yuv422-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yuv422-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yuv422-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yuv422-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yuv422-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yuyv-chroma-subpixel-clip:
- Statuses : 5 fail(s)
- Exec time: [0.20, 0.48] s
* igt@kms_yuv@pipe-a-yuyv-crop-scale-bug:
- Statuses : 1 fail(s) 2 pass(s)
- Exec time: [0.09, 8.04] s
* igt@kms_yuv@pipe-a-yuyv-rgb-scaled-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.25, 8.61] s
* igt@kms_yuv@pipe-a-yuyv-rgb-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.10, 8.31] s
* igt@kms_yuv@pipe-a-yuyv-valid-width:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.17, 14.12] s
* igt@kms_yuv@pipe-a-yvu420-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yvu420-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yvu420-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yvu420-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yvu420-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yvu422-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yvu422-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yvu422-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yvu422-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yvu422-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-a-yvyu-chroma-subpixel-clip:
- Statuses : 5 fail(s)
- Exec time: [0.14, 0.67] s
* igt@kms_yuv@pipe-a-yvyu-crop-scale-bug:
- Statuses : 3 fail(s) 2 pass(s)
- Exec time: [0.21, 8.04] s
* igt@kms_yuv@pipe-a-yvyu-rgb-scaled-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.09, 8.49] s
* igt@kms_yuv@pipe-a-yvyu-rgb-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.28, 8.58] s
* igt@kms_yuv@pipe-a-yvyu-valid-width:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.09, 14.16] s
* igt@kms_yuv@pipe-b-nv12-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0, 0.61] s
* igt@kms_yuv@pipe-b-nv12-crop-scale-bug:
- Statuses : 2 pass(s) 3 skip(s)
- Exec time: [0.0, 10.93] s
* igt@kms_yuv@pipe-b-nv12-rgb-scaled-switch:
- Statuses : 2 pass(s) 3 skip(s)
- Exec time: [0.0, 5.13] s
* igt@kms_yuv@pipe-b-nv12-rgb-switch:
- Statuses : 2 pass(s) 3 skip(s)
- Exec time: [0.0, 5.13] s
* igt@kms_yuv@pipe-b-nv12-valid-width:
- Statuses : 2 pass(s) 3 skip(s)
- Exec time: [0.0, 7.88] s
* igt@kms_yuv@pipe-b-nv16-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv16-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv16-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv16-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv16-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv21-chroma-subpixel-clip:
- Statuses : 4 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv21-crop-scale-bug:
- Statuses : 4 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv21-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv21-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv21-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv61-chroma-subpixel-clip:
- Statuses : 4 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv61-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv61-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv61-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-nv61-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p010-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p010-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p010-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p010-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p010-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p012-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p012-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p012-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p012-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p012-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p016-chroma-subpixel-clip:
- Statuses : 4 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p016-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p016-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p016-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-p016-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-uyvy-chroma-subpixel-clip:
- Statuses : 5 fail(s)
- Exec time: [0.16, 0.42] s
* igt@kms_yuv@pipe-b-uyvy-crop-scale-bug:
- Statuses : 1 fail(s) 2 pass(s)
- Exec time: [0.21, 8.18] s
* igt@kms_yuv@pipe-b-uyvy-rgb-scaled-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.17, 8.63] s
* igt@kms_yuv@pipe-b-uyvy-rgb-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.16, 8.46] s
* igt@kms_yuv@pipe-b-uyvy-valid-width:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.18, 14.30] s
* igt@kms_yuv@pipe-b-vyuy-chroma-subpixel-clip:
- Statuses : 5 fail(s)
- Exec time: [0.10, 0.61] s
* igt@kms_yuv@pipe-b-vyuy-crop-scale-bug:
- Statuses : 3 fail(s) 2 pass(s)
- Exec time: [0.16, 8.14] s
* igt@kms_yuv@pipe-b-vyuy-rgb-scaled-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.17, 8.48] s
* igt@kms_yuv@pipe-b-vyuy-rgb-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.17, 8.54] s
* igt@kms_yuv@pipe-b-vyuy-valid-width:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.26, 14.33] s
* igt@kms_yuv@pipe-b-xyuv8888-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-xyuv8888-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-xyuv8888-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-xyuv8888-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-xyuv8888-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yuv420-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yuv420-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yuv420-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yuv420-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yuv420-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yuv422-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yuv422-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yuv422-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yuv422-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yuv422-valid-width:
- Statuses : 4 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yuyv-chroma-subpixel-clip:
- Statuses : 5 fail(s)
- Exec time: [0.16, 16.73] s
* igt@kms_yuv@pipe-b-yuyv-crop-scale-bug:
- Statuses : 1 fail(s) 2 pass(s)
- Exec time: [0.32, 8.14] s
* igt@kms_yuv@pipe-b-yuyv-rgb-scaled-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.34, 8.42] s
* igt@kms_yuv@pipe-b-yuyv-rgb-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.16, 8.50] s
* igt@kms_yuv@pipe-b-yuyv-valid-width:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.25, 14.27] s
* igt@kms_yuv@pipe-b-yvu420-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yvu420-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yvu420-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yvu420-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yvu420-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yvu422-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yvu422-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yvu422-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yvu422-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yvu422-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-b-yvyu-chroma-subpixel-clip:
- Statuses : 5 fail(s)
- Exec time: [0.18, 1.24] s
* igt@kms_yuv@pipe-b-yvyu-crop-scale-bug:
- Statuses : 3 fail(s) 2 pass(s)
- Exec time: [0.24, 8.14] s
* igt@kms_yuv@pipe-b-yvyu-rgb-scaled-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.26, 8.45] s
* igt@kms_yuv@pipe-b-yvyu-rgb-switch:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.26, 8.46] s
* igt@kms_yuv@pipe-b-yvyu-valid-width:
- Statuses : 2 fail(s) 3 pass(s)
- Exec time: [0.16, 14.29] s
* igt@kms_yuv@pipe-c-nv12-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0, 0.62] s
* igt@kms_yuv@pipe-c-nv12-crop-scale-bug:
- Statuses : 1 pass(s) 4 skip(s)
- Exec time: [0.0, 10.90] s
* igt@kms_yuv@pipe-c-nv12-rgb-scaled-switch:
- Statuses : 1 pass(s) 4 skip(s)
- Exec time: [0.0, 5.12] s
* igt@kms_yuv@pipe-c-nv12-rgb-switch:
- Statuses : 1 pass(s) 4 skip(s)
- Exec time: [0.0, 5.19] s
* igt@kms_yuv@pipe-c-nv12-valid-width:
- Statuses : 1 pass(s) 4 skip(s)
- Exec time: [0.0, 7.83] s
* igt@kms_yuv@pipe-c-nv16-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv16-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv16-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv16-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv16-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv21-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv21-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv21-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv21-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv21-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv61-chroma-subpixel-clip:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv61-crop-scale-bug:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv61-rgb-scaled-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv61-rgb-switch:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_yuv@pipe-c-nv61-valid-width:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* i
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2407/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Given review comments just for few cosmetic changes.
Quoted 209 lines · Maarten Lankhorst via igt-dev
Add tests excercising switching between various scaled/unscaled transitions to and from various nv12 formats, since some of the workarounds mention this may fail.
We also add NV12 specific clipping/scaling tests, to make sure that YUV src coordinates are always programmed as a multiple of 2 correctly, and verify scaling/clipping works with CRC tests.
crop-scale-bug shows a corruption when scaling and cropping at the same time.
The subpixel clip test rotates and clips a rectangle on each side, which should produce the same CRC as when that part of the rectangle is hidden by a cursor and a whole 2x2 pixel is hidden.
Signed-off-by Maarten Lankhorst <[email protected]>--- tests/Makefile.sources | 1 + tests/kms_yuv.c | 845 +++++++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 3 files changed, 847 insertions(+)create mode 100644
tests/kms_yuv.ctests/Makefile.sources +1
-0@@ -72,6 +72,7 @@ TESTS_progs = \ kms_universal_plane \ kms_vblank \ kms_vrr \ + kms_yuv \ kms_sequence \ meta_test \ perf \tests/kms_yuv.c new file +168
-0@@ -0,0 +1,845 @@ +/* +* Copyright © 2019 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +* +* Authors: +* Maarten Lankhorst <[email protected]> +*/ +#include "config.h" + +#include "igt.h" +#include <cairo.h> +#include <errno.h> +#include <stdint.h> +#include <unistd.h> +#include <sys/time.h> + +typedef struct { +igt_display_t display; + +igt_pipe_crc_t *pipe_crc; +struct igt_fb fb[6 ]; +}data_t ; + +static bool plane_supports_format (igt_plane_t *plane,uint32_t format) +{ +int i; + +if (!igt_fb_supported_format (format)) +return false; + +for (i =0 ; i < plane->drm_plane->count_formats; i++) +if (plane->drm_plane->formats[i] == format) +return true; + +return false; +} + +static bool pipe_supports_format (igt_display_t *display,enum pipe pipe,uint32_t format) +{ +igt_plane_t *plane; + +for_each_plane_on_pipe (display, pipe, plane) +if (plane_supports_format (plane, format)) +return true; + +return false; +} + +static void remove_fbs (data_t *data) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (data->fb); i++) +igt_remove_fb (data->display.drm_fd, &data->fb[i]); +} + +static void prepare_crtc (data_t *data,enum pipe pipe,igt_output_t *output) +{ +igt_display_t *display = &data->display; + +remove_fbs (data); +igt_display_reset (display); +igt_output_set_pipe (output, pipe); +igt_display_commit2 (display,COMMIT_ATOMIC ); + +igt_pipe_crc_free (data->pipe_crc); + data->pipe_crc =igt_pipe_crc_new (display->drm_fd, pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); +} + +static void set_fb (igt_plane_t *plane,struct igt_fb *fb,bool scaled) +{ +igt_plane_set_fb (plane, fb); + +if (scaled && fb) +igt_fb_set_size (fb, plane, fb->width,16 ); + +if (fb && fb->tiling ==LOCAL_I915_FORMAT_MOD_Y_TILED ) { +igt_plane_set_rotation (plane,IGT_ROTATION_90 ); +igt_plane_set_size (plane, fb->height, fb->width); + }else +igt_plane_set_rotation (plane,IGT_ROTATION_0 ); +} + +static void yuv_rgb_switch (data_t *data,enum pipe pipe,igt_output_t *output,bool scaled,unsigned format) +{ +drmModeModeInfo *mode =igt_output_get_mode (output); +igt_display_t *display = &data->display; +igt_plane_t *plane; +int i; +igt_crc_t ref_crc[4 ], crc; + +prepare_crtc (data, pipe, output); + +igt_create_pattern_fb (display->drm_fd, mode->hdisplay, mode->vdisplay, + format,LOCAL_I915_FORMAT_MOD_X_TILED , + &data->fb[0 ]); + +igt_create_pattern_fb (display->drm_fd, mode->vdisplay, mode->hdisplay, + format,LOCAL_I915_FORMAT_MOD_Y_TILED , + &data->fb[1 ]); + +igt_create_pattern_fb (display->drm_fd, mode->hdisplay, mode->vdisplay, +DRM_FORMAT_XRGB8888 ,LOCAL_I915_FORMAT_MOD_X_TILED , + &data->fb[2 ]); + +igt_create_pattern_fb (display->drm_fd, mode->vdisplay, mode->hdisplay, +DRM_FORMAT_XRGB8888 ,LOCAL_I915_FORMAT_MOD_Y_TILED , + &data->fb[3 ]); + +for_each_plane_on_pipe (display, pipe, plane) { +if (!plane_supports_format (plane,DRM_FORMAT_XRGB8888 )) +continue ; + +/* We only have few scalers, don't use 1 for unused planes */ +if (plane->type !=DRM_PLANE_TYPE_CURSOR && !scaled) +set_fb (plane, &data->fb[3 ], false); + } + +for_each_plane_on_pipe (display, pipe, plane) { +const int seq[] = { +2 ,0 ,2 ,1 ,3 ,1 ,3 + }; + +if (!plane_supports_format (plane, format)) +continue ; + +/* Collect reference crc with toggle in between. */ +for (i =0 ; i <ARRAY_SIZE (ref_crc); i++) { +set_fb (plane, &data->fb[i], scaled); +igt_display_commit2 (display,COMMIT_ATOMIC ); + +igt_pipe_crc_collect_crc (data->pipe_crc, &ref_crc[i]); + +set_fb (plane,NULL , scaled); +igt_display_commit2 (display,COMMIT_ATOMIC ); + } + +for (i =0 ; i <ARRAY_SIZE (seq); i++) { +int j = seq[i]; + +set_fb (plane, &data->fb[j], scaled); +igt_display_commit2 (display,COMMIT_ATOMIC ); + +igt_pipe_crc_collect_crc (data->pipe_crc, &crc); +igt_assert_crc_equal (&ref_crc[j], &crc); + } + +/* We only have few scalers, don't use 1 for unused planes */ +if (scaled) +igt_plane_set_fb (plane,NULL ); + }
tests/kms_yuv.c line 178
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+} + +#define assert_collected_crc_equal (pipe_crc, crc, ref_crc) \ + do { \ + igt_pipe_crc_get_current(display->drm_fd, pipe_crc, crc); \ + igt_assert_crc_equal(ref_crc, crc); \ + } while (0) + +static void set_src_coords (igt_plane_t *plane,struct igt_fb *fb, +igt_rotation_t rot,int vis,int hidden)
Should one space come before igt_rotation_t to make it align to igt_plane_t?
Quoted 230 lines
tests/kms_yuv.c new file +230
-0+{ +switch (rot) { +case IGT_ROTATION_0 : +igt_fb_set_position (fb, plane, fb->width /2 - vis, fb->height /2 - vis); +break ; +case IGT_ROTATION_90 : +igt_fb_set_position (fb, plane, fb->width /2 - hidden, fb->height /2 - vis); +break ; +case IGT_ROTATION_180 : +igt_fb_set_position (fb, plane, fb->width /2 - hidden, fb->height /2 - hidden); +break ; +case IGT_ROTATION_270 : +igt_fb_set_position (fb, plane, fb->width /2 - vis, fb->height /2 - hidden); +break ; +default :igt_assert (0 ); + } +igt_fb_set_size (fb, plane, vis + hidden, vis + hidden); +} + +static void yuv_valid_width_plane (data_t *data,drmModeModeInfo *mode, +igt_plane_t *plane,struct igt_fb *fb, +igt_rotation_t rot,igt_crc_t *ref_crc) +{ +igt_display_t *display = &data->display; +igt_crc_t crc; +struct igt_fb *clip_fb = &data->fb[2 ]; +int i, ret; + +igt_plane_set_fb (plane, fb); +igt_plane_set_rotation (plane, rot); +if (rot & (IGT_ROTATION_90 |IGT_ROTATION_270 )) +igt_plane_set_size (plane, fb->height, fb->width); +igt_display_commit2 (display,COMMIT_ATOMIC ); + +/* Just clipping.. */ +igt_plane_set_fb (plane, clip_fb); +if (rot & (IGT_ROTATION_90 |IGT_ROTATION_270 )) +igt_plane_set_size (plane, clip_fb->height, clip_fb->width); +igt_plane_set_position (plane, mode->hdisplay - clip_fb->width /2 , mode->vdisplay - clip_fb->height /2 ); +igt_display_commit2 (display,COMMIT_ATOMIC ); +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); + +/* Clipping and scaling. */ +igt_fb_set_position (clip_fb, plane, clip_fb->width /2 -16 , clip_fb->height /2 -16 ); +igt_fb_set_size (clip_fb, plane,32 ,32 ); +igt_display_commit2 (display,COMMIT_ATOMIC ); +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); + +/* Try nvalid < 8 src visible. */ +set_src_coords (plane, clip_fb, rot,4 ,4 ); +igt_display_try_commit2 (display,COMMIT_ATOMIC ); + +/* Try different alignments for x/y to see if any hit underruns */ +for (i =1 ; i <4 ; i++) { +set_src_coords (plane, clip_fb, rot,16 +2 * i,16 -2 * i); +igt_display_commit2 (display,COMMIT_ATOMIC ); +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); + +/* And also show more of the screen */ +set_src_coords (plane, clip_fb, rot,16 + i,16 + i); + ret =igt_display_try_commit2 (display,COMMIT_ATOMIC ); + +if (ret == -EINVAL ) { +igt_assert (i %2 || rot ==IGT_ROTATION_270 || rot == (IGT_ROTATION_90 |IGT_REFLECT_X )); +continue ; + }else +igt_assert_eq (ret,0 ); +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); + } + +/* +* As a final test, try with 16 src visible, and various invisible +* components to check clipping doesn't drop the visible src below 16. +*/ +for (i =0 ; i <16 ; i +=4 ) { +set_src_coords (plane, clip_fb, rot,16 , i); +if (rot & (IGT_ROTATION_90 |IGT_ROTATION_270 )) +igt_plane_set_size (plane, (clip_fb->height /32 ) * (16 + i), + (clip_fb->width /32 ) * (16 + i)); +else +igt_plane_set_size (plane, (clip_fb->width /32 ) * (16 + i), + (clip_fb->height /32 ) * (16 + i)); +igt_display_commit2 (display,COMMIT_ATOMIC ); +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); + } +} + +static void yuv_valid_width (data_t *data,enum pipe pipe,igt_output_t *output,unsigned format) +{ +drmModeModeInfo *mode =igt_output_get_mode (output); +igt_display_t *display = &data->display; +igt_plane_t *plane; +struct igt_fb *clip_fb = &data->fb[2 ]; +struct igt_fb *ref_fb = &data->fb[3 ]; + +prepare_crtc (data, pipe, output); + +igt_create_pattern_fb (display->drm_fd, mode->hdisplay, mode->vdisplay, + format,LOCAL_I915_FORMAT_MOD_X_TILED , + &data->fb[0 ]); + +igt_create_pattern_fb (display->drm_fd, mode->vdisplay, mode->hdisplay, + format,LOCAL_I915_FORMAT_MOD_Y_TILED , + &data->fb[1 ]); + +igt_create_fb (display->drm_fd,64 ,64 , format, +LOCAL_I915_FORMAT_MOD_Y_TILED , ref_fb); + +igt_create_fb (display->drm_fd,2 * ref_fb->width, +2 * ref_fb->height, format, +LOCAL_I915_FORMAT_MOD_Y_TILED , clip_fb); + +igt_pipe_crc_start (data->pipe_crc); + +for_each_plane_on_pipe (display, pipe, plane) { +igt_crc_t ref_crc[4 ]; +cairo_t *cr; +static const double colors[4 ][3 ] = { + {1. ,0. ,0. }, + {0. ,1. ,0. }, + {0. ,0. ,1. }, + {1. ,1. ,1. } + }; +int i; + +if (!plane_supports_format (plane, format)) +continue ; + +/* Draw the FB that will be used for clipping tests. */ + cr =igt_get_cairo_ctx (display->drm_fd, clip_fb); +igt_paint_color (cr,0 ,0 , clip_fb->width /2 , clip_fb->height /2 , + colors[0 ][0 ], colors[0 ][1 ], colors[0 ][2 ]); + +igt_paint_color (cr, clip_fb->width /2 ,0 , + clip_fb->width /2 , clip_fb->height /2 , + colors[1 ][0 ], colors[1 ][1 ], colors[1 ][2 ]); + +igt_paint_color (cr, clip_fb->width /2 , clip_fb->height /2 , + clip_fb->width /2 , clip_fb->height /2 , + colors[2 ][0 ], colors[2 ][1 ], colors[2 ][2 ]); + +igt_paint_color (cr,0 , clip_fb->height /2 , + clip_fb->width /2 , clip_fb->height /2 , + colors[3 ][0 ], colors[3 ][1 ], colors[3 ][2 ]); + +igt_put_cairo_ctx (display->drm_fd, clip_fb, cr); + +/* Draw all reference FB's to collect the CRC. */ +for (i =0 ; i <4 ; i++) { + cr =igt_get_cairo_ctx (display->drm_fd, ref_fb); +igt_paint_color (cr,0 ,0 , ref_fb->width, ref_fb->height, + colors[i][0 ], colors[i][1 ], colors[i][2 ]); +igt_put_cairo_ctx (display->drm_fd, &data->fb[3 ], cr); + +if (!i) { +igt_plane_set_fb (plane, ref_fb); +igt_plane_set_position (plane, mode->hdisplay - ref_fb->width, mode->vdisplay - ref_fb->height); +igt_display_commit2 (display,COMMIT_ATOMIC ); + }else { +igt_dirty_fb (display->drm_fd, ref_fb); +igt_wait_for_vblank (display->drm_fd, pipe); + } + +igt_pipe_crc_drain (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &ref_crc[i]); + } + +igt_plane_set_fb (plane,NULL ); +igt_plane_set_position (plane,0 ,0 ); + +yuv_valid_width_plane (data, mode, plane, &data->fb[0 ],IGT_ROTATION_0 , &ref_crc[0 ]); +yuv_valid_width_plane (data, mode, plane, &data->fb[1 ],IGT_ROTATION_90 , &ref_crc[1 ]); +yuv_valid_width_plane (data, mode, plane, &data->fb[0 ],IGT_ROTATION_180 , &ref_crc[2 ]); +yuv_valid_width_plane (data, mode, plane, &data->fb[1 ],IGT_ROTATION_270 , &ref_crc[3 ]); + +igt_plane_set_fb (plane,NULL ); + } +} + +static bool yuv_commit_rotated (igt_display_t *display,igt_rotation_t rot) +{ +if (igt_display_try_commit2 (display,COMMIT_ATOMIC ) <0 ) { +igt_debug ("Skipping rotated test, alignment is wrong.\n" ); +return false; + } + +return true; +} + +static void yuv_crop_scale_bug_plane (data_t *data,drmModeModeInfo *mode, +igt_plane_t *plane,struct igt_fb *fb, +igt_rotation_t rot,igt_crc_t *ref_crc) +{ +igt_display_t *display = &data->display; +igt_crc_t crc; +int ofs[] = {0 ,1 ,-1 ,2 ,-2 }; +int i, j; + +igt_plane_set_fb (plane, fb); +igt_plane_set_rotation (plane, rot); + +igt_plane_set_position (plane,64 ,64 ); +igt_plane_set_size (plane,256 ,256 ); + +igt_fb_set_position (fb, plane, fb->width /4 , fb->height /4 ); +igt_fb_set_size (fb, plane, fb->width /2 , fb->height /2 ); +igt_display_commit2 (display,COMMIT_ATOMIC ); +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); + +/* Make sure boundaries match */ +igt_fb_set_position (fb, plane, fb->width /4 -2 , fb->height /4 -2 ); +igt_fb_set_size (fb, plane, fb->width /2 +4 , fb->height /2 +4 ); +igt_display_commit2 (display,COMMIT_ATOMIC ); +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); + +for (i =1 ; i <ARRAY_SIZE (ofs); i++) { +igt_debug ("Testing with rot %x and extra %i on the left side\n" , rot, ofs[i]); +igt_fb_set_position (fb, plane, fb->width /4 + ofs[i], fb->height /4 -2 ); +igt_fb_set_size (fb, plane, fb->width /2 +2 - ofs[i], fb->height /2 +4 ); +if (yuv_commit_rotated (display, rot)) +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); + +igt_debug ("Testing with rot %x and extra %i on the top side\n" , rot, ofs[i]); +igt_fb_set_position (fb, plane, fb->width /4 -2 , fb->height /4 + ofs[i]); +igt_fb_set_size (fb, plane, fb->width /2 +4 , fb->height /2 +2 - ofs[i]); +if (yuv_commit_rotated (display, rot)) +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); + +igt_debug ("Testing with rot %x and extra %i on the right side\n" , rot, ofs[i]); +igt_fb_set_position (fb, plane, fb->width /4 -2 , fb->height /4 );
tests/kms_yuv.c line 418
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+igt_fb_set_size (fb, plane, fb->width /2 +2 + ofs[i], fb->height /2 ); +if (yuv_commit_rotated (display, rot)) +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); + +igt_debug ("Testing with rot %x and extra %i on the bottom side\n" , rot, ofs[i]); +igt_fb_set_position (fb, plane, fb->width /4 -2 , fb->height /4 -2 ); +igt_fb_set_size (fb, plane, fb->width /2 +4 , fb->height /2 +2 + ofs[i]); +if (yuv_commit_rotated (display, rot)) +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); +
Extra \n?
Quoted 38 lines
tests/kms_yuv.c new file +38
-0+ } + +for (i =0 ; i <ARRAY_SIZE (ofs); i++) +for (j = !i; j <ARRAY_SIZE (ofs); j++) { +igt_debug ("Testing with rot %x and extra (%i, %i) at the edges\n" , rot, ofs[i], ofs[j]); + +igt_fb_set_position (fb, plane, fb->width /4 + ofs[i], fb->height /4 + ofs[j]); +igt_fb_set_size (fb, plane, fb->width /2 -2 * ofs[i], fb->height /2 -2 * ofs[j]); + +if (yuv_commit_rotated (display, rot)) +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); + } +} + +static void draw_clip_fb (igt_display_t *display,struct igt_fb *clip_fb) +{ +cairo_t *cr =igt_get_cairo_ctx (display->drm_fd, clip_fb); + +igt_paint_color (cr,0 ,0 , clip_fb->width, clip_fb->height,.0 ,.0 ,.5 ); +igt_paint_color (cr, clip_fb->width /4 -2 , clip_fb->height /4 -2 , + clip_fb->width /2 +4 , clip_fb->height /2 +4 ,1. ,1. ,1. ); + +igt_put_cairo_ctx (display->drm_fd, clip_fb, cr); +} + +static void yuv_crop_scale_bug (data_t *data,enum pipe pipe,igt_output_t *output,unsigned format) +{ +drmModeModeInfo *mode =igt_output_get_mode (output); +igt_display_t *display = &data->display; +igt_plane_t *plane, *primary =igt_pipe_get_plane_type (&display->pipes[pipe],DRM_PLANE_TYPE_PRIMARY ); +struct igt_fb *ref_fb = &data->fb[2 ]; +struct igt_fb *clip_fb = &data->fb[3 ]; +struct igt_fb *clip_fb_xtiled = &data->fb[4 ]; +struct igt_fb *clip_fb_ytiled = &data->fb[5 ]; + +prepare_crtc (data, pipe, output); + + igt_create_color_fb(display->drm_fd, mode->hdisplay, mode->vdisplay,
tests/kms_yuv.c line 466
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+ format, LOCAL_I915_FORMAT_MOD_X_TILED, .5, .5, .5, &data->fb[0]); + +igt_create_color_fb (display->drm_fd,256 ,256 , format, +LOCAL_I915_FORMAT_MOD_X_TILED ,1. ,1. ,1. , ref_fb); + +igt_create_fb (display->drm_fd,80 ,128 , format, +LOCAL_DRM_FORMAT_MOD_NONE , clip_fb); + +igt_create_fb (display->drm_fd,80 ,128 , format, +LOCAL_I915_FORMAT_MOD_X_TILED , clip_fb_xtiled);
Should \n come after this?
Quoted 55 lines
tests/kms_yuv.c new file +55
-0+igt_create_fb (display->drm_fd,80 ,128 , format, +LOCAL_I915_FORMAT_MOD_Y_TILED , clip_fb_ytiled); + +draw_clip_fb (display, clip_fb); +draw_clip_fb (display, clip_fb_xtiled); +draw_clip_fb (display, clip_fb_ytiled); + +igt_plane_set_fb (primary, &data->fb[0 ]); + +for_each_plane_on_pipe (display, pipe, plane) { +igt_crc_t ref_crc; + +if (!plane_supports_format (plane, format)) +continue ; + +igt_plane_set_fb (plane, ref_fb); +igt_plane_set_position (plane,64 ,64 ); +igt_display_commit2 (display,COMMIT_ATOMIC ); + +igt_pipe_crc_start (data->pipe_crc); +igt_pipe_crc_get_single (data->pipe_crc, &ref_crc); + +yuv_crop_scale_bug_plane (data, mode, plane, clip_fb,IGT_ROTATION_0 , &ref_crc); +yuv_crop_scale_bug_plane (data, mode, plane, clip_fb_xtiled,IGT_ROTATION_0 , &ref_crc); +yuv_crop_scale_bug_plane (data, mode, plane, clip_fb_ytiled,IGT_ROTATION_0 , &ref_crc); +yuv_crop_scale_bug_plane (data, mode, plane, clip_fb_ytiled,IGT_ROTATION_90 , &ref_crc); +yuv_crop_scale_bug_plane (data, mode, plane, clip_fb,IGT_ROTATION_180 , &ref_crc); +yuv_crop_scale_bug_plane (data, mode, plane, clip_fb_xtiled,IGT_ROTATION_180 , &ref_crc); +yuv_crop_scale_bug_plane (data, mode, plane, clip_fb_ytiled,IGT_ROTATION_180 , &ref_crc); +yuv_crop_scale_bug_plane (data, mode, plane, clip_fb_ytiled,IGT_ROTATION_270 , &ref_crc); + +igt_plane_set_fb (plane, plane != primary ?NULL : &data->fb[0 ]); +break ; + } +} + +static void yuv_chroma_subpixel_clip_plane_with_cursor (data_t *data, +igt_plane_t *plane, +struct igt_fb *clip_fb, +igt_plane_t *cursor, +struct igt_fb *cursor_fb, +igt_crc_t *ref_crc, +int cursor_x,int cursor_y) +{ +igt_display_t *display = &data->display; + +igt_plane_set_fb (plane, clip_fb); +igt_plane_set_position (plane,64 ,64 ); +igt_plane_set_rotation (plane,IGT_ROTATION_0 ); + +igt_plane_set_fb (cursor, cursor_fb); +igt_plane_set_position (cursor, cursor_x, cursor_y); +igt_display_commit2 (display,COMMIT_ATOMIC ); + +igt_pipe_crc_drain (data->pipe_crc);
tests/kms_yuv.c line 531
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+igt_pipe_crc_get_single (data->pipe_crc, ref_crc); + +igt_plane_set_fb (cursor,NULL ); +} + +static bool yuv_chroma_subpixel_clip_plane_right (data_t *data, +igt_rotation_t rotation, +igt_plane_t *plane, +struct igt_fb *clip_fb, +igt_crc_t *ref_crc)
Should make arguments aligned?
Quoted 6 lines
tests/kms_yuv.c new file +6
-0+{ +igt_display_t *display = &data->display; +igt_crc_t crc = {}; + +igt_plane_set_fb (plane, clip_fb); +igt_plane_set_position (plane,64 ,64 );
tests/kms_yuv.c line 547
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+igt_plane_set_rotation (plane, rotation); +igt_plane_set_size (plane, clip_fb->width -1 , clip_fb->height); + +switch (rotation) { +case IGT_ROTATION_180 : +igt_fb_set_position (clip_fb, plane,1 ,0 ); +case IGT_ROTATION_0 : +igt_fb_set_size (clip_fb, plane, clip_fb->width -1 , clip_fb->height); +break ; +
Extra \n?
Quoted 27 lines
tests/kms_yuv.c new file +27
-0+case IGT_ROTATION_270 : +igt_fb_set_position (clip_fb, plane,0 ,1 ); +case IGT_ROTATION_90 : +igt_fb_set_size (clip_fb, plane, clip_fb->width, clip_fb->height -1 ); +break ; +default : +igt_assert_f (0 ,"Unhandled rotation %x\n" , rotation); + } + +if (igt_display_try_commit2 (display,COMMIT_ATOMIC ) <0 ) +return false; + +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); +return true; +} + +static bool yuv_chroma_subpixel_clip_plane_bottom (data_t *data, +igt_rotation_t rotation, +igt_plane_t *plane, +struct igt_fb *clip_fb, +igt_crc_t *ref_crc) +{ +igt_display_t *display = &data->display; +igt_crc_t crc = {}; + +igt_plane_set_fb (plane, clip_fb); +igt_plane_set_position (plane,64 ,64 );
tests/kms_yuv.c line 584
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+igt_plane_set_rotation (plane, rotation); +igt_plane_set_size (plane, clip_fb->width, clip_fb->height -1 ); + +switch (rotation) { +case IGT_ROTATION_180 : +igt_fb_set_position (clip_fb, plane,0 ,1 ); +case IGT_ROTATION_0 : +igt_fb_set_size (clip_fb, plane, clip_fb->width, clip_fb->height -1 ); +break ; +
Extra \n?
Quoted 27 lines
tests/kms_yuv.c new file +27
-0+case IGT_ROTATION_90 : +igt_fb_set_position (clip_fb, plane,1 ,0 ); +case IGT_ROTATION_270 : +igt_fb_set_size (clip_fb, plane, clip_fb->width -1 , clip_fb->height); +break ; +default : +igt_assert_f (0 ,"Unhandled rotation %x\n" , rotation); + } + +if (igt_display_try_commit2 (display,COMMIT_ATOMIC ) <0 ) +return false; + +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); +return true; +} + +static bool yuv_chroma_subpixel_clip_plane_left (data_t *data, +igt_rotation_t rotation, +igt_plane_t *plane, +struct igt_fb *clip_fb, +igt_crc_t *ref_crc) +{ +igt_display_t *display = &data->display; +igt_crc_t crc = {}; + +igt_plane_set_fb (plane, clip_fb); +igt_plane_set_position (plane,65 ,64 );
tests/kms_yuv.c line 621
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+igt_plane_set_rotation (plane, rotation); +igt_plane_set_size (plane, clip_fb->width -1 , clip_fb->height); + +switch (rotation) { +case IGT_ROTATION_0 : +igt_fb_set_position (clip_fb, plane,1 ,0 ); +case IGT_ROTATION_180 : +igt_fb_set_size (clip_fb, plane, clip_fb->width -1 , clip_fb->height); +break ; +
Same here and below clip_plane functions:/ Sorry.
Quoted 136 lines
tests/kms_yuv.c new file +136
-0+case IGT_ROTATION_90 : +igt_fb_set_position (clip_fb, plane,0 ,1 ); +case IGT_ROTATION_270 : +igt_fb_set_size (clip_fb, plane, clip_fb->width, clip_fb->height -1 ); +break ; +default : +igt_assert_f (0 ,"Unhandled rotation %x\n" , rotation); + } + +if (igt_display_try_commit2 (display,COMMIT_ATOMIC ) <0 ) +return false; + +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); +return true; +} + + +static bool yuv_chroma_subpixel_clip_plane_top (data_t *data, +igt_rotation_t rotation, +igt_plane_t *plane, +struct igt_fb *clip_fb, +igt_crc_t *ref_crc) +{ +igt_display_t *display = &data->display; +igt_crc_t crc = {}; + +igt_plane_set_fb (plane, clip_fb); +igt_plane_set_position (plane,64 ,65 ); +igt_plane_set_rotation (plane, rotation); +igt_plane_set_size (plane, clip_fb->width, clip_fb->height -1 ); + +switch (rotation) { +case IGT_ROTATION_0 : +igt_fb_set_position (clip_fb, plane,0 ,1 ); +case IGT_ROTATION_180 : +igt_fb_set_size (clip_fb, plane, clip_fb->width, clip_fb->height -1 ); +break ; + +case IGT_ROTATION_270 : +igt_fb_set_position (clip_fb, plane,1 ,0 ); +case IGT_ROTATION_90 : +igt_fb_set_size (clip_fb, plane, clip_fb->width -1 , clip_fb->height); +break ; +default : +igt_assert_f (0 ,"Unhandled rotation %x\n" , rotation); + } + +if (igt_display_try_commit2 (display,COMMIT_ATOMIC ) <0 ) +return false; + +assert_collected_crc_equal (data->pipe_crc, &crc, ref_crc); +return true; +} + +static void yuv_chroma_subpixel_clip (data_t *data,enum pipe pipe,igt_output_t *output,unsigned format) +{ +drmModeModeInfo *mode =igt_output_get_mode (output); +igt_display_t *display = &data->display; +igt_pipe_t *pipe_obj = &display->pipes[pipe]; +struct igt_fb *bg_fb = &data->fb[0 ]; +struct igt_fb *bg_cursor_fb = &data->fb[1 ]; +struct igt_fb *black_cursor_fb = &data->fb[2 ]; +struct igt_fb *clip_fb = &data->fb[3 ]; +igt_plane_t *primary =igt_pipe_get_plane_type (pipe_obj,DRM_PLANE_TYPE_PRIMARY ); +igt_plane_t *cursor =igt_pipe_get_plane_type (pipe_obj,DRM_PLANE_TYPE_CURSOR ); +igt_plane_t *plane; +cairo_t *cr; +bool ret = false; + +prepare_crtc (data, pipe, output); + +igt_create_color_fb (display->drm_fd, mode->hdisplay, mode->vdisplay, +DRM_FORMAT_XRGB8888 ,LOCAL_I915_FORMAT_MOD_X_TILED , +.0 ,.0 ,1. , bg_fb); + +igt_create_color_fb (display->drm_fd,256 ,256 , +DRM_FORMAT_ARGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , +.0 ,.0 ,1. , bg_cursor_fb); + +igt_create_color_fb (display->drm_fd,256 ,256 , +DRM_FORMAT_ARGB8888 ,LOCAL_DRM_FORMAT_MOD_NONE , +.0 ,.0 ,.0 , black_cursor_fb); + +igt_create_fb (display->drm_fd,256 ,256 , + format,LOCAL_I915_FORMAT_MOD_Y_TILED , clip_fb); + +/* Draw the FB that will be used for clipping the chroma subpixel test. */ + cr =igt_get_cairo_ctx (display->drm_fd, clip_fb); + +igt_paint_color (cr,0 ,0 , clip_fb->width, clip_fb->height,1. ,0. ,0. ); +igt_paint_color (cr,2 ,2 , clip_fb->width -4 , clip_fb->height -4 ,0. ,1. ,1. ); +igt_paint_color (cr,4 ,4 , clip_fb->width -8 , clip_fb->height -8 ,.75 ,.75 ,1. ); + +/* White dots in the corners. */ +igt_paint_color (cr,0 ,0 ,6 ,6 ,1. ,1. ,1. ); +igt_paint_color (cr, clip_fb->width -6 ,0 ,6 ,6 ,1. ,1. ,1. ); +igt_paint_color (cr,0 , clip_fb->height -6 ,6 ,6 ,1. ,1. ,1. ); +igt_paint_color (cr, clip_fb->width -6 , clip_fb->height -6 ,6 ,6 ,1. ,1. ,1. ); + +igt_put_cairo_ctx (display->drm_fd, clip_fb, cr); + +igt_pipe_crc_start (data->pipe_crc); + +igt_plane_set_fb (primary, bg_fb); +for_each_plane_on_pipe (display, pipe, plane) { +struct igt_fb *cursor_fb = plane == primary ? black_cursor_fb : bg_cursor_fb; +igt_crc_t ref_crc; + +if (!plane_supports_format (plane, format) || plane == cursor) +continue ; + +yuv_chroma_subpixel_clip_plane_with_cursor (data, plane, clip_fb, cursor, cursor_fb, &ref_crc,63 + clip_fb->width,64 ); + ret |=yuv_chroma_subpixel_clip_plane_right (data,IGT_ROTATION_0 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_right (data,IGT_ROTATION_90 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_right (data,IGT_ROTATION_180 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_right (data,IGT_ROTATION_270 , plane, clip_fb, &ref_crc); + +yuv_chroma_subpixel_clip_plane_with_cursor (data, plane, clip_fb, cursor, cursor_fb, &ref_crc,64 ,63 + clip_fb->height); + ret |=yuv_chroma_subpixel_clip_plane_bottom (data,IGT_ROTATION_0 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_bottom (data,IGT_ROTATION_90 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_bottom (data,IGT_ROTATION_180 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_bottom (data,IGT_ROTATION_270 , plane, clip_fb, &ref_crc); + +yuv_chroma_subpixel_clip_plane_with_cursor (data, plane, clip_fb, cursor, cursor_fb, &ref_crc,65 - cursor_fb->width,64 ); + ret |=yuv_chroma_subpixel_clip_plane_left (data,IGT_ROTATION_0 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_left (data,IGT_ROTATION_90 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_left (data,IGT_ROTATION_180 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_left (data,IGT_ROTATION_270 , plane, clip_fb, &ref_crc); + +yuv_chroma_subpixel_clip_plane_with_cursor (data, plane, clip_fb, cursor, cursor_fb, &ref_crc,64 ,65 - cursor_fb->height); + ret |=yuv_chroma_subpixel_clip_plane_top (data,IGT_ROTATION_0 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_top (data,IGT_ROTATION_90 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_top (data,IGT_ROTATION_180 , plane, clip_fb, &ref_crc); + ret |=yuv_chroma_subpixel_clip_plane_top (data,IGT_ROTATION_270 , plane, clip_fb, &ref_crc); + +/* Reset to defaults */
tests/kms_yuv.c line 767
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+igt_plane_set_position (plane,0 ,0 ); +igt_plane_set_rotation (plane,IGT_ROTATION_0 ); +igt_plane_set_fb (plane, plane == primary ? bg_fb :NULL ); + } + +igt_require_f (ret,"Could not test subpixel clipping in any corner\n" ); +} + +static void run_tests_for_pipe (data_t *data,enum pipe pipe, +const char *fstr,unsigned int format)
Argument alignment?
Quoted 61 lines
tests/kms_yuv.c new file +61
-0+{ +igt_output_t *output; +igt_display_t *display = &data->display; + + igt_subtest_group { + igt_fixture { +igt_display_require_output_on_pipe (display, pipe); +igt_require (igt_fb_supported_format (format)); +igt_require (pipe_supports_format (display, pipe, format)); + } + +igt_subtest_f ("pipe-%s-%s-rgb-switch" , + kmstest_pipe_name(pipe), fstr) +for_each_valid_output_on_pipe (display, pipe, output) +yuv_rgb_switch (data, pipe, output, false, format); + +igt_subtest_f ("pipe-%s-%s-rgb-scaled-switch" , + kmstest_pipe_name(pipe), fstr) +for_each_valid_output_on_pipe (display, pipe, output) +yuv_rgb_switch (data, pipe, output, true, format); + +igt_subtest_f ("pipe-%s-%s-valid-width" , + kmstest_pipe_name(pipe), fstr) +for_each_valid_output_on_pipe (display, pipe, output) +yuv_valid_width (data, pipe, output, format); + +igt_subtest_f ("pipe-%s-%s-crop-scale-bug" , + kmstest_pipe_name(pipe), fstr) +for_each_valid_output_on_pipe (display, pipe, output) +yuv_crop_scale_bug (data, pipe, output, format); + +igt_subtest_f ("pipe-%s-%s-chroma-subpixel-clip" , + kmstest_pipe_name(pipe), fstr) +for_each_valid_output_on_pipe (display, pipe, output) +yuv_chroma_subpixel_clip (data, pipe, output, format); + } +} + +igt_main +{ +data_t data = {}; +enum pipe pipe; + +igt_skip_on_simulation (); + + igt_fixture { + data.display.drm_fd =drm_open_driver_master (DRIVER_ANY ); + +kmstest_set_vt_graphics_mode (); +igt_display_require (&data.display, data.display.drm_fd); +igt_require (data.display.is_atomic); +igt_require_pipe_crc (data.display.drm_fd); + } + +for_each_pipe_static (pipe) { +run_tests_for_pipe (&data, pipe,"NV12" ,DRM_FORMAT_NV12 ); +run_tests_for_pipe (&data, pipe,"NV16" ,DRM_FORMAT_NV16 ); +run_tests_for_pipe (&data, pipe,"NV21" ,DRM_FORMAT_NV21 ); +run_tests_for_pipe (&data, pipe,"NV61" ,DRM_FORMAT_NV61 ); +run_tests_for_pipe (&data, pipe,"YUV420" ,DRM_FORMAT_YUV420 ); +run_tests_for_pipe (&data, pipe,"YUV422" ,DRM_FORMAT_YUV422 );
tests/kms_yuv.c line 838
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+run_tests_for_pipe (&data, pipe,"YVU420" ,DRM_FORMAT_YVU420 ); +run_tests_for_pipe (&data, pipe,"YVU422" ,DRM_FORMAT_YVU422 ); +run_tests_for_pipe (&data, pipe,"P010" ,DRM_FORMAT_P010 ); +run_tests_for_pipe (&data, pipe,"P012" ,DRM_FORMAT_P012 ); +run_tests_for_pipe (&data, pipe,"P016" ,DRM_FORMAT_P016 ); +run_tests_for_pipe (&data, pipe,"YUYV" ,DRM_FORMAT_YUYV ); +run_tests_for_pipe (&data, pipe,"YVYU" ,DRM_FORMAT_YVYU ); +run_tests_for_pipe (&data, pipe,"UYVY" ,DRM_FORMAT_UYVY ); +run_tests_for_pipe (&data, pipe,"VYUY" ,DRM_FORMAT_VYUY ); +run_tests_for_pipe (&data, pipe,"XYUV8888" ,DRM_FORMAT_XYUV8888 );
Maarten, I doubt here..so we need to simply add YUV format here and no need to make any other change in kms_yuv igt?
Quoted 19 lines
tests/kms_yuv.c new file +7
-0+ } + + igt_fixture { +igt_display_fini (&data.display); +close (data.display.drm_fd); + } +}tests/meson.build +1
-0@@ -60,6 +60,7 @@ test_progs = [ 'kms_universal_plane', 'kms_vblank', 'kms_vrr', + 'kms_yuv', 'meta_test', 'perf', 'pm_backlight',
Signature · 5 lines
~Swati Sharma _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Op 01-03-2019 om 07:23 schreef Sharma, Swati2:
Quoted 883 lines
Given review comments just for few cosmetic changes.
Quoted 209 lines · Maarten Lankhorst via igt-dev
Add tests excercising switching between various scaled/unscaled transitions to and from various nv12 formats, since some of the workarounds mention this may fail.
We also add NV12 specific clipping/scaling tests, to make sure that YUV src coordinates are always programmed as a multiple of 2 correctly, and verify scaling/clipping works with CRC tests.
crop-scale-bug shows a corruption when scaling and cropping at the same time.
The subpixel clip test rotates and clips a rectangle on each side, which should produce the same CRC as when that part of the rectangle is hidden by a cursor and a whole 2x2 pixel is hidden.
Signed-off-by Maarten Lankhorst <[email protected]>---
tests/Makefile.sources | 1 +
tests/kms_yuv.c | 845 +++++++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 +3 files changed, 847 insertions(+)create mode 100644
tests/kms_yuv.ctests/Makefile.sources +1
-0@@ -72,6 +72,7 @@ TESTS_progs = \ kms_universal_plane \ kms_vblank \ kms_vrr \ + kms_yuv \ kms_sequence \ meta_test \ perf \tests/kms_yuv.c new file +168
-0@@ -0,0 +1,845 @@ +/* +* Copyright © 2019 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +* +* Authors: +* Maarten Lankhorst <[email protected]> +*/ +#include "config.h" + +#include "igt.h" +#include <cairo.h> +#include <errno.h> +#include <stdint.h> +#include <unistd.h> +#include <sys/time.h> + +typedef struct { + igt_display_t display; + + igt_pipe_crc_t *pipe_crc; + struct igt_fb fb[6]; +}data_t ; + +static bool plane_supports_format (igt_plane_t *plane,uint32_t format) +{ + int i; + + if (!igt_fb_supported_format(format)) + return false; + + for (i = 0; i < plane->drm_plane->count_formats; i++) + if (plane->drm_plane->formats[i] == format) + return true; + + return false; +} + +static bool pipe_supports_format (igt_display_t *display,enum pipe pipe,uint32_t format) +{ + igt_plane_t *plane; + + for_each_plane_on_pipe(display, pipe, plane) + if (plane_supports_format(plane, format)) + return true; + + return false; +} + +static void remove_fbs (data_t *data) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(data->fb); i++) + igt_remove_fb(data->display.drm_fd, &data->fb[i]); +} + +static void prepare_crtc (data_t *data,enum pipe pipe,igt_output_t *output) +{ + igt_display_t *display = &data->display; + + remove_fbs(data); + igt_display_reset(display); + igt_output_set_pipe(output, pipe); + igt_display_commit2(display, COMMIT_ATOMIC); + + igt_pipe_crc_free(data->pipe_crc); + data->pipe_crc = igt_pipe_crc_new(display->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO); +} + +static void set_fb (igt_plane_t *plane,struct igt_fb *fb,bool scaled) +{ + igt_plane_set_fb(plane, fb); + + if (scaled && fb) + igt_fb_set_size(fb, plane, fb->width, 16); + + if (fb && fb->tiling == LOCAL_I915_FORMAT_MOD_Y_TILED) { + igt_plane_set_rotation(plane, IGT_ROTATION_90); + igt_plane_set_size(plane, fb->height, fb->width); + } else + igt_plane_set_rotation(plane, IGT_ROTATION_0); +} + +static void yuv_rgb_switch (data_t *data,enum pipe pipe,igt_output_t *output,bool scaled,unsigned format) +{ + drmModeModeInfo *mode = igt_output_get_mode(output); + igt_display_t *display = &data->display; + igt_plane_t *plane; + int i; + igt_crc_t ref_crc[4], crc; + + prepare_crtc(data, pipe, output); + + igt_create_pattern_fb(display->drm_fd, mode->hdisplay, mode->vdisplay, + format, LOCAL_I915_FORMAT_MOD_X_TILED, + &data->fb[0]); + + igt_create_pattern_fb(display->drm_fd, mode->vdisplay, mode->hdisplay, + format, LOCAL_I915_FORMAT_MOD_Y_TILED, + &data->fb[1]); + + igt_create_pattern_fb(display->drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, LOCAL_I915_FORMAT_MOD_X_TILED, + &data->fb[2]); + + igt_create_pattern_fb(display->drm_fd, mode->vdisplay, mode->hdisplay, + DRM_FORMAT_XRGB8888, LOCAL_I915_FORMAT_MOD_Y_TILED, + &data->fb[3]); + + for_each_plane_on_pipe(display, pipe, plane) { + if (!plane_supports_format(plane, DRM_FORMAT_XRGB8888)) + continue; + + /* We only have few scalers, don't use 1 for unused planes */ + if (plane->type != DRM_PLANE_TYPE_CURSOR && !scaled) + set_fb(plane, &data->fb[3], false); + } + + for_each_plane_on_pipe(display, pipe, plane) { + const int seq[] = { + 2, 0, 2, 1, 3, 1, 3 + }; + + if (!plane_supports_format(plane, format)) + continue; + + /* Collect reference crc with toggle in between. */ + for (i = 0; i < ARRAY_SIZE(ref_crc); i++) { + set_fb(plane, &data->fb[i], scaled); + igt_display_commit2(display, COMMIT_ATOMIC); + + igt_pipe_crc_collect_crc(data->pipe_crc, &ref_crc[i]); + + set_fb(plane, NULL, scaled); + igt_display_commit2(display, COMMIT_ATOMIC); + } + + for (i = 0; i < ARRAY_SIZE(seq); i++) { + int j = seq[i]; + + set_fb(plane, &data->fb[j], scaled); + igt_display_commit2(display, COMMIT_ATOMIC); + + igt_pipe_crc_collect_crc(data->pipe_crc, &crc); + igt_assert_crc_equal(&ref_crc[j], &crc); + } + + /* We only have few scalers, don't use 1 for unused planes */ + if (scaled) + igt_plane_set_fb(plane, NULL); + }tests/kms_yuv.c line 178
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+} + +#define assert_collected_crc_equal (pipe_crc, crc, ref_crc) \ + do { \ + igt_pipe_crc_get_current(display->drm_fd, pipe_crc, crc); \ + igt_assert_crc_equal(ref_crc, crc); \ + } while (0) + +static void set_src_coords (igt_plane_t *plane,struct igt_fb *fb, + igt_rotation_t rot, int vis, int hidden)Should one space come before
igt_rotation_tto make it align toigt_plane_t?Quoted 230 lines
tests/kms_yuv.c new file +230
-0+{ + switch (rot) { + case IGT_ROTATION_0: + igt_fb_set_position(fb, plane, fb->width / 2 - vis, fb->height / 2 - vis); + break; + case IGT_ROTATION_90: + igt_fb_set_position(fb, plane, fb->width / 2 - hidden, fb->height / 2 - vis); + break; + case IGT_ROTATION_180: + igt_fb_set_position(fb, plane, fb->width / 2 - hidden, fb->height / 2 - hidden); + break; + case IGT_ROTATION_270: + igt_fb_set_position(fb, plane, fb->width / 2 - vis, fb->height / 2 - hidden); + break; + default: igt_assert(0); + } + igt_fb_set_size(fb, plane, vis + hidden, vis + hidden); +} + +static void yuv_valid_width_plane (data_t *data,drmModeModeInfo *mode, + igt_plane_t *plane, struct igt_fb *fb, + igt_rotation_t rot, igt_crc_t *ref_crc) +{ + igt_display_t *display = &data->display; + igt_crc_t crc; + struct igt_fb *clip_fb = &data->fb[2]; + int i, ret; + + igt_plane_set_fb(plane, fb); + igt_plane_set_rotation(plane, rot); + if (rot & (IGT_ROTATION_90 | IGT_ROTATION_270)) + igt_plane_set_size(plane, fb->height, fb->width); + igt_display_commit2(display, COMMIT_ATOMIC); + + /* Just clipping.. */ + igt_plane_set_fb(plane, clip_fb); + if (rot & (IGT_ROTATION_90 | IGT_ROTATION_270)) + igt_plane_set_size(plane, clip_fb->height, clip_fb->width); + igt_plane_set_position(plane, mode->hdisplay - clip_fb->width / 2, mode->vdisplay - clip_fb->height / 2); + igt_display_commit2(display, COMMIT_ATOMIC); + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + + /* Clipping and scaling. */ + igt_fb_set_position(clip_fb, plane, clip_fb->width / 2 - 16, clip_fb->height / 2 - 16); + igt_fb_set_size(clip_fb, plane, 32, 32); + igt_display_commit2(display, COMMIT_ATOMIC); + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + + /* Try nvalid < 8 src visible. */ + set_src_coords(plane, clip_fb, rot, 4, 4); + igt_display_try_commit2(display, COMMIT_ATOMIC); + + /* Try different alignments for x/y to see if any hit underruns */ + for (i = 1; i < 4; i++) { + set_src_coords(plane, clip_fb, rot, 16 + 2 * i, 16 - 2 * i); + igt_display_commit2(display, COMMIT_ATOMIC); + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + + /* And also show more of the screen */ + set_src_coords(plane, clip_fb, rot, 16 + i, 16 + i); + ret = igt_display_try_commit2(display, COMMIT_ATOMIC); + + if (ret == -EINVAL) { + igt_assert(i % 2 || rot == IGT_ROTATION_270 || rot == (IGT_ROTATION_90 | IGT_REFLECT_X)); + continue; + } else + igt_assert_eq(ret, 0); + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + } + + /* + * As a final test, try with 16 src visible, and various invisible + * components to check clipping doesn't drop the visible src below 16. + */ + for (i = 0; i < 16; i += 4) { + set_src_coords(plane, clip_fb, rot, 16, i); + if (rot & (IGT_ROTATION_90 | IGT_ROTATION_270)) + igt_plane_set_size(plane, (clip_fb->height / 32) * (16 + i), + (clip_fb->width / 32) * (16 + i)); + else + igt_plane_set_size(plane, (clip_fb->width / 32) * (16 + i), + (clip_fb->height / 32) * (16 + i)); + igt_display_commit2(display, COMMIT_ATOMIC); + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + } +} + +static void yuv_valid_width (data_t *data,enum pipe pipe,igt_output_t *output,unsigned format) +{ + drmModeModeInfo *mode = igt_output_get_mode(output); + igt_display_t *display = &data->display; + igt_plane_t *plane; + struct igt_fb *clip_fb = &data->fb[2]; + struct igt_fb *ref_fb = &data->fb[3]; + + prepare_crtc(data, pipe, output); + + igt_create_pattern_fb(display->drm_fd, mode->hdisplay, mode->vdisplay, + format, LOCAL_I915_FORMAT_MOD_X_TILED, + &data->fb[0]); + + igt_create_pattern_fb(display->drm_fd, mode->vdisplay, mode->hdisplay, + format, LOCAL_I915_FORMAT_MOD_Y_TILED, + &data->fb[1]); + + igt_create_fb(display->drm_fd, 64, 64, format, + LOCAL_I915_FORMAT_MOD_Y_TILED, ref_fb); + + igt_create_fb(display->drm_fd, 2 * ref_fb->width, + 2 * ref_fb->height, format, + LOCAL_I915_FORMAT_MOD_Y_TILED, clip_fb); + + igt_pipe_crc_start(data->pipe_crc); + + for_each_plane_on_pipe(display, pipe, plane) { + igt_crc_t ref_crc[4]; + cairo_t *cr; + static const double colors[4][3] = { + { 1., 0., 0. }, + { 0., 1., 0. }, + { 0., 0., 1. }, + { 1., 1., 1. } + }; + int i; + + if (!plane_supports_format(plane, format)) + continue; + + /* Draw the FB that will be used for clipping tests. */ + cr = igt_get_cairo_ctx(display->drm_fd, clip_fb); + igt_paint_color(cr, 0, 0, clip_fb->width / 2, clip_fb->height / 2, + colors[0][0], colors[0][1], colors[0][2]); + + igt_paint_color(cr, clip_fb->width / 2, 0, + clip_fb->width / 2, clip_fb->height / 2, + colors[1][0], colors[1][1], colors[1][2]); + + igt_paint_color(cr, clip_fb->width / 2, clip_fb->height / 2, + clip_fb->width / 2, clip_fb->height / 2, + colors[2][0], colors[2][1], colors[2][2]); + + igt_paint_color(cr, 0, clip_fb->height / 2, + clip_fb->width / 2, clip_fb->height / 2, + colors[3][0], colors[3][1], colors[3][2]); + + igt_put_cairo_ctx(display->drm_fd, clip_fb, cr); + + /* Draw all reference FB's to collect the CRC. */ + for (i = 0; i < 4; i++) { + cr = igt_get_cairo_ctx(display->drm_fd, ref_fb); + igt_paint_color(cr, 0, 0, ref_fb->width, ref_fb->height, + colors[i][0], colors[i][1], colors[i][2]); + igt_put_cairo_ctx(display->drm_fd, &data->fb[3], cr); + + if (!i) { + igt_plane_set_fb(plane, ref_fb); + igt_plane_set_position(plane, mode->hdisplay - ref_fb->width, mode->vdisplay - ref_fb->height); + igt_display_commit2(display, COMMIT_ATOMIC); + } else { + igt_dirty_fb(display->drm_fd, ref_fb); + igt_wait_for_vblank(display->drm_fd, pipe); + } + + igt_pipe_crc_drain(data->pipe_crc); + igt_pipe_crc_get_single(data->pipe_crc, &ref_crc[i]); + } + + igt_plane_set_fb(plane, NULL); + igt_plane_set_position(plane, 0, 0); + + yuv_valid_width_plane(data, mode, plane, &data->fb[0], IGT_ROTATION_0, &ref_crc[0]); + yuv_valid_width_plane(data, mode, plane, &data->fb[1], IGT_ROTATION_90, &ref_crc[1]); + yuv_valid_width_plane(data, mode, plane, &data->fb[0], IGT_ROTATION_180, &ref_crc[2]); + yuv_valid_width_plane(data, mode, plane, &data->fb[1], IGT_ROTATION_270, &ref_crc[3]); + + igt_plane_set_fb(plane, NULL); + } +} + +static bool yuv_commit_rotated (igt_display_t *display,igt_rotation_t rot) +{ + if (igt_display_try_commit2(display, COMMIT_ATOMIC) < 0) { + igt_debug("Skipping rotated test, alignment is wrong.\n"); + return false; + } + + return true; +} + +static void yuv_crop_scale_bug_plane (data_t *data,drmModeModeInfo *mode, + igt_plane_t *plane, struct igt_fb *fb, + igt_rotation_t rot, igt_crc_t *ref_crc) +{ + igt_display_t *display = &data->display; + igt_crc_t crc; + int ofs[] = { 0, 1, -1, 2, -2 }; + int i, j; + + igt_plane_set_fb(plane, fb); + igt_plane_set_rotation(plane, rot); + + igt_plane_set_position(plane, 64, 64); + igt_plane_set_size(plane, 256, 256); + + igt_fb_set_position(fb, plane, fb->width / 4, fb->height / 4); + igt_fb_set_size(fb, plane, fb->width / 2, fb->height / 2); + igt_display_commit2(display, COMMIT_ATOMIC); + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + + /* Make sure boundaries match */ + igt_fb_set_position(fb, plane, fb->width / 4 - 2, fb->height / 4 - 2); + igt_fb_set_size(fb, plane, fb->width / 2 + 4, fb->height / 2 + 4); + igt_display_commit2(display, COMMIT_ATOMIC); + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + + for (i = 1; i < ARRAY_SIZE(ofs); i++) { + igt_debug("Testing with rot %x and extra %i on the left side\n", rot, ofs[i]); + igt_fb_set_position(fb, plane, fb->width / 4 + ofs[i], fb->height / 4 - 2); + igt_fb_set_size(fb, plane, fb->width / 2 + 2 - ofs[i], fb->height / 2 + 4); + if (yuv_commit_rotated(display, rot)) + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + + igt_debug("Testing with rot %x and extra %i on the top side\n", rot, ofs[i]); + igt_fb_set_position(fb, plane, fb->width / 4 - 2, fb->height / 4 + ofs[i]); + igt_fb_set_size(fb, plane, fb->width / 2 + 4, fb->height / 2 + 2 - ofs[i]); + if (yuv_commit_rotated(display, rot)) + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + + igt_debug("Testing with rot %x and extra %i on the right side\n", rot, ofs[i]); + igt_fb_set_position(fb, plane, fb->width / 4 - 2, fb->height / 4);tests/kms_yuv.c line 418
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+ igt_fb_set_size(fb, plane, fb->width / 2 + 2 + ofs[i], fb->height / 2); + if (yuv_commit_rotated(display, rot)) + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + + igt_debug("Testing with rot %x and extra %i on the bottom side\n", rot, ofs[i]); + igt_fb_set_position(fb, plane, fb->width / 4 - 2, fb->height / 4 - 2); + igt_fb_set_size(fb, plane, fb->width / 2 + 4, fb->height / 2 + 2 + ofs[i]); + if (yuv_commit_rotated(display, rot)) + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); +Extra \n?
Quoted 38 lines
tests/kms_yuv.c new file +38
-0+ } + + for (i = 0; i < ARRAY_SIZE(ofs); i++) + for (j = !i; j < ARRAY_SIZE(ofs); j++) { + igt_debug("Testing with rot %x and extra (%i, %i) at the edges\n", rot, ofs[i], ofs[j]); + + igt_fb_set_position(fb, plane, fb->width / 4 + ofs[i], fb->height / 4 + ofs[j]); + igt_fb_set_size(fb, plane, fb->width / 2 - 2 * ofs[i], fb->height / 2 - 2 * ofs[j]); + + if (yuv_commit_rotated(display, rot)) + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + } +} + +static void draw_clip_fb (igt_display_t *display,struct igt_fb *clip_fb) +{ + cairo_t *cr = igt_get_cairo_ctx(display->drm_fd, clip_fb); + + igt_paint_color(cr, 0, 0, clip_fb->width, clip_fb->height, .0, .0, .5); + igt_paint_color(cr, clip_fb->width / 4 - 2, clip_fb->height / 4 - 2, + clip_fb->width / 2 + 4, clip_fb->height / 2 + 4, 1., 1., 1.); + + igt_put_cairo_ctx(display->drm_fd, clip_fb, cr); +} + +static void yuv_crop_scale_bug (data_t *data,enum pipe pipe,igt_output_t *output,unsigned format) +{ + drmModeModeInfo *mode = igt_output_get_mode(output); + igt_display_t *display = &data->display; + igt_plane_t *plane, *primary = igt_pipe_get_plane_type(&display->pipes[pipe], DRM_PLANE_TYPE_PRIMARY); + struct igt_fb *ref_fb = &data->fb[2]; + struct igt_fb *clip_fb = &data->fb[3]; + struct igt_fb *clip_fb_xtiled = &data->fb[4]; + struct igt_fb *clip_fb_ytiled = &data->fb[5]; + + prepare_crtc(data, pipe, output); + + igt_create_color_fb(display->drm_fd, mode->hdisplay, mode->vdisplay,tests/kms_yuv.c line 466
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+ format, LOCAL_I915_FORMAT_MOD_X_TILED, .5, .5, .5, &data->fb[0]); + + igt_create_color_fb(display->drm_fd, 256, 256, format, + LOCAL_I915_FORMAT_MOD_X_TILED, 1., 1., 1., ref_fb); + + igt_create_fb(display->drm_fd, 80, 128, format, + LOCAL_DRM_FORMAT_MOD_NONE, clip_fb); + + igt_create_fb(display->drm_fd, 80, 128, format, + LOCAL_I915_FORMAT_MOD_X_TILED, clip_fb_xtiled);Should \n come after this?
Quoted 55 lines
tests/kms_yuv.c new file +55
-0+ igt_create_fb(display->drm_fd, 80, 128, format, + LOCAL_I915_FORMAT_MOD_Y_TILED, clip_fb_ytiled); + + draw_clip_fb(display, clip_fb); + draw_clip_fb(display, clip_fb_xtiled); + draw_clip_fb(display, clip_fb_ytiled); + + igt_plane_set_fb(primary, &data->fb[0]); + + for_each_plane_on_pipe(display, pipe, plane) { + igt_crc_t ref_crc; + + if (!plane_supports_format(plane, format)) + continue; + + igt_plane_set_fb(plane, ref_fb); + igt_plane_set_position(plane, 64, 64); + igt_display_commit2(display, COMMIT_ATOMIC); + + igt_pipe_crc_start(data->pipe_crc); + igt_pipe_crc_get_single(data->pipe_crc, &ref_crc); + + yuv_crop_scale_bug_plane(data, mode, plane, clip_fb, IGT_ROTATION_0, &ref_crc); + yuv_crop_scale_bug_plane(data, mode, plane, clip_fb_xtiled, IGT_ROTATION_0, &ref_crc); + yuv_crop_scale_bug_plane(data, mode, plane, clip_fb_ytiled, IGT_ROTATION_0, &ref_crc); + yuv_crop_scale_bug_plane(data, mode, plane, clip_fb_ytiled, IGT_ROTATION_90, &ref_crc); + yuv_crop_scale_bug_plane(data, mode, plane, clip_fb, IGT_ROTATION_180, &ref_crc); + yuv_crop_scale_bug_plane(data, mode, plane, clip_fb_xtiled, IGT_ROTATION_180, &ref_crc); + yuv_crop_scale_bug_plane(data, mode, plane, clip_fb_ytiled, IGT_ROTATION_180, &ref_crc); + yuv_crop_scale_bug_plane(data, mode, plane, clip_fb_ytiled, IGT_ROTATION_270, &ref_crc); + + igt_plane_set_fb(plane, plane != primary ? NULL : &data->fb[0]); + break; + } +} + +static void yuv_chroma_subpixel_clip_plane_with_cursor (data_t *data, + igt_plane_t *plane, + struct igt_fb *clip_fb, + igt_plane_t *cursor, + struct igt_fb *cursor_fb, + igt_crc_t *ref_crc, + int cursor_x, int cursor_y) +{ + igt_display_t *display = &data->display; + + igt_plane_set_fb(plane, clip_fb); + igt_plane_set_position(plane, 64, 64); + igt_plane_set_rotation(plane, IGT_ROTATION_0); + + igt_plane_set_fb(cursor, cursor_fb); + igt_plane_set_position(cursor, cursor_x, cursor_y); + igt_display_commit2(display, COMMIT_ATOMIC); + + igt_pipe_crc_drain(data->pipe_crc);tests/kms_yuv.c line 531
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+ igt_pipe_crc_get_single(data->pipe_crc, ref_crc); + + igt_plane_set_fb(cursor, NULL); +} + +static bool yuv_chroma_subpixel_clip_plane_right (data_t *data, + igt_rotation_t rotation, + igt_plane_t *plane, + struct igt_fb *clip_fb, + igt_crc_t *ref_crc)Should make arguments aligned?
Quoted 6 lines
tests/kms_yuv.c new file +6
-0+{ + igt_display_t *display = &data->display; + igt_crc_t crc = {}; + + igt_plane_set_fb(plane, clip_fb); + igt_plane_set_position(plane, 64, 64);tests/kms_yuv.c line 547
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+ igt_plane_set_rotation(plane, rotation); + igt_plane_set_size(plane, clip_fb->width - 1, clip_fb->height); + + switch (rotation) { + case IGT_ROTATION_180: + igt_fb_set_position(clip_fb, plane, 1, 0); + case IGT_ROTATION_0: + igt_fb_set_size(clip_fb, plane, clip_fb->width - 1, clip_fb->height); + break; +Extra \n?
Quoted 27 lines
tests/kms_yuv.c new file +27
-0+ case IGT_ROTATION_270: + igt_fb_set_position(clip_fb, plane, 0, 1); + case IGT_ROTATION_90: + igt_fb_set_size(clip_fb, plane, clip_fb->width, clip_fb->height - 1); + break; + default: + igt_assert_f(0, "Unhandled rotation %x\n", rotation); + } + + if (igt_display_try_commit2(display, COMMIT_ATOMIC) < 0) + return false; + + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + return true; +} + +static bool yuv_chroma_subpixel_clip_plane_bottom (data_t *data, + igt_rotation_t rotation, + igt_plane_t *plane, + struct igt_fb *clip_fb, + igt_crc_t *ref_crc) +{ + igt_display_t *display = &data->display; + igt_crc_t crc = {}; + + igt_plane_set_fb(plane, clip_fb); + igt_plane_set_position(plane, 64, 64);tests/kms_yuv.c line 584
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+ igt_plane_set_rotation(plane, rotation); + igt_plane_set_size(plane, clip_fb->width, clip_fb->height - 1); + + switch (rotation) { + case IGT_ROTATION_180: + igt_fb_set_position(clip_fb, plane, 0, 1); + case IGT_ROTATION_0: + igt_fb_set_size(clip_fb, plane, clip_fb->width, clip_fb->height - 1); + break; +Extra \n?
Quoted 27 lines
tests/kms_yuv.c new file +27
-0+ case IGT_ROTATION_90: + igt_fb_set_position(clip_fb, plane, 1, 0); + case IGT_ROTATION_270: + igt_fb_set_size(clip_fb, plane, clip_fb->width - 1, clip_fb->height); + break; + default: + igt_assert_f(0, "Unhandled rotation %x\n", rotation); + } + + if (igt_display_try_commit2(display, COMMIT_ATOMIC) < 0) + return false; + + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + return true; +} + +static bool yuv_chroma_subpixel_clip_plane_left (data_t *data, + igt_rotation_t rotation, + igt_plane_t *plane, + struct igt_fb *clip_fb, + igt_crc_t *ref_crc) +{ + igt_display_t *display = &data->display; + igt_crc_t crc = {}; + + igt_plane_set_fb(plane, clip_fb); + igt_plane_set_position(plane, 65, 64);tests/kms_yuv.c line 621
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+ igt_plane_set_rotation(plane, rotation); + igt_plane_set_size(plane, clip_fb->width - 1, clip_fb->height); + + switch (rotation) { + case IGT_ROTATION_0: + igt_fb_set_position(clip_fb, plane, 1, 0); + case IGT_ROTATION_180: + igt_fb_set_size(clip_fb, plane, clip_fb->width - 1, clip_fb->height); + break; +Same here and below
clip_planefunctions:/ Sorry.Quoted 136 lines
tests/kms_yuv.c new file +136
-0+ case IGT_ROTATION_90: + igt_fb_set_position(clip_fb, plane, 0, 1); + case IGT_ROTATION_270: + igt_fb_set_size(clip_fb, plane, clip_fb->width, clip_fb->height - 1); + break; + default: + igt_assert_f(0, "Unhandled rotation %x\n", rotation); + } + + if (igt_display_try_commit2(display, COMMIT_ATOMIC) < 0) + return false; + + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + return true; +} + + +static bool yuv_chroma_subpixel_clip_plane_top (data_t *data, + igt_rotation_t rotation, + igt_plane_t *plane, + struct igt_fb *clip_fb, + igt_crc_t *ref_crc) +{ + igt_display_t *display = &data->display; + igt_crc_t crc = {}; + + igt_plane_set_fb(plane, clip_fb); + igt_plane_set_position(plane, 64, 65); + igt_plane_set_rotation(plane, rotation); + igt_plane_set_size(plane, clip_fb->width, clip_fb->height - 1); + + switch (rotation) { + case IGT_ROTATION_0: + igt_fb_set_position(clip_fb, plane, 0, 1); + case IGT_ROTATION_180: + igt_fb_set_size(clip_fb, plane, clip_fb->width, clip_fb->height - 1); + break; + + case IGT_ROTATION_270: + igt_fb_set_position(clip_fb, plane, 1, 0); + case IGT_ROTATION_90: + igt_fb_set_size(clip_fb, plane, clip_fb->width - 1, clip_fb->height); + break; + default: + igt_assert_f(0, "Unhandled rotation %x\n", rotation); + } + + if (igt_display_try_commit2(display, COMMIT_ATOMIC) < 0) + return false; + + assert_collected_crc_equal(data->pipe_crc, &crc, ref_crc); + return true; +} + +static void yuv_chroma_subpixel_clip (data_t *data,enum pipe pipe,igt_output_t *output,unsigned format) +{ + drmModeModeInfo *mode = igt_output_get_mode(output); + igt_display_t *display = &data->display; + igt_pipe_t *pipe_obj = &display->pipes[pipe]; + struct igt_fb *bg_fb = &data->fb[0]; + struct igt_fb *bg_cursor_fb = &data->fb[1]; + struct igt_fb *black_cursor_fb = &data->fb[2]; + struct igt_fb *clip_fb = &data->fb[3]; + igt_plane_t *primary = igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_PRIMARY); + igt_plane_t *cursor = igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_CURSOR); + igt_plane_t *plane; + cairo_t *cr; + bool ret = false; + + prepare_crtc(data, pipe, output); + + igt_create_color_fb(display->drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, LOCAL_I915_FORMAT_MOD_X_TILED, + .0, .0, 1., bg_fb); + + igt_create_color_fb(display->drm_fd, 256, 256, + DRM_FORMAT_ARGB8888, LOCAL_DRM_FORMAT_MOD_NONE, + .0, .0, 1., bg_cursor_fb); + + igt_create_color_fb(display->drm_fd, 256, 256, + DRM_FORMAT_ARGB8888, LOCAL_DRM_FORMAT_MOD_NONE, + .0, .0, .0, black_cursor_fb); + + igt_create_fb(display->drm_fd, 256, 256, + format, LOCAL_I915_FORMAT_MOD_Y_TILED, clip_fb); + + /* Draw the FB that will be used for clipping the chroma subpixel test. */ + cr = igt_get_cairo_ctx(display->drm_fd, clip_fb); + + igt_paint_color(cr, 0, 0, clip_fb->width, clip_fb->height, 1., 0., 0.); + igt_paint_color(cr, 2, 2, clip_fb->width - 4, clip_fb->height - 4, 0., 1., 1.); + igt_paint_color(cr, 4, 4, clip_fb->width - 8, clip_fb->height - 8, .75, .75, 1.); + + /* White dots in the corners. */ + igt_paint_color(cr, 0, 0, 6, 6, 1., 1., 1.); + igt_paint_color(cr, clip_fb->width - 6, 0, 6, 6, 1., 1., 1.); + igt_paint_color(cr, 0, clip_fb->height - 6, 6, 6, 1., 1., 1.); + igt_paint_color(cr, clip_fb->width - 6, clip_fb->height - 6, 6, 6, 1., 1., 1.); + + igt_put_cairo_ctx(display->drm_fd, clip_fb, cr); + + igt_pipe_crc_start(data->pipe_crc); + + igt_plane_set_fb(primary, bg_fb); + for_each_plane_on_pipe(display, pipe, plane) { + struct igt_fb *cursor_fb = plane == primary ? black_cursor_fb : bg_cursor_fb; + igt_crc_t ref_crc; + + if (!plane_supports_format(plane, format) || plane == cursor) + continue; + + yuv_chroma_subpixel_clip_plane_with_cursor(data, plane, clip_fb, cursor, cursor_fb, &ref_crc, 63 + clip_fb->width, 64); + ret |= yuv_chroma_subpixel_clip_plane_right(data, IGT_ROTATION_0, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_right(data, IGT_ROTATION_90, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_right(data, IGT_ROTATION_180, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_right(data, IGT_ROTATION_270, plane, clip_fb, &ref_crc); + + yuv_chroma_subpixel_clip_plane_with_cursor(data, plane, clip_fb, cursor, cursor_fb, &ref_crc, 64, 63 + clip_fb->height); + ret |= yuv_chroma_subpixel_clip_plane_bottom(data, IGT_ROTATION_0, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_bottom(data, IGT_ROTATION_90, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_bottom(data, IGT_ROTATION_180, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_bottom(data, IGT_ROTATION_270, plane, clip_fb, &ref_crc); + + yuv_chroma_subpixel_clip_plane_with_cursor(data, plane, clip_fb, cursor, cursor_fb, &ref_crc, 65 - cursor_fb->width, 64); + ret |= yuv_chroma_subpixel_clip_plane_left(data, IGT_ROTATION_0, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_left(data, IGT_ROTATION_90, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_left(data, IGT_ROTATION_180, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_left(data, IGT_ROTATION_270, plane, clip_fb, &ref_crc); + + yuv_chroma_subpixel_clip_plane_with_cursor(data, plane, clip_fb, cursor, cursor_fb, &ref_crc, 64, 65 - cursor_fb->height); + ret |= yuv_chroma_subpixel_clip_plane_top(data, IGT_ROTATION_0, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_top(data, IGT_ROTATION_90, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_top(data, IGT_ROTATION_180, plane, clip_fb, &ref_crc); + ret |= yuv_chroma_subpixel_clip_plane_top(data, IGT_ROTATION_270, plane, clip_fb, &ref_crc); + + /* Reset to defaults */tests/kms_yuv.c line 767
Quoted 10 lines
tests/kms_yuv.c new file +10
-0+ igt_plane_set_position(plane, 0, 0); + igt_plane_set_rotation(plane, IGT_ROTATION_0); + igt_plane_set_fb(plane, plane == primary ? bg_fb : NULL); + } + + igt_require_f(ret, "Could not test subpixel clipping in any corner\n"); +} + +static void run_tests_for_pipe (data_t *data,enum pipe pipe, + const char *fstr, unsigned int format)Argument alignment?
Quoted 64 lines
tests/kms_yuv.c new file +64
-0+{ + igt_output_t *output; + igt_display_t *display = &data->display; + + igt_subtest_group { + igt_fixture { + igt_display_require_output_on_pipe(display, pipe); + igt_require(igt_fb_supported_format(format)); + igt_require(pipe_supports_format(display, pipe, format)); + } + + igt_subtest_f("pipe-%s-%s-rgb-switch", + kmstest_pipe_name(pipe), fstr) + for_each_valid_output_on_pipe(display, pipe, output) + yuv_rgb_switch(data, pipe, output, false, format); + + igt_subtest_f("pipe-%s-%s-rgb-scaled-switch", + kmstest_pipe_name(pipe), fstr) + for_each_valid_output_on_pipe(display, pipe, output) + yuv_rgb_switch(data, pipe, output, true, format); + + igt_subtest_f("pipe-%s-%s-valid-width", + kmstest_pipe_name(pipe), fstr) + for_each_valid_output_on_pipe(display, pipe, output) + yuv_valid_width(data, pipe, output, format); + + igt_subtest_f("pipe-%s-%s-crop-scale-bug", + kmstest_pipe_name(pipe), fstr) + for_each_valid_output_on_pipe(display, pipe, output) + yuv_crop_scale_bug(data, pipe, output, format); + + igt_subtest_f("pipe-%s-%s-chroma-subpixel-clip", + kmstest_pipe_name(pipe), fstr) + for_each_valid_output_on_pipe(display, pipe, output) + yuv_chroma_subpixel_clip(data, pipe, output, format); + } +} + +igt_main +{ + data_t data = {}; + enum pipe pipe; + + igt_skip_on_simulation(); + + igt_fixture { + data.display.drm_fd = drm_open_driver_master(DRIVER_ANY); + + kmstest_set_vt_graphics_mode(); + igt_display_require(&data.display, data.display.drm_fd); + igt_require(data.display.is_atomic); + igt_require_pipe_crc(data.display.drm_fd); + } + + for_each_pipe_static(pipe) { + run_tests_for_pipe(&data, pipe, "NV12", DRM_FORMAT_NV12); + run_tests_for_pipe(&data, pipe, "NV16", DRM_FORMAT_NV16); + run_tests_for_pipe(&data, pipe, "NV21", DRM_FORMAT_NV21); + run_tests_for_pipe(&data, pipe, "NV61", DRM_FORMAT_NV61); + run_tests_for_pipe(&data, pipe, "YUV420", DRM_FORMAT_YUV420); + run_tests_for_pipe(&data, pipe, "YUV422", DRM_FORMAT_YUV422); + run_tests_for_pipe(&data, pipe, "YVU420", DRM_FORMAT_YVU420); + run_tests_for_pipe(&data, pipe, "YVU422", DRM_FORMAT_YVU422); + run_tests_for_pipe(&data, pipe, "P010", DRM_FORMAT_P010);
Quoted 8 lines
tests/kms_yuv.c line 838
Quoted 7 lines
tests/kms_yuv.c new file +7
-0+ run_tests_for_pipe(&data, pipe, "P012", DRM_FORMAT_P012); + run_tests_for_pipe(&data, pipe, "P016", DRM_FORMAT_P016); + run_tests_for_pipe(&data, pipe, "YUYV", DRM_FORMAT_YUYV); + run_tests_for_pipe(&data, pipe, "YVYU", DRM_FORMAT_YVYU); + run_tests_for_pipe(&data, pipe, "UYVY", DRM_FORMAT_UYVY); + run_tests_for_pipe(&data, pipe, "VYUY", DRM_FORMAT_VYUY); + run_tests_for_pipe(&data, pipe, "XYUV8888", DRM_FORMAT_XYUV8888);Maarten, I doubt here..so we need to simply add YUV format here and no need to make any other change in
kms_yuvigt?
Yes that's the idea. For debugging you can even use XRGB8888, if you're not sure whether the issue is YUV specific.
Most tests are about various corner cases with YUV formats, like upscaling an odd number of pixels which may fail on i915 nv12 for example, because it uses 2x2 pixels.
In those cases it skips, if it doesn't skip we compare unscaled vs scaled, and unclipped (with cursor hiding 1 line/row) vs clipped.
~Maarten
Quoted 11 lines
Quoted 11 lines
tests/kms_yuv.c new file +7
-0+ } + + igt_fixture { + igt_display_fini(&data.display); + close(data.display.drm_fd); + } +}tests/meson.build +0
-0
Quoted 9 lines
tests/meson.build test_progs = [ · line 66
Quoted 8 lines
tests/meson.build +1
-0@@ -60,6 +60,7 @@ test_progs = [ 'kms_universal_plane', 'kms_vblank', 'kms_vrr', + 'kms_yuv', 'meta_test', 'perf', 'pm_backlight',
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev