From: Mika Kahola <mika.kahola@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Cc: Vidya Srinivas <vidya.srinivas@intel.com>
Subject: Re: [PATCH i-g-t] tests/kms_plane_scaling: test scaling with tiling rotation and pixel formats, v3.
Date: Tue, 16 Jan 2018 16:22:43 +0200 [thread overview]
Message-ID: <1516112563.12453.125.camel@intel.com> (raw)
In-Reply-To: <20180116140006.69038-1-maarten.lankhorst@linux.intel.com>
On Tue, 2018-01-16 at 15:00 +0100, Maarten Lankhorst wrote:
> From: Jyoti Yadav <jyoti.r.yadav@intel.com>
>
> This patch adds subtest for testing scaling in combination with
> rotation
> and pixel formats.
>
> Changes since v1:
> - Rework test to work with the other changes to kms_plane_scaling.
> (Maarten)
> - Remove hardcodes for MIN/MAX_SRC_WIDTH, and use the value directly.
> (Maarten)
> Changes since v2:
> - Put rotation and tiling in an array. (Maarten)
>
> Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com>
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> tests/kms_plane_scaling.c | 130
> +++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 129 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
> index a361a00face4..b5d31bbeb0f4 100644
> --- a/tests/kms_plane_scaling.c
> +++ b/tests/kms_plane_scaling.c
> @@ -60,6 +60,7 @@ static void cleanup_crtc(data_t *data)
> {
> int i;
>
> + igt_display_reset(&data->display);
> igt_pipe_crc_free(data->pipe_crc);
> data->pipe_crc = NULL;
>
> @@ -79,7 +80,6 @@ static void prepare_crtc(data_t *data, igt_output_t
> *output, enum pipe pipe,
>
> cleanup_crtc(data);
>
> - igt_display_reset(display);
> igt_output_set_pipe(output, pipe);
>
> /* create the pipe_crc object for this pipe */
> @@ -112,6 +112,125 @@ static void prepare_crtc(data_t *data,
> igt_output_t *output, enum pipe pipe,
> igt_display_commit2(display, COMMIT_ATOMIC);
> }
>
> +static void paint_fb(data_t *d, struct igt_fb *fb)
> +{
> + cairo_t *cr;
> +
> + cr = igt_get_cairo_ctx(d->drm_fd, fb);
> + igt_paint_color(cr, 0, 0, fb->width, fb->height, 0.0, 1.0,
> 0.0);
> + igt_assert(cairo_status(cr) == 0);
> + cairo_destroy(cr);
> +}
> +
> +static void check_scaling_pipe_plane_rot(data_t *d, igt_plane_t
> *plane,
> + uint32_t pixel_format,
> + uint64_t tiling, enum pipe
> pipe,
> + igt_output_t *output,
> + igt_rotation_t rot)
> +{
> + igt_display_t *display = &d->display;
> + int width, height;
> + drmModeModeInfo *mode;
> +
> + cleanup_crtc(d);
> +
> + igt_output_set_pipe(output, pipe);
> + mode = igt_output_get_mode(output);
> +
> + /* create buffer in the range of min and max source side
> limit.*/
> + width = height = 9;
> + igt_create_fb(display->drm_fd, width, height,
> + pixel_format, tiling, &d->fb[0]);
> + paint_fb(d, &d->fb[0]);
> + igt_plane_set_fb(plane, &d->fb[0]);
> +
> + /* Check min to full resolution upscaling */
> + igt_fb_set_position(&d->fb[0], plane, 0, 0);
> + igt_fb_set_size(&d->fb[0], plane, width, height);
> + igt_plane_set_position(plane, 0, 0);
> + igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
> + igt_plane_set_rotation(plane, rot);
> + igt_display_commit2(display, COMMIT_ATOMIC);
> +
> + igt_plane_set_fb(plane, NULL);
> + igt_plane_set_position(plane, 0, 0);
> +}
> +
> +static const igt_rotation_t rotations[] = {
> + IGT_ROTATION_0,
> + IGT_ROTATION_90,
> + IGT_ROTATION_180,
> + IGT_ROTATION_270,
> +};
It's better this way so that we don't have to keep in sync
MAX_ROTATIONS and the actual rotation options.
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
> +
> +static void test_scaler_with_rotation_pipe(data_t *d, enum pipe
> pipe,
> + igt_output_t *output)
> +{
> + igt_display_t *display = &d->display;
> + igt_plane_t *plane;
> +
> + igt_output_set_pipe(output, pipe);
> + for_each_plane_on_pipe(display, pipe, plane) {
> + if (plane->type == DRM_PLANE_TYPE_CURSOR)
> + continue;
> +
> + for (int i = 0; i < ARRAY_SIZE(rotations); i++) {
> + igt_rotation_t rot = rotations[i];
> +
> + check_scaling_pipe_plane_rot(d, plane,
> DRM_FORMAT_XRGB8888,
> + LOCAL_I915_FORM
> AT_MOD_Y_TILED,
> + pipe, output,
> rot);
> + }
> + }
> +}
> +
> +static bool can_draw(uint32_t drm_format)
> +{
> + const uint32_t *drm_formats;
> + int format_count, i;
> +
> + igt_get_all_cairo_formats(&drm_formats, &format_count);
> +
> + for (i = 0; i < format_count; i++)
> + if (drm_formats[i] == drm_format)
> + return true;
> +
> + return false;
> +}
> +
> +static const uint64_t tilings[] = {
> + LOCAL_DRM_FORMAT_MOD_NONE,
> + LOCAL_I915_FORMAT_MOD_X_TILED,
> + LOCAL_I915_FORMAT_MOD_Y_TILED,
> + LOCAL_I915_FORMAT_MOD_Yf_TILED
> +};
> +
> +static void test_scaler_with_pixel_format_pipe(data_t *d, enum pipe
> pipe, igt_output_t *output)
> +{
> + igt_display_t *display = &d->display;
> + igt_plane_t *plane;
> +
> + igt_output_set_pipe(output, pipe);
> +
> + for_each_plane_on_pipe(display, pipe, plane) {
> + if (plane->type == DRM_PLANE_TYPE_CURSOR)
> + continue;
> +
> + for (int i = 0; i < ARRAY_SIZE(tilings); i++) {
> + uint64_t tiling = tilings[i];
> +
> + for (int j = 0; j < plane->drm_plane-
> >count_formats; j++) {
> + uint32_t format = plane->drm_plane-
> >formats[j];
> +
> + if (can_draw(format))
> + check_scaling_pipe_plane_rot
> (d, plane,
> +
> format, tiling,
> +
> pipe, output, IGT_ROTATION_0);
> + }
> + }
> + }
> +}
> +
> /* does iterative scaling on plane2 */
> static void iterate_plane_scaling(data_t *d, drmModeModeInfo *mode)
> {
> @@ -295,6 +414,15 @@ igt_main
> igt_subtest_f("pipe-%s-plane-scaling",
> kmstest_pipe_name(pipe))
> for_each_valid_output_on_pipe(&data.display,
> pipe, output)
> test_plane_scaling_on_pipe(&data,
> pipe, output);
> +
> + igt_subtest_f("pipe-%s-scaler-with-pixel-format",
> kmstest_pipe_name(pipe))
> + for_each_valid_output_on_pipe(&data.display,
> pipe, output)
> + test_scaler_with_pixel_format_pipe(&
> data, pipe, output);
> +
> + igt_subtest_f("pipe-%s-scaler-with-rotation",
> kmstest_pipe_name(pipe))
> + for_each_valid_output_on_pipe(&data.display,
> pipe, output)
> + test_scaler_with_rotation_pipe(&data
> , pipe, output);
> +
> }
>
> igt_fixture
--
Mika Kahola - Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-01-16 14:19 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-15 14:28 [PATCH i-g-t v3 0/8] kms_plane_scaling tests Maarten Lankhorst
2018-01-15 14:28 ` [PATCH i-g-t v3 1/8] tests/kms_plane_scaling: Move the actual test to its own function Maarten Lankhorst
2018-01-15 14:28 ` [PATCH i-g-t v3 2/8] tests/kms_plane_scaling: Fix basic scaling test, v3 Maarten Lankhorst
2018-01-15 14:28 ` [PATCH i-g-t v3 3/8] tests/kms_plane_scaling: Convert from simple test to full test Maarten Lankhorst
2018-01-15 14:28 ` [PATCH i-g-t v3 4/8] tests/kms_plane_scaling: Move get_num_scalers to a function Maarten Lankhorst
2018-01-16 8:22 ` Mika Kahola
2018-01-16 10:03 ` [PATCH i-g-t] tests/kms_plane_scaling: Move get_num_scalers to a function, v2 Maarten Lankhorst
2018-01-16 11:55 ` Mika Kahola
2018-01-15 14:28 ` [PATCH i-g-t v3 5/8] tests/kms_plane_scaling: Clean up tests to work better with igt_kms, v2 Maarten Lankhorst
2018-01-16 9:32 ` Mika Kahola
2018-01-15 14:28 ` [PATCH i-g-t v3 6/8] tests/kms_plane_scaling: test scaling with tiling rotation and pixel formats, v2 Maarten Lankhorst
2018-01-16 12:43 ` Mika Kahola
2018-01-16 14:00 ` [PATCH i-g-t] tests/kms_plane_scaling: test scaling with tiling rotation and pixel formats, v3 Maarten Lankhorst
2018-01-16 14:22 ` Mika Kahola [this message]
2018-01-15 14:28 ` [PATCH i-g-t v3 7/8] tests/kms_plane_scaling: test scaler with clipping clamping, v3 Maarten Lankhorst
2018-01-16 11:14 ` Mika Kahola
2018-01-15 14:28 ` [PATCH i-g-t v3 8/8] tests/kms_plane_scaling: test for multi pipe with scaling, v3 Maarten Lankhorst
2018-01-16 13:46 ` Mika Kahola
2018-01-16 13:47 ` Maarten Lankhorst
2018-01-16 13:56 ` Mika Kahola
2018-01-17 9:23 ` Maarten Lankhorst
2018-01-15 16:05 ` ✓ Fi.CI.BAT: success for kms_plane_scaling tests Patchwork
2018-01-15 19:25 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-01-16 9:14 ` ✓ Fi.CI.BAT: success " Patchwork
2018-01-16 10:24 ` ✓ Fi.CI.BAT: success for kms_plane_scaling tests. (rev2) Patchwork
2018-01-16 11:14 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-01-16 14:59 ` ✓ Fi.CI.BAT: success for kms_plane_scaling tests. (rev3) Patchwork
2018-01-16 16:43 ` ✗ Fi.CI.IGT: warning " Patchwork
2018-01-17 10:05 ` [Intel-gfx] [PATCH i-g-t v3 0/8] kms_plane_scaling tests Daniel Vetter
2018-01-17 10:05 ` Daniel Vetter
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=1516112563.12453.125.camel@intel.com \
--to=mika.kahola@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=vidya.srinivas@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.