Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Modem, Bhanuprakash" <bhanuprakash.modem@intel.com>
To: Rob Clark <robdclark@gmail.com>, <igt-dev@lists.freedesktop.org>
Cc: Rob Clark <robdclark@chromium.org>
Subject: Re: [igt-dev] [PATCH v2] tests/kms_plane: Handle hw without legacy gamma support
Date: Tue, 8 Aug 2023 00:26:49 +0530	[thread overview]
Message-ID: <f0aee465-3e20-dac2-a16c-5bcff746e0d6@intel.com> (raw)
In-Reply-To: <20230807163634.205167-1-robdclark@gmail.com>



On Mon-07-08-2023 10:06 pm, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
> 
> Skip the tests which require legacy gamma, instead of failing, if the hw
> does not support legacy gamma.
> 
> v2: igt_require(lut_size > 0) instead
> 
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
>   tests/kms_plane.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> index 67cff61d6cd1..2df1d2f0aeee 100644
> --- a/tests/kms_plane.c
> +++ b/tests/kms_plane.c
> @@ -463,19 +463,22 @@ static void set_legacy_lut(data_t *data, enum pipe pipe,
>   	igt_pipe_t *pipe_obj = &data->display.pipes[pipe];
>   	drmModeCrtc *crtc;
>   	uint16_t *lut;
> -	int i, lut_size;
> +	int i, lut_size, ret;
>   
>   	crtc = drmModeGetCrtc(data->drm_fd, pipe_obj->crtc_id);
>   	lut_size = crtc->gamma_size;
>   	drmModeFreeCrtc(crtc);
>   
> +	igt_require(lut_size > 0);
> +
>   	lut = malloc(sizeof(uint16_t) * lut_size);
>   
>   	for (i = 0; i < lut_size; i++)
>   		lut[i] = (i * 0xffff / (lut_size - 1)) & mask;
>   
> -	igt_assert_eq(drmModeCrtcSetGamma(data->drm_fd, pipe_obj->crtc_id,
> -					  lut_size, lut, lut, lut), 0);
> +	ret = drmModeCrtcSetGamma(data->drm_fd, pipe_obj->crtc_id,
> +				  lut_size, lut, lut, lut);
> +	igt_assert_eq(ret, 0);

Unrelated change. What is wrong with this check?

- Bhanu

>   
>   	free(lut);
>   }

  parent reply	other threads:[~2023-08-07 18:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 16:36 [igt-dev] [PATCH v2] tests/kms_plane: Handle hw without legacy gamma support Rob Clark
2023-08-07 17:26 ` [igt-dev] ○ CI.xeBAT: info for tests/kms_plane: Handle hw without legacy gamma support (rev2) Patchwork
2023-08-07 17:36 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-08-07 18:56 ` Modem, Bhanuprakash [this message]
2023-08-07 19:57   ` [igt-dev] [PATCH v2] tests/kms_plane: Handle hw without legacy gamma support Rob Clark
2023-08-07 22:07 ` [igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_plane: Handle hw without legacy gamma support (rev2) Patchwork

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=f0aee465-3e20-dac2-a16c-5bcff746e0d6@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=robdclark@chromium.org \
    --cc=robdclark@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox