Re: [PATCH v2 1/3] lib/intel: suffix PCI ID based gen/graphics_ver with _legacy

Matt Roper
2026-02-04T18:30:09Z

On Thu, Jan 22, 2026 at 07:15:28AM +0000, Xin Wang wrote:
> Rename the PCI ID translation helpers to intel_gen_legacy() and
> intel_graphics_ver_legacy() across callers.
> This is a preparatory step for introducing fd-based APIs.

Was this [mostly] generated in an automated manner via coccinelle or
sed? If so, it would be helpful to put the semantic patch or sed
command in the commit message so that the patch is easy for people to
re-generate (especially since the maintainers might want to re-generate
it right before applying if anything else landed in the meantime that
still uses the old names).

As a general note, I'd avoid using the suffix "legacy" since it's not
really clear what that means to someone who isn't reading these specific
mailing list threads. A more descriptive suffix like "_from_pciid"
might be a better choice.

>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Ravi Kumar V <ravi.kumar.vodapalli@intel.com>
> Signed-off-by: Xin Wang <x.wang@intel.com>
> ---
...snip...
>
> /**
> - * intel_gen:
> + * intel_gen_legacy:
> * @devid: pci device id
> *
> * Computes the Intel GFX generation for the given device id.
> @@ -747,12 +747,12 @@ const struct intel_cmds_info *intel_get_cmds_info(uint16_t devid)
> * Returns:
> * The GFX generation on successful lookup, -1u on failure.

I'd add some kind of disclaimer to the function documentation for these
indicating that this form is deprecated and should only be used in
places where there's no access to the device itself (e.g., DRM driver
isn't loaded, or a tool is being run in a different environment).

Matt

--
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation