From: Matt Atwood <matthew.s.atwood@intel.com>
To: Gustavo Sousa <gustavo.sousa@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v2 05/11] lib/xe: Return boolean from xe_wa()
Date: Tue, 20 Oct 2026 14:32:27 -0700 [thread overview]
Message-ID: <20261020213227.GD180749@msatwood-mobl> (raw)
In-Reply-To: <20260923-wa_14026539277-v2-5-528b575299d2@intel.com>
On Wed, Sep 23, 2026 at 06:41:12PM -0300, Gustavo Sousa wrote:
> The function xe_wa() will cause a warning to be printed when an error
> condition is found. Since the current users of xe_wa() do not check
> for errors, let's just convert the function to return a boolean.
>
> Checking for xe_wa(...) instead of xe_wa(...) > 0 feels more natural.
>
Reviewed-by: Matt Atwood <matthew.s.atwood@intel.com>
> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
> ---
> lib/xe/xe_wa.c | 11 ++++++-----
> lib/xe/xe_wa.h | 4 +++-
> tests/intel/xe_oa.c | 2 +-
> 3 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/lib/xe/xe_wa.c b/lib/xe/xe_wa.c
> index 59064219cd96..05af64151e7c 100644
> --- a/lib/xe/xe_wa.c
> +++ b/lib/xe/xe_wa.c
> @@ -177,20 +177,21 @@ int xe_wa_test_debugfs_dump_has_wa(char *dump, const char *wa)
> * @fd: A drm file descriptor.
> * @wa: Name of the workaround to be checked.
> *
> - * Returns 1 if enabled, 0 if disabled, -1 on error.
> + * Return a boolean indicating whether the workaround is enabled.
> + * On error, returns false and a warning is printed.
> */
> -int xe_wa(int fd, const char *wa)
> +bool xe_wa(int fd, const char *wa)
> {
> struct xe_wa_cache *wa_cache = xe_device_get(fd)->wa_cache;
>
> if (igt_warn_on(!wa_cache))
> - return -1;
> + return false;
>
> for (int i = 0; i < wa_cache->num_dumps; i++)
> if (debugfs_dump_has_wa(wa_cache->dumps[i], wa))
> - return 1;
> + return true;
>
> - return 0;
> + return false;
> }
>
> /**
> diff --git a/lib/xe/xe_wa.h b/lib/xe/xe_wa.h
> index f0a826553df8..aa1c50c0f9c9 100644
> --- a/lib/xe/xe_wa.h
> +++ b/lib/xe/xe_wa.h
> @@ -6,9 +6,11 @@
> #ifndef XE_WA_H
> #define XE_WA_H
>
> +#include <stdbool.h>
> +
> struct xe_device;
>
> -int xe_wa(int fd, const char *wa);
> +bool xe_wa(int fd, const char *wa);
>
> void xe_wa_build_cache(struct xe_device *xe_dev);
> void xe_wa_free_cache(struct xe_device *xe_dev);
> diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
> index 9571c62c115e..8ce39e6c5064 100644
> --- a/tests/intel/xe_oa.c
> +++ b/tests/intel/xe_oa.c
> @@ -2585,7 +2585,7 @@ test_non_zero_reason(const struct drm_xe_oa_unit *oau, size_t oa_buffer_size)
> * can result in buffer overflows.
> */
> if (oau->oa_unit_type == DRM_XE_OA_UNIT_TYPE_MERT &&
> - xe_wa(drm_fd, "14026633728") > 0) {
> + xe_wa(drm_fd, "14026633728")) {
> oa_exponent = max(oa_exponent, 8);
> properties[9] = oa_exponent;
> }
>
> --
> 2.55.0
>
next prev parent reply other threads:[~2026-10-20 21:33 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 21:41 [PATCH i-g-t v2 00/11] Implement Wa_14026539277 Gustavo Sousa
2026-09-23 21:41 ` [PATCH i-g-t v2 01/11] lib/xe: Move lib/intel_wa to lib/xe/xe_wa Gustavo Sousa
2026-09-23 21:41 ` [PATCH i-g-t v2 02/11] lib/xe: Make debugfs_file_has_wa() aware of the debugfs file layout Gustavo Sousa
2026-10-20 21:15 ` Matt Atwood
2026-09-23 21:41 ` [PATCH i-g-t v2 03/11] lib/xe: Gather workarounds debugfs dumps in a cache struct Gustavo Sousa
2026-10-20 21:24 ` Matt Atwood
2026-10-20 22:49 ` Gustavo Sousa
2026-09-23 21:41 ` [PATCH i-g-t v2 04/11] lib/xe: Cache workaround information in xe_device Gustavo Sousa
2026-10-20 21:30 ` Matt Atwood
2026-09-23 21:41 ` [PATCH i-g-t v2 05/11] lib/xe: Return boolean from xe_wa() Gustavo Sousa
2026-10-20 21:32 ` Matt Atwood [this message]
2026-09-23 21:41 ` [PATCH i-g-t v2 06/11] lib/xe: Assert that cache is available for xe_wa() Gustavo Sousa
2026-10-20 21:33 ` Matt Atwood
2026-09-23 21:41 ` [PATCH i-g-t v2 07/11] tests/intel/xe_pat: Adapt pat_entry_is_wb() to Xe3p Gustavo Sousa
2026-09-23 21:41 ` [PATCH i-g-t v2 08/11] lib/xe: Add xe_wa_from_cache() Gustavo Sousa
2026-09-23 21:41 ` [PATCH i-g-t v2 09/11] lib/intel_pat: Encapsulate management of xe_device's pat_cache Gustavo Sousa
2026-10-20 21:35 ` Matt Atwood
2026-09-23 21:41 ` [PATCH i-g-t v2 10/11] lib/intel_pat: Pass xe_device to xe_get_pat_config() Gustavo Sousa
2026-09-23 21:41 ` [PATCH i-g-t v2 11/11] intel: Implement Wa_14026539277 Gustavo Sousa
2026-09-24 1:52 ` ✓ i915.CI.BAT: success for Implement Wa_14026539277 (rev2) Patchwork
2026-09-24 2:18 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-24 16:04 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-25 0:41 ` ✗ i915.CI.Full: " 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=20261020213227.GD180749@msatwood-mobl \
--to=matthew.s.atwood@intel.com \
--cc=gustavo.sousa@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.