All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Mika Kahola <mika.kahola@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_ccs: Simplify FB width check
Date: Fri, 7 Feb 2020 15:01:44 +0200	[thread overview]
Message-ID: <20200207130144.GB9004@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <20200207115834.26620-1-mika.kahola@intel.com>

On Fri, Feb 07, 2020 at 01:58:34PM +0200, Mika Kahola wrote:
> FB size doesn't have to match with the available modes
> on connector. We can select higher width if the selected
> mode has a FB width less than 1024. This change conserns
> only misaligned and short AUX stride subtests.
> 
> Signed-off-by: Mika Kahola <mika.kahola@intel.com>

Thanks, this simplifies things:

Reviewed-by: Imre Deak <imre.deak@intel.com>

> ---
>  tests/kms_ccs.c | 31 +++++++------------------------
>  1 file changed, 7 insertions(+), 24 deletions(-)
> 
> diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
> index 7ea86613..fa8f624c 100644
> --- a/tests/kms_ccs.c
> +++ b/tests/kms_ccs.c
> @@ -276,28 +276,13 @@ static igt_plane_t *compatible_main_plane(data_t *data)
>  	return igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY);
>  }
>  
> -static drmModeModeInfo *get_wide_mode(drmModeModeInfo *preferred_mode,
> -				      igt_output_t *output)
> -{
> -	drmModeModeInfo *mode, *tmp;
> -	int i;
> -
> -	mode = preferred_mode;
> -	for (i = 0; i < output->config.connector->count_modes; i++) {
> -		tmp = &output->config.connector->modes[i];
> -		if (tmp->hdisplay > mode->hdisplay)
> -			mode = tmp;
> -	}
> -
> -	return mode;
> -}
> -
>  static bool try_config(data_t *data, enum test_fb_flags fb_flags,
>  		       igt_crc_t *crc)
>  {
>  	igt_display_t *display = &data->display;
>  	igt_plane_t *primary = compatible_main_plane(data);
>  	drmModeModeInfo *drm_mode = igt_output_get_mode(data->output);
> +	int fb_width = drm_mode->hdisplay;
>  	enum igt_commit_style commit;
>  	struct igt_fb fb, fb_sprite;
>  	int ret;
> @@ -315,23 +300,21 @@ static bool try_config(data_t *data, enum test_fb_flags fb_flags,
>  		return false;
>  
>  	if ((fb_flags & FB_MISALIGN_AUX_STRIDE) ||
> -	    (fb_flags & FB_SMALL_AUX_STRIDE)) {
> -		drm_mode = get_wide_mode(drm_mode, data->output);
> -		igt_output_override_mode(data->output, drm_mode);
> -	}
> +	    (fb_flags & FB_SMALL_AUX_STRIDE))
> +		fb_width = max(fb_width, 1536);
> +
> +	fb_width = min(MAX_SPRITE_PLANE_WIDTH, fb_width);
>  
>  	if (data->plane && fb_flags & FB_COMPRESSED) {
>  		if (!igt_plane_has_format_mod(data->plane, data->format,
>  					      data->ccs_modifier))
>  			return false;
>  
> -		generate_fb(data, &fb, min(MAX_SPRITE_PLANE_WIDTH, drm_mode->hdisplay),
> -			    drm_mode->vdisplay,
> +		generate_fb(data, &fb, fb_width, drm_mode->vdisplay,
>  			    (fb_flags & ~FB_COMPRESSED) | FB_HAS_PLANE);
>  		generate_fb(data, &fb_sprite, 256, 256, fb_flags);
>  	} else {
> -		generate_fb(data, &fb, min(MAX_SPRITE_PLANE_WIDTH, drm_mode->hdisplay),
> -			    drm_mode->vdisplay, fb_flags);
> +		generate_fb(data, &fb, fb_width, drm_mode->vdisplay, fb_flags);
>  	}
>  
>  	if (data->flags & TEST_FAIL_ON_ADDFB2)
> -- 
> 2.17.1
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2020-02-07 13:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 11:58 [igt-dev] [PATCH i-g-t] tests/kms_ccs: Simplify FB width check Mika Kahola
2020-02-07 12:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-02-07 13:01 ` Imre Deak [this message]
2020-02-07 13:06   ` [igt-dev] [PATCH i-g-t] " Kahola, Mika
2020-02-10 14:23   ` Kahola, Mika
2020-02-10 13:48 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
2020-02-10 14:12   ` Kahola, Mika

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=20200207130144.GB9004@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=mika.kahola@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.