Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	igt-dev@lists.freedesktop.org, kamil.konieczny@intel.com,
	katarzyna.piecielska@intel.com
Subject: Re: [PATCH i-g-t v4] tools/mk_detect_intel_gpu: add a tool to detect Intel GPUs from their PCI IDs
Date: Sat, 25 May 2024 07:44:30 +0200	[thread overview]
Message-ID: <20240525074430.2cef0dbd@maurocar-mobl2> (raw)
In-Reply-To: <87o78voaqn.fsf@intel.com>

On Fri, 24 May 2024 11:49:36 +0300
Jani Nikula <jani.nikula@intel.com> wrote:

> On Thu, 23 May 2024, Kamil Konieczny <kamil.konieczny@linux.intel.com> wrote:
> > Maybe this should/may be added to scripts?
> > I do find it usefull to have a little script checks,
> > without much dependancy on other libs/tools. I would
> > also want to have a way to semi-automatically update
> > it later on, where new devices will be added.  
> 
> I never questioned the usefulness of such a tool. Only the
> implementation, and how perl/make are not aligned with the IGT project,
> and the constant maintenance burden all of this brings.

Maintenance is required only when the macros to define PCI IDs at the
i915 driver changes - or if Xe driver stops using INTEL_VGA_MACRO.
This is not frequent. The only changes such approach had since when it
was written, back in 2022 is when we added support for Xe driver, and
now that the PCI ID macros at drm-tip for i915 changed.

With regards to the latest change, the v5 of this patch solves it.
The only change to make it compatible with the new way is to add a
single line:

	if [ "$$(grep MACRO__ i915_pciids.h)" != "" ]; then sed -E "s/(INTEL_\S+_IDS\()/\1INTEL_VGA_DEVICE, /" -i i915_id.h; fi

As, up to the current upstream Kernel, the macro to define a PCI ID
inside i915_pciids.h were:

	#define INTEL_I815_IDS(info)					\
		INTEL_VGA_DEVICE(0x1132, info)  /* I815*/
	...

And, on current upstream, it now requires INTEL_VGA_DEVICE to be
passed on its first argument:

	#define INTEL_I815_IDS(MACRO__, ...) \
		MACRO__(0x1132, ## __VA_ARGS__)  /* I815*/
	...

So, the generated list of PCI IDs should be changed from:

	static struct pci_device_id pci_ids[] = {
		INTEL_PVC_IDS("PVC"),
		INTEL_MTL_IDS("MTL"),
		INTEL_MTL_P_IDS("MTL_P"),
		INTEL_MTL_M_IDS("MTL_M"),
		...

to:

	static struct pci_device_id pci_ids[] = {
		INTEL_PVC_IDS(INTEL_VGA_DEVICE, "PVC"),
		INTEL_MTL_IDS(INTEL_VGA_DEVICE, "MTL"),
		INTEL_MTL_P_IDS(INTEL_VGA_DEVICE, "MTL_P"),
		INTEL_MTL_M_IDS(INTEL_VGA_DEVICE, "MTL_M"),
		...

Changing PCI ID macros is something that it is not frequent.

Regards,
Mauro

  reply	other threads:[~2024-05-25  5:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22 12:02 [PATCH i-g-t v4] tools/mk_detect_intel_gpu: add a tool to detect Intel GPUs from their PCI IDs Mauro Carvalho Chehab
2024-05-22 12:54 ` Jani Nikula
2024-05-22 13:26   ` Jani Nikula
2024-05-22 14:46     ` Kamil Konieczny
2024-05-23  5:03       ` Mauro Carvalho Chehab
2024-05-23  7:26         ` Jani Nikula
2024-05-23  7:30       ` Jani Nikula
2024-05-23  8:36         ` Mauro Carvalho Chehab
2024-05-23  9:10           ` Jani Nikula
2024-05-23 17:31             ` Kamil Konieczny
2024-05-24  8:49               ` Jani Nikula
2024-05-25  5:44                 ` Mauro Carvalho Chehab [this message]
2024-06-03  7:35             ` Zbigniew Kempczyński
2024-06-04  8:05               ` Jani Nikula

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=20240525074430.2cef0dbd@maurocar-mobl2 \
    --to=mauro.chehab@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=kamil.konieczny@intel.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=katarzyna.piecielska@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