public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Li, Sun peng (Leo)" <Sunpeng.Li@amd.com>
To: "Kazlauskas, Nicholas" <Nicholas.Kazlauskas@amd.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_plane_scaling: Use IGT helpers for selecting planes to scale
Date: Wed, 27 Mar 2019 20:12:20 +0000	[thread overview]
Message-ID: <e0bf8c0b-1dfd-32e7-6cc7-7688d9123b50@amd.com> (raw)
In-Reply-To: <20190313172414.2720-1-nicholas.kazlauskas@amd.com>



On 2019-03-13 1:24 p.m., Nicholas Kazlauskas wrote:
> These tests intend to test scaling on hardware with overlay planes.
> 
> They will incorrectly try to scale the cursor plane or occasionally
> crash by trying to access planes that don't exist for hardware that
> doesn't expose any overlay planes.
> 
> Make plane selection explicit by requesting the plane by type and index
> using the igt helper igt_pipe_get_plane_type_index.
> 
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Reviewed-by: Leo Li <sunpeng.li@amd.com>

Thanks,
Leo

> ---
>   tests/kms_plane_scaling.c | 26 ++++++++++++++++++--------
>   1 file changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
> index d408a203..6fdb50c5 100644
> --- a/tests/kms_plane_scaling.c
> +++ b/tests/kms_plane_scaling.c
> @@ -269,6 +269,7 @@ static void
>   test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
>   {
>   	igt_display_t *display = &d->display;
> +	igt_pipe_t *pipe_obj = &display->pipes[pipe];
>   	drmModeModeInfo *mode;
>   	int primary_plane_scaling = 0; /* For now */
>   	uint64_t tiling = is_i915_device(display->drm_fd) ?
> @@ -280,7 +281,7 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
>   	mode = igt_output_get_mode(output);
>   
>   	/* Set up display with plane 1 */
> -	d->plane1 = &display->pipes[pipe].planes[0];
> +	d->plane1 = igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_PRIMARY);
>   	prepare_crtc(d, output, pipe, d->plane1, mode);
>   
>   	igt_create_color_pattern_fb(display->drm_fd, 600, 600,
> @@ -311,7 +312,14 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
>   	}
>   
>   	/* Set up fb[1]->plane2 mapping. */
> -	d->plane2 = igt_output_get_plane(output, 1);
> +	d->plane2 = igt_pipe_get_plane_type_index(pipe_obj,
> +						  DRM_PLANE_TYPE_OVERLAY, 0);
> +
> +	if (!d->plane2) {
> +		igt_debug("Plane-2 doesnt exist on pipe %s\n", kmstest_pipe_name(pipe));
> +		return;
> +	}
> +
>   	igt_plane_set_fb(d->plane2, &d->fb[1]);
>   
>   	/* 2nd plane windowed */
> @@ -349,14 +357,15 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
>   	}
>   
>   	/* Set up fb[2]->plane3 mapping. */
> -	d->plane3 = igt_output_get_plane(output, 2);
> -	igt_plane_set_fb(d->plane3, &d->fb[2]);
> -
> -	if(d->plane3->type == DRM_PLANE_TYPE_CURSOR) {
> +	d->plane3 = igt_pipe_get_plane_type_index(pipe_obj,
> +						  DRM_PLANE_TYPE_OVERLAY, 1);
> +	if(!d->plane3) {
>   		igt_debug("Plane-3 doesnt exist on pipe %s\n", kmstest_pipe_name(pipe));
>   		return;
>   	}
>   
> +	igt_plane_set_fb(d->plane3, &d->fb[2]);
> +
>   	/* 3rd plane windowed - no scaling */
>   	igt_fb_set_position(&d->fb[2], d->plane3, 100, 100);
>   	igt_fb_set_size(&d->fb[2], d->plane3, d->fb[2].width-300, d->fb[2].height-300);
> @@ -435,13 +444,14 @@ __test_scaler_with_clipping_clamping_scenario(data_t *d, drmModeModeInfo *mode,
>   static void
>   test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe, igt_output_t *output)
>   {
> +	igt_pipe_t *pipe_obj = &d->display.pipes[pipe];
>   	drmModeModeInfo *mode;
>   
>   	igt_require(get_num_scalers(d, pipe) >= 2);
>   
>   	mode = igt_output_get_mode(output);
> -	d->plane1 = &d->display.pipes[pipe].planes[0];
> -	d->plane2 = &d->display.pipes[pipe].planes[1];
> +	d->plane1 = igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_PRIMARY);
> +	d->plane2 = igt_pipe_get_plane_type(pipe_obj, DRM_PLANE_TYPE_OVERLAY);
>   	prepare_crtc(d, output, pipe, d->plane1, mode);
>   
>   	for (int i = 0; i < d->plane1->drm_plane->count_formats; i++) {
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

      parent reply	other threads:[~2019-03-27 20:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 17:24 [igt-dev] [PATCH i-g-t] tests/kms_plane_scaling: Use IGT helpers for selecting planes to scale Nicholas Kazlauskas
2019-03-13 18:15 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-03-14  1:13 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-03-27 20:12 ` Li, Sun peng (Leo) [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=e0bf8c0b-1dfd-32e7-6cc7-7688d9123b50@amd.com \
    --to=sunpeng.li@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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