public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Kahola, Mika" <mika.kahola@intel.com>
To: "Deak, Imre" <imre.deak@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_ccs: Select highest resolution
Date: Wed, 5 Feb 2020 14:29:05 +0000	[thread overview]
Message-ID: <6bc718892a4dc05a13580f11eef64309182e4b1a.camel@intel.com> (raw)
In-Reply-To: <20200205140421.GA4899@ideak-desk.fi.intel.com>

On Wed, 2020-02-05 at 16:04 +0200, Imre Deak wrote:
> On Tue, Jan 28, 2020 at 04:30:54PM +0200, Mika Kahola wrote:
> > In some cases we select resolution that is insufficient for testing
> > and we receive unnecessary skips on CI. Let's loop through all
> > available
> > modes and select the higest one when running the tests.
> > 
> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> > ---
> >  tests/kms_ccs.c | 30 ++++++++++++++++++++++++------
> >  1 file changed, 24 insertions(+), 6 deletions(-)
> > 
> > diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
> > index 2259a4f1..ddc6a30b 100644
> > --- a/tests/kms_ccs.c
> > +++ b/tests/kms_ccs.c
> > @@ -276,12 +276,28 @@ 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_mode(igt_output_t *output)
> 
> Should return a ptr to drmModeModeInfo.
> 
> > +{
> > +	const drmModeModeInfo *mode;
> > +	drmModeModeInfo *tmp;
> > +	int i;
> > +
> > +	mode = &output->config.connector->modes[0];
> 
> Let's still default to the preferred mode:
> 
> 	mode = igt_output_get_mode(output);
> 
> and then look for a wide enough mode only for the
> test_fb_flags & (FB_MISALIGN_AUX_STRIDE|FB_SMALL_AUX_STRIDE)
> case. That would have minimal effect on existing unrelated test
> cases.
> 
> > +	for (i = 1; i < output->config.connector->count_modes; i++) {
> > +		tmp = &output->config.connector->modes[i];
> > +		if (tmp->vdisplay > mode->vdisplay)
> 
> The requirement is mode->hdisplay > 1024, so we should look for such
> a
> mode starting from the default one above.
Thanks for the review! I will fix these issues.

-Mika-

> 
> > +			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);
> > +	drmModeModeInfo drm_mode = get_mode(data->output);
> >  	enum igt_commit_style commit;
> >  	struct igt_fb fb, fb_sprite;
> >  	int ret;
> > @@ -298,25 +314,27 @@ static bool try_config(data_t *data, enum
> > test_fb_flags fb_flags,
> >  				      data->ccs_modifier))
> >  		return false;
> >  
> > +	igt_output_override_mode(data->output, &drm_mode);
> > +
> >  	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, min(MAX_SPRITE_PLANE_WIDTH,
> > drm_mode.hdisplay),
> > +			    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, min(MAX_SPRITE_PLANE_WIDTH,
> > drm_mode.hdisplay),
> > +			    drm_mode.vdisplay, fb_flags);
> >  	}
> >  
> >  	if (data->flags & TEST_FAIL_ON_ADDFB2)
> >  		return true;
> >  
> >  	igt_plane_set_position(primary, 0, 0);
> > -	igt_plane_set_size(primary, drm_mode->hdisplay, drm_mode-
> > >vdisplay);
> > +	igt_plane_set_size(primary, drm_mode.hdisplay,
> > drm_mode.vdisplay);
> >  	igt_plane_set_fb(primary, &fb);
> >  
> >  	if (data->plane && fb_flags & FB_COMPRESSED) {
> > -- 
> > 2.17.1
> > 
> > _______________________________________________
> > 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

      reply	other threads:[~2020-02-05 14:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-28 14:30 [igt-dev] [PATCH i-g-t] tests/kms_ccs: Select highest resolution Mika Kahola
2020-01-28 17:10 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-01-30  2:32 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-02-05 14:04 ` [igt-dev] [PATCH i-g-t] " Imre Deak
2020-02-05 14:29   ` Kahola, Mika [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=6bc718892a4dc05a13580f11eef64309182e4b1a.camel@intel.com \
    --to=mika.kahola@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=imre.deak@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox