From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_plane: add source clamping test
Date: Thu, 22 Nov 2018 19:51:54 +0100 [thread overview]
Message-ID: <20b0bec6-0a21-ddea-0360-77e7df0f82ed@linux.intel.com> (raw)
In-Reply-To: <1542905145-29310-1-git-send-email-juhapekka.heikkila@gmail.com>
Op 22-11-18 om 17:45 schreef Juha-Pekka Heikkila:
> Add test which create fb bigger than plane and clamp fb
> from all sides.
>
> v2 (Maarten Lankhorst): Fix typo, create different color
> border around clamped fb where during test border should
> stay outside visible area.
>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> ---
> tests/kms_plane.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
> 1 file changed, 54 insertions(+), 3 deletions(-)
>
> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> index 45e0a30..b26fda6 100644
> --- a/tests/kms_plane.c
> +++ b/tests/kms_plane.c
> @@ -41,6 +41,7 @@ typedef struct {
> int drm_fd;
> igt_display_t display;
> igt_pipe_crc_t *pipe_crc;
> + uint32_t crop;
> } data_t;
>
> static color_t red = { 1.0f, 0.0f, 0.0f };
> @@ -412,12 +413,49 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
> const color_t *c = &colors[color];
> struct igt_fb old_fb = *fb;
>
> - igt_create_color_fb(data->drm_fd, width, height,
> - format, LOCAL_DRM_FORMAT_MOD_NONE,
> - c->red, c->green, c->blue, fb);
> + if (data->crop == 0 || format == DRM_FORMAT_XRGB8888) {
> + igt_create_color_fb(data->drm_fd, width, height, format,
> + LOCAL_DRM_FORMAT_MOD_NONE,
> + c->red, c->green, c->blue, fb);
> + } else {
> + /*
> + * paint border in inverted color, then visible area in middle
> + * with correct color for clamping test
> + */
> + cairo_t *cr;
> +
> + igt_create_fb(data->drm_fd, width + data->crop * 2,
> + height + data->crop * 2, format,
> + LOCAL_DRM_FORMAT_MOD_NONE,
> + fb);
> +
> + cr = igt_get_cairo_ctx(data->drm_fd, fb);
> +
> + igt_paint_color(cr, 0, 0,
> + width+data->crop * 2,
> + height+data->crop * 2,
> + 1.0f - c->red,
> + 1.0f - c->green,
> + 1.0f - c->blue);
> +
> + igt_paint_color(cr, data->crop, data->crop,
> + width, height,
> + c->red, c->green, c->blue);
> +
> + igt_put_cairo_ctx(data->drm_fd, fb, cr);
> + }
>
> igt_plane_set_fb(plane, fb);
>
> + /*
> + * if clamping test. DRM_FORMAT_XRGB8888 is used for reference color.
> + */
> + if (data->crop != 0 && format != DRM_FORMAT_XRGB8888) {
> + igt_plane_set_size(plane, width, height);
> + igt_fb_set_position(fb, plane, data->crop, data->crop);
> + igt_fb_set_size(fb, plane, width, height);
> + }
> +
> igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_UNIVERSAL);
> igt_pipe_crc_get_current(data->display.drm_fd, data->pipe_crc, crc);
>
> @@ -435,6 +473,12 @@ static void test_format_plane(data_t *data, enum pipe pipe,
> uint64_t width, height;
> igt_crc_t ref_crc[ARRAY_SIZE(colors)];
>
> + /*
> + * No clamping test for cursor plane
> + */
> + if (data->crop != 0 && plane->type == DRM_PLANE_TYPE_CURSOR)
> + return;
> +
> mode = igt_output_get_mode(output);
> if (plane->type != DRM_PLANE_TYPE_CURSOR) {
> width = mode->hdisplay;
> @@ -554,6 +598,13 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
> kmstest_pipe_name(pipe))
> test_pixel_formats(data, pipe);
>
> + igt_subtest_f("pixel-format-pipe-%s-planes-source-clamping",
> + kmstest_pipe_name(pipe)) {
> + data->crop = 4;
> + test_pixel_formats(data, pipe);
> + }
> +
> + data->crop = 0;
> igt_subtest_f("plane-position-covered-pipe-%s-planes",
> kmstest_pipe_name(pipe))
> test_plane_position(data, pipe, TEST_POSITION_FULLY_COVERED);
Much better. :)
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-11-22 18:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-15 15:51 [igt-dev] [PATCH i-g-t] tests/kms_plane: add source clamping test Juha-Pekka Heikkila
2018-11-15 16:16 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-11-15 19:40 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-11-20 11:30 ` [igt-dev] [PATCH i-g-t] " Maarten Lankhorst
2018-11-21 9:45 ` Juha-Pekka Heikkila
2018-11-22 16:45 ` Juha-Pekka Heikkila
2018-11-22 18:51 ` Maarten Lankhorst [this message]
2018-11-23 11:51 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_plane: add source clamping test (rev2) Patchwork
2018-11-23 12:40 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20b0bec6-0a21-ddea-0360-77e7df0f82ed@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=juhapekka.heikkila@gmail.com \
/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