public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	<igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t] tests/intel/kms_pwrite_crc: Create basic subtest
Date: Tue, 21 Apr 2026 08:58:02 +0530	[thread overview]
Message-ID: <409b4955-27be-4be4-9740-2f5f3f0582a1@intel.com> (raw)
In-Reply-To: <20260420150753.96250-1-kamil.konieczny@linux.intel.com>

Hi Kamil,

On 4/20/2026 8:37 PM, Kamil Konieczny wrote:
> Create a basic subtests which allows to properly cleanup after
> any failure or a skip. Also while at this, move an igt header
> to proper place.
>
> Cc: Karthik B S <karthik.b.s@intel.com>
> Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
>   tests/intel/kms_pwrite_crc.c | 39 +++++++++++++++++++++++-------------
>   1 file changed, 25 insertions(+), 14 deletions(-)
>
> diff --git a/tests/intel/kms_pwrite_crc.c b/tests/intel/kms_pwrite_crc.c
> index bd536007c..92f5292dd 100644
> --- a/tests/intel/kms_pwrite_crc.c
> +++ b/tests/intel/kms_pwrite_crc.c
> @@ -30,15 +30,16 @@
>    * Mega feature: General Display Features
>    */
>   
> -#include "igt.h"
>   #include <errno.h>
>   #include <limits.h>
>   #include <stdbool.h>
>   #include <stdio.h>
>   #include <string.h>
>   
> +#include "igt.h"
> +
>   /**
> - * SUBTEST:
> + * SUBTEST: basic
>    * Description: Use the display CRC support to validate pwrite to an already
>    *              uncached future scanout buffer.
>    */
> @@ -192,22 +193,32 @@ static void run_test(data_t *data)
>   	igt_skip("no valid crtc/connector combinations found\n");
>   }
>   
> -static data_t data;
> +static data_t data = { };
>   
> -int igt_simple_main()
> +int igt_main()
>   {
> -	data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
> -	kmstest_set_vt_graphics_mode();
> +	igt_fixture() {
> +		data.drm_fd = -1;

This is redundant with the next line?

> +		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
> +		kmstest_set_vt_graphics_mode();
>   
> -	igt_display_require(&data.display, data.drm_fd);
> -	igt_display_require_output(&data.display);
> -	igt_require_pipe_crc(data.drm_fd);
> +		igt_display_require(&data.display, data.drm_fd);
> +		igt_display_require_output(&data.display);
> +		igt_require_pipe_crc(data.drm_fd);
>   
> -	data.devid = intel_get_drm_devid(data.drm_fd);
> -	data.pipe_crc = NULL;
> +		data.devid = intel_get_drm_devid(data.drm_fd);
> +		data.pipe_crc = NULL;
> +	}
>   
> -	run_test(&data);
> +	igt_describe("Use the display CRC support to validate pwrite "
> +		     "to an already uncached future scanout buffer.");
> +	igt_subtest("basic")
> +		run_test(&data);
>   
> -	igt_display_fini(&data.display);
> -	drm_close_driver(data.drm_fd);
> +	igt_fixture() {
> +		if (data.drm_fd != -1) {

Similar redundancy here? If drm_fd = -1, the test will be skipped in the 
first fixture itself and this check is not needed?

With these removed the patch LGTM,

Reviewed-by: Karthik B S <karthik.b.s@intel.com>

> +			igt_display_fini(&data.display);
> +			drm_close_driver(data.drm_fd);
> +		}
> +	}
>   }

  reply	other threads:[~2026-04-21  3:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 15:07 [PATCH i-g-t] tests/intel/kms_pwrite_crc: Create basic subtest Kamil Konieczny
2026-04-21  3:28 ` Karthik B S [this message]
2026-04-21 12:05   ` Kamil Konieczny

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=409b4955-27be-4be4-9740-2f5f3f0582a1@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@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