From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH 2/2] tests/fbdev: Add tests for display panning
Date: Mon, 11 Oct 2021 17:24:06 +0300 [thread overview]
Message-ID: <YWRJBvGbsrcSIbXh@intel.com> (raw)
In-Reply-To: <20211011140719.11733-3-tzimmermann@suse.de>
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
next prev parent reply other threads:[~2021-10-11 14:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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ä [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YWRJBvGbsrcSIbXh@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox