Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Introduce intel_cpu_info.c for CPU IDs

Having similar naming convention in intel-family.h and intel_device_info.h
results in redefinition of a few platforms. Define CPU IDs in its own file
to avoid this.

v3: Move file out of gt directory, add kernel doc (Riana)
Rephrase file description (Jani)

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241211115952.1659287-4-raag.jadav@intel.com

authored by

Raag Jadav and committed by
Andi Shyti
d58db10e f9a15b96

+58
+1
drivers/gpu/drm/i915/Makefile
··· 34 34 i915_sysfs.o \ 35 35 i915_utils.o \ 36 36 intel_clock_gating.o \ 37 + intel_cpu_info.o \ 37 38 intel_device_info.o \ 38 39 intel_memory_region.o \ 39 40 intel_pcode.o \
+44
drivers/gpu/drm/i915/intel_cpu_info.c
··· 1 + // SPDX-License-Identifier: MIT 2 + /* 3 + * Copyright © 2024 Intel Corporation 4 + * 5 + * Avoid INTEL_<PLATFORM> name collisions between asm/intel-family.h and 6 + * intel_device_info.h by having a separate file. 7 + */ 8 + 9 + #include "intel_cpu_info.h" 10 + 11 + #ifdef CONFIG_X86 12 + #include <asm/cpu_device_id.h> 13 + #include <asm/intel-family.h> 14 + 15 + static const struct x86_cpu_id g8_cpu_ids[] = { 16 + X86_MATCH_VFM(INTEL_ALDERLAKE, NULL), 17 + X86_MATCH_VFM(INTEL_ALDERLAKE_L, NULL), 18 + X86_MATCH_VFM(INTEL_COMETLAKE, NULL), 19 + X86_MATCH_VFM(INTEL_KABYLAKE, NULL), 20 + X86_MATCH_VFM(INTEL_KABYLAKE_L, NULL), 21 + X86_MATCH_VFM(INTEL_RAPTORLAKE, NULL), 22 + X86_MATCH_VFM(INTEL_RAPTORLAKE_P, NULL), 23 + X86_MATCH_VFM(INTEL_RAPTORLAKE_S, NULL), 24 + X86_MATCH_VFM(INTEL_ROCKETLAKE, NULL), 25 + {} 26 + }; 27 + 28 + /** 29 + * intel_match_g8_cpu - match current CPU against g8_cpu_ids 30 + * 31 + * This matches current CPU against g8_cpu_ids, which are applicable 32 + * for G8 workaround. 33 + * 34 + * Returns: %true if matches, %false otherwise. 35 + */ 36 + bool intel_match_g8_cpu(void) 37 + { 38 + return x86_match_cpu(g8_cpu_ids); 39 + } 40 + #else /* CONFIG_X86 */ 41 + 42 + bool intel_match_g8_cpu(void) { return false; } 43 + 44 + #endif /* CONFIG_X86 */
+13
drivers/gpu/drm/i915/intel_cpu_info.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* 3 + * Copyright © 2024 Intel Corporation 4 + */ 5 + 6 + #ifndef _INTEL_CPU_INFO_H_ 7 + #define _INTEL_CPU_INFO_H_ 8 + 9 + #include <linux/types.h> 10 + 11 + bool intel_match_g8_cpu(void); 12 + 13 + #endif /* _INTEL_CPU_INFO_H_ */