public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Wentland, Harry" <Harry.Wentland@amd.com>
To: "Kazlauskas, Nicholas" <Nicholas.Kazlauskas@amd.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t v2 1/3] lib/drmtest: Add helpers to check and require amdgpu
Date: Wed, 27 Mar 2019 15:09:52 +0000	[thread overview]
Message-ID: <b878fc63-87b9-2481-2eb6-3e8d58c34a01@amd.com> (raw)
In-Reply-To: <20190315150442.10237-1-nicholas.kazlauskas@amd.com>



On 2019-03-15 11:04 a.m., Nicholas Kazlauskas wrote:
> These helpers will be used to address amdgpu specific quirks and
> features. They're implemented like the i915 and VC4 helpers.
> 
> In order for the string comparison to pick up "amdgpu" the buffer size
> had to be expanded for __is_device. I've gone ahead and made it 12 bytes
> to cover everything that's there right now.
> 
> v2: rebase
> 
> Cc: Leo Li <sunpeng.li@amd.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>  lib/drmtest.c | 12 +++++++++++-
>  lib/drmtest.h |  2 ++
>  2 files changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index 6506791b..d09638e8 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -93,7 +93,7 @@ static int __get_drm_device_name(int fd, char *name, int name_size)
>  
>  static bool __is_device(int fd, const char *expect)
>  {
> -	char name[5] = "";
> +	char name[12] = "";
>  
>  	if (__get_drm_device_name(fd, name, sizeof(name) - 1))
>  		return false;
> @@ -101,6 +101,11 @@ static bool __is_device(int fd, const char *expect)
>  	return strcmp(expect, name) == 0;
>  }
>  
> +bool is_amdgpu_device(int fd)
> +{
> +	return __is_device(fd, "amdgpu");
> +}
> +
>  bool is_i915_device(int fd)
>  {
>  	return __is_device(fd, "i915");
> @@ -485,6 +490,11 @@ int drm_open_driver_render(int chipset)
>  	return fd;
>  }
>  
> +void igt_require_amdgpu(int fd)
> +{
> +	igt_require(is_amdgpu_device(fd));
> +}
> +
>  void igt_require_intel(int fd)
>  {
>  	igt_require(is_i915_device(fd) && has_known_intel_chipset(fd));
> diff --git a/lib/drmtest.h b/lib/drmtest.h
> index ca347a71..f509e0d4 100644
> --- a/lib/drmtest.h
> +++ b/lib/drmtest.h
> @@ -79,9 +79,11 @@ int __drm_open_driver(int chipset);
>  
>  void gem_quiescent_gpu(int fd);
>  
> +void igt_require_amdgpu(int fd);
>  void igt_require_intel(int fd);
>  void igt_require_vc4(int fd);
>  
> +bool is_amdgpu_device(int fd);
>  bool is_i915_device(int fd);
>  bool is_vc4_device(int fd);
>  
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

      parent reply	other threads:[~2019-03-27 15:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-15 15:04 [igt-dev] [PATCH i-g-t v2 1/3] lib/drmtest: Add helpers to check and require amdgpu Nicholas Kazlauskas
2019-03-15 15:04 ` [igt-dev] [PATCH i-g-t v2 2/3] lib/debugfs: Don't do CRC sanity checks on amdgpu Nicholas Kazlauskas
2019-03-27 15:10   ` Wentland, Harry
2019-03-27 17:09     ` Daniel Vetter
2019-03-27 17:17       ` Kazlauskas, Nicholas
2019-03-28  9:11         ` Daniel Vetter
2019-03-15 15:04 ` [igt-dev] [PATCH i-g-t v2 3/3] lib/igt_fb: Align min_stride to 256 bytes for YUV buffers " Nicholas Kazlauskas
2019-03-27 15:15   ` Wentland, Harry
2019-03-18 10:13 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/3] lib/drmtest: Add helpers to check and require amdgpu (rev2) Patchwork
2019-03-18 11:54 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-03-27 15:09 ` Wentland, Harry [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=b878fc63-87b9-2481-2eb6-3e8d58c34a01@amd.com \
    --to=harry.wentland@amd.com \
    --cc=Nicholas.Kazlauskas@amd.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