* [igt-dev] [PATCH 0/2] tests/fbdev: Additional tests for resolution and panning
@ 2021-10-11 14:07 Thomas Zimmermann
2021-10-11 14:07 ` [igt-dev] [PATCH 1/2] tests/fbdev: Test for validity of video mode settings Thomas Zimmermann
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Thomas Zimmermann @ 2021-10-11 14:07 UTC (permalink / raw)
To: igt-dev; +Cc: Thomas Zimmermann
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 pageflipping. 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.
[1] https://lore.kernel.org/dri-devel/20211005070355.7680-1-tzimmermann@suse.de/
Thomas Zimmermann (2):
tests/fbdev: Test for validity of video mode settings
tests/fbdev: Add tests for display panning
tests/fbdev.c | 135 +++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 127 insertions(+), 8 deletions(-)
--
2.33.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [igt-dev] [PATCH 1/2] tests/fbdev: Test for validity of video mode settings
2021-10-11 14:07 [igt-dev] [PATCH 0/2] tests/fbdev: Additional tests for resolution and panning Thomas Zimmermann
@ 2021-10-11 14:07 ` Thomas Zimmermann
2021-10-11 14:20 ` Ville Syrjälä
2021-10-11 14:07 ` [igt-dev] [PATCH 2/2] tests/fbdev: Add tests for display panning Thomas Zimmermann
2021-10-11 14:43 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/fbdev: Additional tests for resolution and panning Patchwork
2 siblings, 1 reply; 8+ messages in thread
From: Thomas Zimmermann @ 2021-10-11 14:07 UTC (permalink / raw)
To: igt-dev; +Cc: Thomas Zimmermann
Add basic tests for video mode resolution and color on fbdev
devices.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
tests/fbdev.c | 43 +++++++++++++++++++++++++++++++++++--------
1 file changed, 35 insertions(+), 8 deletions(-)
diff --git a/tests/fbdev.c b/tests/fbdev.c
index 443a43dc..c9903f8b 100644
--- a/tests/fbdev.c
+++ b/tests/fbdev.c
@@ -50,14 +50,41 @@ 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 nlines;
+
+ /* video memory configuration */
+ igt_assert_f(fix_info.line_length, "line pitch 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);
+
+ /* 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.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 pitch %u exceeds available video memory\n",
+ var_info.yres_virtual, fix_info.line_length);
}
}
--
2.33.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [igt-dev] [PATCH 2/2] tests/fbdev: Add tests for display panning
2021-10-11 14:07 [igt-dev] [PATCH 0/2] tests/fbdev: Additional tests for resolution and panning Thomas Zimmermann
2021-10-11 14:07 ` [igt-dev] [PATCH 1/2] tests/fbdev: Test for validity of video mode settings Thomas Zimmermann
@ 2021-10-11 14:07 ` Thomas Zimmermann
2021-10-11 14:24 ` Ville Syrjälä
2021-10-11 14:43 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/fbdev: Additional tests for resolution and panning Patchwork
2 siblings, 1 reply; 8+ messages in thread
From: Thomas Zimmermann @ 2021-10-11 14:07 UTC (permalink / raw)
To: igt-dev; +Cc: Thomas Zimmermann
Add 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.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
tests/fbdev.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/tests/fbdev.c b/tests/fbdev.c
index c9903f8b..17727cd0 100644
--- a/tests/fbdev.c
+++ b/tests/fbdev.c
@@ -86,6 +86,98 @@ static void mode_tests(int fd)
"vertical virtual resolution (%u) with pitch %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, new_var;
+ int ret;
+
+ /* jump to opposite end of virtual screen */
+ pan_var.xoffset = var_info.xres_virtual - var_info.xres - var_info.xoffset;
+ pan_var.yoffset = var_info.yres_virtual - var_info.yres - var_info.yoffset;
+ ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
+ igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
+ ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
+ igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) 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);
+
+ /* jump to (0, 0) */
+ pan_var.xoffset = 0;
+ pan_var.yoffset = 0;
+ ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
+ igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
+ ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
+ igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) 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);
+
+ /* jump to maximum extend */
+ pan_var.xoffset = var_info.xres_virtual - var_info.xres;
+ pan_var.yoffset = var_info.yres_virtual - var_info.yres;
+ ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
+ igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
+ ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
+ igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) 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);
+
+ /* return to original offsets for next tests */
+ ret = ioctl(fd, FBIOPAN_DISPLAY, &var_info);
+ igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
+
+ /* jump beyond maximum horizontal extend */
+ pan_var.xoffset = var_info.xres_virtual - var_info.xres + 1;
+ pan_var.yoffset = 0;
+ ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
+ igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
+ ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
+ igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
+ igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
+
+ /* jump beyond maximum vertical extend */
+ pan_var.xoffset = 0;
+ pan_var.yoffset = var_info.yres_virtual - var_info.yres + 1;
+ ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
+ igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY), ret=%d\n", ret);
+ ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
+ igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
+ igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
+
+ /* jump beyond horizontal virtual resolution */
+ pan_var.xoffset = var_info.xres_virtual;
+ pan_var.yoffset = 0;
+ ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
+ igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY), ret=%d\n", ret);
+ ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
+ igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
+ igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
+
+ /* jump beyond vertical virtual resolution */
+ pan_var.xoffset = 0;
+ pan_var.yoffset = var_info.yres_virtual;
+ ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
+ igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
+ ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
+ igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
+ igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
+ }
+
+ igt_fixture {
+ /* restore original panning offsets */
+ ioctl(fd, FBIOPAN_DISPLAY, &var_info);
+ }
}
static void framebuffer_tests(int fd)
--
2.33.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH 1/2] tests/fbdev: Test for validity of video mode settings
2021-10-11 14:07 ` [igt-dev] [PATCH 1/2] tests/fbdev: Test for validity of video mode settings Thomas Zimmermann
@ 2021-10-11 14:20 ` Ville Syrjälä
2021-10-12 14:23 ` Thomas Zimmermann
0 siblings, 1 reply; 8+ messages in thread
From: Ville Syrjälä @ 2021-10-11 14:20 UTC (permalink / raw)
To: Thomas Zimmermann; +Cc: igt-dev
On Mon, Oct 11, 2021 at 04:07:18PM +0200, Thomas Zimmermann wrote:
> Add basic tests for video mode resolution and color on fbdev
> devices.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> tests/fbdev.c | 43 +++++++++++++++++++++++++++++++++++--------
> 1 file changed, 35 insertions(+), 8 deletions(-)
>
> diff --git a/tests/fbdev.c b/tests/fbdev.c
> index 443a43dc..c9903f8b 100644
> --- a/tests/fbdev.c
> +++ b/tests/fbdev.c
> @@ -50,14 +50,41 @@ 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 nlines;
> +
> + /* video memory configuration */
> + igt_assert_f(fix_info.line_length, "line pitch 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);
> +
> + /* 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.yoffset <= (var_info.yres_virtual - var_info.yres),
> + "screen vertical offset (%u) overflow\n",
> + var_info.yoffset);
YWRAP does allow for that IIRC. So maybe should check that, or maybe we
don't care about drivers that support it?
> + nlines = fix_info.smem_len / fix_info.line_length;
> + igt_assert_f(var_info.yres_virtual <= nlines,
> + "vertical virtual resolution (%u) with pitch %u exceeds available video memory\n",
> + var_info.yres_virtual, fix_info.line_length);
Maybe add the counterpart for the horizontal direction?
> }
> }
>
> --
> 2.33.0
--
Ville Syrjälä
Intel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH 2/2] tests/fbdev: Add tests for display panning
2021-10-11 14:07 ` [igt-dev] [PATCH 2/2] tests/fbdev: Add tests for display panning Thomas Zimmermann
@ 2021-10-11 14:24 ` Ville Syrjälä
2021-10-12 14:26 ` Thomas Zimmermann
0 siblings, 1 reply; 8+ messages in thread
From: Ville Syrjälä @ 2021-10-11 14:24 UTC (permalink / raw)
To: Thomas Zimmermann; +Cc: igt-dev
On Mon, Oct 11, 2021 at 04:07:19PM +0200, Thomas Zimmermann wrote:
> Add 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.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> tests/fbdev.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 92 insertions(+)
>
> diff --git a/tests/fbdev.c b/tests/fbdev.c
> index c9903f8b..17727cd0 100644
> --- a/tests/fbdev.c
> +++ b/tests/fbdev.c
> @@ -86,6 +86,98 @@ static void mode_tests(int fd)
> "vertical virtual resolution (%u) with pitch %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, new_var;
> + int ret;
> +
> + /* jump to opposite end of virtual screen */
> + pan_var.xoffset = var_info.xres_virtual - var_info.xres - var_info.xoffset;
> + pan_var.yoffset = var_info.yres_virtual - var_info.yres - var_info.yoffset;
Should look at {x,y}panstep probably before assuming this stuff will do exactly
what you ask it.
> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) 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);
> +
> + /* jump to (0, 0) */
> + pan_var.xoffset = 0;
> + pan_var.yoffset = 0;
> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) 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);
> +
> + /* jump to maximum extend */
> + pan_var.xoffset = var_info.xres_virtual - var_info.xres;
> + pan_var.yoffset = var_info.yres_virtual - var_info.yres;
> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) 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);
> +
> + /* return to original offsets for next tests */
> + ret = ioctl(fd, FBIOPAN_DISPLAY, &var_info);
> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
> +
> + /* jump beyond maximum horizontal extend */
> + pan_var.xoffset = var_info.xres_virtual - var_info.xres + 1;
> + pan_var.yoffset = 0;
> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
> + igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
> + igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
> +
> + /* jump beyond maximum vertical extend */
> + pan_var.xoffset = 0;
> + pan_var.yoffset = var_info.yres_virtual - var_info.yres + 1;
> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
> + igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY), ret=%d\n", ret);
> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
> + igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
> +
> + /* jump beyond horizontal virtual resolution */
> + pan_var.xoffset = var_info.xres_virtual;
> + pan_var.yoffset = 0;
> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
> + igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY), ret=%d\n", ret);
> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
> + igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
> +
> + /* jump beyond vertical virtual resolution */
> + pan_var.xoffset = 0;
> + pan_var.yoffset = var_info.yres_virtual;
> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
> + igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
Another YWRAP issue here.
> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
> + igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
> + }
> +
> + igt_fixture {
> + /* restore original panning offsets */
> + ioctl(fd, FBIOPAN_DISPLAY, &var_info);
> + }
> }
>
> static void framebuffer_tests(int fd)
> --
> 2.33.0
--
Ville Syrjälä
Intel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for tests/fbdev: Additional tests for resolution and panning
2021-10-11 14:07 [igt-dev] [PATCH 0/2] tests/fbdev: Additional tests for resolution and panning Thomas Zimmermann
2021-10-11 14:07 ` [igt-dev] [PATCH 1/2] tests/fbdev: Test for validity of video mode settings Thomas Zimmermann
2021-10-11 14:07 ` [igt-dev] [PATCH 2/2] tests/fbdev: Add tests for display panning Thomas Zimmermann
@ 2021-10-11 14:43 ` Patchwork
2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2021-10-11 14:43 UTC (permalink / raw)
To: Thomas Zimmermann; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 2780 bytes --]
== Series Details ==
Series: tests/fbdev: Additional tests for resolution and panning
URL : https://patchwork.freedesktop.org/series/95676/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_10715 -> IGTPW_6307
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6307/index.html
Known issues
------------
Here are the changes found in IGTPW_6307 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_cs_nop@sync-fork-compute0:
- fi-snb-2600: NOTRUN -> [SKIP][1] ([fdo#109271]) +17 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6307/fi-snb-2600/igt@amdgpu/amd_cs_nop@sync-fork-compute0.html
* igt@gem_exec_suspend@basic-s3:
- fi-tgl-1115g4: [PASS][2] -> [FAIL][3] ([i915#1888])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10715/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s3.html
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6307/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s3.html
* igt@kms_frontbuffer_tracking@basic:
- fi-cml-u2: [PASS][4] -> [DMESG-WARN][5] ([i915#4269])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10715/fi-cml-u2/igt@kms_frontbuffer_tracking@basic.html
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6307/fi-cml-u2/igt@kms_frontbuffer_tracking@basic.html
#### Possible fixes ####
* igt@i915_selftest@live@hangcheck:
- fi-snb-2600: [INCOMPLETE][6] ([i915#3921]) -> [PASS][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10715/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6307/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#3921]: https://gitlab.freedesktop.org/drm/intel/issues/3921
[i915#4269]: https://gitlab.freedesktop.org/drm/intel/issues/4269
Participating hosts (40 -> 35)
------------------------------
Missing (5): fi-kbl-soraka fi-tgl-dsi fi-bsw-cyan fi-kbl-guc fi-ctg-p8600
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_6242 -> IGTPW_6307
CI-20190529: 20190529
CI_DRM_10715: 74b6fd5b34d5fbe3672e864d279654d079e88073 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_6307: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6307/index.html
IGT_6242: 721fd85ee95225ed5df322f7182bdfa9b86a3e68 @ 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_6307/index.html
[-- Attachment #2: Type: text/html, Size: 3465 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH 1/2] tests/fbdev: Test for validity of video mode settings
2021-10-11 14:20 ` Ville Syrjälä
@ 2021-10-12 14:23 ` Thomas Zimmermann
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Zimmermann @ 2021-10-12 14:23 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: igt-dev
[-- Attachment #1.1: Type: text/plain, Size: 3693 bytes --]
Hi
Am 11.10.21 um 16:20 schrieb Ville Syrjälä:
> On Mon, Oct 11, 2021 at 04:07:18PM +0200, Thomas Zimmermann wrote:
>> Add basic tests for video mode resolution and color on fbdev
>> devices.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>> tests/fbdev.c | 43 +++++++++++++++++++++++++++++++++++--------
>> 1 file changed, 35 insertions(+), 8 deletions(-)
>>
>> diff --git a/tests/fbdev.c b/tests/fbdev.c
>> index 443a43dc..c9903f8b 100644
>> --- a/tests/fbdev.c
>> +++ b/tests/fbdev.c
>> @@ -50,14 +50,41 @@ 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 nlines;
>> +
>> + /* video memory configuration */
>> + igt_assert_f(fix_info.line_length, "line pitch 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);
>> +
>> + /* 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.yoffset <= (var_info.yres_virtual - var_info.yres),
>> + "screen vertical offset (%u) overflow\n",
>> + var_info.yoffset);
>
> YWRAP does allow for that IIRC. So maybe should check that, or maybe we
> don't care about drivers that support it?
Some fbdev drivers and omap_drm seem to support it. I'll add a test for it.
>
>> + nlines = fix_info.smem_len / fix_info.line_length;
>> + igt_assert_f(var_info.yres_virtual <= nlines,
>> + "vertical virtual resolution (%u) with pitch %u exceeds available video memory\n",
>> + var_info.yres_virtual, fix_info.line_length);
>
> Maybe add the counterpart for the horizontal direction?
I thought about this, but found that maybe some awkward color format
might not have a clear relation between resolution and linelength. But
I'll add a test to check against the bit per line. Hopefully this will work.
Best regards
Thomas
>
>> }
>> }
>>
>> --
>> 2.33.0
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [igt-dev] [PATCH 2/2] tests/fbdev: Add tests for display panning
2021-10-11 14:24 ` Ville Syrjälä
@ 2021-10-12 14:26 ` Thomas Zimmermann
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Zimmermann @ 2021-10-12 14:26 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: igt-dev
[-- Attachment #1.1: Type: text/plain, Size: 6474 bytes --]
Hi
Am 11.10.21 um 16:24 schrieb Ville Syrjälä:
> On Mon, Oct 11, 2021 at 04:07:19PM +0200, Thomas Zimmermann wrote:
>> Add 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.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>> tests/fbdev.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 92 insertions(+)
>>
>> diff --git a/tests/fbdev.c b/tests/fbdev.c
>> index c9903f8b..17727cd0 100644
>> --- a/tests/fbdev.c
>> +++ b/tests/fbdev.c
>> @@ -86,6 +86,98 @@ static void mode_tests(int fd)
>> "vertical virtual resolution (%u) with pitch %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, new_var;
>> + int ret;
>> +
>> + /* jump to opposite end of virtual screen */
>> + pan_var.xoffset = var_info.xres_virtual - var_info.xres - var_info.xoffset;
>> + pan_var.yoffset = var_info.yres_virtual - var_info.yres - var_info.yoffset;
>
> Should look at {x,y}panstep probably before assuming this stuff will do exactly
> what you ask it.
Good point. Aligning the offsets should do the job.
>
>> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
>> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
>> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
>> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) 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);
>> +
>> + /* jump to (0, 0) */
>> + pan_var.xoffset = 0;
>> + pan_var.yoffset = 0;
>> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
>> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
>> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
>> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) 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);
>> +
>> + /* jump to maximum extend */
>> + pan_var.xoffset = var_info.xres_virtual - var_info.xres;
>> + pan_var.yoffset = var_info.yres_virtual - var_info.yres;
>> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
>> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
>> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
>> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) 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);
>> +
>> + /* return to original offsets for next tests */
>> + ret = ioctl(fd, FBIOPAN_DISPLAY, &var_info);
>> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
>> +
>> + /* jump beyond maximum horizontal extend */
>> + pan_var.xoffset = var_info.xres_virtual - var_info.xres + 1;
>> + pan_var.yoffset = 0;
>> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
>> + igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
>> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
>> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
>> + igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
>> +
>> + /* jump beyond maximum vertical extend */
>> + pan_var.xoffset = 0;
>> + pan_var.yoffset = var_info.yres_virtual - var_info.yres + 1;
>> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
>> + igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY), ret=%d\n", ret);
>> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
>> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
>> + igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
>> +
>> + /* jump beyond horizontal virtual resolution */
>> + pan_var.xoffset = var_info.xres_virtual;
>> + pan_var.yoffset = 0;
>> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
>> + igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY), ret=%d\n", ret);
>> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
>> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
>> + igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
>> +
>> + /* jump beyond vertical virtual resolution */
>> + pan_var.xoffset = 0;
>> + pan_var.yoffset = var_info.yres_virtual;
>> + ret = ioctl(fd, FBIOPAN_DISPLAY, &pan_var);
>> + igt_assert_f(ret == -1, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
>
> Another YWRAP issue here.
Really? It's a flag in var.vmode. I'd expect that we can leave it out
for the tests to disable the wrap-around.
Best regards
Thomas
>
>> + ret = ioctl(fd, FBIOGET_VSCREENINFO, &new_var);
>> + igt_assert_f(ret == 0, "ioctl(FBIOPAN_DISPLAY) failed, ret=%d\n", ret);
>> + igt_assert_f(var_info.xoffset == new_var.xoffset && var_info.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);
>> + }
>> +
>> + igt_fixture {
>> + /* restore original panning offsets */
>> + ioctl(fd, FBIOPAN_DISPLAY, &var_info);
>> + }
>> }
>>
>> static void framebuffer_tests(int fd)
>> --
>> 2.33.0
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-10-12 14:26 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-11 14:07 [igt-dev] [PATCH 0/2] tests/fbdev: Additional tests for resolution and panning Thomas Zimmermann
2021-10-11 14:07 ` [igt-dev] [PATCH 1/2] tests/fbdev: Test for validity of video mode settings Thomas Zimmermann
2021-10-11 14:20 ` Ville Syrjälä
2021-10-12 14:23 ` Thomas Zimmermann
2021-10-11 14:07 ` [igt-dev] [PATCH 2/2] tests/fbdev: Add tests for display panning Thomas Zimmermann
2021-10-11 14:24 ` Ville Syrjälä
2021-10-12 14:26 ` Thomas Zimmermann
2021-10-11 14:43 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/fbdev: Additional tests for resolution and panning Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox