All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lisovskiy, Stanislav" <stanislav.lisovskiy@intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_flip_scaled_crc: try to set mode to 1080p during test
Date: Tue, 26 Jan 2021 13:28:42 +0200	[thread overview]
Message-ID: <20210126112842.GA8075@intel.com> (raw)
In-Reply-To: <20210124144002.5741-1-juhapekka.heikkila@gmail.com>

On Sun, Jan 24, 2021 at 04:40:02PM +0200, Juha-Pekka Heikkila wrote:
> Different default resolutions will affect test execution, try to normalize
> situation by always going to 1080p resolution. If this test will run on
> connector which doesn't have 1080p resolution, default resolution will be
> used. On gen<11 will be used 480p
> 
> v2 (Stan): Use igt functions for modesetting. Change igt_warn to igt_debug
> because there's one ICL in intel CI with eDP that would show up warnings
> randomly depending which machine run which test.
> 
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>

> ---
>  tests/kms_flip_scaled_crc.c | 85 ++++++++++++++++++++-----------------
>  1 file changed, 45 insertions(+), 40 deletions(-)
> 
> diff --git a/tests/kms_flip_scaled_crc.c b/tests/kms_flip_scaled_crc.c
> index 93d8031f7..f77484063 100644
> --- a/tests/kms_flip_scaled_crc.c
> +++ b/tests/kms_flip_scaled_crc.c
> @@ -35,6 +35,8 @@ typedef struct {
>  	struct igt_fb small_fb;
>  	struct igt_fb big_fb;
>  	igt_pipe_crc_t *pipe_crc;
> +	uint32_t attemptmodewidth;
> +	uint32_t attemptmodeheight;
>  } data_t;
>  
>  const struct {
> @@ -133,8 +135,7 @@ static void test_flip_to_scaled(data_t *data, uint32_t index, enum pipe pipe,
>  {
>  	igt_plane_t *primary;
>  	igt_crc_t small_crc, big_crc;
> -
> -	drmModeModeInfo *mode;
> +	drmModeModeInfoPtr modetoset = NULL;
>  	struct drm_event_vblank ev;
>  	int ret;
>  
> @@ -142,41 +143,24 @@ static void test_flip_to_scaled(data_t *data, uint32_t index, enum pipe pipe,
>  
>  	igt_debug("running on output %s pipe %s\n", output->name,
>  		  kmstest_pipe_name(pipe));
> +
>  	if (data->big_fb.fb_id == 0) {
> -		mode = igt_output_get_mode(output);
> -
> -		// big fb will be 4k unless running on older than ICL
> -		if (data->gen < 11) {
> -			setup_fb(data, &data->small_fb,
> -				 min(mode->hdisplay, 640),
> -				 min(mode->vdisplay, 480),
> -				 flip_scenario_test[index].firstformat,
> -				 flip_scenario_test[index].firstmodifier);
> -
> -			setup_fb(data, &data->big_fb,
> -				 1280, 960,
> -				 flip_scenario_test[index].secondformat,
> -				 flip_scenario_test[index].secondmodifier);
> -			igt_debug("small fb %dx%d\n", data->small_fb.width,
> -			          data->small_fb.height);
> -			igt_debug("big fb %dx%d\n", data->big_fb.width,
> -			          data->big_fb.height);
> -		} else {
> -			setup_fb(data, &data->small_fb,
> -				 min(mode->hdisplay, 1920),
> -				 min(mode->vdisplay, 1080),
> -				 flip_scenario_test[index].firstformat,
> -				 flip_scenario_test[index].firstmodifier);
> -
> -			setup_fb(data, &data->big_fb,
> -				 3840, 2160,
> -				 flip_scenario_test[index].secondformat,
> -				 flip_scenario_test[index].secondmodifier);
> -			igt_debug("small fb %dx%d\n", data->small_fb.width,
> -			          data->small_fb.height);
> -			igt_debug("big fb %dx%d\n", data->big_fb.width,
> -			          data->big_fb.height);
> -		}
> +		setup_fb(data, &data->small_fb,
> +				data->attemptmodewidth,
> +				data->attemptmodeheight,
> +				flip_scenario_test[index].firstformat,
> +				flip_scenario_test[index].firstmodifier);
> +
> +		setup_fb(data, &data->big_fb,
> +				data->attemptmodewidth * 2,
> +				data->attemptmodeheight * 2,
> +				flip_scenario_test[index].secondformat,
> +				flip_scenario_test[index].secondmodifier);
> +
> +		igt_debug("small fb %dx%d\n", data->small_fb.width,
> +				data->small_fb.height);
> +		igt_debug("big fb %dx%d\n", data->big_fb.width,
> +				data->big_fb.height);
>  	}
>  
>  	igt_output_set_pipe(output, pipe);
> @@ -186,13 +170,26 @@ static void test_flip_to_scaled(data_t *data, uint32_t index, enum pipe pipe,
>  				  NULL);
>  	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
>  					  INTEL_PIPE_CRC_SOURCE_AUTO);
> -	igt_pipe_crc_start(data->pipe_crc);
> +
> +	for (int i = 0; i < output->config.connector->count_modes; i++) {
> +		if (output->config.connector->modes[i].hdisplay == data->attemptmodewidth &&
> +		   output->config.connector->modes[i].vdisplay == data->attemptmodeheight) {
> +			modetoset = &output->config.connector->modes[i];
> +			break;
> +		   }
> +	}
> +
> +	if (!modetoset)
> +		igt_debug("%dp mode was not found from connector, will continue with default. This may cause cdclk to fail this test.\n",
> +			  data->attemptmodeheight);
> +	else
> +		igt_output_override_mode(output, modetoset);
>  
>  	igt_plane_set_position(primary, 0, 0);
>  	igt_plane_set_fb(primary, &data->small_fb);
> +	igt_display_commit_atomic(&data->display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
>  
> -	igt_display_commit_atomic(&data->display,
> -				  DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +	igt_pipe_crc_start(data->pipe_crc);
>  	igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &small_crc);
>  
>  	igt_plane_set_fb(primary, &data->big_fb);
> @@ -203,7 +200,7 @@ static void test_flip_to_scaled(data_t *data, uint32_t index, enum pipe pipe,
>  					    DRM_MODE_PAGE_FLIP_EVENT, NULL);
>  
>  	igt_require_f(ret != -ERANGE,
> -		      "Platform scaling limits exceeded, skipping.");
> +		      "Platform scaling limits exceeded, skipping.\n");
>  	igt_assert_eq(ret, 0);
>  
>  	igt_assert(read(data->drm_fd, &ev, sizeof(ev)) == sizeof(ev));
> @@ -230,6 +227,14 @@ igt_main
>  		igt_require(data.display.is_atomic);
>  		igt_require_pipe_crc(data.drm_fd);
>  		kmstest_set_vt_graphics_mode();
> +
> +		if (data.gen < 11) {
> +			data.attemptmodewidth = 640;
> +			data.attemptmodeheight = 480;
> +		} else {
> +			data.attemptmodewidth = 1920;
> +			data.attemptmodeheight = 1080;
> +		}
>  	}
>  
>  	for (int index = 0; index < ARRAY_SIZE(flip_scenario_test); index++) {
> -- 
> 2.28.0
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2021-01-26 11:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24 14:40 [igt-dev] [PATCH i-g-t] tests/kms_flip_scaled_crc: try to set mode to 1080p during test Juha-Pekka Heikkila
2021-01-24 15:16 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_flip_scaled_crc: try to set mode to 1080p during test (rev2) Patchwork
2021-01-24 17:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-01-24 20:35   ` Juha-Pekka Heikkilä
2021-01-25  2:30     ` Vudum, Lakshminarayana
2021-01-25  2:23 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2021-01-26 11:28 ` Lisovskiy, Stanislav [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-22  8:41 [igt-dev] [PATCH i-g-t] tests/kms_flip_scaled_crc: try to set mode to 1080p during test Juha-Pekka Heikkila
2021-01-22 11:44 ` Lisovskiy, Stanislav

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=20210126112842.GA8075@intel.com \
    --to=stanislav.lisovskiy@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 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.