All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Modem, Bhanuprakash" <bhanuprakash.modem@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t v3 4/7] tests/kms_color: Pass pipe to invalid LUT size tests
Date: Tue, 7 Sep 2021 20:26:53 +0300	[thread overview]
Message-ID: <YTeg3Yi6Q1vX+Pd0@intel.com> (raw)
In-Reply-To: <DM8PR11MB571939F2C5F6BFCF7A7D80C68DD29@DM8PR11MB5719.namprd11.prod.outlook.com>

On Mon, Sep 06, 2021 at 06:37:39AM +0000, Modem, Bhanuprakash wrote:
> > From: Ville Syrjala <ville.syrjala@linux.intel.com>
> > Sent: Friday, September 3, 2021 9:58 PM
> > To: igt-dev@lists.freedesktop.org
> > Cc: Modem, Bhanuprakash <bhanuprakash.modem@intel.com>
> > Subject: [PATCH i-g-t v3 4/7] tests/kms_color: Pass pipe to invalid LUT size
> > tests
> > 
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Each pipe can have a different LUT sizes, so run the invalid LUT
> > size tests once for each pipe.
> > 
> > This also makes sure data->(de)gamma_lut_size are properly initialized
> > prior to running these subtests.
> > 
> > Cc: Bhanuprakash Modem <Bhanuprakash.modem@intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  tests/kms_color.c        | 73 +++++++++++++++++++++++++---------------
> >  tests/kms_color_helper.c | 17 +++++-----
> >  tests/kms_color_helper.h |  7 ++--
> >  3 files changed, 58 insertions(+), 39 deletions(-)
> > 
> > diff --git a/tests/kms_color.c b/tests/kms_color.c
> > index 9105076aba4f..dabc6963e9e0 100644
> > --- a/tests/kms_color.c
> > +++ b/tests/kms_color.c
> > @@ -638,6 +638,26 @@ static void test_pipe_limited_range_ctm(data_t *data,
> >  }
> >  #endif
> > 
> > +static void
> > +prep_pipe(data_t *data, enum pipe p)
> > +{
> > +	igt_require_pipe(&data->display, p);
> > +
> > +	if (igt_pipe_obj_has_prop(&data->display.pipes[p],
> > IGT_CRTC_DEGAMMA_LUT_SIZE)) {
> > +		data->degamma_lut_size =
> > +			igt_pipe_obj_get_prop(&data->display.pipes[p],
> > +					      IGT_CRTC_DEGAMMA_LUT_SIZE);
> > +		igt_assert_lt(0, data->degamma_lut_size);
> > +	}
> > +
> > +	if (igt_pipe_obj_has_prop(&data->display.pipes[p],
> > IGT_CRTC_GAMMA_LUT_SIZE)) {
> > +		data->gamma_lut_size =
> > +			igt_pipe_obj_get_prop(&data->display.pipes[p],
> > +					      IGT_CRTC_GAMMA_LUT_SIZE);
> > +		igt_assert_lt(0, data->gamma_lut_size);
> > +	}
> > +}
> > +
> >  static void
> >  run_tests_for_pipe(data_t *data, enum pipe p)
> >  {
> > @@ -652,10 +672,10 @@ run_tests_for_pipe(data_t *data, enum pipe p)
> >  	};
> > 
> >  	igt_fixture {
> > +		prep_pipe(data, p);
> > +
> >  		igt_require_pipe_crc(data->drm_fd);
> > 
> > -		igt_require_pipe(&data->display, p);
> > -
> >  		pipe = &data->display.pipes[p];
> >  		igt_require(pipe->n_planes >= 0);
> > 
> > @@ -665,20 +685,6 @@ run_tests_for_pipe(data_t *data, enum pipe p)
> >  						  primary->pipe->pipe,
> >  						  INTEL_PIPE_CRC_SOURCE_AUTO);
> > 
> > -		if (igt_pipe_obj_has_prop(&data->display.pipes[p],
> > IGT_CRTC_DEGAMMA_LUT_SIZE)) {
> > -			data->degamma_lut_size =
> > -				igt_pipe_obj_get_prop(&data->display.pipes[p],
> > -						      IGT_CRTC_DEGAMMA_LUT_SIZE);
> > -			igt_assert_lt(0, data->degamma_lut_size);
> > -		}
> > -
> > -		if (igt_pipe_obj_has_prop(&data->display.pipes[p],
> > IGT_CRTC_GAMMA_LUT_SIZE)) {
> > -			data->gamma_lut_size =
> > -				igt_pipe_obj_get_prop(&data->display.pipes[p],
> > -						      IGT_CRTC_GAMMA_LUT_SIZE);
> > -			igt_assert_lt(0, data->gamma_lut_size);
> > -		}
> > -
> >  		igt_display_require_output_on_pipe(&data->display, p);
> >  	}
> > 
> > @@ -865,6 +871,25 @@ run_tests_for_pipe(data_t *data, enum pipe p)
> >  	}
> >  }
> > 
> > +static void
> > +run_invalid_tests_for_pipe(data_t *data, enum pipe p)
> > +{
> > +	igt_fixture
> > +		prep_pipe(data, p);
> > +
> > +	igt_describe("Negative check for invalid gamma lut sizes");
> > +	igt_subtest_f("pipe-%s-invalid-gamma-lut-sizes", kmstest_pipe_name(p))
> > +		invalid_gamma_lut_sizes(data, p);
> > +
> > +	igt_describe("Negative check for invalid degamma lut sizes");
> > +	igt_subtest_f("pipe-%s-invalid-degamma-lut-sizes", kmstest_pipe_name(p))
> > +		invalid_degamma_lut_sizes(data, p);
> > +
> > +	igt_describe("Negative check for color tranformation matrix sizes");
> > +	igt_subtest_f("pipe-%s-invalid-ctm-matrix-sizes", kmstest_pipe_name(p))
> > +		invalid_ctm_matrix_sizes(data, p);
> > +}
> > +
> >  igt_main
> >  {
> >  	data_t data = {};
> > @@ -879,21 +904,13 @@ igt_main
> >  		igt_display_require(&data.display, data.drm_fd);
> >  	}
> > 
> > -	for_each_pipe_static(pipe)
> > +	for_each_pipe_static(pipe) {
> >  		igt_subtest_group
> >  			run_tests_for_pipe(&data, pipe);
> > 
> > -	igt_describe("Negative check for invalid gamma lut sizes");
> > -	igt_subtest_f("pipe-invalid-gamma-lut-sizes")
> > -		invalid_gamma_lut_sizes(&data);
> > -
> > -	igt_describe("Negative check for invalid degamma lut sizes");
> > -	igt_subtest_f("pipe-invalid-degamma-lut-sizes")
> > -		invalid_degamma_lut_sizes(&data);
> > -
> > -	igt_describe("Negative check for color tranformation matrix sizes");
> > -	igt_subtest_f("pipe-invalid-ctm-matrix-sizes")
> > -		invalid_ctm_matrix_sizes(&data);
> > +		igt_subtest_group
> > +			run_invalid_tests_for_pipe(&data, pipe);
> > +	}
> > 
> >  	igt_fixture {
> >  		igt_display_fini(&data.display);
> > diff --git a/tests/kms_color_helper.c b/tests/kms_color_helper.c
> > index 8b08cdaeea5f..d71e7bb2e6f9 100644
> > --- a/tests/kms_color_helper.c
> > +++ b/tests/kms_color_helper.c
> > @@ -287,10 +287,11 @@ pipe_set_property_blob(igt_pipe_t *pipe,
> >  }
> > 
> >  static void
> > -invalid_lut_sizes(data_t *data, enum igt_atomic_crtc_properties prop, int
> > size)
> > +invalid_lut_sizes(data_t *data, enum pipe p,
> > +		  enum igt_atomic_crtc_properties prop, int size)
> >  {
> >  	igt_display_t *display = &data->display;
> > -	igt_pipe_t *pipe = &display->pipes[0];
> > +	igt_pipe_t *pipe = &display->pipes[p];
> >  	struct drm_color_lut *lut;
> >  	size_t lut_size = size * sizeof(lut[0]);
> > 
> > @@ -319,21 +320,21 @@ invalid_lut_sizes(data_t *data, enum
> > igt_atomic_crtc_properties prop, int size)
> >  }
> > 
> >  void
> > -invalid_gamma_lut_sizes(data_t *data)
> > +invalid_gamma_lut_sizes(data_t *data, enum pipe p)
> >  {
> > -	invalid_lut_sizes(data, IGT_CRTC_GAMMA_LUT, data->gamma_lut_size);
> > +	invalid_lut_sizes(data, p, IGT_CRTC_GAMMA_LUT, data->gamma_lut_size);
>  
> Still, it is possible to get data->gamma_lut_size as NULL, b'coz prep_pipe()
> will not initialize if GAMMA_LUT_SIZE prop is not present.
> 
> `igt_require(data->gamma_lut_size);` or
> `igt_require(igt_pipe_obj_has_prop(p, IGT_CRTC_GAMMA_LUT_SIZE));` before
> calling invalid_lut_sizes() can fix this.

invalid_lut_sizes() already has the necessary igt_require().

> 
> >  }
> > 
> >  void
> > -invalid_degamma_lut_sizes(data_t *data)
> > +invalid_degamma_lut_sizes(data_t *data, enum pipe p)
> >  {
> > -	invalid_lut_sizes(data, IGT_CRTC_DEGAMMA_LUT, data->degamma_lut_size);
> > +	invalid_lut_sizes(data, p, IGT_CRTC_DEGAMMA_LUT, data-
> > >degamma_lut_size);
>  
> Please consider the above comment.
> 
> With above change, this patch is
> Reviewed-by: Bhanuprakash Modem <Bhanuprakash.modem@intel.com>
> 
> - Bhanu
> 
> >  }
> > 
> > -void invalid_ctm_matrix_sizes(data_t *data)
> > +void invalid_ctm_matrix_sizes(data_t *data, enum pipe p)
> >  {
> >  	igt_display_t *display = &data->display;
> > -	igt_pipe_t *pipe = &display->pipes[0];
> > +	igt_pipe_t *pipe = &display->pipes[p];
> >  	void *ptr;
> > 
> >  	igt_require(igt_pipe_obj_has_prop(pipe, IGT_CRTC_CTM));
> > diff --git a/tests/kms_color_helper.h b/tests/kms_color_helper.h
> > index 3f49e7cae4c0..bb6f0054f388 100644
> > --- a/tests/kms_color_helper.h
> > +++ b/tests/kms_color_helper.h
> > @@ -103,8 +103,9 @@ int pipe_set_property_blob_id(igt_pipe_t *pipe,
> >  int pipe_set_property_blob(igt_pipe_t *pipe,
> >  			   enum igt_atomic_crtc_properties prop,
> >  			   void *ptr, size_t length);
> > -void invalid_gamma_lut_sizes(data_t *data);
> > -void invalid_degamma_lut_sizes(data_t *data);
> > -void invalid_ctm_matrix_sizes(data_t *data);
> > +void invalid_gamma_lut_sizes(data_t *data, enum pipe p);
> > +void invalid_degamma_lut_sizes(data_t *data, enum pipe p);
> > +void invalid_ctm_matrix_sizes(data_t *data, enum pipe p);
> > +
> >  #endif
> > 
> > --
> > 2.31.1
> 

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2021-09-07 17:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 16:27 [igt-dev] [PATCH i-g-t v3 0/7] tests/kms_color: 3D LUT tests Ville Syrjala
2021-09-03 16:27 ` [igt-dev] [PATCH i-g-t v3 1/7] tests/kms_color_chamelium: Remove invalid LUT size tests Ville Syrjala
2021-09-12 15:30   ` Modem, Bhanuprakash
2021-09-03 16:27 ` [igt-dev] [PATCH i-g-t v3 2/7] tests/kms_color: Refactor " Ville Syrjala
2021-09-06  6:37   ` Modem, Bhanuprakash
2021-09-03 16:27 ` [igt-dev] [PATCH i-g-t v3 3/7] tests/kms_color: Store r/g/b separately for LUT color tests Ville Syrjala
2021-09-03 16:27 ` [igt-dev] [PATCH i-g-t v3 4/7] tests/kms_color: Pass pipe to invalid LUT size tests Ville Syrjala
2021-09-06  6:37   ` Modem, Bhanuprakash
2021-09-07 17:26     ` Ville Syrjälä [this message]
2021-09-03 16:27 ` [igt-dev] [PATCH i-g-t v3 5/7] tests/kms_color: Run each subtest only for a single connector Ville Syrjala
2021-09-06  6:38   ` Modem, Bhanuprakash
2021-09-07 17:34     ` Ville Syrjälä
2021-09-12 15:36       ` Modem, Bhanuprakash
2021-09-03 16:27 ` [igt-dev] [PATCH i-g-t v3 6/7] lib/kms: Add GAMMA_LUT_3D support Ville Syrjala
2021-09-03 16:27 ` [igt-dev] [PATCH i-g-t v3 7/7] tests/kms_color: Add GAMMA_LUT_3D tests Ville Syrjala
2021-09-06  6:38   ` Modem, Bhanuprakash
2021-09-03 17:25 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_color: 3D LUT tests (rev5) Patchwork
2021-09-03 19:46 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-09-06  6:37 ` [igt-dev] [PATCH i-g-t v3 0/7] tests/kms_color: 3D LUT tests Modem, Bhanuprakash

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=YTeg3Yi6Q1vX+Pd0@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=bhanuprakash.modem@intel.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 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.