tests/fbdev: Additional tests for resolution and panning
v3 cover tests/fbdev: Additional tests for resolution and panning
Add addtional tests for resolution and panning operations on fbdev devices. Succeed on successful operations. Fail on invalid operations or state.
DRM's simpledrm driver exposed a bug in DRM's fbdev overallocation code,
[1] which is required for fbdev page flipping. The new test cases intent to test panning and page flipping, and detect such issues early.
Tested with the current simpledrm and a hacked version that supports fbdev overallocation. This will also help to implement the panning functionality for real in simpledrm and other drivers.
v3:
* move pan-test logic into helper function (Ville)
* fixes and comments for FB_VMODE_YWRAP
v2:
* test horizontal resolution against line length (Ville)
* respect FB_VMODE_YWRAP (Ville)
* respect {x,y}panstep (Ville)
[1] https://lore.kernel.org/dri-devel/[email protected]/
Thomas Zimmermann (2):
tests/fbdev: Test for validity of video mode settings tests/fbdev: Add tests for display panning
tests/fbdev.c | 154 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 146 insertions(+), 8 deletions(-)
--
2.33.0
PATCH v3 1/2 tests/fbdev: Test for validity of video mode settings
Add basic tests for video mode resolution and color on fbdev devices.
v2:
* respect FB_VMODE_YWRAP (Ville)
* test horizontal resolution against line length
--- tests/fbdev.c | 49 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-)
tests/fbdev.c +41 -8
@@ -27,6 +27,7 @@#include <errno.h> #include <fcntl.h> +#include <limits.h> #include <string.h> #include <sys/ioctl.h> #include <sys/mman.h>
@@ -50,14 +51,46 @@ static void mode_tests(int fd)igt_describe ("Check if screeninfo is valid" ); igt_subtest("info") { -unsigned long size; - - size = var_info.yres * fix_info.line_length; -igt_assert_f (size <= fix_info.smem_len, -"screen size (%d x %d) of pitch %d does not fit within mappable area of size %u\n" , - var_info.xres, var_info.yres, - fix_info.line_length, - fix_info.smem_len); +unsigned long nbits, nlines; + +/* video memory configuration */ +igt_assert_f (fix_info.line_length,"line length not set\n" ); +igt_assert_f (fix_info.smem_len,"size of video memory not set\n" ); +igt_assert_f (fix_info.line_length <= fix_info.smem_len, +"line length (%u) exceeds available video memory (%u)\n" , + fix_info.line_length, fix_info.smem_len); + +/* color format */ +igt_assert_f (var_info.bits_per_pixel,"bits-per-pixel not set\n" ); + +/* horizontal resolution */ +igt_assert_f (var_info.xres,"horizontal resolution not set\n" ); +igt_assert_f (var_info.xres_virtual,"horizontal virtual resolution not set\n" ); +igt_assert_f (var_info.xres <= var_info.xres_virtual, +"horizontal virtual resolution (%u) less than horizontal resolution (%u)\n" , + var_info.xres_virtual, var_info.xres); +igt_assert_f (var_info.xoffset <= (var_info.xres_virtual - var_info.xres), +"screen horizontal offset (%u) overflow\n" , + var_info.xoffset); + nbits = fix_info.line_length *CHAR_BIT ; +igt_assert_f ((var_info.xres_virtual * var_info.bits_per_pixel) <= nbits, +"vertical virtual resolution (%u) with bpp %u exceeds line length %u\n" , + var_info.yres_virtual, var_info.bits_per_pixel, fix_info.line_length); + +/* vertical resolution */ +igt_assert_f (var_info.yres,"vertical resolution not set\n" ); +igt_assert_f (var_info.yres_virtual,"vertical virtual resolution not set\n" ); +igt_assert_f (var_info.yres <= var_info.yres_virtual, +"vertical virtual resolution (%u) less than vertical resolution (%u)\n" , + var_info.yres_virtual, var_info.yres); +igt_assert_f ((var_info.vmode &FB_VMODE_YWRAP ) || + (var_info.yoffset <= (var_info.yres_virtual - var_info.yres)), +"screen vertical offset (%u) overflow\n" , + var_info.yoffset); + nlines = fix_info.smem_len / fix_info.line_length; +igt_assert_f (var_info.yres_virtual <= nlines, +"vertical virtual resolution (%u) with line length %u exceeds available video memory\n" , + var_info.yres_virtual, fix_info.line_length); } }
Signature · 1 line
2.33.0
PATCH v3 2/2 tests/fbdev: Add tests for display panning
In reply to Thomas ZimmermannAdd tests that perform panning / page flip operations on an fbdev device. Panning should work when the viewport wi within the virtual screen and fail otherwise.
v3:
* moved ioctls and assertions into helper (Ville)
* set FB_VMODE_YWRAP for rsp tests
* additional comments on YWRAP
v2:
* set offset to respect panning offsets (Ville)
* respect FB_VMODE_YWRAP (Ville)
--- tests/fbdev.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+)
tests/fbdev.c +105 -0
@@ -39,6 +39,38 @@#include "igt.h" +#define PANSTEP (panstep_) \ + ((panstep_) ? (panstep_) : 1) + +static unsigned int __panoffset (unsigned int offset,unsigned int panstep) +{ +return offset - (offset %PANSTEP (panstep)); +} + +#define XOFFSET (offset_) \ + __panoffset(offset_, fix_info.xpanstep) + +#define YOFFSET (offset_) \ + __panoffset(offset_, fix_info.ypanstep) + +static void pan_test (int fd,const struct fb_var_screeninfo *var,int expected_ret) +{ +struct fb_var_screeninfo pan_var, new_var; +int ret; + +memcpy (&pan_var, var,sizeof (pan_var)); + + ret =ioctl (fd,FBIOPAN_DISPLAY , &pan_var); +igt_assert_f (ret == expected_ret, +"ioctl(FBIOPAN_DISPLAY) returned ret=%d, expected %d\n" , ret, expected_ret); + + ret =ioctl (fd,FBIOGET_VSCREENINFO , &new_var); +igt_assert_f (ret ==0 ,"ioctl(FBIOGET_VSCREENINFO) failed, ret=%d\n" , ret); +igt_assert_f (pan_var.xoffset == new_var.xoffset && pan_var.yoffset == new_var.yoffset, +"panning to (%u, %u) moved to (%u, %u)\n" , + pan_var.xoffset, pan_var.yoffset, new_var.xoffset, new_var.yoffset); +} +static void mode_tests (int fd) {struct fb_var_screeninfo var_info;
@@ -92,6 +124,79 @@ static void mode_tests(int fd)"vertical virtual resolution (%u) with line length %u exceeds available video memory\n" , var_info.yres_virtual, fix_info.line_length); } + +igt_describe ("Check panning / page flipping" ); + igt_subtest("pan") { +struct fb_var_screeninfo pan_var; +int expected_ret; + +memset (&pan_var,0 ,sizeof (pan_var)); + +/* +* Tests that are expected to succeed. +*/ + +/* jump to opposite end of virtual screen */ + pan_var.xoffset =XOFFSET (var_info.xres_virtual - var_info.xres - var_info.xoffset); + pan_var.yoffset =YOFFSET (var_info.yres_virtual - var_info.yres - var_info.yoffset); +pan_test (fd, &pan_var,0 ); +/* jump to (0, 0) */ + pan_var.xoffset =XOFFSET (0 ); + pan_var.yoffset =YOFFSET (0 ); +pan_test (fd, &pan_var,0 ); +/* jump to maximum extend */ + pan_var.xoffset =XOFFSET (var_info.xres_virtual - var_info.xres); + pan_var.yoffset =YOFFSET (var_info.yres_virtual - var_info.yres); +pan_test (fd, &pan_var,0 ); + +/* +* Tests that are expected to fail. +*/ + +/* jump beyond maximum horizontal extend */ + pan_var.xoffset =XOFFSET (var_info.xres_virtual - var_info.xres +PANSTEP (fix_info.xpanstep)); + pan_var.yoffset =YOFFSET (0 ); +pan_test (fd, &pan_var,-1 ); +/* jump beyond horizontal virtual resolution */ + pan_var.xoffset =XOFFSET (var_info.xres_virtual); + pan_var.yoffset =YOFFSET (0 ); +pan_test (fd, &pan_var,-1 ); + +/* +* The FB_VMODE_YWRAP flag is configurable as part of ioctl(FBIOPAN_DISPLAY), +* but it's hard to know which drivers support it and which don't. Testing for +* FBINFO_HWACCEL_YWRAP does not produce meaningful results. So we got with the +* device's current setting. +* +* With FB_VMODE_YWRAP set, the display is expected to wrap around when +* reaching the limits of the vertical resolution. Otherwise, this should +* fail. +* +*/ + +if (var_info.vmode &FB_VMODE_YWRAP ) { + pan_var.vmode |=FB_VMODE_YWRAP ; + expected_ret =0 ; + }else { + expected_ret =-1 ; + } + +/* jump beyond maximum vertical extend */ + pan_var.xoffset =XOFFSET (0 ); + pan_var.yoffset =YOFFSET (var_info.yres_virtual - var_info.yres +PANSTEP (fix_info.ypanstep)); +pan_test (fd, &pan_var, expected_ret); +/* jump beyond vertical virtual resolution */ + pan_var.xoffset =XOFFSET (0 ); + pan_var.yoffset =YOFFSET (var_info.yres_virtual); +pan_test (fd, &pan_var, expected_ret); + + pan_var.vmode &= ~FB_VMODE_YWRAP ; + } + + igt_fixture { +/* restore original panning offsets */ +ioctl (fd,FBIOPAN_DISPLAY , &var_info); + } }static void framebuffer_tests (int fd)
Signature · 1 line
2.33.0
Patchwork
CI[igt-dev] ✗ Fi.CI.BAT: failure for tests/fbdev: Additional tests for resolution and panning (rev3)
In reply to Thomas Zimmermann== Series Details ==
== Series Details ==
Series: tests/fbdev: Additional tests for resolution and panning (rev3)
URL : https://patchwork.freedesktop.org/series/95676/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_10768 -> IGTPW_6341
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_6341 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_6341, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_6341:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@hangcheck:
- fi-bsw-kefka: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10768/fi-bsw-kefka/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-bsw-kefka/igt@i915_selftest@[email protected]
Known issues
------------
Here are the changes found in IGTPW_6341 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_huc_copy@huc-copy:
- fi-glk-dsi: NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#2190])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-glk-dsi/igt@[email protected]
* igt@kms_chamelium@dp-crc-fast:
- fi-bsw-nick: NOTRUN -> [SKIP][4] ([fdo#109271] / [fdo#111827]) +8 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-bsw-nick/igt@[email protected]
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-glk-dsi: NOTRUN -> [SKIP][5] ([fdo#109271] / [fdo#111827]) +8 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-glk-dsi/igt@[email protected]
* igt@kms_flip@basic-plain-flip@c-dp1:
- fi-cfl-8109u: [PASS][6] -> [FAIL][7] ([i915#4165])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10768/fi-cfl-8109u/igt@kms_flip@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-cfl-8109u/igt@kms_flip@[email protected]
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-b:
- fi-cfl-8109u: [PASS][8] -> [DMESG-WARN][9] ([i915#295]) +14 similar issues
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10768/fi-cfl-8109u/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-cfl-8109u/igt@[email protected]
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
- fi-glk-dsi: NOTRUN -> [SKIP][10] ([fdo#109271] / [i915#533])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-glk-dsi/igt@[email protected]
* igt@kms_psr@primary_page_flip:
- fi-glk-dsi: NOTRUN -> [SKIP][11] ([fdo#109271]) +30 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-glk-dsi/igt@kms_psr@primary_page_flip.html
* igt@prime_vgem@basic-fence-flip:
- fi-bsw-nick: NOTRUN -> [SKIP][12] ([fdo#109271]) +63 similar issues
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-bsw-nick/igt@[email protected]
* igt@runner@aborted:
- fi-bsw-kefka: NOTRUN -> [FAIL][13] ([fdo#109271] / [i915#1436] / [i915#3428] / [i915#4312])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-bsw-kefka/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s3:
- fi-tgl-1115g4: [FAIL][14] ([i915#1888]) -> [PASS][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10768/fi-tgl-1115g4/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-tgl-1115g4/igt@[email protected]
* igt@i915_selftest@live@hangcheck:
- {fi-hsw-gt1}: [DMESG-WARN][16] ([i915#3303]) -> [PASS][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10768/fi-hsw-gt1/igt@i915_selftest@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-hsw-gt1/igt@i915_selftest@[email protected]
* igt@kms_frontbuffer_tracking@basic:
- fi-cml-u2: [DMESG-WARN][18] ([i915#4269]) -> [PASS][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10768/fi-cml-u2/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/fi-cml-u2/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#295]: https://gitlab.freedesktop.org/drm/intel/issues/295
[i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
[i915#3428]: https://gitlab.freedesktop.org/drm/intel/issues/3428
[i915#4165]: https://gitlab.freedesktop.org/drm/intel/issues/4165
[i915#4269]: https://gitlab.freedesktop.org/drm/intel/issues/4269
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
Participating hosts (41 -> 37)
------------------------------
Additional (2): fi-glk-dsi fi-bsw-nick
Missing (6): bat-dg1-6 fi-hsw-4200u bat-dg1-5 fi-bsw-cyan bat-adlp-4 fi-ctg-p8600
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_6258 -> IGTPW_6341
CI-20190529: 20190529
CI_DRM_10768: 0e1c99720e0793390c9758dc1b4eedd7395b1382 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_6341: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/index.html
IGT_6258: 4c80c71d7dec29b6376846ae96bd04dc0b6e34d9 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
== Testlist changes ==
+igt@fbdev@pan
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6341/index.html