public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/6] tests/kms_color: Nuke local struct definitions
Date: Wed, 3 Apr 2019 10:40:38 +0200	[thread overview]
Message-ID: <20190403084038.GV2665@phenom.ffwll.local> (raw)
In-Reply-To: <20190402163348.4680-1-ville.syrjala@linux.intel.com>

On Tue, Apr 02, 2019 at 07:33:43PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> I think we can assume fresh enough headers by now, so remove
> the local _drm_color_ctm and _drm_color_lut structs definitions.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  tests/kms_color.c | 74 +++++++++++++++++++----------------------------
>  1 file changed, 29 insertions(+), 45 deletions(-)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c
> index decf3c2a680e..1e5a5d329bea 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -31,22 +31,6 @@
>  
>  IGT_TEST_DESCRIPTION("Test Color Features at Pipe level");
>  
> -/* Data structures for gamma/degamma ramps & ctm matrix. */
> -struct _drm_color_ctm {
> -	/* Transformation matrix in S31.32 format. */
> -	__s64 matrix[9];
> -};
> -
> -struct _drm_color_lut {
> -	/*
> -	 * Data is U0.16 fixed point format.
> -	 */
> -	__u16 red;
> -	__u16 green;
> -	__u16 blue;
> -	__u16 reserved;
> -};
> -
>  /* Internal */
>  typedef struct {
>  	double r, g, b;
> @@ -163,13 +147,13 @@ static double *generate_table_zero(uint32_t lut_size)
>  	return coeffs;
>  }
>  
> -static struct _drm_color_lut *coeffs_to_lut(data_t *data,
> -					    const double *coefficients,
> -					    uint32_t lut_size,
> -					    uint32_t color_depth,
> -					    int off)
> +static struct drm_color_lut *coeffs_to_lut(data_t *data,
> +					   const double *coefficients,
> +					   uint32_t lut_size,
> +					   uint32_t color_depth,
> +					   int off)
>  {
> -	struct _drm_color_lut *lut;
> +	struct drm_color_lut *lut;
>  	uint32_t i;
>  	uint32_t max_value = (1 << 16) - 1;
>  	uint32_t mask;
> @@ -179,7 +163,7 @@ static struct _drm_color_lut *coeffs_to_lut(data_t *data,
>  	else
>  		mask = max_value;
>  
> -	lut = malloc(sizeof(struct _drm_color_lut) * lut_size);
> +	lut = malloc(sizeof(struct drm_color_lut) * lut_size);
>  
>  	if (IS_CHERRYVIEW(data->devid))
>  		lut_size -= 1;
> @@ -211,8 +195,8 @@ static void set_degamma(data_t *data,
>  			igt_pipe_t *pipe,
>  			const double *coefficients)
>  {
> -	size_t size = sizeof(struct _drm_color_lut) * data->degamma_lut_size;
> -	struct _drm_color_lut *lut = coeffs_to_lut(data,
> +	size_t size = sizeof(struct drm_color_lut) * data->degamma_lut_size;
> +	struct drm_color_lut *lut = coeffs_to_lut(data,
>  						   coefficients,
>  						   data->degamma_lut_size,
>  						   data->color_depth, 0);
> @@ -226,8 +210,8 @@ static void set_gamma(data_t *data,
>  		      igt_pipe_t *pipe,
>  		      const double *coefficients)
>  {
> -	size_t size = sizeof(struct _drm_color_lut) * data->gamma_lut_size;
> -	struct _drm_color_lut *lut = coeffs_to_lut(data,
> +	size_t size = sizeof(struct drm_color_lut) * data->gamma_lut_size;
> +	struct drm_color_lut *lut = coeffs_to_lut(data,
>  						   coefficients,
>  						   data->gamma_lut_size,
>  						   data->color_depth, 0);
> @@ -239,7 +223,7 @@ static void set_gamma(data_t *data,
>  
>  static void set_ctm(igt_pipe_t *pipe, const double *coefficients)
>  {
> -	struct _drm_color_ctm ctm;
> +	struct drm_color_ctm ctm;
>  	int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(ctm.matrix); i++) {
> @@ -552,7 +536,7 @@ static void test_pipe_legacy_gamma_reset(data_t *data,
>  	double *degamma_linear, *gamma_zero;
>  	uint32_t i, legacy_lut_size;
>  	uint16_t *red_lut, *green_lut, *blue_lut;
> -	struct _drm_color_lut *lut;
> +	struct drm_color_lut *lut;
>  	drmModePropertyBlobPtr blob;
>  	igt_output_t *output;
>  
> @@ -578,20 +562,20 @@ static void test_pipe_legacy_gamma_reset(data_t *data,
>  
>  		blob = get_blob(data, primary->pipe, IGT_CRTC_DEGAMMA_LUT);
>  		igt_assert(blob &&
> -			   blob->length == (sizeof(struct _drm_color_lut) *
> +			   blob->length == (sizeof(struct drm_color_lut) *
>  					    data->degamma_lut_size));
>  		drmModeFreePropertyBlob(blob);
>  
>  		blob = get_blob(data, primary->pipe, IGT_CRTC_CTM);
>  		igt_assert(blob &&
> -			   blob->length == sizeof(struct _drm_color_ctm));
> +			   blob->length == sizeof(struct drm_color_ctm));
>  		drmModeFreePropertyBlob(blob);
>  
>  		blob = get_blob(data, primary->pipe, IGT_CRTC_GAMMA_LUT);
>  		igt_assert(blob &&
> -			   blob->length == (sizeof(struct _drm_color_lut) *
> +			   blob->length == (sizeof(struct drm_color_lut) *
>  					    data->gamma_lut_size));
> -		lut = (struct _drm_color_lut *) blob->data;
> +		lut = (struct drm_color_lut *) blob->data;
>  		for (i = 0; i < data->gamma_lut_size; i++)
>  			igt_assert(lut[i].red == 0 &&
>  				   lut[i].green == 0 &&
> @@ -625,9 +609,9 @@ static void test_pipe_legacy_gamma_reset(data_t *data,
>  
>  		blob = get_blob(data, primary->pipe, IGT_CRTC_GAMMA_LUT);
>  		igt_assert(blob &&
> -			   blob->length == (sizeof(struct _drm_color_lut) *
> +			   blob->length == (sizeof(struct drm_color_lut) *
>  					    legacy_lut_size));
> -		lut = (struct _drm_color_lut *) blob->data;
> +		lut = (struct drm_color_lut *) blob->data;
>  		for (i = 0; i < legacy_lut_size; i++)
>  			igt_assert(lut[i].red == 0xffff &&
>  				   lut[i].green == 0xffff &&
> @@ -1079,11 +1063,11 @@ invalid_lut_sizes(data_t *data)
>  {
>  	igt_display_t *display = &data->display;
>  	igt_pipe_t *pipe = &display->pipes[0];
> -	size_t degamma_lut_size = data->degamma_lut_size * sizeof(struct _drm_color_lut);
> -	size_t gamma_lut_size = data->gamma_lut_size * sizeof(struct _drm_color_lut);
> +	size_t degamma_lut_size = data->degamma_lut_size * sizeof(struct drm_color_lut);
> +	size_t gamma_lut_size = data->gamma_lut_size * sizeof(struct drm_color_lut);
>  
> -	struct _drm_color_lut *degamma_lut = malloc(data->degamma_lut_size * sizeof(struct _drm_color_lut) * 2);
> -	struct _drm_color_lut *gamma_lut = malloc(data->gamma_lut_size * sizeof(struct _drm_color_lut) * 2);
> +	struct drm_color_lut *degamma_lut = malloc(data->degamma_lut_size * sizeof(struct drm_color_lut) * 2);
> +	struct drm_color_lut *gamma_lut = malloc(data->gamma_lut_size * sizeof(struct drm_color_lut) * 2);
>  
>  	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
>  
> @@ -1097,7 +1081,7 @@ invalid_lut_sizes(data_t *data)
>  						     degamma_lut, degamma_lut_size - 1),
>  			      -EINVAL);
>  		igt_assert_eq(pipe_set_property_blob(pipe, IGT_CRTC_DEGAMMA_LUT,
> -						     degamma_lut, degamma_lut_size + sizeof(struct _drm_color_lut)),
> +						     degamma_lut, degamma_lut_size + sizeof(struct drm_color_lut)),
>  			      -EINVAL);
>  		igt_assert_eq(pipe_set_property_blob_id(pipe, IGT_CRTC_DEGAMMA_LUT, pipe->crtc_id),
>  			      -EINVAL);
> @@ -1116,7 +1100,7 @@ invalid_lut_sizes(data_t *data)
>  						     gamma_lut, gamma_lut_size - 1),
>  			      -EINVAL);
>  		igt_assert_eq(pipe_set_property_blob(pipe, IGT_CRTC_GAMMA_LUT,
> -						     gamma_lut, gamma_lut_size + sizeof(struct _drm_color_lut)),
> +						     gamma_lut, gamma_lut_size + sizeof(struct drm_color_lut)),
>  			      -EINVAL);
>  		igt_assert_eq(pipe_set_property_blob_id(pipe, IGT_CRTC_GAMMA_LUT, pipe->crtc_id),
>  			      -EINVAL);
> @@ -1138,18 +1122,18 @@ invalid_ctm_matrix_sizes(data_t *data)
>  	if (!igt_pipe_obj_has_prop(pipe, IGT_CRTC_CTM))
>  		return;
>  
> -	ptr = malloc(sizeof(struct _drm_color_ctm) * 4);
> +	ptr = malloc(sizeof(struct drm_color_ctm) * 4);
>  
>  	igt_assert_eq(pipe_set_property_blob(pipe, IGT_CRTC_CTM, ptr, 1),
>  		      -EINVAL);
>  	igt_assert_eq(pipe_set_property_blob(pipe, IGT_CRTC_CTM, ptr,
> -					     sizeof(struct _drm_color_ctm) + 1),
> +					     sizeof(struct drm_color_ctm) + 1),
>  		      -EINVAL);
>  	igt_assert_eq(pipe_set_property_blob(pipe, IGT_CRTC_CTM, ptr,
> -					     sizeof(struct _drm_color_ctm) - 1),
> +					     sizeof(struct drm_color_ctm) - 1),
>  		      -EINVAL);
>  	igt_assert_eq(pipe_set_property_blob(pipe, IGT_CRTC_CTM, ptr,
> -					     sizeof(struct _drm_color_ctm) * 2),
> +					     sizeof(struct drm_color_ctm) * 2),
>  		      -EINVAL);
>  	igt_assert_eq(pipe_set_property_blob_id(pipe, IGT_CRTC_CTM, pipe->crtc_id),
>  		      -EINVAL);
> -- 
> 2.19.2
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

      parent reply	other threads:[~2019-04-03  8:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02 16:33 [igt-dev] [PATCH i-g-t 1/6] tests/kms_color: Nuke local struct definitions Ville Syrjala
2019-04-02 16:33 ` [igt-dev] [PATCH i-g-t 2/6] tests/kms_color: Wrap LUTs in a gamma_lut_t struct Ville Syrjala
2019-04-03 10:50   ` Daniel Vetter
2019-04-02 16:33 ` [igt-dev] [PATCH i-g-t 3/6] tests/kms_color: Reuse some already compute values Ville Syrjala
2019-04-03 10:51   ` Daniel Vetter
2019-04-02 16:33 ` [igt-dev] [PATCH i-g-t 4/6] tests/kms_color: Allow most subtests to run with a partial color pipeline Ville Syrjala
2019-04-03 13:50   ` Daniel Vetter
2019-04-03 14:22     ` Ville Syrjälä
2019-04-02 16:33 ` [igt-dev] [PATCH i-g-t 5/6] tests/kms_color: Split invalid_lut_sizes() into gamma vs. degamma versions Ville Syrjala
2019-04-03 13:52   ` Daniel Vetter
2019-04-03 14:20     ` Ville Syrjälä
2019-04-02 16:33 ` [igt-dev] [PATCH i-g-t 6/6] tests/kms_color: Make legacy-gamma-reset work with a partial color pipeline Ville Syrjala
2019-04-03 13:53   ` Daniel Vetter
2019-04-02 17:37 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/6] tests/kms_color: Nuke local struct definitions Patchwork
2019-04-03  6:33 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-04-03  8:40 ` Daniel Vetter [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=20190403084038.GV2665@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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