* [igt-dev] [PATCH i-g-t] tests/kms_plane: Add 1 pixel wide visible plane test
@ 2019-02-25 13:00 Juha-Pekka Heikkila
2019-02-25 13:39 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-02-25 16:54 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
0 siblings, 2 replies; 5+ messages in thread
From: Juha-Pekka Heikkila @ 2019-02-25 13:00 UTC (permalink / raw)
To: igt-dev
This test creates plane and fb which are 1 pixel wider than
maximum visible size. On both ends are vertical lines, first
plane is positioned at place (0,0) and then (-width,0) and
crc is compared. This test will skip YUV fb formats.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
tests/kms_plane.c | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 170 insertions(+)
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 91de469..c0f9b54 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -586,6 +586,173 @@ test_pixel_formats(data_t *data, enum pipe pipe)
}
}
+static const struct {
+ uint64_t tiling;
+ const char *tiling_name;
+} tiling[] = {
+ {LOCAL_DRM_FORMAT_MOD_NONE, "MOD_NONE" },
+ {LOCAL_I915_FORMAT_MOD_X_TILED, "X_TILED" },
+ {LOCAL_I915_FORMAT_MOD_Y_TILED, "Y_TILED" },
+ {LOCAL_I915_FORMAT_MOD_Yf_TILED, "Yf_TILED" }
+};
+
+static void
+test_1px_plane(data_t *data, enum pipe pipe, igt_output_t *output,
+ igt_plane_t *plane)
+{
+ struct igt_fb primary_fb;
+ struct igt_fb fb = {};
+ drmModeModeInfo *mode;
+ uint32_t format;
+ uint64_t width, height;
+ igt_crc_t crc[2]; /* 2 ref crcs as in ref and test */
+
+ /*
+ * No 1pix wide test for cursor.
+ */
+ if (plane->type == DRM_PLANE_TYPE_CURSOR)
+ return;
+
+ mode = igt_output_get_mode(output);
+ width = mode->hdisplay;
+ height = mode->vdisplay;
+
+ igt_debug("Testing connector %s on %s plane %s.%u\n",
+ igt_output_name(output), kmstest_plane_type_name(plane->type),
+ kmstest_pipe_name(pipe), plane->index);
+
+ igt_output_set_pipe(output, pipe);
+ igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+
+ set_legacy_lut(data, pipe, 0xfc00);
+
+ data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+ igt_pipe_crc_start(data->pipe_crc);
+
+ for (int i = 0; i < plane->drm_plane->count_formats; i++) {
+ int rval;
+
+ format = plane->drm_plane->formats[i];
+
+ if (!igt_fb_supported_format(format))
+ continue;
+
+ /*
+ * There seems to be some issue there with the CRC not
+ * matching. Both CRCs are stable, but don't match,
+ * which seems to indicate some issue with the CRC
+ * computation logic, but I haven't been able to find
+ * what.
+ */
+ if (format == DRM_FORMAT_XBGR8888)
+ continue;
+
+ rval = 0;
+ for (int j = 0; j < ARRAY_SIZE(tiling) && !rval; j++) {
+ cairo_t *cr;
+
+ igt_info("Testing format " IGT_FORMAT_FMT " with %s tiling on %s.%u\n",
+ IGT_FORMAT_ARGS(format), tiling[j].tiling_name,
+ kmstest_pipe_name(pipe), plane->index);
+
+ for (int k = 0; k < ARRAY_SIZE(colors) && !rval; k++) {
+ /*
+ * create 1pix wider plane than mode, there will be vertical line at
+ * both horizontal ends, always one of them hidden and one showing.
+ */
+ igt_create_fb(data->drm_fd, width+1,
+ height, format,
+ tiling[j].tiling,
+ &fb);
+
+ cr = igt_get_cairo_ctx(data->drm_fd, &fb);
+
+ igt_paint_color(cr, 0, 0,
+ 1,
+ height,
+ colors[k].red,
+ colors[k].green,
+ colors[k].blue);
+
+ igt_paint_color(cr, 1, 0,
+ width-1,
+ height-1,
+ 0.0f,
+ 0.0f,
+ 0.0f);
+
+ igt_paint_color(cr, width, 0,
+ 1,
+ height,
+ colors[k].red,
+ colors[k].green,
+ colors[k].blue);
+
+ igt_put_cairo_ctx(data->drm_fd, &fb, cr);
+
+ igt_plane_set_fb(plane, &fb);
+ igt_plane_set_position(plane, 0, 0);
+ igt_plane_set_size(plane, width+1, height);
+ igt_fb_set_position(&fb, plane, 0, 0);
+ rval = igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
+
+ if (rval)
+ goto next_round;
+
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, &crc[0]);
+
+ igt_plane_set_position(plane, -width, 0);
+ rval = igt_display_try_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
+
+ /*
+ * yuv will fail here and we're all ok with that.
+ * if skip here it will skip rest of this fb format
+ * from modifier test.
+ */
+ if (rval)
+ goto next_round;
+
+ igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, &crc[1]);
+
+ igt_assert_crc_equal(&crc[0], &crc[1]);
+
+next_round:
+ igt_plane_set_fb(plane, NULL);
+ igt_remove_fb(data->drm_fd, &fb);
+ }
+ }
+ }
+
+ igt_pipe_crc_stop(data->pipe_crc);
+ igt_pipe_crc_free(data->pipe_crc);
+
+ set_legacy_lut(data, pipe, 0xffff);
+
+ igt_plane_set_fb(plane, NULL);
+ igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+
+ igt_remove_fb(data->drm_fd, &fb);
+ igt_remove_fb(data->drm_fd, &primary_fb);
+}
+
+static void
+test_1px_wide_planes(data_t *data, enum pipe pipe)
+{
+ igt_output_t *output;
+
+ igt_display_require_output_on_pipe(&data->display, pipe);
+
+ for_each_valid_output_on_pipe(&data->display, pipe, output) {
+ igt_plane_t *plane;
+
+ for_each_plane_on_pipe(&data->display, pipe, plane)
+ test_1px_plane(data, pipe, output, plane);
+
+ igt_output_set_pipe(output, PIPE_ANY);
+ }
+}
+
static void
run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
{
@@ -629,6 +796,9 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
kmstest_pipe_name(pipe))
test_plane_panning(data, pipe, TEST_PANNING_BOTTOM_RIGHT |
TEST_SUSPEND_RESUME);
+
+ igt_subtest_f("plane-1pix-wide-pipe-%s", kmstest_pipe_name(pipe))
+ test_1px_wide_planes(data, pipe);
}
--
2.7.4
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_plane: Add 1 pixel wide visible plane test
2019-02-25 13:00 [igt-dev] [PATCH i-g-t] tests/kms_plane: Add 1 pixel wide visible plane test Juha-Pekka Heikkila
@ 2019-02-25 13:39 ` Patchwork
2019-02-25 16:54 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
1 sibling, 0 replies; 5+ messages in thread
From: Patchwork @ 2019-02-25 13:39 UTC (permalink / raw)
To: igt-dev
== Series Details ==
Series: tests/kms_plane: Add 1 pixel wide visible plane test
URL : https://patchwork.freedesktop.org/series/57185/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5658 -> IGTPW_2508
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/57185/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2508 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_basic@cs-compute:
- fi-kbl-8809g: NOTRUN -> FAIL [fdo#108094]
* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-byt-j1900: PASS -> SKIP [fdo#109271]
* igt@i915_pm_rpm@basic-rte:
- fi-byt-j1900: PASS -> FAIL [fdo#108800]
* igt@kms_busy@basic-flip-a:
- fi-gdg-551: PASS -> FAIL [fdo#103182]
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
- fi-blb-e6850: PASS -> INCOMPLETE [fdo#107718]
#### Possible fixes ####
* igt@amdgpu/amd_basic@userptr:
- fi-kbl-8809g: DMESG-WARN [fdo#108965] -> PASS
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-kbl-7567u: WARN [fdo#109380] -> PASS
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c:
- fi-kbl-7567u: SKIP [fdo#109271] -> PASS +33
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108094]: https://bugs.freedesktop.org/show_bug.cgi?id=108094
[fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800
[fdo#108965]: https://bugs.freedesktop.org/show_bug.cgi?id=108965
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109380]: https://bugs.freedesktop.org/show_bug.cgi?id=109380
Participating hosts (44 -> 37)
------------------------------
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-snb-2520m fi-ctg-p8600 fi-pnv-d510
Build changes
-------------
* IGT: IGT_4854 -> IGTPW_2508
CI_DRM_5658: dc6f5e9c1239d7a4b77e31cfaca48873692d579f @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2508: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2508/
IGT_4854: 06b0830fb948b9b632342cd26100342aa01cbc79 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Testlist changes ==
+igt@kms_plane@plane-1pix-wide-pipe-a
+igt@kms_plane@plane-1pix-wide-pipe-b
+igt@kms_plane@plane-1pix-wide-pipe-c
+igt@kms_plane@plane-1pix-wide-pipe-d
+igt@kms_plane@plane-1pix-wide-pipe-e
+igt@kms_plane@plane-1pix-wide-pipe-f
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2508/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
* [igt-dev] ✓ Fi.CI.IGT: success for tests/kms_plane: Add 1 pixel wide visible plane test
2019-02-25 13:00 [igt-dev] [PATCH i-g-t] tests/kms_plane: Add 1 pixel wide visible plane test Juha-Pekka Heikkila
2019-02-25 13:39 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2019-02-25 16:54 ` Patchwork
1 sibling, 0 replies; 5+ messages in thread
From: Patchwork @ 2019-02-25 16:54 UTC (permalink / raw)
To: igt-dev
== Series Details ==
Series: tests/kms_plane: Add 1 pixel wide visible plane test
URL : https://patchwork.freedesktop.org/series/57185/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5658_full -> IGTPW_2508_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/57185/revisions/1/mbox/
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_2508_full:
### IGT changes ###
#### Possible regressions ####
* {igt@kms_plane@plane-1pix-wide-pipe-a} (NEW):
- shard-apl: NOTRUN -> CRASH +1
- shard-kbl: NOTRUN -> CRASH +2
* {igt@kms_plane@plane-1pix-wide-pipe-b} (NEW):
- shard-hsw: NOTRUN -> CRASH +2
- shard-snb: NOTRUN -> CRASH +1
* {igt@kms_plane@plane-1pix-wide-pipe-c} (NEW):
- shard-glk: NOTRUN -> CRASH +1
New tests
---------
New tests have been introduced between CI_DRM_5658_full and IGTPW_2508_full:
### New IGT tests (6) ###
* igt@kms_plane@plane-1pix-wide-pipe-a:
- Statuses : 5 crash(s)
- Exec time: [0.39, 36.08] s
* igt@kms_plane@plane-1pix-wide-pipe-b:
- Statuses : 3 crash(s)
- Exec time: [0.43, 22.07] s
* igt@kms_plane@plane-1pix-wide-pipe-c:
- Statuses : 4 crash(s) 1 skip(s)
- Exec time: [0.0, 36.22] s
* igt@kms_plane@plane-1pix-wide-pipe-d:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_plane@plane-1pix-wide-pipe-e:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@kms_plane@plane-1pix-wide-pipe-f:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
Known issues
------------
Here are the changes found in IGTPW_2508_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_isolation@vcs0-s3:
- shard-kbl: PASS -> INCOMPLETE [fdo#103665] +1
* igt@gem_exec_schedule@preemptive-hang-bsd2:
- shard-hsw: NOTRUN -> SKIP [fdo#109271] +31
* igt@i915_suspend@sysfs-reader:
- shard-apl: PASS -> DMESG-WARN [fdo#108566]
* igt@kms_busy@extended-modeset-hang-newfb-render-a:
- shard-snb: NOTRUN -> DMESG-WARN [fdo#107956]
* igt@kms_busy@extended-pageflip-hang-oldfb-render-d:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +4
* igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
- shard-glk: PASS -> FAIL [fdo#108145] +1
* igt@kms_cursor_crc@cursor-256x85-random:
- shard-apl: PASS -> FAIL [fdo#103232] +6
* igt@kms_cursor_crc@cursor-64x64-onscreen:
- shard-apl: NOTRUN -> FAIL [fdo#103232]
* igt@kms_cursor_crc@cursor-size-change:
- shard-glk: PASS -> FAIL [fdo#103232]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-onoff:
- shard-apl: PASS -> FAIL [fdo#103167] +1
* igt@kms_frontbuffer_tracking@fbc-1p-rte:
- shard-glk: PASS -> FAIL [fdo#103167] / [fdo#105682]
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-mmap-cpu:
- shard-glk: PASS -> FAIL [fdo#103167] +10
* igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-pri-indfb-draw-render:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] +16
* {igt@kms_plane@plane-1pix-wide-pipe-d} (NEW):
- shard-apl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +5
- shard-glk: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +2
* {igt@kms_plane@plane-1pix-wide-pipe-e} (NEW):
- shard-snb: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +4
* {igt@kms_plane@plane-1pix-wide-pipe-f} (NEW):
- shard-hsw: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +5
* igt@kms_plane_alpha_blend@pipe-a-alpha-transparant-fb:
- shard-apl: NOTRUN -> FAIL [fdo#108145]
- shard-kbl: NOTRUN -> FAIL [fdo#108145]
* igt@kms_plane_multiple@atomic-pipe-b-tiling-none:
- shard-apl: PASS -> FAIL [fdo#103166] +5
* igt@kms_plane_multiple@atomic-pipe-c-tiling-x:
- shard-kbl: PASS -> FAIL [fdo#103166]
* igt@kms_universal_plane@universal-plane-pipe-c-functional:
- shard-glk: PASS -> FAIL [fdo#103166] +8
* igt@kms_vblank@pipe-b-ts-continuation-modeset:
- shard-kbl: PASS -> FAIL [fdo#104894]
* igt@kms_vblank@pipe-c-ts-continuation-modeset-hang:
- shard-apl: PASS -> FAIL [fdo#104894] +1
* igt@perf_pmu@busy-accuracy-2-vcs1:
- shard-glk: NOTRUN -> SKIP [fdo#109271] +2
* igt@perf_pmu@busy-check-all-vecs0:
- shard-snb: NOTRUN -> SKIP [fdo#109271] +36
* igt@perf_pmu@rc6-runtime-pm-long:
- shard-apl: PASS -> FAIL [fdo#105010]
- shard-kbl: PASS -> FAIL [fdo#105010]
* igt@prime_vgem@fence-write-hang:
- shard-apl: NOTRUN -> SKIP [fdo#109271] +30
#### Possible fixes ####
* igt@kms_atomic_transition@plane-all-modeset-transition:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS
- shard-apl: INCOMPLETE [fdo#103927] -> PASS
* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-b:
- shard-kbl: DMESG-WARN [fdo#107956] -> PASS
* igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
- shard-apl: FAIL [fdo#106510] / [fdo#108145] -> PASS
* igt@kms_color@pipe-b-legacy-gamma:
- shard-apl: FAIL [fdo#104782] -> PASS
- shard-kbl: FAIL [fdo#104782] -> PASS
* igt@kms_cursor_crc@cursor-128x42-sliding:
- shard-kbl: FAIL [fdo#103232] -> PASS +1
* igt@kms_cursor_crc@cursor-64x21-sliding:
- shard-apl: FAIL [fdo#103232] -> PASS +4
* igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
- shard-glk: FAIL [fdo#104873] -> PASS
* igt@kms_cursor_legacy@pipe-c-torture-bo:
- shard-hsw: DMESG-WARN [fdo#107122] -> PASS
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt:
- shard-apl: FAIL [fdo#103167] -> PASS +1
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
- shard-glk: FAIL [fdo#103167] -> PASS +1
* igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
- shard-apl: FAIL [fdo#108948] -> PASS +1
* igt@kms_plane@pixel-format-pipe-c-planes-source-clamping:
- shard-glk: FAIL [fdo#108948] -> PASS
* igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
- shard-glk: FAIL [fdo#103166] -> PASS
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
[fdo#104873]: https://bugs.freedesktop.org/show_bug.cgi?id=104873
[fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
[fdo#105010]: https://bugs.freedesktop.org/show_bug.cgi?id=105010
[fdo#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
[fdo#106510]: https://bugs.freedesktop.org/show_bug.cgi?id=106510
[fdo#107122]: https://bugs.freedesktop.org/show_bug.cgi?id=107122
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
Participating hosts (7 -> 5)
------------------------------
Missing (2): shard-skl shard-iclb
Build changes
-------------
* IGT: IGT_4854 -> IGTPW_2508
* Piglit: piglit_4509 -> None
CI_DRM_5658: dc6f5e9c1239d7a4b77e31cfaca48873692d579f @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2508: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2508/
IGT_4854: 06b0830fb948b9b632342cd26100342aa01cbc79 @ 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_2508/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
* [igt-dev] [PATCH i-g-t] tests/kms_plane: Add 1 pixel wide visible plane test
@ 2019-02-26 12:43 Juha-Pekka Heikkila
0 siblings, 0 replies; 5+ messages in thread
From: Juha-Pekka Heikkila @ 2019-02-26 12:43 UTC (permalink / raw)
To: igt-dev
This test creates plane and fb which are 1 pixel wider than
maximum visible size. On both ends are vertical lines, first
plane is positioned at place (0,0) and then (-width,0) and
crc is compared. Then plane is positioned to (-1,0) and
(width-1,0) and crcs are compared again.
This test will skip YUV fb formats.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
tests/kms_plane.c | 189 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 189 insertions(+)
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 91de469..622368a 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -586,6 +586,187 @@ test_pixel_formats(data_t *data, enum pipe pipe)
}
}
+static const struct {
+ uint64_t tiling;
+ const char *tiling_name;
+} tiling[] = {
+ {LOCAL_DRM_FORMAT_MOD_NONE, "MOD_NONE" },
+ {LOCAL_I915_FORMAT_MOD_X_TILED, "X_TILED" },
+ {LOCAL_I915_FORMAT_MOD_Y_TILED, "Y_TILED" },
+ {LOCAL_I915_FORMAT_MOD_Yf_TILED, "Yf_TILED" }
+};
+
+#define CRC_AMOUNT_1PIXTEST 10
+static void
+test_1px_plane(data_t *data, enum pipe pipe, igt_output_t *output,
+ igt_plane_t *plane)
+{
+ struct igt_fb fb = {};
+ drmModeModeInfo *mode;
+ uint32_t format;
+ uint64_t width, height;
+ igt_crc_t refcrc, *crcs;
+
+ /*
+ * No 1pix wide test for cursor.
+ */
+ if (plane->type == DRM_PLANE_TYPE_CURSOR)
+ return;
+
+ mode = igt_output_get_mode(output);
+ width = mode->hdisplay;
+ height = mode->vdisplay;
+
+ igt_debug("Testing connector %s on %s plane %s.%u\n",
+ igt_output_name(output), kmstest_plane_type_name(plane->type),
+ kmstest_pipe_name(pipe), plane->index);
+
+ igt_output_set_pipe(output, pipe);
+ igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+
+ set_legacy_lut(data, pipe, 0xfc00);
+
+ data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+ igt_pipe_crc_start(data->pipe_crc);
+
+ for (int i = 0; i < plane->drm_plane->count_formats; i++) {
+ int rval;
+
+ format = plane->drm_plane->formats[i];
+
+ if (!igt_fb_supported_format(format))
+ continue;
+
+ /*
+ * There seems to be some issue there with the CRC not
+ * matching. Both CRCs are stable, but don't match,
+ * which seems to indicate some issue with the CRC
+ * computation logic, but I haven't been able to find
+ * what.
+ */
+ if (format == DRM_FORMAT_XBGR8888)
+ continue;
+
+ rval = 0;
+ for (int j = 0; j < ARRAY_SIZE(tiling) && !rval; j++) {
+ cairo_t *cr;
+
+ igt_info("Testing format " IGT_FORMAT_FMT " with %s tiling on %s.%u\n",
+ IGT_FORMAT_ARGS(format), tiling[j].tiling_name,
+ kmstest_pipe_name(pipe), plane->index);
+
+ for (int k = 0; k < ARRAY_SIZE(colors) && !rval; k++) {
+ /*
+ * create 1pix wider plane than mode, there will be vertical line at
+ * both horizontal ends, always one of them hidden and one showing.
+ */
+ igt_create_fb(data->drm_fd, width+1,
+ height, format,
+ tiling[j].tiling,
+ &fb);
+
+ cr = igt_get_cairo_ctx(data->drm_fd, &fb);
+
+ igt_paint_color(cr, 0, 0,
+ 1,
+ height,
+ colors[k].red,
+ colors[k].green,
+ colors[k].blue);
+
+ igt_paint_color(cr, 1, 0,
+ width-1,
+ height-1,
+ 0.0f,
+ 0.0f,
+ 0.0f);
+
+ igt_paint_color(cr, width, 0,
+ 1,
+ height,
+ colors[k].red,
+ colors[k].green,
+ colors[k].blue);
+
+ igt_put_cairo_ctx(data->drm_fd, &fb, cr);
+
+ igt_plane_set_fb(plane, &fb);
+ igt_plane_set_position(plane, 0, 0);
+ igt_plane_set_size(plane, width+1, height);
+ igt_fb_set_position(&fb, plane, 0, 0);
+ igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
+
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, &refcrc);
+
+ igt_plane_set_position(plane, -width, 0);
+ rval = igt_display_try_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
+
+ /*
+ * yuv will fail here and we're all ok with that.
+ * if skip here it will skip rest of this fb format
+ * from modifier test.
+ */
+ if (rval)
+ goto next_round;
+
+ /*
+ * in following there are multiple crcs collected
+ * because single crc comparison was sometimes
+ * passing incorrectly.
+ */
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_crcs(data->pipe_crc, CRC_AMOUNT_1PIXTEST, &crcs);
+ for (int c = 0; c < CRC_AMOUNT_1PIXTEST; c++)
+ igt_assert_crc_equal(&refcrc, &(crcs[c]));
+ free(crcs);
+
+ /*
+ * here begin right side test
+ */
+ igt_plane_set_position(plane, -1, 0);
+ rval = igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, &refcrc);
+
+ igt_plane_set_position(plane, width-1, 0);
+ rval = igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_crcs(data->pipe_crc, CRC_AMOUNT_1PIXTEST, &crcs);
+ for (int c = 0; c < CRC_AMOUNT_1PIXTEST; c++)
+ igt_assert_crc_equal(&refcrc, &(crcs[c]));
+ free(crcs);
+next_round:
+ igt_plane_set_fb(plane, NULL);
+ igt_remove_fb(data->drm_fd, &fb);
+ }
+ }
+ }
+
+ igt_pipe_crc_stop(data->pipe_crc);
+ igt_pipe_crc_free(data->pipe_crc);
+
+ set_legacy_lut(data, pipe, 0xffff);
+ igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+}
+
+static void
+test_1px_wide_planes(data_t *data, enum pipe pipe)
+{
+ igt_output_t *output;
+
+ igt_display_require_output_on_pipe(&data->display, pipe);
+
+ for_each_valid_output_on_pipe(&data->display, pipe, output) {
+ igt_plane_t *plane;
+
+ for_each_plane_on_pipe(&data->display, pipe, plane)
+ test_1px_plane(data, pipe, output, plane);
+
+ igt_output_set_pipe(output, PIPE_ANY);
+ }
+}
+
static void
run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
{
@@ -629,6 +810,14 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
kmstest_pipe_name(pipe))
test_plane_panning(data, pipe, TEST_PANNING_BOTTOM_RIGHT |
TEST_SUSPEND_RESUME);
+
+ igt_subtest_f("plane-1pix-wide-pipe-%s", kmstest_pipe_name(pipe)) {
+ int gen = 0;
+
+ gen = intel_gen(intel_get_drm_devid(data->drm_fd));
+ igt_require(gen >= 9);
+ test_1px_wide_planes(data, pipe);
+ }
}
--
2.7.4
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [igt-dev] [PATCH i-g-t] tests/kms_plane: Add 1 pixel wide visible plane test
@ 2019-02-25 13:48 Juha-Pekka Heikkila
0 siblings, 0 replies; 5+ messages in thread
From: Juha-Pekka Heikkila @ 2019-02-25 13:48 UTC (permalink / raw)
To: igt-dev
This test creates plane and fb which are 1 pixel wider than
maximum visible size. On both ends are vertical lines, first
plane is positioned at place (0,0) and then (-width,0) and
crc is compared. Then plane is positioned to (-1,0) and
(width-1,0) and crcs are compared again.
This test will skip YUV fb formats.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
tests/kms_plane.c | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 179 insertions(+)
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 91de469..f378135 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -586,6 +586,182 @@ test_pixel_formats(data_t *data, enum pipe pipe)
}
}
+static const struct {
+ uint64_t tiling;
+ const char *tiling_name;
+} tiling[] = {
+ {LOCAL_DRM_FORMAT_MOD_NONE, "MOD_NONE" },
+ {LOCAL_I915_FORMAT_MOD_X_TILED, "X_TILED" },
+ {LOCAL_I915_FORMAT_MOD_Y_TILED, "Y_TILED" },
+ {LOCAL_I915_FORMAT_MOD_Yf_TILED, "Yf_TILED" }
+};
+
+static void
+test_1px_plane(data_t *data, enum pipe pipe, igt_output_t *output,
+ igt_plane_t *plane)
+{
+ struct igt_fb fb = {};
+ drmModeModeInfo *mode;
+ uint32_t format;
+ uint64_t width, height;
+ igt_crc_t crc[2]; /* 2 ref crcs as in ref and test */
+
+ /*
+ * No 1pix wide test for cursor.
+ */
+ if (plane->type == DRM_PLANE_TYPE_CURSOR)
+ return;
+
+ mode = igt_output_get_mode(output);
+ width = mode->hdisplay;
+ height = mode->vdisplay;
+
+ igt_debug("Testing connector %s on %s plane %s.%u\n",
+ igt_output_name(output), kmstest_plane_type_name(plane->type),
+ kmstest_pipe_name(pipe), plane->index);
+
+ igt_output_set_pipe(output, pipe);
+ igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+
+ set_legacy_lut(data, pipe, 0xfc00);
+
+ data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+ igt_pipe_crc_start(data->pipe_crc);
+
+ for (int i = 0; i < plane->drm_plane->count_formats; i++) {
+ int rval;
+
+ format = plane->drm_plane->formats[i];
+
+ if (!igt_fb_supported_format(format))
+ continue;
+
+ /*
+ * There seems to be some issue there with the CRC not
+ * matching. Both CRCs are stable, but don't match,
+ * which seems to indicate some issue with the CRC
+ * computation logic, but I haven't been able to find
+ * what.
+ */
+ if (format == DRM_FORMAT_XBGR8888)
+ continue;
+
+ rval = 0;
+ for (int j = 0; j < ARRAY_SIZE(tiling) && !rval; j++) {
+ cairo_t *cr;
+
+ igt_info("Testing format " IGT_FORMAT_FMT " with %s tiling on %s.%u\n",
+ IGT_FORMAT_ARGS(format), tiling[j].tiling_name,
+ kmstest_pipe_name(pipe), plane->index);
+
+ for (int k = 0; k < ARRAY_SIZE(colors) && !rval; k++) {
+ /*
+ * create 1pix wider plane than mode, there will be vertical line at
+ * both horizontal ends, always one of them hidden and one showing.
+ */
+ igt_create_fb(data->drm_fd, width+1,
+ height, format,
+ tiling[j].tiling,
+ &fb);
+
+ cr = igt_get_cairo_ctx(data->drm_fd, &fb);
+
+ igt_paint_color(cr, 0, 0,
+ 1,
+ height,
+ colors[k].red,
+ colors[k].green,
+ colors[k].blue);
+
+ igt_paint_color(cr, 1, 0,
+ width-1,
+ height-1,
+ 0.0f,
+ 0.0f,
+ 0.0f);
+
+ igt_paint_color(cr, width, 0,
+ 1,
+ height,
+ colors[k].red,
+ colors[k].green,
+ colors[k].blue);
+
+ igt_put_cairo_ctx(data->drm_fd, &fb, cr);
+
+ igt_plane_set_fb(plane, &fb);
+ igt_plane_set_position(plane, 0, 0);
+ igt_plane_set_size(plane, width+1, height);
+ igt_fb_set_position(&fb, plane, 0, 0);
+ igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
+
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, &crc[0]);
+
+ igt_plane_set_position(plane, -width, 0);
+ rval = igt_display_try_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
+
+ /*
+ * yuv will fail here and we're all ok with that.
+ * if skip here it will skip rest of this fb format
+ * from modifier test.
+ */
+ if (rval)
+ goto next_round;
+
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, &crc[1]);
+ igt_assert_crc_equal(&crc[0], &crc[1]);
+
+ /*
+ * here begin right side test
+ */
+ igt_plane_set_position(plane, -1, 0);
+ rval = igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, &crc[0]);
+
+ igt_plane_set_position(plane, width-1, 0);
+ rval = igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
+ igt_pipe_crc_drain(data->pipe_crc);
+ igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, &crc[1]);
+
+ igt_assert_crc_equal(&crc[0], &crc[1]);
+next_round:
+ igt_plane_set_fb(plane, NULL);
+ igt_remove_fb(data->drm_fd, &fb);
+ }
+ }
+ }
+
+ igt_pipe_crc_stop(data->pipe_crc);
+ igt_pipe_crc_free(data->pipe_crc);
+
+ set_legacy_lut(data, pipe, 0xffff);
+
+ igt_plane_set_fb(plane, NULL);
+ igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+
+ igt_remove_fb(data->drm_fd, &fb);
+}
+
+static void
+test_1px_wide_planes(data_t *data, enum pipe pipe)
+{
+ igt_output_t *output;
+
+ igt_display_require_output_on_pipe(&data->display, pipe);
+
+ for_each_valid_output_on_pipe(&data->display, pipe, output) {
+ igt_plane_t *plane;
+
+ for_each_plane_on_pipe(&data->display, pipe, plane)
+ test_1px_plane(data, pipe, output, plane);
+
+ igt_output_set_pipe(output, PIPE_ANY);
+ }
+}
+
static void
run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
{
@@ -629,6 +805,9 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
kmstest_pipe_name(pipe))
test_plane_panning(data, pipe, TEST_PANNING_BOTTOM_RIGHT |
TEST_SUSPEND_RESUME);
+
+ igt_subtest_f("plane-1pix-wide-pipe-%s", kmstest_pipe_name(pipe))
+ test_1px_wide_planes(data, pipe);
}
--
2.7.4
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-02-26 12:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25 13:00 [igt-dev] [PATCH i-g-t] tests/kms_plane: Add 1 pixel wide visible plane test Juha-Pekka Heikkila
2019-02-25 13:39 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-02-25 16:54 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-02-25 13:48 [igt-dev] [PATCH i-g-t] " Juha-Pekka Heikkila
2019-02-26 12:43 Juha-Pekka Heikkila
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.