From: Daniel Vetter <daniel@ffwll.ch>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/4] tests/kms_plane: Remove the upscaling requirement
Date: Fri, 29 Mar 2019 10:41:55 +0100 [thread overview]
Message-ID: <20190329094155.GI2665@phenom.ffwll.local> (raw)
In-Reply-To: <20190328175727.3086-1-ville.syrjala@linux.intel.com>
On Thu, Mar 28, 2019 at 07:57:24PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> No point in requiring upscaling when trying to use a small fb to test
> pixel formats.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> tests/kms_plane.c | 55 ++++++++++++++++++++---------------------------
> 1 file changed, 23 insertions(+), 32 deletions(-)
>
> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> index d8a14ecb3982..143bc5e6f3b8 100644
> --- a/tests/kms_plane.c
> +++ b/tests/kms_plane.c
> @@ -392,40 +392,39 @@ static void set_legacy_lut(data_t *data, enum pipe pipe,
>
> static void test_format_plane_color(data_t *data, enum pipe pipe,
> igt_plane_t *plane,
> - uint32_t format, int src_w, int src_h,
> - int dst_w, int dst_h,
> + uint32_t format, int width, int height,
> int color, igt_crc_t *crc, struct igt_fb *fb)
> {
> const color_t *c = &colors[color];
> struct igt_fb old_fb = *fb;
>
> if (data->crop == 0 || format == DRM_FORMAT_XRGB8888) {
> - igt_create_color_fb(data->drm_fd, src_w, src_h, format,
> - LOCAL_DRM_FORMAT_MOD_NONE,
> + igt_create_color_fb(data->drm_fd, width, height,
> + format, 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
> - */
> + /*
> + * 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, src_w + data->crop * 2,
> - src_h + data->crop * 2, format,
> - LOCAL_DRM_FORMAT_MOD_NONE,
> - fb);
> + igt_create_fb(data->drm_fd,
> + width + data->crop * 2,
> + height + data->crop * 2,
> + format, DRM_FORMAT_MOD_NONE, fb);
>
> cr = igt_get_cairo_ctx(data->drm_fd, fb);
>
> igt_paint_color(cr, 0, 0,
> - src_w+data->crop * 2,
> - src_h+data->crop * 2,
> + 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,
> - src_w, src_h,
> + width, height,
> c->red, c->green, c->blue);
>
> igt_put_cairo_ctx(data->drm_fd, fb, cr);
> @@ -436,11 +435,8 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
> /*
> * if clamping test. DRM_FORMAT_XRGB8888 is used for reference color.
> */
> - if (data->crop != 0 && format != DRM_FORMAT_XRGB8888) {
> + if (data->crop != 0 && format != DRM_FORMAT_XRGB8888)
> igt_fb_set_position(fb, plane, data->crop, data->crop);
> - igt_fb_set_size(fb, plane, src_w, src_h);
> - }
> - igt_plane_set_size(plane, dst_w, dst_h);
>
> 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);
> @@ -456,7 +452,7 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
> struct igt_fb fb = {};
> drmModeModeInfo *mode;
> uint32_t format, ref_format;
> - uint64_t width, height, dst_w, dst_h;
> + uint64_t width, height;
> igt_crc_t ref_crc[ARRAY_SIZE(colors)];
> bool result = true;
>
> @@ -480,8 +476,6 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
> do_or_die(drmGetCap(data->drm_fd, DRM_CAP_CURSOR_HEIGHT, &height));
> ref_format = format = DRM_FORMAT_ARGB8888;
> }
> - dst_w = width;
> - dst_h = height;
>
> igt_debug("Testing connector %s on %s plane %s.%u\n",
> igt_output_name(output), kmstest_plane_type_name(plane->type),
> @@ -506,31 +500,29 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
> kmstest_pipe_name(pipe), plane->index);
>
> if (plane->type != DRM_PLANE_TYPE_CURSOR && data->display.is_atomic) {
> + struct igt_fb test_fb;
> int ret;
>
> igt_create_fb(data->drm_fd, 256, 256, format,
> - LOCAL_DRM_FORMAT_MOD_NONE, &fb);
> + LOCAL_DRM_FORMAT_MOD_NONE, &test_fb);
>
> - igt_plane_set_fb(plane, &fb);
> - /* Upscale to max size */
> - igt_plane_set_size(plane, dst_w, dst_h);
> + igt_plane_set_fb(plane, &test_fb);
>
> ret = igt_display_try_commit_atomic(&data->display, DRM_MODE_ATOMIC_TEST_ONLY, NULL);
>
> if (!ret) {
> - width = fb.width;
> - height = fb.height;
> + width = test_fb.width;
> + height = test_fb.height;
> }
>
> - igt_remove_fb(data->drm_fd, &fb);
> -
> igt_plane_set_fb(plane, NULL);
> +
> + igt_remove_fb(data->drm_fd, &test_fb);
> }
>
> for (int i = 0; i < ARRAY_SIZE(colors); i++) {
> test_format_plane_color(data, pipe, plane,
> format, width, height,
> - dst_w, dst_h,
> i, &ref_crc[i], &fb);
> }
>
> @@ -554,7 +546,6 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
> for (int j = 0; j < ARRAY_SIZE(colors); j++) {
> test_format_plane_color(data, pipe, plane,
> format, width, height,
> - dst_w, dst_h,
> j, &crc, &fb);
>
> if (!igt_check_crc_equal(&crc, &ref_crc[j])) {
> --
> 2.19.2
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
prev parent reply other threads:[~2019-03-29 9:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-28 17:57 [igt-dev] [PATCH i-g-t 1/4] tests/kms_plane: Remove the upscaling requirement Ville Syrjala
2019-03-28 17:57 ` [igt-dev] [PATCH i-g-t 2/4] tests/kms_plane: Reduce the plane size 64x64 Ville Syrjala
2019-03-29 9:42 ` Daniel Vetter
2019-03-28 17:57 ` [igt-dev] [PATCH i-g-t 3/4] tests/kms_plane: Eliminate modeset between every plane Ville Syrjala
2019-03-29 9:45 ` Daniel Vetter
2019-03-28 17:57 ` [igt-dev] [PATCH i-g-t 4/4] tests/kms_plane: Test all modifiers as well Ville Syrjala
2019-03-29 9:53 ` Daniel Vetter
2019-03-29 11:11 ` Ville Syrjälä
2019-03-28 18:36 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/kms_plane: Remove the upscaling requirement Patchwork
2019-03-29 4:25 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-03-29 9:41 ` Daniel Vetter [this message]
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=20190329094155.GI2665@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=igt-dev@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.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 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.