mbox series

[0/8] drm/i915 & drm/xe: shared PCI ID macros

Message ID cover.1725297097.git.jani.nikula@intel.com (mailing list archive)
Headers show
Series drm/i915 & drm/xe: shared PCI ID macros | expand

Message

Jani Nikula Sept. 2, 2024, 5:13 p.m. UTC
There's considerable overlap in i915 and xe PCI ID macros, and (as can
be seen in this series) they get updated out of sync. With i915 display
continuing to use PCI IDs for platforms that i915 core does not support,
but xe does, the duplication will just increase. Just use a single file
for all of them.

BR,
Jani.

Jani Nikula (8):
  drm/i915/pciids: use designated initializers in INTEL_VGA_DEVICE()
  drm/i915/pciids: separate ARL and MTL PCI IDs
  drm/xe/pciids: add some missing ADL-N PCI IDs
  drm/xe/pciids: separate RPL-U and RPL-P PCI IDs
  drm/xe/pciids: separate ARL and MTL PCI IDs
  drm/i915/pciids: add PVC PCI ID macros
  drm/intel/pciids: rename i915_pciids.h to just pciids.h
  drm/xe: switch to common PCI ID macros

 arch/x86/kernel/early-quirks.c                |   2 +-
 .../drm/i915/display/intel_display_device.c   |   3 +-
 drivers/gpu/drm/i915/i915_pci.c               |   3 +-
 drivers/gpu/drm/i915/intel_device_info.c      |   2 +-
 drivers/gpu/drm/xe/xe_pci.c                   |  49 ++--
 include/drm/intel/{i915_pciids.h => pciids.h} |  63 ++---
 include/drm/intel/xe_pciids.h                 | 218 ------------------
 7 files changed, 64 insertions(+), 276 deletions(-)
 rename include/drm/intel/{i915_pciids.h => pciids.h} (96%)
 delete mode 100644 include/drm/intel/xe_pciids.h

Comments

Lucas De Marchi Sept. 3, 2024, 2:41 a.m. UTC | #1
On Mon, Sep 02, 2024 at 08:13:59PM GMT, Jani Nikula wrote:
>There's considerable overlap in i915 and xe PCI ID macros, and (as can
>be seen in this series) they get updated out of sync. With i915 display
>continuing to use PCI IDs for platforms that i915 core does not support,

humn.. but display is not using a separate device. It's rather the same
that we bind to the xe driver. Why does i915 need to know the PCI ID?

>but xe does, the duplication will just increase. Just use a single file
>for all of them.

I'd expect PCI IDs to stop being added in one header and start to be
added in another.

Lucas De Marchi
Jani Nikula Sept. 3, 2024, 7:32 a.m. UTC | #2
On Mon, 02 Sep 2024, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> On Mon, Sep 02, 2024 at 08:13:59PM GMT, Jani Nikula wrote:
>>There's considerable overlap in i915 and xe PCI ID macros, and (as can
>>be seen in this series) they get updated out of sync. With i915 display
>>continuing to use PCI IDs for platforms that i915 core does not support,
>
> humn.. but display is not using a separate device. It's rather the same
> that we bind to the xe driver. Why does i915 need to know the PCI ID?

Because display does its own device identification for display, for
display needs, without depending on either xe or i915 passing along some
data that has to be managed between all three.

>>but xe does, the duplication will just increase. Just use a single file
>>for all of them.
>
> I'd expect PCI IDs to stop being added in one header and start to be
> added in another.

Display could include xe_pciids.h too, and start using the XE_*_IDS()
macros for LNL+, but still the intersection of PCI IDs from both i915
and xe should match.


BR,
Jani.
Jani Nikula Sept. 4, 2024, 9:55 a.m. UTC | #3
On Mon, 02 Sep 2024, Jani Nikula <jani.nikula@intel.com> wrote:
> There's considerable overlap in i915 and xe PCI ID macros, and (as can
> be seen in this series) they get updated out of sync. With i915 display
> continuing to use PCI IDs for platforms that i915 core does not support,
> but xe does, the duplication will just increase. Just use a single file
> for all of them.
>
> BR,
> Jani.
>
> Jani Nikula (8):
>   drm/i915/pciids: use designated initializers in INTEL_VGA_DEVICE()
>   drm/i915/pciids: separate ARL and MTL PCI IDs

Sent these for drm-intel-next:

https://lore.kernel.org/r/cover.1725443418.git.jani.nikula@intel.com

>   drm/xe/pciids: add some missing ADL-N PCI IDs
>   drm/xe/pciids: separate RPL-U and RPL-P PCI IDs
>   drm/xe/pciids: separate ARL and MTL PCI IDs

Sent these for drm-xe-next:

https://lore.kernel.org/r/cover.1725443121.git.jani.nikula@intel.com

>   drm/i915/pciids: add PVC PCI ID macros
>   drm/intel/pciids: rename i915_pciids.h to just pciids.h
>   drm/xe: switch to common PCI ID macros

Dropping these for now, but I might resurrect the idea after the merge
window.


BR,
Jani.

>
>  arch/x86/kernel/early-quirks.c                |   2 +-
>  .../drm/i915/display/intel_display_device.c   |   3 +-
>  drivers/gpu/drm/i915/i915_pci.c               |   3 +-
>  drivers/gpu/drm/i915/intel_device_info.c      |   2 +-
>  drivers/gpu/drm/xe/xe_pci.c                   |  49 ++--
>  include/drm/intel/{i915_pciids.h => pciids.h} |  63 ++---
>  include/drm/intel/xe_pciids.h                 | 218 ------------------
>  7 files changed, 64 insertions(+), 276 deletions(-)
>  rename include/drm/intel/{i915_pciids.h => pciids.h} (96%)
>  delete mode 100644 include/drm/intel/xe_pciids.h
Lucas De Marchi Sept. 10, 2024, 3:04 p.m. UTC | #4
On Tue, Sep 03, 2024 at 10:32:03AM GMT, Jani Nikula wrote:
>On Mon, 02 Sep 2024, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
>> On Mon, Sep 02, 2024 at 08:13:59PM GMT, Jani Nikula wrote:
>>>There's considerable overlap in i915 and xe PCI ID macros, and (as can
>>>be seen in this series) they get updated out of sync. With i915 display
>>>continuing to use PCI IDs for platforms that i915 core does not support,
>>
>> humn.. but display is not using a separate device. It's rather the same
>> that we bind to the xe driver. Why does i915 need to know the PCI ID?
>
>Because display does its own device identification for display, for
>display needs, without depending on either xe or i915 passing along some
>data that has to be managed between all three.

I'd rather have the drivers pass to display what it needs rather than
having logic in 3 places for similar things.

>
>>>but xe does, the duplication will just increase. Just use a single file
>>>for all of them.
>>
>> I'd expect PCI IDs to stop being added in one header and start to be
>> added in another.
>
>Display could include xe_pciids.h too, and start using the XE_*_IDS()
>macros for LNL+, but still the intersection of PCI IDs from both i915
>and xe should match.

I will disagree and commit here, because leaving it in the current state
is even worse.

Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>

Lucas De Marchi

>
>
>BR,
>Jani.
>
>
>-- 
>Jani Nikula, Intel