* [PATCH i-g-t v1 0/2] Allow intel_reg tool to work also with accelerators
@ 2026-06-17 20:25 Kamil Konieczny
2026-06-17 20:25 ` [PATCH i-g-t v1 1/2] lib/intel_chipset: Create intel_get_pci_accelerator_device() function Kamil Konieczny
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Kamil Konieczny @ 2026-06-17 20:25 UTC (permalink / raw)
To: igt-dev
Cc: Kamil Konieczny, Ashutosh Dixit, Jani Nikula, Janusz Krzysztofik,
Lukasz Laguna, Zbigniew Kempczyński
An Intel tool for register access could also be used for
accelerators. While the device could be accesed by BDF address
with the help of --pci-slot option, allow a tool to work with
default device found on PCI bus. When no Intel display device
is present then intel_reg will search for Intel accelerator and
it will use it for operations on registers.
For reference please look into https://patchwork.freedesktop.org/series/168385/
lib/intel_chipset: Extend intel_get_pci_device to PCI accelerator class
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Cc: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Kamil Konieczny (2):
lib/intel_chipset: Create intel_get_pci_accelerator_device() function
tools/intel_reg: Create default accelerator access
lib/intel_chipset.c | 47 ++++++++++++++++++++++++++++++++++++---------
lib/intel_chipset.h | 1 +
tools/intel_reg.c | 12 ++++++++++++
3 files changed, 51 insertions(+), 9 deletions(-)
--
2.54.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH i-g-t v1 1/2] lib/intel_chipset: Create intel_get_pci_accelerator_device() function
2026-06-17 20:25 [PATCH i-g-t v1 0/2] Allow intel_reg tool to work also with accelerators Kamil Konieczny
@ 2026-06-17 20:25 ` Kamil Konieczny
2026-06-17 20:25 ` [PATCH i-g-t v1 2/2] tools/intel_reg: Create default accelerator access Kamil Konieczny
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Kamil Konieczny @ 2026-06-17 20:25 UTC (permalink / raw)
To: igt-dev; +Cc: Kamil Konieczny, Ashutosh Dixit
Among Intel DRM devices there are also accelerators, so create
a new function for searching for them.
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
lib/intel_chipset.c | 47 ++++++++++++++++++++++++++++++++++++---------
lib/intel_chipset.h | 1 +
2 files changed, 39 insertions(+), 9 deletions(-)
diff --git a/lib/intel_chipset.c b/lib/intel_chipset.c
index 760faede2..9f9643414 100644
--- a/lib/intel_chipset.c
+++ b/lib/intel_chipset.c
@@ -64,15 +64,14 @@
enum pch_type intel_pch;
/**
- * intel_get_pci_device:
+ * intel_get_pci_device_by_class:
*
* Looks up the main graphics pci device using libpciaccess.
*
* Returns:
- * The pci_device, exits the program on any failures.
+ * The pci_device, exits the program on probe failure.
*/
-struct pci_device *
-intel_get_pci_device(void)
+static struct pci_device *intel_get_pci_device_by_class(unsigned int class)
{
struct pci_device *pci_dev;
int error;
@@ -81,7 +80,7 @@ intel_get_pci_device(void)
igt_fail_on_f(error != 0,
"Couldn't initialize PCI system\n");
- /* Grab the graphics card. Try the canonical slot first, then
+ /* Grab Intel device by class. Try the canonical slot first, then
* walk the entire PCI bus for a matching device. */
pci_dev = pci_device_find_by_slot(0, 0, 2, 0);
if (pci_dev == NULL || pci_dev->vendor_id != 0x8086) {
@@ -93,7 +92,7 @@ intel_get_pci_device(void)
match.subvendor_id = PCI_MATCH_ANY;
match.subdevice_id = PCI_MATCH_ANY;
- match.device_class = 0x3 << 16;
+ match.device_class = class << 16;
match.device_class_mask = 0xff << 16;
match.match_data = 0;
@@ -102,18 +101,48 @@ intel_get_pci_device(void)
pci_dev = pci_device_next(iter);
pci_iterator_destroy(iter);
}
- igt_require_f(pci_dev, "Couldn't find Intel graphics card\n");
+
+ if (!pci_dev)
+ return NULL;
error = pci_device_probe(pci_dev);
igt_fail_on_f(error != 0,
"Couldn't probe graphics card\n");
- if (pci_dev->vendor_id != 0x8086)
- errx(1, "Graphics card is non-intel");
+ if (pci_dev->vendor_id != 0x8086) /* should not happen */
+ errx(1, "PCI device 0x%02x card is non-intel", class);
return pci_dev;
}
+/**
+ * intel_get_pci_device:
+ *
+ * Looks up the main graphics pci device using libpciaccess.
+ *
+ * Returns:
+ * The pci_device or NULL if no Intel GPU card found.
+ */
+struct pci_device *intel_get_pci_device(void)
+{
+ /* PCI display (0x03) class devices */
+ return intel_get_pci_device_by_class(0x03);
+}
+
+/**
+ * intel_get_pci_accelerator_device:
+ *
+ * Looks up the main accelerator pci device using libpciaccess.
+ *
+ * Returns:
+ * The pci_device or NULL if no Intel accelerator card found.
+ */
+struct pci_device *intel_get_pci_accelerator_device(void)
+{
+ /* PCI accelerator (0x12) class devices */
+ return intel_get_pci_device_by_class(0x12);
+}
+
static uint32_t __i915_get_drm_devid(int fd)
{
struct drm_i915_getparam gp;
diff --git a/lib/intel_chipset.h b/lib/intel_chipset.h
index 98a2a81fc..82c7883ea 100644
--- a/lib/intel_chipset.h
+++ b/lib/intel_chipset.h
@@ -36,6 +36,7 @@
#define BIT(x) (1ul <<(x))
struct pci_device *intel_get_pci_device(void);
+struct pci_device *intel_get_pci_accelerator_device(void);
uint32_t intel_get_drm_devid(int fd);
struct intel_device_info {
--
2.54.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH i-g-t v1 2/2] tools/intel_reg: Create default accelerator access
2026-06-17 20:25 [PATCH i-g-t v1 0/2] Allow intel_reg tool to work also with accelerators Kamil Konieczny
2026-06-17 20:25 ` [PATCH i-g-t v1 1/2] lib/intel_chipset: Create intel_get_pci_accelerator_device() function Kamil Konieczny
@ 2026-06-17 20:25 ` Kamil Konieczny
2026-06-17 22:09 ` Dixit, Ashutosh
2026-06-17 22:14 ` ✓ Xe.CI.BAT: success for Allow intel_reg tool to work also with accelerators Patchwork
2026-06-17 22:29 ` ✓ i915.CI.BAT: " Patchwork
3 siblings, 1 reply; 6+ messages in thread
From: Kamil Konieczny @ 2026-06-17 20:25 UTC (permalink / raw)
To: igt-dev; +Cc: Kamil Konieczny, Ashutosh Dixit
Among computing devices there are GPU and accelerators and the
intel_reg tool worked only with former ones. Create new way for
finding a compute device and when no Intel GPU is found, then
search for Intel accelerator. Also, inform user about which type
of device will be accessed.
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
tools/intel_reg.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/intel_reg.c b/tools/intel_reg.c
index 49afe91c0..b4f8cd0fd 100644
--- a/tools/intel_reg.c
+++ b/tools/intel_reg.c
@@ -1382,6 +1382,18 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
} else {
config.pci_dev = intel_get_pci_device();
+ if (config.pci_dev) {
+ fprintf(stderr, "Found Intel GPU PCI device 0x%x\n", config.pci_dev->device_id);
+ } else {
+ config.pci_dev = intel_get_pci_accelerator_device();
+ if (config.pci_dev)
+ fprintf(stderr, "Found Intel accelerator PCI device 0x%x\n", config.pci_dev->device_id);
+ }
+
+ if (!config.pci_dev) {
+ fprintf(stderr, "Cannot find Intel GPU nor accelerator device\n");
+ return EXIT_FAILURE;
+ }
}
config.devid = config.pci_dev->device_id;
--
2.54.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH i-g-t v1 2/2] tools/intel_reg: Create default accelerator access
2026-06-17 20:25 ` [PATCH i-g-t v1 2/2] tools/intel_reg: Create default accelerator access Kamil Konieczny
@ 2026-06-17 22:09 ` Dixit, Ashutosh
0 siblings, 0 replies; 6+ messages in thread
From: Dixit, Ashutosh @ 2026-06-17 22:09 UTC (permalink / raw)
To: Kamil Konieczny; +Cc: igt-dev
On Wed, 17 Jun 2026 13:25:58 -0700, Kamil Konieczny wrote:
>
> Among computing devices there are GPU and accelerators and the
> intel_reg tool worked only with former ones. Create new way for
> finding a compute device and when no Intel GPU is found, then
> search for Intel accelerator. Also, inform user about which type
> of device will be accessed.
>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
> tools/intel_reg.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/tools/intel_reg.c b/tools/intel_reg.c
> index 49afe91c0..b4f8cd0fd 100644
> --- a/tools/intel_reg.c
> +++ b/tools/intel_reg.c
> @@ -1382,6 +1382,18 @@ int main(int argc, char *argv[])
> return EXIT_FAILURE;
> } else {
> config.pci_dev = intel_get_pci_device();
> + if (config.pci_dev) {
> + fprintf(stderr, "Found Intel GPU PCI device 0x%x\n", config.pci_dev->device_id);
> + } else {
> + config.pci_dev = intel_get_pci_accelerator_device();
> + if (config.pci_dev)
> + fprintf(stderr, "Found Intel accelerator PCI device 0x%x\n", config.pci_dev->device_id);
> + }
> +
> + if (!config.pci_dev) {
> + fprintf(stderr, "Cannot find Intel GPU nor accelerator device\n");
> + return EXIT_FAILURE;
> + }
So what I am not following is why you want to preserve
intel_get_pci_device() to just display class devices? In
https://patchwork.freedesktop.org/series/168385/ intel_get_pci_device() is
extended to both display and acceleretor class devices. So this kind of
modification to the individual tools is not needed at all.
Note that it is not just intel_reg. Similar modification will need to all
tools which currently call intel_get_pci_device(). They will now all have
to be changed to add the intel_get_pci_accelerator_device() calls,
something which is not needed with
https://patchwork.freedesktop.org/series/168385/ (especially rev1 of that
series). Because we would want most of these tools to "just work" with any
intel device (display or accelerator).
See also my comments here:
https://lore.kernel.org/igt-dev/87wlvyzbn0.wl-ashutosh.dixit@intel.com/
Anyway, let's see what other reviewers have to say about this.
Thanks.
--
Ashutosh
> }
>
> config.devid = config.pci_dev->device_id;
> --
> 2.54.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✓ Xe.CI.BAT: success for Allow intel_reg tool to work also with accelerators
2026-06-17 20:25 [PATCH i-g-t v1 0/2] Allow intel_reg tool to work also with accelerators Kamil Konieczny
2026-06-17 20:25 ` [PATCH i-g-t v1 1/2] lib/intel_chipset: Create intel_get_pci_accelerator_device() function Kamil Konieczny
2026-06-17 20:25 ` [PATCH i-g-t v1 2/2] tools/intel_reg: Create default accelerator access Kamil Konieczny
@ 2026-06-17 22:14 ` Patchwork
2026-06-17 22:29 ` ✓ i915.CI.BAT: " Patchwork
3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2026-06-17 22:14 UTC (permalink / raw)
To: Kamil Konieczny; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 1076 bytes --]
== Series Details ==
Series: Allow intel_reg tool to work also with accelerators
URL : https://patchwork.freedesktop.org/series/168736/
State : success
== Summary ==
CI Bug Log - changes from XEIGT_8971_BAT -> XEIGTPW_15391_BAT
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Participating hosts (13 -> 13)
------------------------------
No changes in participating hosts
Changes
-------
No changes found
Build changes
-------------
* IGT: IGT_8971 -> IGTPW_15391
* Linux: xe-5274-f7cb2873b7430d84afd4ad4e4771d3f8ad03fbf9 -> xe-5275-18816557ad112c94f3bf5ee625cd862d8d3f41af
IGTPW_15391: 1862c378ecfbf12c2dab61a1c11c7170f516506f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
IGT_8971: 8971
xe-5274-f7cb2873b7430d84afd4ad4e4771d3f8ad03fbf9: f7cb2873b7430d84afd4ad4e4771d3f8ad03fbf9
xe-5275-18816557ad112c94f3bf5ee625cd862d8d3f41af: 18816557ad112c94f3bf5ee625cd862d8d3f41af
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_15391/index.html
[-- Attachment #2: Type: text/html, Size: 1635 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✓ i915.CI.BAT: success for Allow intel_reg tool to work also with accelerators
2026-06-17 20:25 [PATCH i-g-t v1 0/2] Allow intel_reg tool to work also with accelerators Kamil Konieczny
` (2 preceding siblings ...)
2026-06-17 22:14 ` ✓ Xe.CI.BAT: success for Allow intel_reg tool to work also with accelerators Patchwork
@ 2026-06-17 22:29 ` Patchwork
3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2026-06-17 22:29 UTC (permalink / raw)
To: Kamil Konieczny; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 2917 bytes --]
== Series Details ==
Series: Allow intel_reg tool to work also with accelerators
URL : https://patchwork.freedesktop.org/series/168736/
State : success
== Summary ==
CI Bug Log - changes from IGT_8971 -> IGTPW_15391
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15391/index.html
Participating hosts (41 -> 40)
------------------------------
Additional (1): fi-skl-6600u
Missing (2): bat-dg2-13 fi-snb-2520m
Known issues
------------
Here are the changes found in IGTPW_15391 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@core_hotunplug@unbind-rebind:
- fi-bsw-n3050: [PASS][1] -> [DMESG-WARN][2] ([i915#16057])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8971/fi-bsw-n3050/igt@core_hotunplug@unbind-rebind.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15391/fi-bsw-n3050/igt@core_hotunplug@unbind-rebind.html
* igt@gem_huc_copy@huc-copy:
- fi-skl-6600u: NOTRUN -> [SKIP][3] ([i915#2190])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15391/fi-skl-6600u/igt@gem_huc_copy@huc-copy.html
* igt@gem_lmem_swapping@random-engines:
- fi-skl-6600u: NOTRUN -> [SKIP][4] ([i915#4613]) +3 other tests skip
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15391/fi-skl-6600u/igt@gem_lmem_swapping@random-engines.html
* igt@i915_selftest@live@late_gt_pm:
- fi-cfl-8109u: [PASS][5] -> [DMESG-WARN][6] ([i915#13735]) +34 other tests dmesg-warn
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_8971/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15391/fi-cfl-8109u/igt@i915_selftest@live@late_gt_pm.html
* igt@kms_dsc@dsc-basic:
- fi-skl-6600u: NOTRUN -> [SKIP][7] +11 other tests skip
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15391/fi-skl-6600u/igt@kms_dsc@dsc-basic.html
[i915#13735]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13735
[i915#16057]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/16057
[i915#2190]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/2190
[i915#4613]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4613
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_8971 -> IGTPW_15391
* Linux: CI_DRM_18696 -> CI_DRM_18697
CI-20190529: 20190529
CI_DRM_18696: f7cb2873b7430d84afd4ad4e4771d3f8ad03fbf9 @ git://anongit.freedesktop.org/gfx-ci/linux
CI_DRM_18697: 18816557ad112c94f3bf5ee625cd862d8d3f41af @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_15391: 1862c378ecfbf12c2dab61a1c11c7170f516506f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
IGT_8971: 8971
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_15391/index.html
[-- Attachment #2: Type: text/html, Size: 3647 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-17 22:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-17 20:25 [PATCH i-g-t v1 0/2] Allow intel_reg tool to work also with accelerators Kamil Konieczny
2026-06-17 20:25 ` [PATCH i-g-t v1 1/2] lib/intel_chipset: Create intel_get_pci_accelerator_device() function Kamil Konieczny
2026-06-17 20:25 ` [PATCH i-g-t v1 2/2] tools/intel_reg: Create default accelerator access Kamil Konieczny
2026-06-17 22:09 ` Dixit, Ashutosh
2026-06-17 22:14 ` ✓ Xe.CI.BAT: success for Allow intel_reg tool to work also with accelerators Patchwork
2026-06-17 22:29 ` ✓ i915.CI.BAT: " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox