From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t 01/10] lib/xe: Move lib/intel_wa to lib/xe/xe_wa
Date: Wed, 29 Jul 2026 18:09:13 -0300 [thread overview]
Message-ID: <87se51zeo6.fsf@intel.com> (raw)
In-Reply-To: <20260729210427.GA7790@mdroper-desk1.amr.corp.intel.com>
Matt Roper <matthew.d.roper@intel.com> writes:
> On Tue, Jul 21, 2026 at 03:59:54PM -0300, Gustavo Sousa wrote:
>> The functionality provided by intel_wa is specific devices managed by
>> the xe driver, so move that module to belong to the lib/xe folder.
>>
>> While at it, change the function signature to match the adopted
>> standard for lib/xe (used xe_query.h as example).
>>
>> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
>> ---
>> lib/intel_wa.h | 11 -----------
>> lib/meson.build | 2 +-
>> lib/{intel_wa.c => xe/xe_wa.c} | 21 +++++++++++----------
>> lib/xe/xe_wa.h | 11 +++++++++++
>> tests/intel/xe_oa.c | 4 ++--
>> 5 files changed, 25 insertions(+), 24 deletions(-)
>>
>> diff --git a/lib/intel_wa.h b/lib/intel_wa.h
>> deleted file mode 100644
>> index 765a5948ef88..000000000000
>> --- a/lib/intel_wa.h
>> +++ /dev/null
>> @@ -1,11 +0,0 @@
>> -/* SPDX-License-Identifier: MIT */
>> -/*
>> - * Copyright © 2025 Intel Corporation
>> - */
>> -
>> -#ifndef __INTEL_WA_H__
>> -#define __INTEL_WA_H__
>> -
>> -int igt_has_intel_wa(int drm_fd, const char *check_wa);
>> -
>> -#endif /* __INTEL_WA_H__ */
>> diff --git a/lib/meson.build b/lib/meson.build
>> index 8db9fffdecec..b31936d6c3fd 100644
>> --- a/lib/meson.build
>> +++ b/lib/meson.build
>> @@ -93,7 +93,6 @@ lib_sources = [
>> 'intel_aux_pgtable.c',
>> 'intel_reg_map.c',
>> 'intel_iosf.c',
>> - 'intel_wa.c',
>> 'igt_kms.c',
>> 'igt_fb.c',
>> 'igt_core.c',
>> @@ -135,6 +134,7 @@ lib_sources = [
>> 'xe/xe_sriov_debugfs.c',
>> 'xe/xe_sriov_provisioning.c',
>> 'xe/xe_util.c',
>> + 'xe/xe_wa.c',
>>
>> # Vendored libraries:
>> 'vendor/uwildmat/uwildmat.c',
>> diff --git a/lib/intel_wa.c b/lib/xe/xe_wa.c
>> similarity index 66%
>> rename from lib/intel_wa.c
>> rename to lib/xe/xe_wa.c
>> index 727dd6c988df..ff5daf529831 100644
>> --- a/lib/intel_wa.c
>> +++ b/lib/xe/xe_wa.c
>> @@ -9,7 +9,8 @@
>>
>> #include "igt_debugfs.h"
>> #include "igt_sysfs.h"
>> -#include "intel_wa.h"
>> +
>> +#include "xe/xe_wa.h"
>> #include "xe/xe_query.h"
>
> Nitpick: These aren't sorted.
Thanks.
>
>>
>> static int debugfs_file_has_wa(int drm_fd, int debugfs_fd,
>> @@ -34,32 +35,32 @@ static int debugfs_file_has_wa(int drm_fd, int debugfs_fd,
>> }
>>
>> /**
>> - * igt_has_intel_wa:
>> - * @drm_fd: A drm file descriptor
>> - * @check_wa: Workaround to be checked
>> + * xe_wa: Check if a workaround is enabled for the device.
>> + * @fd: A drm file descriptor.
>> + * @wa: Name of the workaround to be checked.
>> *
>> - * Returns: 0 if no WA, 1 if WA present, -1 on error
>> + * Returns 1 if enabled, 0 if disabled, -1 on error.
>> */
>> -int igt_has_intel_wa(int drm_fd, const char *check_wa)
>> +int xe_wa(int fd, const char *wa)
>> {
>> int ret = 0;
>> int debugfs_fd;
>> unsigned int xe;
>> char name[256];
>>
>> - debugfs_fd = igt_debugfs_dir(drm_fd);
>> + debugfs_fd = igt_debugfs_dir(fd);
>> if (debugfs_fd == -1)
>> return -1;
>>
>> - xe_for_each_gt(drm_fd, xe) {
>> + xe_for_each_gt(fd, xe) {
>> sprintf(name, "gt%d/workarounds", xe);
>> - ret = debugfs_file_has_wa(drm_fd, debugfs_fd, name, check_wa);
>> + ret = debugfs_file_has_wa(fd, debugfs_fd, name, wa);
>> if (ret)
>> break;
>> }
>>
>> if (!ret)
>> - ret = debugfs_file_has_wa(drm_fd, debugfs_fd, "workarounds", check_wa);
>> + ret = debugfs_file_has_wa(fd, debugfs_fd, "workarounds", wa);
>>
>> close(debugfs_fd);
>> return ret;
>> diff --git a/lib/xe/xe_wa.h b/lib/xe/xe_wa.h
>> new file mode 100644
>> index 000000000000..4ff897196545
>> --- /dev/null
>> +++ b/lib/xe/xe_wa.h
>> @@ -0,0 +1,11 @@
>> +/* SPDX-License-Identifier: MIT */
>> +/*
>> + * Copyright © 2025 Intel Corporation
>
> Nitpick: This should say 2026.
Even though we are essentially moving the content?
>
>
> Aside from those two minor things,
>
> Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Thanks!
--
Gustavo Sousa
>
>
> Matt
>
>> + */
>> +
>> +#ifndef XE_WA_H
>> +#define XE_WA_H
>> +
>> +int xe_wa(int fd, const char *wa);
>> +
>> +#endif /* XE_WA_H */
>> diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
>> index 68c7537d3888..fcf1d71a167f 100644
>> --- a/tests/intel/xe_oa.c
>> +++ b/tests/intel/xe_oa.c
>> @@ -24,10 +24,10 @@
>> #include "igt_device.h"
>> #include "igt_syncobj.h"
>> #include "igt_sysfs.h"
>> -#include "intel_wa.h"
>> #include "xe/xe_ioctl.h"
>> #include "xe/xe_query.h"
>> #include "xe/xe_oa.h"
>> +#include "xe/xe_wa.h"
>>
>> /**
>> * TEST: perf
>> @@ -2678,7 +2678,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 &&
>> - igt_has_intel_wa(drm_fd, "14026633728") > 0) {
>> + xe_wa(drm_fd, "14026633728") > 0) {
>> oa_exponent = max(oa_exponent, 8);
>> properties[9] = oa_exponent;
>> }
>>
>> --
>> 2.55.0
>>
>
> --
> Matt Roper
> Graphics Software Engineer
> Linux GPU Platform Enablement
> Intel Corporation
next prev parent reply other threads:[~2026-07-29 21:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 18:59 [PATCH i-g-t 00/10] Implement Wa_14026539277 Gustavo Sousa
2026-07-21 18:59 ` [PATCH i-g-t 01/10] lib/xe: Move lib/intel_wa to lib/xe/xe_wa Gustavo Sousa
2026-07-29 21:04 ` Matt Roper
2026-07-29 21:09 ` Gustavo Sousa [this message]
2026-07-21 18:59 ` [PATCH i-g-t 02/10] lib/xe: Use stricter line-equality check when checking for workarounds Gustavo Sousa
2026-07-29 21:23 ` Matt Roper
2026-07-21 18:59 ` [PATCH i-g-t 03/10] lib/xe: Gather workarounds debugfs dumps Gustavo Sousa
2026-07-29 21:39 ` Matt Roper
2026-07-21 18:59 ` [PATCH i-g-t 04/10] lib/xe: Cache workaround information in xe_device Gustavo Sousa
2026-07-29 21:58 ` Matt Roper
2026-07-21 18:59 ` [PATCH i-g-t 05/10] lib/xe: Return boolean from xe_wa() Gustavo Sousa
2026-07-29 22:14 ` Matt Roper
2026-07-21 18:59 ` [PATCH i-g-t 06/10] tests/intel/xe_pat: Adapt pat_entry_is_wb() to Xe3p Gustavo Sousa
2026-07-29 22:16 ` Matt Roper
2026-07-21 19:00 ` [PATCH i-g-t 07/10] lib/xe: Add xe_wa_from_cache() Gustavo Sousa
2026-07-29 22:20 ` Matt Roper
2026-07-21 19:00 ` [PATCH i-g-t 08/10] lib/intel_pat: Encapsulate management of xe_device's pat_cache Gustavo Sousa
2026-07-29 22:35 ` Matt Roper
2026-07-21 19:00 ` [PATCH i-g-t 09/10] lib/intel_pat: Pass xe_device to xe_get_pat_config() Gustavo Sousa
2026-07-29 22:38 ` Matt Roper
2026-07-21 19:00 ` [PATCH i-g-t 10/10] intel: Implement Wa_14026539277 Gustavo Sousa
2026-07-21 23:18 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-07-21 23:56 ` ✓ i915.CI.BAT: " Patchwork
2026-07-22 14:09 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-22 22:52 ` ✗ i915.CI.Full: failure " 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=87se51zeo6.fsf@intel.com \
--to=gustavo.sousa@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=matthew.d.roper@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