Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [i-g-t 1/5] lib/drmtest: Add helpers to check and require the XE driver
Date: Tue, 14 Mar 2023 12:57:52 +0100	[thread overview]
Message-ID: <20230314125752.009f197a@maurocar-mobl2> (raw)
In-Reply-To: <20230314105452.2169208-2-bhanuprakash.modem@intel.com>

On Tue, 14 Mar 2023 16:24:48 +0530
Bhanuprakash Modem <bhanuprakash.modem@intel.com> wrote:

> In order to add support for features specific to the XE driver, add
> helpers for checking and requiring the driver.
> 
> This patch will also update igt_require_intel() to support XE, and
> create new helper igt_require_i915() as both i915 & XE belongs to
> intel.
> 
> Credits-to: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> ---
>  lib/drmtest.c | 20 ++++++++++++++++++++
>  lib/drmtest.h |  4 ++++
>  2 files changed, 24 insertions(+)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index 0ceab1038..ef0d4909f 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -139,6 +139,16 @@ bool is_vc4_device(int fd)
>  	return __is_device(fd, "vc4");
>  }
>  
> +bool is_xe_device(int fd)
> +{
> +	return __is_device(fd, "xe");
> +}
> +
> +bool is_intel_device(int fd)
> +{
> +	return is_i915_device(fd) || is_xe_device(fd);
> +}
> +
>  static char _forced_driver[16] = "";
>  
>  /**
> @@ -645,6 +655,11 @@ void igt_require_amdgpu(int fd)
>  }
>  
>  void igt_require_intel(int fd)
> +{
> +	igt_require(is_i915_device(fd) || is_xe_device(fd));

I would code it as:

	igt_require(is_intel_device(fd))

With that:

Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>

> +}
> +
> +void igt_require_i915(int fd)
>  {
>  	igt_require(is_i915_device(fd));
>  }
> @@ -658,3 +673,8 @@ void igt_require_vc4(int fd)
>  {
>  	igt_require(is_vc4_device(fd));
>  }
> +
> +void igt_require_xe(int fd)
> +{
> +	igt_require(is_xe_device(fd));
> +}
> diff --git a/lib/drmtest.h b/lib/drmtest.h
> index 448ac03b4..392470ac0 100644
> --- a/lib/drmtest.h
> +++ b/lib/drmtest.h
> @@ -99,8 +99,10 @@ int __drm_open_driver_render(int chipset);
>  
>  void igt_require_amdgpu(int fd);
>  void igt_require_intel(int fd);
> +void igt_require_i915(int fd);
>  void igt_require_nouveau(int fd);
>  void igt_require_vc4(int fd);
> +void igt_require_xe(int fd);
>  
>  bool is_amdgpu_device(int fd);
>  bool is_i915_device(int fd);
> @@ -108,6 +110,8 @@ bool is_mtk_device(int fd);
>  bool is_msm_device(int fd);
>  bool is_nouveau_device(int fd);
>  bool is_vc4_device(int fd);
> +bool is_xe_device(int fd);
> +bool is_intel_device(int fd);
>  
>  /**
>   * do_or_die:

  parent reply	other threads:[~2023-03-14 11:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 10:54 [igt-dev] [i-g-t 0/5] Add basic helpers to support display in XE Bhanuprakash Modem
2023-03-14 10:54 ` [igt-dev] [i-g-t 1/5] lib/drmtest: Add helpers to check and require the XE driver Bhanuprakash Modem
2023-03-14 11:14   ` Zbigniew Kempczyński
2023-03-14 11:57   ` Mauro Carvalho Chehab [this message]
2023-03-14 10:54 ` [igt-dev] [i-g-t 2/5] i915: s/igt_require_intel/igt_require_i915 Bhanuprakash Modem
2023-03-14 11:15   ` Zbigniew Kempczyński
2023-03-14 12:03   ` Mauro Carvalho Chehab
2023-03-14 14:32     ` Modem, Bhanuprakash
2023-03-14 10:54 ` [igt-dev] [i-g-t 3/5] lib/xe/xe_query: Add dev_id() interface Bhanuprakash Modem
2023-03-14 11:17   ` Zbigniew Kempczyński
2023-03-14 12:06   ` Mauro Carvalho Chehab
2023-03-14 10:54 ` [igt-dev] [i-g-t 4/5] lib/intel_chipset: Add support to XE driver to get devid Bhanuprakash Modem
2023-03-14 11:20   ` Zbigniew Kempczyński
2023-03-14 12:08   ` Mauro Carvalho Chehab
2023-03-14 12:20     ` Zbigniew Kempczyński
2023-03-14 14:30       ` Modem, Bhanuprakash
2023-03-14 10:54 ` [igt-dev] [i-g-t 5/5] lib/igt_kms: Cache xe_device info for kms tests Bhanuprakash Modem
2023-03-14 11:38   ` Zbigniew Kempczyński
2023-03-14 12:08   ` Mauro Carvalho Chehab
2023-03-14 12:45 ` [igt-dev] ✓ Fi.CI.BAT: success for Add basic helpers to support display in XE Patchwork
2023-03-15 16:57 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20230314125752.009f197a@maurocar-mobl2 \
    --to=mauro.chehab@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox