From: "Belgaumkar, Vinay" <vinay.belgaumkar@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
<intel-gfx@lists.freedesktop.org>,
<igt-dev@lists.freedesktop.org>,
"Sk Anirban" <sk.anirban@intel.com>
Subject: Re: [PATCH v2 i-g-t 1/2] lib/xe_gt: Add function to toggle efficient freq
Date: Wed, 18 Nov 2026 16:15:35 -0800 [thread overview]
Message-ID: <203434d5-3fdb-4e77-81d6-4784b74413c1@intel.com> (raw)
In-Reply-To: <bcxh4lgvnmcloc3ovgobcf42x2pszklx3w2vlffrpnaqwjdhrd@by5cigap77ec>
On 11/17/2026 6:19 AM, Kamil Konieczny wrote:
> Hi Vinay,
> On 2026-11-12 at 18:11:50 -0800, Vinay Belgaumkar wrote:
>> This writes to the use_rpe sysfs interface to toggle the use
>> of GT efficient frequency. The KMD patch that introduces this
>> sysfs is at: https://patchwork.freedesktop.org/series/178352/
>>
>> v2: Address review comments (Anirban)
>>
>> Cc: Sk Anirban <sk.anirban@intel.com>
>> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
>> ---
>> lib/xe/xe_gt.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++
>> lib/xe/xe_gt.h | 2 ++
>> 2 files changed, 61 insertions(+)
>>
>> diff --git a/lib/xe/xe_gt.c b/lib/xe/xe_gt.c
>> index 1f0b77986..6f33df890 100644
>> --- a/lib/xe/xe_gt.c
>> +++ b/lib/xe/xe_gt.c
>> @@ -345,6 +345,65 @@ int xe_gt_set_freq(int fd, int gt_id, const char *freq_name, uint32_t freq)
>> return ret;
>> }
>>
>> +/**
>> + * xe_gt_set_use_rpe:
>> + * @fd: pointer to xe drm fd
>> + * @gt_id: GT id
>> + * @val: Value to set use_rpe
>> + *
>> + * Set use_rpe. Function will assert if the sysfs node is
>> + * not found.
>> + *
>> + * Return: success or failure
>> + */
>> +int xe_gt_set_use_rpe(int fd, int gt_id, uint32_t val)
>> +{
>> + int ret = -EAGAIN;
>> + int gt_fd;
>> +
>> + gt_fd = xe_sysfs_gt_open(fd, gt_id);
>> + igt_assert_lte(0, gt_fd);
>> +
>> + while (ret == -EAGAIN)
>> + ret = igt_sysfs_printf(gt_fd, "freq0/use_rpe", "%u", val);
>> +
>> + close(gt_fd);
>> +
>> + return ret;
>> +}
>> +
>> +/**
>> + * xe_gt_get_use_rpe:
>> + * @fd: pointer to xe drm fd
>> + * @gt_id: GT id
>> + *
>> + * Get use_rpe. Function will assert if the sysfs node is
>> + * not found.
>> + *
>> + * Return: use_rpe value
>> + */
>> +uint32_t xe_gt_get_use_rpe(int fd, int gt_id)
>> +{
>> + int err = -EAGAIN;
>> + int gt_fd;
>> + uint32_t use_rpe;
>> +
>> + igt_debug("Opening attr: %s\n", "freq0/rpe");
>> + gt_fd = xe_sysfs_gt_open(fd, gt_id);
>> + igt_assert_lte(0, gt_fd);
>> +
>> + while (err == -EAGAIN)
>> + err = igt_sysfs_scanf(gt_fd, "freq0/use_rpe", "%u", &use_rpe);
>> +
>> + igt_assert_eq(err, 1);
> Can you fallback to old method on older kernels?
> I mean when err == -ENOENTRY.
Older kernels do not support any way to check/change RPe support.
Thanks,
Vinay.
>
> Regards,
> Kamil
>
>
>> +
>> + igt_debug("gt%d: use_rpe %u\n", gt_id, use_rpe);
>> +
>> + close(gt_fd);
>> +
>> + return use_rpe;
>> +}
>> +
>> /**
>> * xe_gt_get_freq:
>> * @fd: pointer to xe drm fd
>> diff --git a/lib/xe/xe_gt.h b/lib/xe/xe_gt.h
>> index 9ef15d7dd..7f824ca63 100644
>> --- a/lib/xe/xe_gt.h
>> +++ b/lib/xe/xe_gt.h
>> @@ -29,4 +29,6 @@ int xe_gt_count_engines_by_class(int fd, int gt, int class);
>>
>> int xe_gt_set_freq(int fd, int gt_id, const char *freq_name, uint32_t freq);
>> uint32_t xe_gt_get_freq(int fd, int gt_id, const char *freq_name);
>> +uint32_t xe_gt_get_use_rpe(int fd, int gt_id);
>> +int xe_gt_set_use_rpe(int fd, int gt_id, uint32_t val);
>> #endif
>> --
>> 2.53.0
>>
next prev parent reply other threads:[~2026-11-19 0:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 2:11 [PATCH v2 i-g-t 1/2] lib/xe_gt: Add function to toggle efficient freq Vinay Belgaumkar
2026-11-13 2:11 ` [PATCH v2 i-g-t 2/2] tests/xe_gt_freq: Disable efficient freq using sysfs Vinay Belgaumkar
2026-12-03 18:02 ` Anirban, Sk
2026-11-13 3:38 ` ✓ Xe.CI.BAT: success for series starting with [v2,i-g-t,1/2] lib/xe_gt: Add function to toggle efficient freq Patchwork
2026-11-13 3:57 ` ✓ i915.CI.BAT: " Patchwork
2026-11-13 16:44 ` ✓ Xe.CI.FULL: " Patchwork
2026-11-14 8:06 ` ✗ i915.CI.Full: failure " Patchwork
2026-11-17 14:19 ` [PATCH v2 i-g-t 1/2] " Kamil Konieczny
2026-11-19 0:15 ` Belgaumkar, Vinay [this message]
2026-12-03 17:38 ` Anirban, Sk
2026-12-03 22:37 ` Belgaumkar, Vinay
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=203434d5-3fdb-4e77-81d6-4784b74413c1@intel.com \
--to=vinay.belgaumkar@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.com \
--cc=sk.anirban@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