All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Swati Sharma <swati2.sharma@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [v4 5/9] tests/kms_plane_scaling: Upscaling on 2 planes
Date: Tue, 15 Feb 2022 22:43:37 +0200	[thread overview]
Message-ID: <YgwQeeXoIXP50G3J@intel.com> (raw)
In-Reply-To: <20220215122344.11168-6-swati2.sharma@intel.com>

On Tue, Feb 15, 2022 at 05:53:40PM +0530, Swati Sharma wrote:
> i915 driver supports 2 scalers per pipe. Added test case
> to upscale 2 overlay planes simultaneously on single pipe.
> 
> v2: -add check for min 2 scalers
>     -add igt_require() for overlay planes, fixes CRASH on KBL
> v3: -test modified for n planes (Ville)
> v4: -modularized the code
>     -removed i915 dependency (Ville)
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>  tests/kms_plane_scaling.c | 85 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 85 insertions(+)
> 
> diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
> index e960a6c5..11bf5af9 100644
> --- a/tests/kms_plane_scaling.c
> +++ b/tests/kms_plane_scaling.c
> @@ -33,6 +33,7 @@ IGT_TEST_DESCRIPTION("Test display plane scaling");
>  enum {
>  	TEST_UPSCALING = 1 << 0,
>  	TEST_DOWNSCALING = 1 << 1,
> +	TEST_UPSCALING_UPSCALING = 1 << 2,
>  };
>  
>  typedef struct {
> @@ -340,6 +341,83 @@ test_plane_scaling(data_t *d, enum pipe pipe, igt_output_t *output, uint32_t fla
>  	}
>  }
>  
> +static void
> +__test_planes_upscaling_upscaling(data_t *d, enum pipe pipe, igt_output_t *output,
> +				  igt_plane_t *overlay1, igt_plane_t *overlay2,
> +				  struct igt_fb *fb1, struct igt_fb *fb2)
> +{
> +	igt_display_t *display = &d->display;
> +	drmModeModeInfo *mode;
> +	int width, height;
> +	int ret;
> +
> +	mode = igt_output_get_mode(output);
> +	width = mode->hdisplay;
> +	height = mode->vdisplay;
> +
> +	igt_plane_set_fb(overlay1, fb1);
> +	igt_plane_set_fb(overlay2, fb2);
> +
> +	/* 1st overlay plane upscaling */
> +	igt_plane_set_size(overlay1, width, height);
> +	/* 2nd overlay plane upscaling */
> +	igt_plane_set_size(overlay2, width - 20, height - 20);
> +	ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +	igt_plane_set_fb(overlay1, NULL);
> +	igt_plane_set_fb(overlay2, NULL);
> +
> +	igt_skip_on_f(ret == -EINVAL, "Scaling op not supported\n");
> +}
> +
> +static void setup_fb(int fd, int width, int height,
> +		     double r, double g, double b,
> +		     struct igt_fb *fb)
> +{
> +	igt_create_color_pattern_fb(fd, width, height,
> +				    DRM_FORMAT_XRGB8888,
> +				    I915_TILING_NONE,
> +				    r, g, b, fb);
> +}
> +
> +static void
> +test_plane_scaling_combo(data_t *d, enum pipe pipe, igt_output_t *output, uint32_t flags)
> +{
> +	igt_display_t *display = &d->display;
> +	int width, height;
> +
> +	cleanup_crtc(d);
> +
> +	width = height = 20;
> +
> +	if (flags & TEST_UPSCALING_UPSCALING) {
> +		setup_fb(display->drm_fd, width, height, 1.0, 0.0, 0.0, &d->fb[1]);
> +		setup_fb(display->drm_fd, width, height, 0.0, 1.0, 0.0, &d->fb[2]);
> +	}
> +
> +	igt_output_set_pipe(output, pipe);
> +
> +	for (int k = 0; k < display->pipes[pipe].n_planes; k++) {
> +		igt_plane_t *plane1, *plane2;
> +
> +		plane1 = &display->pipes[pipe].planes[k];
> +		igt_require(plane1);
> +		plane2 = &display->pipes[pipe].planes[k+1];
> +		igt_require(plane2);
> +
> +		if (plane1->type == DRM_PLANE_TYPE_PRIMARY  || plane1->type == DRM_PLANE_TYPE_CURSOR ||
> +		    plane2->type == DRM_PLANE_TYPE_PRIMARY || plane2->type ==DRM_PLANE_TYPE_CURSOR)
> +				continue;

Why are we not interested in primary planes in this test?
I think you were testing them in the individual plane tests.

> +
> +		if (flags & TEST_UPSCALING_UPSCALING)
> +			__test_planes_upscaling_upscaling(d, pipe, output, plane1, plane2,
> +							  &d->fb[1], &d->fb[2]);
> +	}
> +
> +	igt_remove_fb(display->drm_fd, &d->fb[1]);
> +        igt_remove_fb(display->drm_fd, &d->fb[2]);

Some kind of whitespace gremlin was here.

> +}
> +
>  static bool test_pipe_iteration(data_t *data, enum pipe pipe, int iteration)
>  {
>  	if (!is_i915_device(data->drm_fd) ||
> @@ -671,6 +749,13 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
>  					test_plane_scaling(&data, pipe, output, TEST_DOWNSCALING);
>  		}
>  
> +		igt_describe("Tests upscaling of 2 overlay planes.");
> +		igt_subtest_with_dynamic("planes-upscaling-upscaling") {
> +			for_each_pipe_with_single_output(&data.display, pipe, output)
> +				igt_dynamic_f("pipe-%s-%s-planes-upscaling-upscaling", kmstest_pipe_name(pipe), igt_output_name(output))
> +					test_plane_scaling_combo(&data, pipe, output, TEST_UPSCALING_UPSCALING);
> +		}
> +
>  		igt_describe("Tests scaling with pixel formats.");
>  		igt_subtest_with_dynamic("scaler-with-pixel-format") {
>  			for_each_pipe_with_single_output(&data.display, pipe, output)
> -- 
> 2.25.1

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-02-15 20:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 12:23 [igt-dev] [v4 0/9] Addition of new plane scaling test cases Swati Sharma
2022-02-15 12:23 ` [igt-dev] [v4 1/9] tests/kms_plane_scaling: Removal of plane-scaling subtest Swati Sharma
2022-02-15 12:23 ` [igt-dev] [v4 2/9] tests/kms_plane_scaling: Add output name in dynamic subtests Swati Sharma
2022-02-15 12:23 ` [igt-dev] [v4 3/9] tests/kms_plane_scaling: Upscaling each plane Swati Sharma
2022-02-15 20:43   ` Ville Syrjälä
2022-02-15 12:23 ` [igt-dev] [v4 4/9] tests/kms_plane_scaling: Downscaling " Swati Sharma
2022-02-15 20:43   ` Ville Syrjälä
     [not found]   ` <a85c6701-43ad-4b25-6184-8798e8db2e2d@quicinc.com>
2022-02-17 12:15     ` Sharma, Swati2
2022-02-17 18:22       ` Jessica Zhang
2022-02-17 18:37         ` Sharma, Swati2
2022-02-22 19:36           ` Jessica Zhang
2022-02-23  6:46             ` Sharma, Swati2
2022-02-15 12:23 ` [igt-dev] [v4 5/9] tests/kms_plane_scaling: Upscaling on 2 planes Swati Sharma
2022-02-15 20:43   ` Ville Syrjälä [this message]
2022-02-15 12:23 ` [igt-dev] [v4 6/9] tests/kms_plane_scaling: Downscaling " Swati Sharma
2022-02-15 12:23 ` [igt-dev] [v4 7/9] tests/kms_plane_scaling: Upscaling and downscaling scenario Swati Sharma
2022-02-15 12:23 ` [igt-dev] [v4 8/9] tests/kms_plane_scaling: Add negative test to check num of scalers Swati Sharma
2022-02-15 12:23 ` [igt-dev] [v4 9/9] tests/kms_plane_scaling: Refactor clipping-clamping subtest Swati Sharma
2022-02-15 18:23 ` [igt-dev] ✓ Fi.CI.BAT: success for Addition of new plane scaling test cases (rev6) Patchwork
2022-02-15 21:59 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=YgwQeeXoIXP50G3J@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=swati2.sharma@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.