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

drm/i915/pch: abstract fake PCH detection better

Abstract detection of platforms with south display on the same PCI
device or SoC die as north display, and all around clarify what this
means. Debug log about it for good measure.

Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Link: https://lore.kernel.org/r/95cd619b63a81a0a7f8c73a64694da9d41e3a575.1744880985.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Jani Nikula 246b259f 2958620a

+28 -19
+28 -19
drivers/gpu/drm/i915/display/intel_pch.c
··· 39 39 #define INTEL_PCH_P3X_DEVICE_ID_TYPE 0x7000 40 40 #define INTEL_PCH_QEMU_DEVICE_ID_TYPE 0x2900 /* qemu q35 has 2918 */ 41 41 42 + /* 43 + * Check for platforms where the south display is on the same PCI device or SoC 44 + * die as the north display. The PCH (if it even exists) is not involved in 45 + * display. Return a fake PCH type for south display handling on these 46 + * platforms, without actually detecting the PCH, and PCH_NONE otherwise. 47 + */ 48 + static enum intel_pch intel_pch_fake_for_south_display(struct intel_display *display) 49 + { 50 + enum intel_pch pch_type = PCH_NONE; 51 + 52 + if (DISPLAY_VER(display) >= 20) 53 + pch_type = PCH_LNL; 54 + else if (display->platform.battlemage || display->platform.meteorlake) 55 + pch_type = PCH_MTL; 56 + else if (display->platform.dg2) 57 + pch_type = PCH_DG2; 58 + else if (display->platform.dg1) 59 + pch_type = PCH_DG1; 60 + 61 + return pch_type; 62 + } 63 + 42 64 /* Map PCH device id to PCH type, or PCH_NONE if unknown. */ 43 65 static enum intel_pch 44 66 intel_pch_type(const struct intel_display *display, unsigned short id) ··· 280 258 unsigned short id; 281 259 enum intel_pch pch_type; 282 260 283 - /* 284 - * South display engine on the same PCI device: just assign the fake 285 - * PCH. 286 - */ 287 - if (DISPLAY_VER(display) >= 20) { 288 - display->pch_type = PCH_LNL; 289 - return; 290 - } else if (display->platform.battlemage || display->platform.meteorlake) { 291 - /* 292 - * Both north display and south display are on the SoC die. 293 - * The real PCH (if it even exists) is uninvolved in display. 294 - */ 295 - display->pch_type = PCH_MTL; 296 - return; 297 - } else if (display->platform.dg2) { 298 - display->pch_type = PCH_DG2; 299 - return; 300 - } else if (display->platform.dg1) { 301 - display->pch_type = PCH_DG1; 261 + pch_type = intel_pch_fake_for_south_display(display); 262 + if (pch_type != PCH_NONE) { 263 + display->pch_type = pch_type; 264 + drm_dbg_kms(display->drm, 265 + "PCH not involved in display, using fake PCH type %d for south display\n", 266 + pch_type); 302 267 return; 303 268 } 304 269